If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

improve window resize handling in CanvasBrowser.js

VERIFIED FIXED in fennec1.0a2

Status

Fennec Graveyard
General
VERIFIED FIXED
9 years ago
8 years ago

People

(Reporter: Gavin, Assigned: Gavin)

Tracking

Trunk
fennec1.0a2

Details

Attachments

(1 attachment, 1 obsolete attachment)

Right now we rely on various element widths to do constraints while panning, and we're calling getBoundingClientRect() pretty much every time to handle window resizes. We should be caching these widths and using a resize handler to invalidate, to avoid unnecessary gets. Window resizing in general could be improved (e.g. making sure not to redraw instead of stretch the canvas when resizing).
Blocks: 460089

Updated

9 years ago
Duplicate of this bug: 460391
Assignee: nobody → gavin.sharp
Summary: improve window resize handling in deckbrowser → improve window resize handling in CanvasBrowser.js

Updated

9 years ago
Target Milestone: --- → Fennec A2
Created attachment 352200 [details] [diff] [review]
patch

The part of this patch that's actually relevant to this bug:
-cache canvas rect in canvasDimensions 

Other cleanup:
-clean out CanvasBrowser constructor (don't set things that are set in prototype just below)
-simplify _effectiveCanvasDimensions using map()
-comment out/remove _effectiveViewportDimensions and ensureElementIsVisible since they're broken
-fix strict warning in viewportHandler ("doesn't always return a value")
-get rid of _canvasPageOffset since it's always [0, 0]
-get rid of _drawOffset since it's now equivalent to _pageOffset
-comment out "avoiding dumb paint" since that's annoying
-make _pageOffset a getter rather than a function
Attachment #352200 - Flags: review?(pavlov)

Updated

9 years ago
Attachment #352200 - Flags: review?(pavlov) → review+
Created attachment 352343 [details] [diff] [review]
patch

Huh, I could have sworn I attached this update, which takes advantage of the rect cache in _clientToContentCoords as well.
Attachment #352200 - Attachment is obsolete: true
https://hg.mozilla.org/mobile-browser/rev/97a04bb9aeec
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Stuart rightfully points out that caching left/top is not a winning strategy!

Fixed: https://hg.mozilla.org/mobile-browser/rev/3b1727f1a2ad
verified FIXED on build:

Mozilla/5.0 (Macintosh; U; Intel Mac OSX 10.5; en-US; rv:1.9.2a2pre)
Gecko/20090808 Fennec/1.0b3pre
Status: RESOLVED → VERIFIED
Duplicate of this bug: 464172
You need to log in before you can comment on or make changes to this bug.