[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()
https://bugs.webkit.org/show_bug.cgi?id=233403

Attachment 444915: Patch

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




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

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
value)

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
value)

Same here as setValueForAxis.


More information about the webkit-reviews mailing list