Bug 1203871 - Part 3. Use eQueryTextRectArray on ContentCache for e10s. r=masayuki

Use new event to update cotent process's cache.

MozReview-Commit-ID: CexTXW4knMQ

--HG--
extra : rebase_source : 525a8b0a1fe6ef533e06f76ac5156e264b158c70
extra : histedit_source : 2a8c46a64eb5c6a7a05adc28917422c488b2b1c4
This commit is contained in:
Makoto Kato 2016-03-14 16:03:31 +09:00
Родитель 689ca97c17
Коммит 8e42cbc802
1 изменённых файлов: 7 добавлений и 13 удалений

Просмотреть файл

@ -307,20 +307,14 @@ ContentCacheInChild::CacheTextRects(nsIWidget* aWidget,
// it's modified after all edit action listeners are performed but this
// is called while some of them are performed.
uint32_t length = textComposition->LastData().Length();
mTextRectArray.mRects.SetCapacity(length);
mTextRectArray.mStart = mCompositionStart;
uint32_t endOffset = mTextRectArray.mStart + length;
for (uint32_t i = mTextRectArray.mStart; i < endOffset; i++) {
LayoutDeviceIntRect charRect;
if (NS_WARN_IF(!QueryCharRect(aWidget, i, charRect))) {
MOZ_LOG(sContentCacheLog, LogLevel::Error,
("ContentCacheInChild: 0x%p CacheTextRects(), FAILED, "
"couldn't retrieve text rect at offset=%u", this, i));
mTextRectArray.Clear();
return false;
}
mTextRectArray.mRects.AppendElement(charRect);
}
nsEventStatus status = nsEventStatus_eIgnore;
WidgetQueryContentEvent textRects(true, eQueryTextRectArray, aWidget);
textRects.InitForQueryTextRectArray(mTextRectArray.mStart, length);
aWidget->DispatchEvent(&textRects, status);
mTextRectArray.mRects = textRects.mReply.mRectArray;
}
if (mTextRectArray.InRange(mSelection.mAnchor)) {