deckbrowser canvas/viewport layout refactoring and cleanup

VERIFIED FIXED in fennec1.0a1

Status

Fennec Graveyard
General
VERIFIED FIXED
9 years ago
8 years ago

People

(Reporter: Gavin, Assigned: Gavin)

Tracking

Trunk
fennec1.0a1

Details

Attachments

(1 attachment)

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
Attachment #340654 - Flags: review?(mark.finkle)
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
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?
Attachment #340654 - Flags: review?(mark.finkle) → review+
yep
http://hg.mozilla.org/mobile-browser/rev/6beda8b6019a
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Fennec A1
>1 year since this was checked in, our code has changed a lot and this is working well now.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.