Created attachment 340654 [details] [diff] [review] patch This is the first step towards bug 450816. I wanted to split this part out to make it easier to review. This patch doesn't change the behavior, but it does a couple of things that makes using a larger canvas for panning easier: -changes the browser.xul code to position the deckbrowser using margins instead of stack positioning, which allows the deckbrowser to flex to the screen width automatically The only concern I have about this is that _setContentPosition isn't quite as efficient as it could be given string conversions and having to set two margins, but hopefully that's not too much of a problem. -avoid hardcoding the viewport size, and insert a div in the deckbrowser to allow it to be sized using percentages of the viewport (set to 100% atm to preserve current behavior) -introduce _effectiveViewportDimensions/viewportDimensions and use it instead of _effectiveCanvasDimensions Other somewhat unrelated cleanup: -inlines _updateViewState (there was only one caller) -make zoomToPage call _browserToCanvas to make it useful to external users, and refactor updateCanvasState to use that redraw instead of redrawing itself -some minor style changes/comment fixes -add smart getter code (can be expanded to other elements in followup bugs) Some followups that I noticed while working on this: -use smart getters in for other frequently accessed elements -add deckbrowser code to better deal with browser resizes -avoid saving/restoring scroll state in tab expiration code (because of bug 452286) -make sure that we don't set margins
Comment on attachment 340654 [details] [diff] [review] patch I assume you're using: gContentBox.style.marginTop == "0px" instead of this._contentTop == 0 to avoid the parseInt?
>1 year since this was checked in, our code has changed a lot and this is working well now.