mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 479862 - scrollTop and scrollLeft might contain wrong values for scripts on pages [r=vingtetun]
This commit is contained in:
parent
178d0d74b1
commit
58eed775e2
@ -269,6 +269,8 @@ let DOMEvents = {
|
||||
DOMEvents.init();
|
||||
|
||||
let ContentScroll = {
|
||||
ignoreScroll: false,
|
||||
|
||||
init: function() {
|
||||
addMessageListener("Content:ScrollTo", this);
|
||||
addMessageListener("Content:ScrollBy", this);
|
||||
@ -282,11 +284,21 @@ let ContentScroll = {
|
||||
receiveMessage: function(aMessage) {
|
||||
let json = aMessage.json;
|
||||
switch (aMessage.name) {
|
||||
case "Content:ScrollTo":
|
||||
case "Content:ScrollTo": {
|
||||
let scrollOffset = Util.getScrollOffset(content);
|
||||
if (scrollOffset.x == json.x && scrollOffset.y == json.y)
|
||||
return;
|
||||
|
||||
this.ignoreScroll = true;
|
||||
content.scrollTo(json.x, json.y);
|
||||
break;
|
||||
}
|
||||
|
||||
case "Content:ScrollBy":
|
||||
if (!json.dx && !json.dy)
|
||||
return;
|
||||
|
||||
this.ignoreScroll = true;
|
||||
content.scrollBy(json.dx, json.dy);
|
||||
break;
|
||||
|
||||
@ -341,6 +353,11 @@ let ContentScroll = {
|
||||
handleEvent: function(aEvent) {
|
||||
switch (aEvent.type) {
|
||||
case "scroll": {
|
||||
if (this.ignoreScroll) {
|
||||
this.ignoreScroll = false;
|
||||
return;
|
||||
}
|
||||
|
||||
let doc = aEvent.target;
|
||||
if (doc != content.document)
|
||||
return;
|
||||
|
@ -1176,6 +1176,9 @@ Browser.MainDragger.prototype = {
|
||||
this._contentView = null;
|
||||
this.dragMove(Browser.snapSidebars(), 0, scroller);
|
||||
Browser.tryUnfloatToolbar();
|
||||
|
||||
// Update the scroll position of the content
|
||||
getBrowser()._updateCSSViewport();
|
||||
},
|
||||
|
||||
dragMove: function dragMove(dx, dy, scroller) {
|
||||
|
Loading…
Reference in New Issue
Block a user