зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1119126 - Send updateposition after reflow when selection is collapsed. r=roc
This commit is contained in:
Родитель
d975c07099
Коммит
58963742cf
|
@ -638,6 +638,8 @@ BrowserElementChild.prototype = {
|
|||
// We clear selectionStateChangedTarget if selection carets are invisible.
|
||||
if (e.visible && !isCollapsed) {
|
||||
this._selectionStateChangedTarget = e.target;
|
||||
} else if (canPaste && isCollapsed) {
|
||||
this._selectionStateChangedTarget = e.target;
|
||||
} else {
|
||||
this._selectionStateChangedTarget = null;
|
||||
}
|
||||
|
@ -1144,6 +1146,7 @@ BrowserElementChild.prototype = {
|
|||
|
||||
_recvDoCommand: function(data) {
|
||||
if (this._isCommandEnabled(data.json.command)) {
|
||||
this._selectionStateChangedTarget = null;
|
||||
docShell.doCommand(COMMAND_MAP[data.json.command]);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1220,6 +1220,12 @@ SelectionCarets::ScrollPositionChanged()
|
|||
SelectionState::Updateposition);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
nsRefPtr<dom::Selection> selection = GetSelection();
|
||||
if (selection && selection->RangeCount() && selection->IsCollapsed()) {
|
||||
DispatchSelectionStateChangedEvent(selection,
|
||||
SelectionState::Updateposition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1317,6 +1323,12 @@ SelectionCarets::Reflow(DOMHighResTimeStamp aStart, DOMHighResTimeStamp aEnd)
|
|||
DispatchSelectionStateChangedEvent(GetSelection(),
|
||||
SelectionState::Updateposition);
|
||||
}
|
||||
} else {
|
||||
nsRefPtr<dom::Selection> selection = GetSelection();
|
||||
if (selection && selection->RangeCount() && selection->IsCollapsed()) {
|
||||
DispatchSelectionStateChangedEvent(selection,
|
||||
SelectionState::Updateposition);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче