Bug 235881 - [CSS Container Queries] Check for query containers when matching rules
Summary: [CSS Container Queries] Check for query containers when matching rules
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 02:08 PST by Antti Koivisto
Modified: 2022-01-31 06:58 PST (History)
3 users (show)

See Also:


Attachments
Patch (11.92 KB, patch)
2022-01-31 02:13 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
Patch (20.26 KB, patch)
2022-01-31 02:53 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
Patch for landing (20.26 KB, patch)
2022-01-31 06:03 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 02:08:12 PST
Skip rules inside container queries when there are no container ancestors.
Comment 1 Antti Koivisto 2022-01-31 02:13:23 PST
Created attachment 450390 [details]
Patch
Comment 2 Antti Koivisto 2022-01-31 02:53:01 PST
Created attachment 450392 [details]
Patch
Comment 3 Tim Nguyen (:ntim) 2022-01-31 04:31:45 PST
Comment on attachment 450392 [details]
Patch

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

> Source/WebCore/ChangeLog:16
> +        This patch doesn't yet do any actual container query matching, it just check

nit: it just checks

> Source/WebCore/style/ElementRuleCollector.cpp:488
> +        if (auto* containerQuery = matchRequest.ruleSet.containerQueryFor(ruleData)) {
> +            if (!containerQueryMatches(*containerQuery))

you could combine both lines, unless you're planning to re-use containerQuery
Comment 4 Antoine Quint 2022-01-31 05:32:58 PST
Comment on attachment 450392 [details]
Patch

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

r+ but you'll probably want to account for Tim's comments as well.

> LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-invalidation-expected.txt:3
> +FAIL Changing the container type invalidates relevant descendants assert_equals: expected "rgb(0, 128, 0)" but got "rgb(0, 0, 0)"

What an odd change!
Comment 5 Antti Koivisto 2022-01-31 06:03:00 PST
Created attachment 450405 [details]
Patch for landing
Comment 6 EWS 2022-01-31 06:57:35 PST
Committed r288813 (246589@main): <https://commits.webkit.org/246589@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 450405 [details].
Comment 7 Radar WebKit Bug Importer 2022-01-31 06:58:16 PST
<rdar://problem/88268007>