Bug 223111

Summary: Fix interpolation of perspective property
Product: WebKit Reporter: Antoine Quint <graouts>
Component: AnimationsAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: changseok, dino, esprehn+autocc, ews-watchlist, glenn, graouts, gyuyoung.kim, koivisto, kondapallykalyan, macpherson, menard, pdr, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch koivisto: review+

Description Antoine Quint 2021-03-11 23:13:51 PST
Fix interpolation of perspective property
Comment 1 Antoine Quint 2021-03-11 23:20:33 PST
Created attachment 423018 [details]
Patch
Comment 2 Antti Koivisto 2021-03-11 23:45:07 PST
Comment on attachment 423018 [details]
Patch

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

> Source/WebCore/rendering/style/RenderStyle.h:719
> +    bool hasPerspective() const { return m_rareNonInheritedData->perspective != -1; }

Maybe this could compare against initialPerspective() instead of -1 to be less magical.

> Source/WebCore/style/StyleBuilderConverter.h:1229
> -        return 0.f;
> +        return -1;

Similarly this could return RenderStyle::initialPerspective().
Comment 3 Antoine Quint 2021-03-12 00:40:39 PST
(In reply to Antti Koivisto from comment #2)
> Comment on attachment 423018 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=423018&action=review
> 
> > Source/WebCore/rendering/style/RenderStyle.h:719
> > +    bool hasPerspective() const { return m_rareNonInheritedData->perspective != -1; }
> 
> Maybe this could compare against initialPerspective() instead of -1 to be
> less magical.
> 
> > Source/WebCore/style/StyleBuilderConverter.h:1229
> > -        return 0.f;
> > +        return -1;
> 
> Similarly this could return RenderStyle::initialPerspective().

Yes, good points. Even though the initial value could be something other than "none", it's unlikely to change and it'd be more explicit than -1.
Comment 4 Antoine Quint 2021-03-12 01:19:21 PST
Committed r274329 (235217@main): <https://commits.webkit.org/235217@main>
Comment 5 Radar WebKit Bug Importer 2021-03-12 01:20:18 PST
<rdar://problem/75353982>