| Summary: | `contain: layout` on the html element should change position:fixed behavior | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> | ||||||||||
| Component: | Layout and Rendering | Assignee: | Rob Buis <rbuis> | ||||||||||
| Status: | RESOLVED FIXED | ||||||||||||
| Severity: | Normal | CC: | bfulgham, cathiechen, changseok, clopez, dino, esprehn+autocc, ews-watchlist, fmalita, glenn, gyuyoung.kim, kondapallykalyan, pdr, rbuis, sabouhallawa, schenney, sergio, simon.fraser, webkit-bug-importer, youennf, zalan | ||||||||||
| Priority: | P2 | Keywords: | BrowserCompat, InRadar | ||||||||||
| Version: | Safari Technology Preview | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| See Also: |
https://github.com/web-platform-tests/wpt/pull/33667 https://bugs.webkit.org/show_bug.cgi?id=243571 |
||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Simon Fraser (smfr)
2022-03-30 10:52:17 PDT
I noticed the problem goes away if RenderLayerCompositor treats contain: layout always as a composited layer. However I guess it should work for non composited too... Seems like `RenderElement::canContainFixedPositionObjects()` already considers containment so not sure why this is broken. Maybe RenderLayer::flagsForUpdateLayerPositions() also needs fixing. Created attachment 457706 [details]
Patch
Comment on attachment 457706 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457706&action=review > Source/WebCore/rendering/RenderBox.cpp:2325 > + else if (hasTransform() || shouldApplyLayoutContainment(*this)) This should share code with canContainFixedPositionObjects() Created attachment 457744 [details]
Patch
Created attachment 457806 [details]
Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess Comment on attachment 457706 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457706&action=review >> Source/WebCore/rendering/RenderBox.cpp:2325 >> + else if (hasTransform() || shouldApplyLayoutContainment(*this)) > > This should share code with canContainFixedPositionObjects() Done. Comment on attachment 457806 [details]
Patch
RenderSVGRoot::mapLocalToContainer() and RenderBox::mapAbsoluteToLocalPoint() need the same change.
Created attachment 458086 [details]
Patch
Committed r293209 (249880@main): <https://commits.webkit.org/249880@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 458086 [details]. |