зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1118791 - Long press on white space selects closest vertical element, r=margaret
This commit is contained in:
Родитель
aa5ccc9006
Коммит
35def50721
|
@ -102,7 +102,7 @@ function testSelectDivAtPoint() {
|
|||
selection.collapseToStart();
|
||||
|
||||
return Promise.all([
|
||||
ok(selection.getRangeAt(0).collapsed, "Selection should be collapsed"),
|
||||
ok(selection.collapsed, "Selection should be collapsed"),
|
||||
ok(!sh.isSelectionActive(), "Selection should not be active"),
|
||||
]);
|
||||
});
|
||||
|
|
|
@ -1024,9 +1024,15 @@ var SelectionHandler = {
|
|||
if (selection) {
|
||||
// Remove our listener before we clear the selection
|
||||
selection.QueryInterface(Ci.nsISelectionPrivate).removeSelectionListener(this);
|
||||
// Clear selection without clearing the anchorNode or focusNode
|
||||
|
||||
// Remove the selection. For editables, we clear selection without losing
|
||||
// element focus. For non-editables, just clear all.
|
||||
if (selection.rangeCount != 0) {
|
||||
selection.collapseToStart();
|
||||
if (this.isElementEditableText(this._targetElement)) {
|
||||
selection.collapseToStart();
|
||||
} else {
|
||||
selection.removeAllRanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче