Handle FrameMetrics::mCumulativeResolution being 0 gracefully
Categories
(Core :: Panning and Zooming, enhancement, P3)
Tracking
()
People
(Reporter: botond, Assigned: aemad, Mentored)
Details
(Whiteboard: [apz-outreachy][lang=c++])
Attachments
(1 file, 1 obsolete file)
| Reporter | ||
Updated•5 years ago
|
| Reporter | ||
Updated•5 years ago
|
| Reporter | ||
Updated•5 years ago
|
| Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
| Reporter | ||
Comment 3•5 years ago
|
||
Just wanted to document a clarification here:
(In reply to Botond Ballo [:botond] from comment #0)
FrameMetrics::mCumulativeResolutioncan have a 0 component in situations
where an element has a scale transform of 0 in that direction
A scale transform can indeed be zero in one direction and nonzero in another. This comment seems to suggest that in such cases, only the corresponding component of mCumulativeResolution will be zero.
However, in bug 1277814, where we fixed one instance of this problem, the test case involved a transform with only one component (scaleY) being zero, but the fix only added a check for CSSToParentLayerScale2D(0, 0), and that fix caused the test case to pass, suggesting that a transform with a zero scale in one direction results in a mCumulativeResolution that is zero in both directions.
The explanation for this appears to lie in the implementation of BaseMatrix::ScaleFactors(), which returns a scale that's zero in both dimensions if the matrix's determinant is zero. Having a zero scale along either axis as part of the transform will result in the matrix having determinant zero and this code path being hit. Finally, the code that calculates mCumulativeResolution calls nsLayoutUtils::GetTransformToAncestorScale() (which uses this ScaleFactors() function) to pick up the CSS-driven resolution.
(The conclusion relevant to the patch is that it's fine to test for CSSToParentLayerScale2D(0, 0) and not necessary to test the dimensions individually.)
Comment 5•5 years ago
|
||
| bugherder | ||
Updated•5 years ago
|
Description
•