Bug 261298

Summary: Make TranslateTransformOperation::X/Y return const Length&
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: bfulgham, mattwoodrow, simon.fraser, zalan
Priority: P2    
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   

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