Compute 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
Committed:
https://crrev.com/3194544827727439d99dc72bec19d59a6004db0d
Cr-Commit-Position: refs/heads/master@{#391562}
CQ_EXTRA_TRYBOTS=tryserver.chromium.perf:android_s5_perf_cq;tryserver.chromium.perf:winx64_10_perf_cq;tryserver.chromium.perf:mac_retina_perf_cq