[webkit-reviews] review granted: [Bug 233403] Clarify behavior of ScrollAnimator::scroll() : [Attachment 444915] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Nov 21 10:33:34 PST 2021

Sam Weinig <sam at webkit.org> has granted Simon Fraser (smfr)
<simon.fraser at apple.com>'s request for review:
Bug 233403: Clarify behavior of ScrollAnimator::scroll()

Attachment 444915: Patch


--- Comment #3 from Sam Weinig <sam at webkit.org> ---
Comment on attachment 444915
  --> https://bugs.webkit.org/attachment.cgi?id=444915

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

> Source/WebCore/platform/ScrollTypes.h:174
> +inline ScrollEventAxis axisFromDirection(ScrollDirection direction)

You could make this constexpr.

> Source/WebCore/platform/ScrollTypes.h:194
> +inline void setValueForAxis(FloatSize& size, ScrollEventAxis axis, float

I think this reference parameter makes this more confusing than necessary, and
probably isn't a performance win over just returning a new FloatSize.

An alternative that might make sense would be making a subclass or wrapper
class of FloatSize called something like ScrollDelta that has this function.

> Source/WebCore/platform/ScrollTypes.h:211
> +inline void setValueForAxis(FloatPoint& point, ScrollEventAxis axis, float

Same here as setValueForAxis.

More information about the webkit-reviews mailing list