Bug 217246 - TranslateTransformOperation shouldn't take in a FloatSize to convert z as a double
Summary: TranslateTransformOperation shouldn't take in a FloatSize to convert z as a d...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-10-02 13:09 PDT by Antoine Quint
Modified: 2020-10-19 23:20 PDT (History)
5 users (show)

See Also:


Attachments
Patch (5.10 KB, patch)
2020-10-02 13:11 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (5.09 KB, patch)
2020-10-19 12:03 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2020-10-02 13:09:00 PDT
TranslateTransformOperation shouldn't take in a FloatSize to convert z as a double
Comment 1 Antoine Quint 2020-10-02 13:11:23 PDT
Created attachment 410358 [details]
Patch
Comment 2 Darin Adler 2020-10-02 13:17:40 PDT
Comment on attachment 410358 [details]
Patch

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

> Source/WebCore/platform/graphics/transforms/TranslateTransformOperation.h:53
> +    double xAsDouble(const FloatSize& borderBoxSize) const { return floatValueForLength(m_x, borderBoxSize.width()); }
> +    double yAsDouble(const FloatSize& borderBoxSize) const { return floatValueForLength(m_y, borderBoxSize.height()); }
> +    double zAsDouble() const { return floatValueForLength(m_z, 1); }

Strange mix here. We are calling something that computes a float, then converting it to a double when returning it, then it seems 2 of the 3 call sites call narrowPrecisionToFloat on a value that was just converted *from* a float. Maybe this should return float, not double?
Comment 3 Radar WebKit Bug Importer 2020-10-09 13:09:14 PDT
<rdar://problem/70150086>
Comment 4 Antoine Quint 2020-10-19 12:03:27 PDT
Created attachment 411771 [details]
Patch
Comment 5 Antoine Quint 2020-10-19 23:20:14 PDT
Committed r268714: <https://trac.webkit.org/changeset/268714>