Bug 234145 - When transform-style: preserve-3d is used with a grouping property it should still create a containing block
Summary: When transform-style: preserve-3d is used with a grouping property it should ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Martin Robinson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-12-10 06:33 PST by Martin Robinson
Modified: 2022-01-07 00:46 PST (History)
9 users (show)

See Also:


Attachments
Patch (15.13 KB, patch)
2022-01-05 10:00 PST, Martin Robinson
no flags Details | Formatted Diff | Diff
Patch (29.83 KB, patch)
2022-01-06 07:47 PST, Martin Robinson
no flags Details | Formatted Diff | Diff
Patch (29.83 KB, patch)
2022-01-06 08:13 PST, Martin Robinson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Robinson 2021-12-10 06:33:12 PST
https://drafts.csswg.org/css-transforms-2/#interpolation-of-transform-functions says:

> The use of this property with any value other than none establishes a stacking context. It also establishes a containing block for all descendants, just like the transform property does.

Currently we are handling this via the StyleAdjuster, which is why preserve-3d-flat-grouping-properties-containing-block.html is failing the WPT test suite.
Comment 1 Radar WebKit Bug Importer 2021-12-17 06:34:17 PST
<rdar://problem/86630387>
Comment 2 Martin Robinson 2022-01-05 10:00:09 PST
Created attachment 448397 [details]
Patch
Comment 3 Simon Fraser (smfr) 2022-01-05 11:02:04 PST
Comment on attachment 448397 [details]
Patch

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

> Source/WebCore/rendering/style/RenderStyle.cpp:1188
> +        if (usedTransformStyle3D() != other.usedTransformStyle3D()

I wonder if this will be a perf regression, since usedTransformStyle3D() does more work now. This code is pretty hot. Might be better to keep the /StyleAdjuster code but have it set a usedTransformStyle field.
Comment 4 Martin Robinson 2022-01-06 07:47:13 PST
Created attachment 448501 [details]
Patch
Comment 5 Martin Robinson 2022-01-06 08:12:05 PST
(In reply to Simon Fraser (smfr) from comment #3)
> Comment on attachment 448397 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=448397&action=review
> 
> > Source/WebCore/rendering/style/RenderStyle.cpp:1188
> > +        if (usedTransformStyle3D() != other.usedTransformStyle3D()
> 
> I wonder if this will be a perf regression, since usedTransformStyle3D()
> does more work now. This code is pretty hot. Might be better to keep the
> /StyleAdjuster code but have it set a usedTransformStyle field.

Thanks for the review!

The new patch takes the approach you suggest. I ended up adding a boolean field to StyleRareNonInheritedData because that makes managing style changes a little more straight-forward (and saves a bit). I can probably change this to be an enum field if that's a better path. In addition, I've rewritten the existing tests that checked this behavior. Now they test both the used and computed value.
Comment 6 Martin Robinson 2022-01-06 08:13:16 PST
Created attachment 448503 [details]
Patch
Comment 7 EWS 2022-01-07 00:46:39 PST
Committed r287742 (245812@main): <https://commits.webkit.org/245812@main>

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