mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-16 06:54:00 +00:00
Bug 799094 - Move text selection handles when scrolling a subdocument with a text selection. r=margaret
This commit is contained in:
parent
5c28f41e90
commit
f06b1a33bb
@ -2056,6 +2056,29 @@ var SelectionHandler = {
|
||||
positions: positions
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
subdocumentScrolled: function sh_subdocumentScrolled(aElement) {
|
||||
if (this._activeType == this.TYPE_NONE) {
|
||||
return;
|
||||
}
|
||||
let scrollView = aElement.ownerDocument.defaultView;
|
||||
let view = this._view;
|
||||
while (true) {
|
||||
if (view == scrollView) {
|
||||
// The selection is in a view (or sub-view) of the view that scrolled.
|
||||
// So we need to reposition the handles.
|
||||
if (this._activeType == this.TYPE_SELECTION) {
|
||||
this.updateCacheForSelection();
|
||||
}
|
||||
this.positionHandles();
|
||||
break;
|
||||
}
|
||||
if (view == view.parent) {
|
||||
break;
|
||||
}
|
||||
view = view.parent;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -3646,6 +3669,7 @@ var BrowserEventHandler = {
|
||||
if (this._elementCanScroll(this._scrollableElement, data.x, data.y)) {
|
||||
this._scrollElementBy(this._scrollableElement, data.x, data.y);
|
||||
sendMessageToJava({ gecko: { type: "Gesture:ScrollAck", scrolled: true } });
|
||||
SelectionHandler.subdocumentScrolled(this._scrollableElement);
|
||||
} else {
|
||||
sendMessageToJava({ gecko: { type: "Gesture:ScrollAck", scrolled: false } });
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user