Bug 618975 Mobile patch r=mfinkle a=blocking-fennec

This commit is contained in:
Benjamin Stover 2011-03-08 21:32:15 -08:00
Родитель 0ab7355a94
Коммит f0657a12c8
3 изменённых файлов: 22 добавлений и 5 удалений

Просмотреть файл

@ -301,11 +301,18 @@ let ContentScroll = {
},
getScrollOffsetForElement: function(aElement) {
if (aElement.parentNode == aElement.ownerDocument)
return this.getScrollOffset(aElement.ownerDocument.defaultView);
return { x: aElement.scrollLeft, y: aElement.scrollTop };
},
setScrollOffsetForElement: function(aElement, aLeft, aTop) {
if (aElement.parentNode == aElement.ownerDocument) {
aElement.ownerDocument.defaultView.scrollTo(aLeft, aTop);
} else {
aElement.scrollLeft = aLeft;
aElement.scrollTop = aTop;
}
},
receiveMessage: function(aMessage) {
@ -347,7 +354,8 @@ let ContentScroll = {
let win = element.ownerDocument.defaultView;
let winCwu = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
winCwu.setDisplayPort(x, y, displayport.width, displayport.height);
let winCwu20 = winCwu.QueryInterface(Ci.nsIDOMWindowUtils_MOZILLA_2_0_BRANCH);
winCwu20.setDisplayPortForElement(x, y, displayport.width, displayport.height, element);
break;
}
@ -419,7 +427,8 @@ let ContentActive = {
case "Content:Deactivate":
docShell.isActive = false;
let cwu = content.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
cwu.setDisplayPort(0,0,0,0);
let cwu20 = cwu.QueryInterface(Ci.nsIDOMWindowUtils_MOZILLA_2_0_BRANCH);
cwu20.setDisplayPortForElement(0,0,0,0,content.document.documentElement);
break;
case "Content:Activate":

Просмотреть файл

@ -950,7 +950,13 @@
*/
_updateCacheViewport: function() {
// Do not update scroll values for content.
if (this.isRoot())
this._sendDisplayportUpdate(-1, -1);
else {
let contentView = this._contentView;
this._sendDisplayportUpdate(contentView.scrollX,
contentView.scrollY);
}
},
_getContentSize: function() {

Просмотреть файл

@ -1161,6 +1161,8 @@ Browser.MainDragger.prototype = {
},
dragStop: function dragStop(dx, dy, scroller) {
if (this._contentView && this._contentView._updateCacheViewport)
this._contentView._updateCacheViewport();
this._contentView = null;
this.dragMove(Browser.snapSidebars(), 0, scroller);
Browser.tryUnfloatToolbar();