Bug 235881

Summary: [CSS Container Queries] Check for query containers when matching rules
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: CSSAssignee: Antti Koivisto <koivisto>
Status: RESOLVED FIXED    
Severity: Normal CC: graouts, ntim, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 229659    
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing none

Antti Koivisto
Reported 2022-01-31 02:08:12 PST
Skip rules inside container queries when there are no container ancestors.
Attachments
Patch (11.92 KB, patch)
2022-01-31 02:13 PST, Antti Koivisto
no flags
Patch (20.26 KB, patch)
2022-01-31 02:53 PST, Antti Koivisto
no flags
Patch for landing (20.26 KB, patch)
2022-01-31 06:03 PST, Antti Koivisto
no flags
Antti Koivisto
Comment 1 2022-01-31 02:13:23 PST
Antti Koivisto
Comment 2 2022-01-31 02:53:01 PST
Tim Nguyen (:ntim)
Comment 3 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
Antoine Quint
Comment 4 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!
Antti Koivisto
Comment 5 2022-01-31 06:03:00 PST
Created attachment 450405 [details] Patch for landing
EWS
Comment 6 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].
Radar WebKit Bug Importer
Comment 7 2022-01-31 06:58:16 PST
Note You need to log in before you can comment on or make changes to this bug.