Bug 222010

Summary: Add CSS property to enable separated bit on GraphicsLayer
Product: WebKit Reporter: Sam Weinig <sam>
Component: CSSAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, changseok, cmarcelo, dino, esprehn+autocc, ews-watchlist, fred.wang, glenn, gyuyoung.kim, joepeck, kondapallykalyan, macpherson, mcatanzaro, menard, pdr, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing none

Description Sam Weinig 2021-02-16 16:42:54 PST
There is no way to enable the separated bit on graphics layer from the page (currently been hardcoding it). We should expose some way to enable it via CSS (experimental, disabled by default).
Comment 1 Sam Weinig 2021-02-16 18:25:40 PST
Created attachment 420577 [details]
Patch
Comment 2 Dean Jackson 2021-02-16 19:53:21 PST
Comment on attachment 420577 [details]
Patch

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

> Source/WTF/ChangeLog:6
> +        Add internal access to the seperated bit on graphics layer via a 

typo: separated

> Source/WTF/ChangeLog:7
> +        new "optimized-3d" transform-style. This is all off by default

I'll let it slide that optimised is spelt incorrectly though.

> Source/WTF/Scripts/Preferences/WebPreferences.yaml:395
> +CSSTransformStyleOptimized3DEnabled:
> +  type: bool
> +  condition: ENABLE(CSS_TRANSFORM_STYLE_OPTIMIZED_3D)
> +  defaultValue:
> +    WebKitLegacy:
> +      default: false
> +    WebKit:
> +      default: false
> +    WebCore:
> +      default: false

Given that the default value for the compile-time constant is 0, maybe these values should be true for now? That way we only have to toggle one thing to test it. Then, if we make it compiled in by default, we'd turn the runtime flags off.

That might be too confusing though.

> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:3621
> +                case TransformStyle3D::Flat:
> +                    return cssValuePool.createIdentifierValue(CSSValueFlat);
> +                case TransformStyle3D::Preserve3D:
> +                    return cssValuePool.createIdentifierValue(CSSValuePreserve3d);
> +#if ENABLE(CSS_TRANSFORM_STYLE_OPTIMIZED_3D)
> +                case TransformStyle3D::Optimized3D:
> +                    return cssValuePool.createIdentifierValue(CSSValueOptimized3d);
> +#endif

Indentation is out here.

> Source/WebCore/css/CSSProperties.json:6566
> +                "preserve-3d",
> +                {
> +                    "value": "optimized-3d",
> +                    "status": "internal"
> +                }

We probably don't need to add it to the prefixed version.
Comment 3 Sam Weinig 2021-02-16 21:50:05 PST
Created attachment 420596 [details]
Patch
Comment 4 EWS 2021-02-16 22:47:32 PST
Committed r272987: <https://commits.webkit.org/r272987>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 420596 [details].
Comment 5 Radar WebKit Bug Importer 2021-02-16 22:48:17 PST
<rdar://problem/74422474>
Comment 6 Michael Catanzaro 2021-02-17 07:02:24 PST
Reopening to attach new patch.
Comment 7 Michael Catanzaro 2021-02-17 07:02:27 PST
Created attachment 420639 [details]
Patch for landing
Comment 8 EWS 2021-02-17 07:56:30 PST
Committed r272998: <https://commits.webkit.org/r272998>

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