diff -r 3a9197ec8297 chrome/content/bindings.xml --- a/chrome/content/bindings.xml Fri Oct 08 07:22:03 2010 +0200 +++ b/chrome/content/bindings.xml Fri Oct 08 09:17:20 2010 +0200 @@ -86,22 +86,20 @@ - + - + diff -r 3a9197ec8297 chrome/content/browser.js --- a/chrome/content/browser.js Fri Oct 08 07:22:03 2010 +0200 +++ b/chrome/content/browser.js Fri Oct 08 09:17:20 2010 +0200 @@ -1044,27 +1044,34 @@ var Browser = { } break; } } }; Browser.MainDragger = function MainDragger() { + this._contentStack = document.getElementById("content-stack"); + this._verticalScrollbar = document.getElementById("vertical-scroller"); + this._horizontalScrollbar = document.getElementById("horizontal-scroller"); }; Browser.MainDragger.prototype = { isDraggable: function isDraggable(target, scroller) { return { x: true, y: true }; }, dragStart: function dragStart(clientX, clientY, target, scroller) { + this._sizeScrollbars(); + this._updateScrollbars(); + this._contentStack.setAttribute("panning", "true"); }, dragStop: function dragStop(dx, dy, scroller) { + this._contentStack.removeAttribute("panning"); this.dragMove(Browser.snapSidebars(), 0, scroller); Browser.tryUnfloatToolbar(); }, dragMove: function dragMove(dx, dy, scroller) { let doffset = new Point(dx, dy); // First calculate any panning to take sidebars out of view @@ -1074,16 +1081,17 @@ Browser.MainDragger.prototype = { this._panScroller(Browser.contentScrollboxScroller, doffset); // Any leftover panning in doffset would bring controls into view. Add to sidebar // away panning for the total scroll offset. doffset.add(panOffset); Browser.tryFloatToolbar(doffset.x, 0); this._panScroller(Browser.controlsScrollboxScroller, doffset); this._panScroller(Browser.pageScrollboxScroller, doffset); + this._updateScrollbars(); return !doffset.equals(dx, dy); }, /** Return offset that pans controls away from screen. Updates doffset with leftovers. */ _panControlsAwayOffset: function(doffset) { let x = 0, y = 0, rect; @@ -1106,16 +1114,33 @@ Browser.MainDragger.prototype = { }, /** Pan scroller by the given amount. Updates doffset with leftovers. */ _panScroller: function _panScroller(scroller, doffset) { let { x: x0, y: y0 } = Browser.getScrollboxPosition(scroller); scroller.scrollBy(doffset.x, doffset.y); let { x: x1, y: y1 } = Browser.getScrollboxPosition(scroller); doffset.subtract(x1 - x0, y1 - y0); + }, + + _sizeScrollbars: function _sizeScrollbars() { + let browser = Browser.selectedBrowser; + let width = window.innerWidth, height = window.innerHeight; + this._widthRatio = width / (browser.contentDocumentWidth * browser.scale); + this._heightRatio = height / (browser.contentDocumentHeight * browser.scale); + + this._horizontalScrollbar.style.width = width * this._widthRatio + "px"; + this._verticalScrollbar.style.height = height * this._heightRatio + "px"; + }, + + _updateScrollbars: function _updateScrollbars() { + let browser = Browser.selectedBrowser; + let { x: scrollX, y: scrollY } = browser.getPosition(); + this._horizontalScrollbar.left = scrollX * this._widthRatio; + this._verticalScrollbar.top = scrollY * this._heightRatio; } }; function nsBrowserAccess() { } diff -r 3a9197ec8297 chrome/content/browser.xul --- a/chrome/content/browser.xul Fri Oct 08 07:22:03 2010 +0200 +++ b/chrome/content/browser.xul Fri Oct 08 09:17:20 2010 +0200 @@ -219,17 +219,17 @@ - + #ifdef MOZ_PLATFORM_MAEMO #endif @@ -275,16 +275,18 @@ @@ -505,17 +507,17 @@ #ifdef MOZ_SERVICES_SYNC #endif -