-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Avoid over-eager clipping of child layers in multicolumn #47276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Avoid over-eager clipping of child layers in multicolumn #47276
Conversation
EWS run on previous version of this PR (hash daf5431) |
daf5431
to
7ea91dd
Compare
EWS run on previous version of this PR (hash 7ea91dd) |
https://bugs.webkit.org/show_bug.cgi?id=272280 rdar://126413036 Reviewed by NOBODY (OOPS!). This patch aligns WebKit with Gecko / Firefox and Blink / Chromium. Merge: https://chromium.googlesource.com/chromium/src.git/+/e500cbd3ba36bf3216087481790f5aece0e778a5 Self-painting layers (caused by e.g. position:relative) don't contribute to visual overflow in their parent layout object; see RenderBox::addOverflowFromChild(). We cannot use the visual overflow rectangle set on the flow thread when calculating the bounding box of a fragment established by a child layer. Therefore, only clip in the flow thread's block direction in overflowRectForFragmentedFlowPortion(), and leave the inline axis alone. I simplified the implementation, since it's now way easier to start with an infinite rectangle, and just limit the dimensions that need it afterwards. Also got rid of an old check for shouldClipFragmentedFlowContent(), which must have been residue from the CSS regions implementation. This also happened to fix some inaccuracies mostly invisible to the naked eye, when it comes to transform:scale()d text with glyphs that have negative left bearing or overflow the line box vertically. It looks like we measure and lay out with the CSS computed font, and then switch to a scaled font when painting, so that it looks crisp and nice. In WebKit, we didn't had equivalent to `infiniteIntRect` so introduce 'renderableInfiniteRect' and use it for our use case similar to other cases in WebKit. * Source/WebCore/rendering/RenderFragmentContainer.cpp: (WebCore::RenderFragmentContainer::overflowRectForFragmentedFlowPortion const): > Local Tests: * LayoutTests/fast/multicol/scale-transform-text.html: Add Test Case * LayoutTests/fast/multicol/scale-transform-text-expected.html: Add Test Case Expectation * LayoutTests/fast/multicol/overflowing-relpos.html: Add Test Case * LayoutTests/fast/multicol/overflowing-relpos-expected.html: Add Test Case Expectation > WPT Progressions: * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/css/css-break/relpos-inline-hit-testing-expected.txt: > Rebaselines: * LayoutTests/imported/blink/fast/multicol/unbreakable-block-too-tall-at-column-start.html: WPE & GTK Specific Pixel Failures * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-003-expected.txt: * LayoutTests/fast/multicol/client-rects.html: GTK specific
7ea91dd
to
53e4565
Compare
EWS run on current version of this PR (hash 53e4565) |
auto renderableInfiniteRect = [] { | ||
// Return a infinite-like rect whose values are such that, when converted to float pixel values, they can reasonably represent device pixels. | ||
return LayoutRect(LayoutUnit::nearlyMin() / 32, LayoutUnit::nearlyMin() / 32, LayoutUnit::nearlyMax() / 16, LayoutUnit::nearlyMax() / 16); | ||
}(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any particular reason for not using LayoutRect's infiniteRect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It leads to WPT failure - css/css-break/out-of-flow-in-multicolumn-018.htm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alanbaradlay - I noticed that Blink has infiniteIntRect
, which is different from our infiniteRect. I think either we update our or introduce newer helper. I copied this one from Simon's from here - https://searchfox.org/wubkat/rev/4e9806c2e7f7c29e4a6d87ebeca603c4cc8f080c/Source/WebCore/rendering/RenderLayerCompositor.cpp#3630 to workaround here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me debug this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to defer to @smfr on this, but 1, it does not scale well 2, technically we now return a non-infinite rect even when there's no clipping at all (so comparing to LayoutRect::infiniteRect() will return false)
53e4565
53e4565