Closed
Bug 1507279
Opened 6 years ago
Closed 6 years ago
Add an internal API for setting the visual viewport offset from the main thread
Categories
(Core :: Panning and Zooming, enhancement, P3)
Core
Panning and Zooming
Tracking
()
RESOLVED
FIXED
mozilla66
People
(Reporter: botond, Assigned: botond)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
Several internal consumers (e.g. session history, scroll anchoring) have a need to change the visual viewport offset from the main thread. This bug tracks adding an internal API for making such changes.
The API can live in nsIPresShell for C++ consumers, with an nsIDOMWindowUtils wrapper for JS consumers.
The implementation would send a message to APZ and update the RCD-RSF visual viewport offset, while leaving the layout viewport offset alone (modulo changes needed to keep the layout viewport enclosing the visual viewport).
Assignee | ||
Comment 1•6 years ago
|
||
(In reply to Botond Ballo [:botond] from comment #0)
> The implementation would send a message to APZ and update the RCD-RSF visual
> viewport offset, while leaving the layout viewport offset alone (modulo
> changes needed to keep the layout viewport enclosing the visual viewport).
After thinking about this some more, I think it would make more sense to send the update as part of the next transaction, rather than having a separate message. We can add a "visual viewport offset updated" flag to ScrollMetadata, and have APZ accept both the layout and visual offsets sent by the main thread.
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → botond
Assignee | ||
Comment 2•6 years ago
|
||
Assignee | ||
Comment 3•6 years ago
|
||
Depends on D16141
Assignee | ||
Comment 4•6 years ago
|
||
I would have liked to avoid introducing FrameMetrics::mVisualViewportOffset
, but that would have required some refactoring that I haven't done yet, and I didn't want to risk this not landing in 66 given all the things in blocks.
For an example use of the API, see this patch.
Pushed by bballo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bea2de966d14
Add a mechanism for the main thread to set a visual viewport offset. r=kats
https://hg.mozilla.org/integration/autoland/rev/47c259e23cfe
Expose the visual scrolling mechanism to internal JS users. r=kats
Comment 6•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/bea2de966d14
https://hg.mozilla.org/mozilla-central/rev/47c259e23cfe
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox66:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Updated•6 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•