Bug 237079 - [CSS Container Queries] offsetWidth/Height and similar should update layout for container queries
Summary: [CSS Container Queries] offsetWidth/Height and similar should update layout f...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (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-02-23 05:14 PST by Antti Koivisto
Modified: 2022-02-23 10:17 PST (History)
8 users (show)

See Also:


Attachments
Patch (11.48 KB, patch)
2022-02-23 05:18 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-02-23 05:14:43 PST
css/css-contain/container-queries/inline-size-containment.html
css/css-contain/container-queries/inline-size-containment-vertical-rl.html
Comment 1 Antti Koivisto 2022-02-23 05:18:57 PST
Created attachment 452966 [details]
Patch
Comment 2 Simon Fraser (smfr) 2022-02-23 09:26:36 PST
Comment on attachment 452966 [details]
Patch

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

> Source/WebCore/dom/Document.cpp:2218
> +    while (styleScope().updateQueryContainerState(queryContainerUpdateContext)) {
> +        updateStyleIfNeeded();
> +
> +        if (!frameView->layoutContext().needsLayout())
> +            break;
> +
> +        frameView->layoutContext().layout();

This makes me nervous that we could get into an infinite loop here. Should we bail after N iterations?
Comment 3 Antti Koivisto 2022-02-23 09:42:24 PST
> This makes me nervous that we could get into an infinite loop here. Should
> we bail after N iterations?

The queryContainerUpdateContext thing does prevent infinite looping (since in worst case you'll eventually have every element in that set and won't invalidate anything any more).
Comment 4 EWS 2022-02-23 10:16:26 PST
Committed r290380 (247695@main): <https://commits.webkit.org/247695@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 452966 [details].
Comment 5 Radar WebKit Bug Importer 2022-02-23 10:17:18 PST
<rdar://problem/89363521>