DescriptionCompute snap offsets according to CSS Scroll Snap Spec Level 1
Add logic to compute snap offsets (those defined on snap container and snap
areas) according to the published spec [1].
SnapCoordinator maintains the mapping between snap containers and the snap
areas. This mapping is stored in |LayoutBoxRareData| and updated on style
change, attach, and detach events via hooks in |LayoutBox::styleWillChange| ,
|LayoutBox::insertedIntoTree| and |LayoutBox::willBeDestoryed|.
This implementation is the naive approach as described in [2]. It does not
attempt to track which snap areas have moved in relation to their container to
minimize snap offsets re-computation. It simply re-computes all snap points
every time they are needed.
At the moment the computed snap offsets are not used for anything except to pass
the tests. In future, |SnapCoordinator| will compute them as part of the
document lifecycle and send necessary updates to the Compositor Worker instance
which is going to be responsible for snapping during scrolls.
[1] https://www.w3.org/TR/2015/WD-css-snappoints-1-20150326/
[2] https://docs.google.com/document/d/1BO0EgcMe3DTsO1uwM_psZeJ_Gz5OZR-oYrpJBKAJLoU/edit?pli=1
This is a re-land of https://crrev.com/1188563005
BUG=
TBR=eae@chromium.org
Committed: https://crrev.com/eff6c4c5699d35bc5703d706324c4c1c8b9ac19b
Cr-Commit-Position: refs/heads/master@{#392993}
Patch Set 1 #Patch Set 2 : Fix {client,scroll}Size to handle overlay scrollbar case on Android #
Total comments: 1
Patch Set 3 : size_t -> unsigned #Patch Set 4 : #Messages
Total messages: 21 (12 generated)
|