mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 799094 - Move text selection handles when scrolling a subdocument with a text selection. r=margaret
This commit is contained in:
parent
86ffca961d
commit
29cbb86dd5
@ -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…
Reference in New Issue
Block a user