[Webkit-unassigned] [Bug 135268] Compute and store snap point positions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 13 10:24:49 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=135268


Simon Fraser (smfr) <simon.fraser at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #236522|review?                     |review-
               Flag|                            |




--- Comment #22 from Simon Fraser (smfr) <simon.fraser at apple.com>  2014-08-13 10:24:56 PST ---
(From update of attachment 236522)
View in context: https://bugs.webkit.org/attachment.cgi?id=236522&action=review

> Source/WebCore/page/FrameView.cpp:869
> +    if (!m_horizontalSnapOffsets)
> +        m_horizontalSnapOffsets = std::make_unique<Vector<LayoutUnit>>();
> +
> +    if (!m_verticalSnapOffsets)
> +        m_verticalSnapOffsets = std::make_unique<Vector<LayoutUnit>>();

You shouldn't allocate these vectors if there are no snap points.

> Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp:98
> +void updateHorizontalVerticalSnapOffsets(Vector<LayoutUnit>& horizontalSnapOffsets, Vector<LayoutUnit>& verticalSnapOffsets, HTMLElement& scrollingElement, const RenderBox& box, const RenderStyle& style)

This should have two unique_ptr<Vector<LayoutUnit>>& out params so that you can only allocate the vectors if you have snap points.

> Source/WebCore/platform/ScrollableArea.h:271
> +    std::unique_ptr<Vector<LayoutUnit>> m_horizontalSnapOffsets;
> +    std::unique_ptr<Vector<LayoutUnit>> m_verticalSnapOffsets;

Please make these private and provide protected setters.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list