Bug 243449

Summary: [CSS Container Queries] Update query grammar to the spec
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: CSSAssignee: Antti Koivisto <koivisto>
Status: RESOLVED FIXED    
Severity: Normal CC: clopez, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, hi, joepeck, macpherson, menard, ntim, pangle, webkit-bug-importer, youennf
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
Patch for landing none

Description Antti Koivisto 2022-08-02 02:39:31 PDT
The spec was changed to allow logical operators on top level without parenthesis making

@container not (foo)

legal.

https://drafts.csswg.org/css-contain-3/#container-rule
Comment 1 Radar WebKit Bug Importer 2022-08-02 02:42:28 PDT
<rdar://problem/97967682>
Comment 2 Antti Koivisto 2022-08-02 03:05:17 PDT
Created attachment 461354 [details]
Patch
Comment 3 Antti Koivisto 2022-08-02 03:09:36 PDT
Created attachment 461355 [details]
Patch
Comment 4 Tim Nguyen (:ntim) 2022-08-02 05:45:41 PDT
Comment on attachment 461355 [details]
Patch

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

> Source/WebCore/css/ContainerQueryParser.cpp:98
>  

For posterity (and anyone else looking at this patch), the `not` part is handled just below (click expand to make it appear in the diff view).

> Source/WebCore/css/StyleRule.cpp:466
> +    , m_containerdQuery(WTFMove(query))
>  {
>  }
>  
>  StyleRuleContainer::StyleRuleContainer(const StyleRuleContainer& other)
>      : StyleRuleGroup(other)
> -    , m_filteredQuery(other.m_filteredQuery)
> +    , m_containerdQuery(other.m_containerdQuery)

typo: m_containerdQuery (extra d)

> Source/WebCore/css/StyleRule.h:303
> +    CQ::ContainerQuery m_containerdQuery;

ditto in this file
Comment 5 Antti Koivisto 2022-08-02 05:57:01 PDT
Created attachment 461357 [details]
Patch for landing
Comment 6 EWS 2022-08-02 05:58:25 PDT
Commit message contains (OOPS!), blocking PR #None
Comment 7 Antti Koivisto 2022-08-02 05:59:00 PDT
Created attachment 461358 [details]
Patch for landing
Comment 8 EWS 2022-08-02 08:33:34 PDT
Committed 253035@main (2956c932c8f4): <https://commits.webkit.org/253035@main>

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