Bug 303414
| Summary: | Container query interleaving prevents StyleAdjuster from running on top layer elements | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ruthvik Konda <rkonda2> |
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ruthvik Konda
When an element enters the top layer via fullscreen and its parent has container-type set, TreeResolver's container query interleaving logic (StyleTreeResolver.cpp:1382-1403) returns LayoutInterleavingAction::SkipDescendants, which defers style resolution for all descendants. This prevents StyleAdjuster::adjust() (StyleAdjuster.cpp:546-549) from ever running on the top layer element, so it never receives the required position:absolute style. This creates a broken invariant where the element remains in the normal flow of its layout parent (making isGridItem() return true) while containingBlock() correctly returns RenderView per top layer rules (RenderObject.cpp:782-783), leading to type confusion crashes. The fundamental issue is that style resolution interleaving breaks the contract that all top layer elements must be position:absolute. As a result, this architectural problem caused a downcast crash in rdar://163028025. If the top layer element was correctly set to position:absolute, then it would have correctly been out of flow positioned and the crash would've been avoided. Instead isGridItem() returns true and containingBlock() returns a RenderView which is fundamentally wrong.
rdar://163028025 has a workaround fix in place. But this is a deeper rooted issue that needs to go to a fullscreen or style resolution expert to solve.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/165714112>