Closed Bug 444858 Opened 12 years ago Closed 12 years ago
improve zoom-to-element behavior
Right now we're just zooming directly to the clicked on element. Some ideas for improving this: - add a margin (trivial) - search through document tree and determine a reasonable zoom level based on size/position of parents/children of the selected element - look for non-inline elements and use those as a guide (some of the previous zooming code looked for the first block ancestor and zoomed to that, iirc)
Priority: -- → P2
Target Milestone: --- → Fennec M6
Assignee: nobody → gavin.sharp
This just puts a 15px margin around the zoom area instead of zooming directly to the element.
Attachment #331168 - Flags: review?(pavlov)
(We don't need to worry about coordinates that stretch outside the viewport, since the rest of the code handles those appropriately.)
Attachment #331168 - Attachment description: add a margin → add a margin (checked in)
Can this be closed?
I can close it and open a new bug, but I still want to investigate further improvements.
Let's just keep this open then :)
Two fixes: 1) Look for block or table ancestors when zooming 2) Rework client to content coordinate conversion code to work with zoomed out pages (e.g. cnn.com). 2) fixes two bugs that affected zooming or clicking near the bottom edge of the page when the page was zoomed out (e.g. on cnn.com). The first bug was that zooming and click redispatching used slightly different ways of coordinating event coordinates (one was adjusting for browserTop before dividing by zoomLevel, while the other was doing it after), so I consolidated that into _clientToContentCoords. The second bug was that for zoomed out pages, it was possible for content displayed near the bottom of the page to be offscreen in the hidden <browser>, which means that elementFromPoint was returning null, which explains bug 446509. I fixed that by trying to scroll to the clicked point directly instead of just to the pageoffset, and adjusting the values returned by _clientToContentCoords accordingly (also added a comment).
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
verified in beta3
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.