--- a/widget/ContentCache.cpp
+++ b/widget/ContentCache.cpp
@@ -88,61 +88,59 @@ ContentCacheInChild::ContentCacheInChild
: ContentCache()
{
}
void
ContentCacheInChild::Clear()
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInChild: 0x%p Clear()", this));
+ ("0x%p Clear()", this));
mCompositionStart = UINT32_MAX;
mText.Truncate();
mSelection.Clear();
mFirstCharRect.SetEmpty();
mCaret.Clear();
mTextRectArray.Clear();
mEditorRect.SetEmpty();
}
bool
ContentCacheInChild::CacheAll(nsIWidget* aWidget,
const IMENotification* aNotification)
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInChild: 0x%p CacheAll(aWidget=0x%p, "
- "aNotification=%s)",
+ ("0x%p CacheAll(aWidget=0x%p, aNotification=%s)",
this, aWidget, GetNotificationName(aNotification)));
if (NS_WARN_IF(!CacheText(aWidget, aNotification)) ||
NS_WARN_IF(!CacheEditorRect(aWidget, aNotification))) {
return false;
}
return true;
}
bool
ContentCacheInChild::CacheSelection(nsIWidget* aWidget,
const IMENotification* aNotification)
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInChild: 0x%p CacheSelection(aWidget=0x%p, "
- "aNotification=%s)",
+ ("0x%p CacheSelection(aWidget=0x%p, aNotification=%s)",
this, aWidget, GetNotificationName(aNotification)));
mCaret.Clear();
mSelection.Clear();
nsEventStatus status = nsEventStatus_eIgnore;
WidgetQueryContentEvent selection(true, eQuerySelectedText, aWidget);
aWidget->DispatchEvent(&selection, status);
if (NS_WARN_IF(!selection.mSucceeded)) {
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCache: 0x%p CacheSelection(), FAILED, "
+ ("0x%p CacheSelection(), FAILED, "
"couldn't retrieve the selected text", this));
return false;
}
if (selection.mReply.mReversed) {
mSelection.mAnchor =
selection.mReply.mOffset + selection.mReply.mString.Length();
mSelection.mFocus = selection.mReply.mOffset;
} else {
@@ -156,18 +154,17 @@ ContentCacheInChild::CacheSelection(nsIW
CacheTextRects(aWidget, aNotification);
}
bool
ContentCacheInChild::CacheCaret(nsIWidget* aWidget,
const IMENotification* aNotification)
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInChild: 0x%p CacheCaret(aWidget=0x%p, "
- "aNotification=%s)",
+ ("0x%p CacheCaret(aWidget=0x%p, aNotification=%s)",
this, aWidget, GetNotificationName(aNotification)));
mCaret.Clear();
if (NS_WARN_IF(!mSelection.IsValid())) {
return false;
}
@@ -175,82 +172,78 @@ ContentCacheInChild::CacheCaret(nsIWidge
mCaret.mOffset = mSelection.StartOffset();
nsEventStatus status = nsEventStatus_eIgnore;
WidgetQueryContentEvent caretRect(true, eQueryCaretRect, aWidget);
caretRect.InitForQueryCaretRect(mCaret.mOffset);
aWidget->DispatchEvent(&caretRect, status);
if (NS_WARN_IF(!caretRect.mSucceeded)) {
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInChild: 0x%p CacheCaret(), FAILED, "
+ ("0x%p CacheCaret(), FAILED, "
"couldn't retrieve the caret rect at offset=%u",
this, mCaret.mOffset));
mCaret.Clear();
return false;
}
mCaret.mRect = caretRect.mReply.mRect;
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInChild: 0x%p CacheCaret(), Succeeded, "
+ ("0x%p CacheCaret(), Succeeded, "
"mSelection={ mAnchor=%u, mFocus=%u, mWritingMode=%s }, "
"mCaret={ mOffset=%u, mRect=%s }",
this, mSelection.mAnchor, mSelection.mFocus,
GetWritingModeName(mSelection.mWritingMode).get(), mCaret.mOffset,
GetRectText(mCaret.mRect).get()));
return true;
}
bool
ContentCacheInChild::CacheEditorRect(nsIWidget* aWidget,
const IMENotification* aNotification)
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInChild: 0x%p CacheEditorRect(aWidget=0x%p, "
- "aNotification=%s)",
+ ("0x%p CacheEditorRect(aWidget=0x%p, aNotification=%s)",
this, aWidget, GetNotificationName(aNotification)));
nsEventStatus status = nsEventStatus_eIgnore;
WidgetQueryContentEvent editorRectEvent(true, eQueryEditorRect, aWidget);
aWidget->DispatchEvent(&editorRectEvent, status);
if (NS_WARN_IF(!editorRectEvent.mSucceeded)) {
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInChild: 0x%p CacheEditorRect(), FAILED, "
+ ("0x%p CacheEditorRect(), FAILED, "
"couldn't retrieve the editor rect", this));
return false;
}
mEditorRect = editorRectEvent.mReply.mRect;
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInChild: 0x%p CacheEditorRect(), Succeeded, "
+ ("0x%p CacheEditorRect(), Succeeded, "
"mEditorRect=%s", this, GetRectText(mEditorRect).get()));
return true;
}
bool
ContentCacheInChild::CacheText(nsIWidget* aWidget,
const IMENotification* aNotification)
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInChild: 0x%p CacheText(aWidget=0x%p, "
- "aNotification=%s)",
+ ("0x%p CacheText(aWidget=0x%p, aNotification=%s)",
this, aWidget, GetNotificationName(aNotification)));
nsEventStatus status = nsEventStatus_eIgnore;
WidgetQueryContentEvent queryText(true, eQueryTextContent, aWidget);
queryText.InitForQueryTextContent(0, UINT32_MAX);
aWidget->DispatchEvent(&queryText, status);
if (NS_WARN_IF(!queryText.mSucceeded)) {
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInChild: 0x%p CacheText(), FAILED, "
- "couldn't retrieve whole text", this));
+ ("0x%p CacheText(), FAILED, couldn't retrieve whole text", this));
mText.Truncate();
return false;
}
mText = queryText.mReply.mString;
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInChild: 0x%p CacheText(), Succeeded, "
- "mText.Length()=%u", this, mText.Length()));
+ ("0x%p CacheText(), Succeeded, mText.Length()=%u", this, mText.Length()));
return CacheSelection(aWidget, aNotification);
}
bool
ContentCacheInChild::QueryCharRect(nsIWidget* aWidget,
uint32_t aOffset,
LayoutDeviceIntRect& aCharRect) const
@@ -276,18 +269,18 @@ ContentCacheInChild::QueryCharRect(nsIWi
return true;
}
bool
ContentCacheInChild::CacheTextRects(nsIWidget* aWidget,
const IMENotification* aNotification)
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInChild: 0x%p CacheTextRects(aWidget=0x%p, "
- "aNotification=%s), mCaret={ mOffset=%u, IsValid()=%s }",
+ ("0x%p CacheTextRects(aWidget=0x%p, aNotification=%s), "
+ "mCaret={ mOffset=%u, IsValid()=%s }",
this, aWidget, GetNotificationName(aNotification), mCaret.mOffset,
GetBoolName(mCaret.IsValid())));
mCompositionStart = UINT32_MAX;
mTextRectArray.Clear();
mSelection.mAnchorCharRect.SetEmpty();
mSelection.mFocusCharRect.SetEmpty();
mSelection.mRect.SetEmpty();
@@ -319,72 +312,72 @@ ContentCacheInChild::CacheTextRects(nsIW
}
if (mTextRectArray.InRange(mSelection.mAnchor)) {
mSelection.mAnchorCharRect = mTextRectArray.GetRect(mSelection.mAnchor);
} else {
LayoutDeviceIntRect charRect;
if (NS_WARN_IF(!QueryCharRect(aWidget, mSelection.mAnchor, charRect))) {
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInChild: 0x%p CacheTextRects(), FAILED, "
+ ("0x%p CacheTextRects(), FAILED, "
"couldn't retrieve text rect at anchor of selection (%u)",
this, mSelection.mAnchor));
}
mSelection.mAnchorCharRect = charRect;
}
if (mSelection.Collapsed()) {
mSelection.mFocusCharRect = mSelection.mAnchorCharRect;
} else if (mTextRectArray.InRange(mSelection.mFocus)) {
mSelection.mFocusCharRect = mTextRectArray.GetRect(mSelection.mFocus);
} else {
LayoutDeviceIntRect charRect;
if (NS_WARN_IF(!QueryCharRect(aWidget, mSelection.mFocus, charRect))) {
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInChild: 0x%p CacheTextRects(), FAILED, "
+ ("0x%p CacheTextRects(), FAILED, "
"couldn't retrieve text rect at focus of selection (%u)",
this, mSelection.mFocus));
}
mSelection.mFocusCharRect = charRect;
}
if (!mSelection.Collapsed()) {
nsEventStatus status = nsEventStatus_eIgnore;
WidgetQueryContentEvent textRect(true, eQueryTextRect, aWidget);
textRect.InitForQueryTextRect(mSelection.StartOffset(),
mSelection.Length());
aWidget->DispatchEvent(&textRect, status);
if (NS_WARN_IF(!textRect.mSucceeded)) {
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInChild: 0x%p CacheTextRects(), FAILED, "
+ ("0x%p CacheTextRects(), FAILED, "
"couldn't retrieve text rect of whole selected text", this));
} else {
mSelection.mRect = textRect.mReply.mRect;
}
}
if (!mSelection.mFocus) {
mFirstCharRect = mSelection.mFocusCharRect;
} else if (!mSelection.mAnchor) {
mFirstCharRect = mSelection.mAnchorCharRect;
} else if (mTextRectArray.InRange(0)) {
mFirstCharRect = mTextRectArray.GetRect(0);
} else {
LayoutDeviceIntRect charRect;
if (NS_WARN_IF(!QueryCharRect(aWidget, 0, charRect))) {
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInChild: 0x%p CacheTextRects(), FAILED, "
+ ("0x%p CacheTextRects(), FAILED, "
"couldn't retrieve first char rect", this));
} else {
mFirstCharRect = charRect;
}
}
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInChild: 0x%p CacheTextRects(), Succeeded, "
+ ("0x%p CacheTextRects(), Succeeded, "
"mText.Length()=%u, mTextRectArray={ mStart=%u, mRects.Length()=%u }, "
"mSelection={ mAnchor=%u, mAnchorCharRect=%s, mFocus=%u, "
"mFocusCharRect=%s, mRect=%s }, mFirstCharRect=%s",
this, mText.Length(), mTextRectArray.mStart,
mTextRectArray.mRects.Length(), mSelection.mAnchor,
GetRectText(mSelection.mAnchorCharRect).get(), mSelection.mFocus,
GetRectText(mSelection.mFocusCharRect).get(),
GetRectText(mSelection.mRect).get(), GetRectText(mFirstCharRect).get()));
@@ -394,17 +387,17 @@ ContentCacheInChild::CacheTextRects(nsIW
void
ContentCacheInChild::SetSelection(nsIWidget* aWidget,
uint32_t aStartOffset,
uint32_t aLength,
bool aReversed,
const WritingMode& aWritingMode)
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInChild: 0x%p SetSelection(aStartOffset=%u, "
+ ("0x%p SetSelection(aStartOffset=%u, "
"aLength=%u, aReversed=%s, aWritingMode=%s), mText.Length()=%u",
this, aStartOffset, aLength, GetBoolName(aReversed),
GetWritingModeName(aWritingMode).get(), mText.Length()));
if (!aReversed) {
mSelection.mAnchor = aStartOffset;
mSelection.mFocus = aStartOffset + aLength;
} else {
@@ -447,17 +440,17 @@ ContentCacheInParent::AssignContent(cons
if (mIsComposing) {
NS_WARN_IF(mCompositionStart == UINT32_MAX);
IMEStateManager::MaybeStartOffsetUpdatedInChild(aWidget, mCompositionStart);
} else {
NS_WARN_IF(mCompositionStart != UINT32_MAX);
}
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p AssignContent(aNotification=%s), "
+ ("0x%p AssignContent(aNotification=%s), "
"Succeeded, mText.Length()=%u, mSelection={ mAnchor=%u, mFocus=%u, "
"mWritingMode=%s, mAnchorCharRect=%s, mFocusCharRect=%s, mRect=%s }, "
"mFirstCharRect=%s, mCaret={ mOffset=%u, mRect=%s }, mTextRectArray={ "
"mStart=%u, mRects.Length()=%u }, mIsComposing=%s, mCompositionStart=%u, "
"mEditorRect=%s",
this, GetNotificationName(aNotification),
mText.Length(), mSelection.mAnchor, mSelection.mFocus,
GetWritingModeName(mSelection.mWritingMode).get(),
@@ -505,210 +498,210 @@ ContentCacheInParent::HandleQueryContent
mSelection.StartOffset()))) {
return false;
}
}
switch (aEvent.mMessage) {
case eQuerySelectedText:
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent("
+ ("0x%p HandleQueryContentEvent("
"aEvent={ mMessage=eQuerySelectedText }, aWidget=0x%p)",
this, aWidget));
if (aWidget->PluginHasFocus()) {
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
+ ("0x%p HandleQueryContentEvent(), "
"return emtpy selection becasue plugin has focus",
this));
aEvent.mSucceeded = true;
aEvent.mReply.mOffset = 0;
aEvent.mReply.mReversed = false;
aEvent.mReply.mHasSelection = false;
return true;
}
if (NS_WARN_IF(!IsSelectionValid())) {
// If content cache hasn't been initialized properly, make the query
// failed.
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
+ ("0x%p HandleQueryContentEvent(), "
"FAILED because mSelection is not valid", this));
return true;
}
aEvent.mReply.mOffset = mSelection.StartOffset();
if (mSelection.Collapsed()) {
aEvent.mReply.mString.Truncate(0);
} else {
if (NS_WARN_IF(mSelection.EndOffset() > mText.Length())) {
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
+ ("0x%p HandleQueryContentEvent(), "
"FAILED because mSelection.EndOffset()=%u is larger than "
"mText.Length()=%u",
this, mSelection.EndOffset(), mText.Length()));
return false;
}
aEvent.mReply.mString =
Substring(mText, aEvent.mReply.mOffset, mSelection.Length());
}
aEvent.mReply.mReversed = mSelection.Reversed();
aEvent.mReply.mHasSelection = true;
aEvent.mReply.mWritingMode = mSelection.mWritingMode;
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
+ ("0x%p HandleQueryContentEvent(), "
"Succeeded, aEvent={ mReply={ mOffset=%u, mString=\"%s\", "
"mReversed=%s, mHasSelection=%s, mWritingMode=%s } }",
this, aEvent.mReply.mOffset,
NS_ConvertUTF16toUTF8(aEvent.mReply.mString).get(),
GetBoolName(aEvent.mReply.mReversed),
GetBoolName(aEvent.mReply.mHasSelection),
GetWritingModeName(aEvent.mReply.mWritingMode).get()));
break;
case eQueryTextContent: {
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent("
+ ("0x%p HandleQueryContentEvent("
"aEvent={ mMessage=eQueryTextContent, mInput={ mOffset=%u, "
"mLength=%u } }, aWidget=0x%p), mText.Length()=%u",
this, aEvent.mInput.mOffset,
aEvent.mInput.mLength, aWidget, mText.Length()));
uint32_t inputOffset = aEvent.mInput.mOffset;
uint32_t inputEndOffset =
std::min(aEvent.mInput.EndOffset(), mText.Length());
if (NS_WARN_IF(inputEndOffset < inputOffset)) {
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
+ ("0x%p HandleQueryContentEvent(), "
"FAILED because inputOffset=%u is larger than inputEndOffset=%u",
this, inputOffset, inputEndOffset));
return false;
}
aEvent.mReply.mOffset = inputOffset;
aEvent.mReply.mString =
Substring(mText, inputOffset, inputEndOffset - inputOffset);
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
+ ("0x%p HandleQueryContentEvent(), "
"Succeeded, aEvent={ mReply={ mOffset=%u, mString.Length()=%u } }",
this, aEvent.mReply.mOffset, aEvent.mReply.mString.Length()));
break;
}
case eQueryTextRect:
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent("
+ ("0x%p HandleQueryContentEvent("
"aEvent={ mMessage=eQueryTextRect, mInput={ mOffset=%u, "
"mLength=%u } }, aWidget=0x%p), mText.Length()=%u",
this, aEvent.mInput.mOffset, aEvent.mInput.mLength, aWidget,
mText.Length()));
if (NS_WARN_IF(!IsSelectionValid())) {
// If content cache hasn't been initialized properly, make the query
// failed.
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
+ ("0x%p HandleQueryContentEvent(), "
"FAILED because mSelection is not valid", this));
return true;
}
// Note that if the query is relative to insertion point, the query was
// probably requested by native IME. In such case, we should return
// non-empty rect since returning failure causes IME showing its window
// at odd position.
if (aEvent.mInput.mLength) {
if (NS_WARN_IF(!GetUnionTextRects(aEvent.mInput.mOffset,
aEvent.mInput.mLength,
isRelativeToInsertionPoint,
aEvent.mReply.mRect))) {
// XXX We don't have cache for this request.
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
+ ("0x%p HandleQueryContentEvent(), "
"FAILED to get union rect", this));
return false;
}
} else {
// If the length is 0, we should return caret rect instead.
if (NS_WARN_IF(!GetCaretRect(aEvent.mInput.mOffset,
isRelativeToInsertionPoint,
aEvent.mReply.mRect))) {
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
+ ("0x%p HandleQueryContentEvent(), "
"FAILED to get caret rect", this));
return false;
}
}
if (aEvent.mInput.mOffset < mText.Length()) {
aEvent.mReply.mString =
Substring(mText, aEvent.mInput.mOffset,
mText.Length() >= aEvent.mInput.EndOffset() ?
aEvent.mInput.mLength : UINT32_MAX);
} else {
aEvent.mReply.mString.Truncate(0);
}
aEvent.mReply.mOffset = aEvent.mInput.mOffset;
// XXX This may be wrong if storing range isn't in the selection range.
aEvent.mReply.mWritingMode = mSelection.mWritingMode;
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
+ ("0x%p HandleQueryContentEvent(), "
"Succeeded, aEvent={ mReply={ mOffset=%u, mString=\"%s\", "
"mWritingMode=%s, mRect=%s } }",
this, aEvent.mReply.mOffset,
NS_ConvertUTF16toUTF8(aEvent.mReply.mString).get(),
GetWritingModeName(aEvent.mReply.mWritingMode).get(),
GetRectText(aEvent.mReply.mRect).get()));
break;
case eQueryCaretRect:
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent("
+ ("0x%p HandleQueryContentEvent("
"aEvent={ mMessage=eQueryCaretRect, mInput={ mOffset=%u } }, "
"aWidget=0x%p), mText.Length()=%u",
this, aEvent.mInput.mOffset, aWidget, mText.Length()));
if (NS_WARN_IF(!IsSelectionValid())) {
// If content cache hasn't been initialized properly, make the query
// failed.
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
+ ("0x%p HandleQueryContentEvent(), "
"FAILED because mSelection is not valid", this));
return true;
}
// Note that if the query is relative to insertion point, the query was
// probably requested by native IME. In such case, we should return
// non-empty rect since returning failure causes IME showing its window
// at odd position.
if (NS_WARN_IF(!GetCaretRect(aEvent.mInput.mOffset,
isRelativeToInsertionPoint,
aEvent.mReply.mRect))) {
MOZ_LOG(sContentCacheLog, LogLevel::Error,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
+ ("0x%p HandleQueryContentEvent(), "
"FAILED to get caret rect", this));
return false;
}
aEvent.mReply.mOffset = aEvent.mInput.mOffset;
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
+ ("0x%p HandleQueryContentEvent(), "
"Succeeded, aEvent={ mReply={ mOffset=%u, mRect=%s } }",
this, aEvent.mReply.mOffset, GetRectText(aEvent.mReply.mRect).get()));
break;
case eQueryEditorRect:
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent("
+ ("0x%p HandleQueryContentEvent("
"aEvent={ mMessage=eQueryEditorRect }, aWidget=0x%p)",
this, aWidget));
aEvent.mReply.mRect = mEditorRect;
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p HandleQueryContentEvent(), "
+ ("0x%p HandleQueryContentEvent(), "
"Succeeded, aEvent={ mReply={ mRect=%s } }",
this, GetRectText(aEvent.mReply.mRect).get()));
break;
default:
break;
}
aEvent.mSucceeded = true;
return true;
}
bool
ContentCacheInParent::GetTextRect(uint32_t aOffset,
bool aRoundToExistingOffset,
LayoutDeviceIntRect& aTextRect) const
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p GetTextRect(aOffset=%u, "
+ ("0x%p GetTextRect(aOffset=%u, "
"aRoundToExistingOffset=%s), "
"mTextRectArray={ mStart=%u, mRects.Length()=%u }, "
"mSelection={ mAnchor=%u, mFocus=%u }",
this, aOffset, GetBoolName(aRoundToExistingOffset),
mTextRectArray.mStart, mTextRectArray.mRects.Length(),
mSelection.mAnchor, mSelection.mFocus));
if (!aOffset) {
@@ -753,17 +746,17 @@ ContentCacheInParent::GetTextRect(uint32
bool
ContentCacheInParent::GetUnionTextRects(
uint32_t aOffset,
uint32_t aLength,
bool aRoundToExistingOffset,
LayoutDeviceIntRect& aUnionTextRect) const
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p GetUnionTextRects(aOffset=%u, "
+ ("0x%p GetUnionTextRects(aOffset=%u, "
"aLength=%u, aRoundToExistingOffset=%s), mTextRectArray={ "
"mStart=%u, mRects.Length()=%u }, "
"mSelection={ mAnchor=%u, mFocus=%u }",
this, aOffset, aLength, GetBoolName(aRoundToExistingOffset),
mTextRectArray.mStart, mTextRectArray.mRects.Length(),
mSelection.mAnchor, mSelection.mFocus));
CheckedInt<uint32_t> endOffset =
@@ -830,17 +823,17 @@ ContentCacheInParent::GetUnionTextRects(
}
bool
ContentCacheInParent::GetCaretRect(uint32_t aOffset,
bool aRoundToExistingOffset,
LayoutDeviceIntRect& aCaretRect) const
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p GetCaretRect(aOffset=%u, "
+ ("0x%p GetCaretRect(aOffset=%u, "
"aRoundToExistingOffset=%s), "
"mCaret={ mOffset=%u, mRect=%s, IsValid()=%s }, mTextRectArray={ "
"mStart=%u, mRects.Length()=%u }, mSelection={ mAnchor=%u, mFocus=%u, "
"mWritingMode=%s, mAnchorCharRect=%s, mFocusCharRect=%s }, "
"mFirstCharRect=%s",
this, aOffset, GetBoolName(aRoundToExistingOffset),
mCaret.mOffset, GetRectText(mCaret.mRect).get(),
GetBoolName(mCaret.IsValid()), mTextRectArray.mStart,
@@ -883,17 +876,17 @@ ContentCacheInParent::GetCaretRect(uint3
}
return true;
}
bool
ContentCacheInParent::OnCompositionEvent(const WidgetCompositionEvent& aEvent)
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p OnCompositionEvent(aEvent={ "
+ ("0x%p OnCompositionEvent(aEvent={ "
"mMessage=%s, mData=\"%s\" (Length()=%u), mRanges->Length()=%u }), "
"mPendingEventsNeedingAck=%u, mIsComposing=%s, "
"mCommitStringByRequest=0x%p",
this, ToChar(aEvent.mMessage),
NS_ConvertUTF16toUTF8(aEvent.mData).get(), aEvent.mData.Length(),
aEvent.mRanges ? aEvent.mRanges->Length() : 0, mPendingEventsNeedingAck,
GetBoolName(mIsComposing), mCommitStringByRequest));
@@ -932,17 +925,17 @@ ContentCacheInParent::OnCompositionEvent
return true;
}
void
ContentCacheInParent::OnSelectionEvent(
const WidgetSelectionEvent& aSelectionEvent)
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p OnSelectionEvent(aEvent={ "
+ ("0x%p OnSelectionEvent(aEvent={ "
"mMessage=%s, mOffset=%u, mLength=%u, mReversed=%s, "
"mExpandToClusterBoundary=%s, mUseNativeLineBreak=%s }), "
"mPendingEventsNeedingAck=%u, mIsComposing=%s",
this, ToChar(aSelectionEvent.mMessage),
aSelectionEvent.mOffset, aSelectionEvent.mLength,
GetBoolName(aSelectionEvent.mReversed),
GetBoolName(aSelectionEvent.mExpandToClusterBoundary),
GetBoolName(aSelectionEvent.mUseNativeLineBreak), mPendingEventsNeedingAck,
@@ -954,17 +947,17 @@ ContentCacheInParent::OnSelectionEvent(
void
ContentCacheInParent::OnEventNeedingAckHandled(nsIWidget* aWidget,
EventMessage aMessage)
{
// This is called when the child process receives WidgetCompositionEvent or
// WidgetSelectionEvent.
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p OnEventNeedingAckHandled(aWidget=0x%p, "
+ ("0x%p OnEventNeedingAckHandled(aWidget=0x%p, "
"aMessage=%s), mPendingEventsNeedingAck=%u",
this, aWidget, ToChar(aMessage), mPendingEventsNeedingAck));
MOZ_RELEASE_ASSERT(mPendingEventsNeedingAck > 0);
if (--mPendingEventsNeedingAck) {
return;
}
@@ -972,41 +965,41 @@ ContentCacheInParent::OnEventNeedingAckH
}
bool
ContentCacheInParent::RequestIMEToCommitComposition(nsIWidget* aWidget,
bool aCancel,
nsAString& aCommittedString)
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- ("ContentCacheInParent: 0x%p RequestToCommitComposition(aWidget=%p, "
+ ("0x%p RequestToCommitComposition(aWidget=%p, "
"aCancel=%s), mIsComposing=%s, mCommitStringByRequest=%p",
this, aWidget, GetBoolName(aCancel), GetBoolName(mIsComposing),
mCommitStringByRequest));
MOZ_ASSERT(!mCommitStringByRequest);
RefPtr<TextComposition> composition =
IMEStateManager::GetTextCompositionFor(aWidget);
if (NS_WARN_IF(!composition)) {
MOZ_LOG(sContentCacheLog, LogLevel::Warning,
- (" ContentCacheInParent: 0x%p RequestToCommitComposition(), "
+ (" 0x%p RequestToCommitComposition(), "
"does nothing due to no composition", this));
return false;
}
mCommitStringByRequest = &aCommittedString;
aWidget->NotifyIME(IMENotification(aCancel ? REQUEST_TO_CANCEL_COMPOSITION :
REQUEST_TO_COMMIT_COMPOSITION));
mCommitStringByRequest = nullptr;
MOZ_LOG(sContentCacheLog, LogLevel::Info,
- (" ContentCacheInParent: 0x%p RequestToCommitComposition(), "
+ (" 0x%p RequestToCommitComposition(), "
"mIsComposing=%s, the composition %s committed synchronously",
this, GetBoolName(mIsComposing),
composition->Destroyed() ? "WAS" : "has NOT been"));
if (!composition->Destroyed()) {
// When the composition isn't committed synchronously, the remote process's
// TextComposition instance will synthesize commit events and wait to
// receive delayed composition events. When TextComposition instances both