Bug 223111 - Fix interpolation of perspective property
Summary: Fix interpolation of perspective property
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-11 23:13 PST by Antoine Quint
Modified: 2021-03-12 01:20 PST (History)
13 users (show)

See Also:


Attachments
Patch (38.02 KB, patch)
2021-03-11 23:20 PST, Antoine Quint
koivisto: review+
Details | Formatted Diff | Diff

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