зеркало из https://github.com/mozilla/gecko-dev.git
Bug 858526 - Use non-native text offsets in domWinUtils sendQueryContentEvent w/QUERY_CARET_RECT. r=ehsan
This commit is contained in:
Родитель
f00a0d1d10
Коммит
ae248b6cc7
|
@ -701,6 +701,13 @@ nsContentEventHandler::OnQueryCaretRect(nsQueryContentEvent* aEvent)
|
|||
uint32_t offset;
|
||||
rv = GetFlatTextOffsetOfRange(mRootContent, mFirstSelectedRange, &offset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
// strip out native new lines, we want the non-native offset. The offsets
|
||||
// handed in here are from selection, caretPositionFromPoint, and editable
|
||||
// element offset properties. We need to match those or things break.
|
||||
nsINode* startNode = mFirstSelectedRange->GetStartParent();
|
||||
if (startNode && startNode->IsNodeOfType(nsINode::eTEXT)) {
|
||||
offset = ConvertToXPOffset(static_cast<nsIContent*>(startNode), offset);
|
||||
}
|
||||
if (offset == aEvent->mInput.mOffset) {
|
||||
nsRect rect;
|
||||
nsIFrame* caretFrame = caret->GetGeometry(mSelection, &rect);
|
||||
|
|
Загрузка…
Ссылка в новой задаче