Closed Bug 1815372 Opened 1 year ago Closed 1 year ago

Introduce an OuterCSSPixel type

Categories

(Core :: Panning and Zooming, task, P3)

task

Tracking

()

RESOLVED FIXED
112 Branch
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.

Depends on: 1554795

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

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
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
Regressions: 1820338
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: