Bug 235896 - [CSS Container Queries] Ensure query containers have valid layout before resolving the subtree
Summary: [CSS Container Queries] Ensure query containers have valid layout before reso...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antti Koivisto
URL:
Keywords: InRadar
Depends on:
Blocks: 229659
  Show dependency treegraph
 
Reported: 2022-01-31 10:11 PST by Antti Koivisto
Modified: 2022-02-01 12:35 PST (History)
7 users (show)

See Also:


Attachments
Patch (11.17 KB, patch)
2022-02-01 05:07 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
Patch for landing (11.13 KB, patch)
2022-02-01 11:23 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2022-01-31 10:11:29 PST
Bounce between style and layout to ensure query containers have valid style.
Comment 1 Radar WebKit Bug Importer 2022-01-31 10:27:39 PST
<rdar://problem/88279976>
Comment 2 Antti Koivisto 2022-02-01 05:07:03 PST
Created attachment 450518 [details]
Patch
Comment 3 zalan 2022-02-01 10:38:52 PST
Comment on attachment 450518 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=450518&action=review

> Source/WebCore/ChangeLog:24
> +        Don't run post-layout tasks when resolving query containers.

yeah, I wish there was a disposable layout type of thing where we could just run layout on the tree, produce geometry and let the rest of the update flow take care of the "final" layout including paint invalidation etc. Running the post layout tasks (even on a subsequent runloop) may also produce some unexpected results.

> Source/WebCore/dom/Document.cpp:2063
> +            if (frameView.layoutContext().isLayoutPending() || renderView()->needsLayout())

I'd just check FrameViewLayoutContext::needsLayout() (in addition to ^^, it also covers things like subtree layout, which may get triggered by containment)
Comment 4 Antti Koivisto 2022-02-01 11:23:31 PST
Created attachment 450553 [details]
Patch for landing
Comment 5 EWS 2022-02-01 12:35:41 PST
Committed r288906 (246648@main): <https://commits.webkit.org/246648@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 450553 [details].