Introduce an OuterCSSPixel type
Categories
(Core :: Panning and Zooming, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox112 | --- | fixed |
People
(Reporter: botond, Assigned: botond)
References
Details
Attachments
(3 files)
In several places in APZ code, we need to distinguish / convert between two different types of CSS pixels in the context of a scroll frame that can be zoomed:
- the CSS pixels of the content inside the scroll frame (i.e. inside the zoom)
- the CSS pixels of the content outside the scroll frame (i.e. outside the zoom), such as the scrollbar
We don't currently have distinct types for these, and this has led to confusion from time to time (most recently, in bug 1554795 we discovered that the code in AsyncScrollThumbTransformer::ScaleThumbBy()
was quite confused in this respect).
I would like to propose introducing a new type, OuterCSSPixel
, to represent quantities in the second category. Its use would be limited to places in APZ that work with CSS pixels of both types.
Assignee | ||
Comment 1•1 year ago
|
||
Assignee | ||
Comment 2•1 year ago
|
||
This is currently used mostly for calculations related to scrollbars,
which are an example of content outside the scroll frame (and in
particular not subject to the zoom of a zoomable scroll frame).
As part of this change, FrameMetrics::
CalculateCompositionBoundsInCssPixelsOfSurroundingContent() is
renamed to CalculateCompositionBoundsInOuterCSSPixels() for brevity.
Depends on D171141
Assignee | ||
Comment 3•1 year ago
|
||
Depends on D171141
Pushed by bballo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/45e576292e77 Factor out a TranslateThumb() helper function. r=dlrobertson https://hg.mozilla.org/integration/autoland/rev/06133bc2e290 Add a ViewAs<>() overload for casting between scales. r=dlrobertson https://hg.mozilla.org/integration/autoland/rev/a4c727631ea4 Introduce OuterCSSPixel to represent quantities in CSS pixels of content surrounding a scroll frame. r=dlrobertson
Comment 5•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/45e576292e77
https://hg.mozilla.org/mozilla-central/rev/06133bc2e290
https://hg.mozilla.org/mozilla-central/rev/a4c727631ea4
Description
•