Bug 233193

Summary: Re-add 'style' to contain:strict and contain:content CSS properties
Product: WebKit Reporter: Rob Buis <rbuis>
Component: CSSAssignee: Rob Buis <rbuis>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, changseok, darin, esprehn+autocc, ews-watchlist, glenn, kondapallykalyan, pdr, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 172026    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Rob Buis 2021-11-16 08:13:52 PST
Re-add 'style' to contain:strict and contain:content CSS properties.
Comment 1 Rob Buis 2021-11-16 08:14:41 PST
This is fixed in the spec, implemented in chromium and Firefox has verbally agreed to do it as well:
https://groups.google.com/a/chromium.org/g/blink-dev/c/oMVBKemrTDQ?pli=1
Comment 2 Rob Buis 2021-11-16 10:59:35 PST
Created attachment 444411 [details]
Patch
Comment 3 Rob Buis 2021-11-16 14:47:08 PST
Created attachment 444436 [details]
Patch
Comment 4 Radar WebKit Bug Importer 2021-11-16 15:23:22 PST
<rdar://problem/85478069>
Comment 5 Brent Fulgham 2021-11-16 15:26:12 PST
Comment on attachment 444436 [details]
Patch

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

r=me

> Source/WebCore/ChangeLog:9
> +        The chsange was done in chromium and Firefox has verbally agreed to make the change as well [3].

Nit: change
Comment 6 Rob Buis 2021-11-16 22:48:38 PST
Created attachment 444482 [details]
Patch
Comment 7 EWS 2021-11-16 23:55:06 PST
Committed r285918 (244327@main): <https://commits.webkit.org/244327@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 444482 [details].
Comment 8 Darin Adler 2021-11-17 09:29:51 PST
Comment on attachment 444482 [details]
Patch

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

> Source/WebCore/rendering/style/RenderStyle.h:1673
>      static OptionSet<Containment> initialContainment() { return OptionSet<Containment> { }; }
> -    static OptionSet<Containment> strictContainment() { return OptionSet<Containment> { Containment::Size, Containment::Layout, Containment::Paint }; }
> -    static OptionSet<Containment> contentContainment() { return OptionSet<Containment> { Containment::Layout, Containment::Paint }; }
> +    static OptionSet<Containment> strictContainment() { return OptionSet<Containment> { Containment::Size, Containment::Layout, Containment::Paint, Containment::Style }; }
> +    static OptionSet<Containment> contentContainment() { return OptionSet<Containment> { Containment::Layout, Containment::Paint, Containment::Style }; }

Not sure we have to name the OptionSet type twice. I think we can just use braces inside the function without naming the type?
Comment 9 Rob Buis 2021-11-17 09:41:27 PST
Comment on attachment 444482 [details]
Patch

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

>> Source/WebCore/rendering/style/RenderStyle.h:1673
>> +    static OptionSet<Containment> contentContainment() { return OptionSet<Containment> { Containment::Layout, Containment::Paint, Containment::Style }; }
> 
> Not sure we have to name the OptionSet type twice. I think we can just use braces inside the function without naming the type?

I had that change locally but wanted to keep the patch simple. Note that methods in RenderStyle returning OptionSet do this inconsistently already before my patch. Maybe somebody can make it consistent.
Comment 10 Darin Adler 2021-11-17 09:43:52 PST
(In reply to Rob Buis from comment #9)
> Maybe somebody can make it consistent.

As you probably know, this is the kind of thing I often do.