Bug 261298 - Make TranslateTransformOperation::X/Y return const Length&
Summary: Make TranslateTransformOperation::X/Y return const Length&
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-07 15:18 PDT by Ahmad Saleem
Modified: 2023-09-07 16:47 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmad Saleem 2023-09-07 15:18:17 PDT
Hi Team,


Based on discussion with Matt over email, it makes sense to merge but it does not have much benefit but still good to add.

Blink Commit: https://chromium-review.googlesource.com/c/chromium/src/+/970821

GitHub WebKit Source: https://github.com/WebKit/WebKit/blob/641608e9630336fbbd011dc072655ee83bdf7b03/Source/WebCore/platform/graphics/transforms/TranslateTransformOperation.h#L56 etc.

___

Local Patch in .h:

 const Length& x() const { return m_x; }
 const Length& y() const { return m_y; }

and in .cpp:

const auto* fromOp = downcast<TranslateTransformOperation>(from);
    const Length& fromX = fromOp ? fromOp->m_x : zeroLength;
    const Length& fromY = fromOp ? fromOp->m_y : zeroLength;

____

Just wanted to raise to merge it.

Thanks!
Comment 1 Ahmad Saleem 2023-09-07 16:47:13 PDT
Simon's comment on Slack - i don't think it's worth doing this. Length is < 64 bits
Comment 2 Ahmad Saleem 2023-09-07 16:47:38 PDT
PR attempt for reference - https://github.com/WebKit/WebKit/pull/17558