Bug 233193 - Re-add 'style' to contain:strict and contain:content CSS properties
Summary: Re-add 'style' to contain:strict and contain:content CSS properties
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: InRadar
Depends on:
Blocks: 172026
  Show dependency treegraph
 
Reported: 2021-11-16 08:13 PST by Rob Buis
Modified: 2021-11-17 09:43 PST (History)
9 users (show)

See Also:


Attachments
Patch (6.22 KB, patch)
2021-11-16 10:59 PST, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (6.11 KB, patch)
2021-11-16 14:47 PST, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (6.11 KB, patch)
2021-11-16 22:48 PST, Rob Buis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.