Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Issue 1188563005: Compute snap offsets (both repeat and element based) (Closed)

Created:
5 years, 6 months ago by majidvp
Modified:
4 years, 5 months ago
Reviewers:
esprehn, skobes, eae
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, dglazkov+blink, kenneth.christiansen, ojan, rwlbuis, Timothy Loh
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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

Patch Set 1 #

Patch Set 2 : Add LayoutObject hooks #

Patch Set 3 : Fix issues #

Patch Set 4 : rebase and minor changes #

Patch Set 5 : Better handle negative repeat #

Patch Set 6 : Fix Compile issue #

Patch Set 7 : improve macro #

Patch Set 8 : Remove EQ_ARRAY macro #

Patch Set 9 : Fix link issue, change signatures #

Patch Set 10 : minor #

Patch Set 11 : rebase #

Patch Set 12 : Correct repeat calculations #

Patch Set 13 : rebase #

Patch Set 14 : Simplify and cleanup #

Patch Set 15 : Remove unnecessary change #

Patch Set 16 : rebase #

Patch Set 17 : Clean up TODOs #

Total comments: 27

Patch Set 18 : Address feedback + merge master #

Patch Set 19 : Remove extra lines #

Patch Set 20 : merge master #

Patch Set 21 : remove m_frame #

Total comments: 14

Patch Set 22 : Move storage to LayoutBoxRareData and simplify #

Patch Set 23 : Fix compile issue #

Total comments: 40

Patch Set 24 : Address review feedback from esprehn@ #

Total comments: 8

Patch Set 25 : Fix oilpan issues #

Patch Set 26 : rebase #

Total comments: 19

Patch Set 27 : Rebase and address review feedback #

Patch Set 28 : merge master #

Patch Set 29 : Test w/o root-scroll-layer and leave in the scroll bars #

Patch Set 30 : #

Total comments: 2

Patch Set 31 : Use client and scroll size to handle overlay scrollbars #

Unified diffs Side-by-side diffs Delta from patch set Stats (+769 lines, -7 lines) Patch
M third_party/WebKit/Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 3 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 6 chunks +18 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/LocalFrame.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 6 chunks +29 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 6 chunks +83 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +58 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 29 30 1 chunk +171 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/page/scrolling/SnapCoordinatorTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 chunk +388 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/LengthFunctions.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/LengthFunctions.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 53 (17 generated)
majidvp
vollick@ please take a look and let me know if the overall design of this ...
5 years, 5 months ago (2015-07-08 18:57:05 UTC) #2
Ian Vollick
Seems pretty straightforward, though I'd like to be sure we have a consistent story for ...
5 years, 5 months ago (2015-07-08 19:16:51 UTC) #3
flackr
On 2015/07/08 19:16:51, vollick (ooo until July 27) wrote: > Seems pretty straightforward, though I'd ...
5 years, 5 months ago (2015-07-21 17:38:46 UTC) #4
majidvp
On 2015/07/21 17:38:46, flackr wrote: > On 2015/07/08 19:16:51, vollick (ooo until July 27) wrote: ...
5 years, 3 months ago (2015-09-14 18:16:54 UTC) #5
majidvp
esprehn@, timloh@, ojan@: can one of you please take a look at this CL and ...
5 years, 3 months ago (2015-09-14 18:24:33 UTC) #7
majidvp
On 2015/09/14 18:24:33, majidvp wrote: > esprehn@, timloh@, ojan@: can one of you please take ...
5 years, 3 months ago (2015-09-21 12:43:50 UTC) #9
esprehn
https://codereview.chromium.org/1188563005/diff/320001/Source/core/dom/ContainerNode.cpp File Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/1188563005/diff/320001/Source/core/dom/ContainerNode.cpp#newcode877 Source/core/dom/ContainerNode.cpp:877: if (document().frame() && document().frame()->snapCoordinator()) ditto checking for frame() doesn't ...
5 years, 3 months ago (2015-09-24 17:37:41 UTC) #10
majidvp
Thanks esprehn@ for review. I have updated the patch and it should address all comments. ...
5 years, 2 months ago (2015-10-15 21:47:03 UTC) #11
majidvp
esprehn: ping
5 years, 2 months ago (2015-10-20 17:52:42 UTC) #13
esprehn
I don't think you need most of this, you just want to store the snap ...
5 years, 2 months ago (2015-10-20 21:03:35 UTC) #14
majidvp
> I don't think you need most of this, you just want to store the ...
5 years, 2 months ago (2015-10-22 21:03:03 UTC) #15
majidvp
esprehn@: I got rid of the maps and moved the storage of mapping to LayoutBoxRareData. ...
5 years, 1 month ago (2015-11-23 15:43:57 UTC) #16
majidvp
@esprehn: friendly ping
5 years ago (2015-11-25 20:43:01 UTC) #18
esprehn
On 2015/11/25 at 20:43:01, majidvp wrote: > @esprehn: friendly ping Looking now, sorry for the ...
5 years ago (2015-12-01 17:48:07 UTC) #19
esprehn
https://codereview.chromium.org/1188563005/diff/440001/third_party/WebKit/Source/core/layout/LayoutBox.cpp File third_party/WebKit/Source/core/layout/LayoutBox.cpp (right): https://codereview.chromium.org/1188563005/diff/440001/third_party/WebKit/Source/core/layout/LayoutBox.cpp#newcode272 third_party/WebKit/Source/core/layout/LayoutBox.cpp:272: updateScrollSnapMappingAfterStyleChange(&newStyle, oldStyle); newStyle should be a reference, don't do ...
5 years ago (2015-12-01 18:31:12 UTC) #20
majidvp
Thanks for review Elliot and happy thanks giving. :) I have tried to address the ...
5 years ago (2015-12-03 17:54:17 UTC) #21
majidvp
esprehn@: Did these fixes address your review feedback?
5 years ago (2015-12-08 20:09:13 UTC) #22
majidvp
On 2015/12/08 20:09:13, majidvp wrote: > esprehn@: Did these fixes address your review feedback? esprehn@: ...
5 years ago (2015-12-14 22:19:43 UTC) #23
esprehn
Your Oilpan code isn't right for LayoutBox. https://codereview.chromium.org/1188563005/diff/460001/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp File third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp (right): https://codereview.chromium.org/1188563005/diff/460001/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp#newcode34 third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp:34: snapArea.setSnapContainer(nullptr); early ...
5 years ago (2015-12-16 02:06:10 UTC) #24
majidvp
https://codereview.chromium.org/1188563005/diff/460001/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp File third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp (right): https://codereview.chromium.org/1188563005/diff/460001/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp#newcode34 third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp:34: snapArea.setSnapContainer(nullptr); On 2015/12/16 02:06:10, esprehn wrote: > early return. ...
5 years ago (2015-12-17 23:51:21 UTC) #26
majidvp
esprehn: ping
4 years, 11 months ago (2016-01-04 19:08:37 UTC) #27
majidvp
On 2016/01/04 19:08:37, majidvp wrote: > esprehn: ping esprehn@: PTAL.
4 years, 11 months ago (2016-01-20 21:15:59 UTC) #28
Ian Vollick
On 2016/01/20 21:15:59, majidvp wrote: > On 2016/01/04 19:08:37, majidvp wrote: > > esprehn: ping ...
4 years, 9 months ago (2016-03-02 16:36:12 UTC) #29
majidvp
eae@: can you please take a look at this patch. P.S.: I am going to ...
4 years, 9 months ago (2016-03-02 16:49:51 UTC) #32
eae
I'll try to get to this later today.
4 years, 9 months ago (2016-03-02 19:23:11 UTC) #33
eae
I'd like skobes to review the scrolling aspects of this change.
4 years, 9 months ago (2016-03-03 00:50:30 UTC) #35
skobes
https://codereview.chromium.org/1188563005/diff/500001/third_party/WebKit/Source/core/layout/LayoutBox.cpp File third_party/WebKit/Source/core/layout/LayoutBox.cpp (right): https://codereview.chromium.org/1188563005/diff/500001/third_party/WebKit/Source/core/layout/LayoutBox.cpp#newcode173 third_party/WebKit/Source/core/layout/LayoutBox.cpp:173: for (LayoutObject* curr = parent(); curr && !curr-isLayoutView(); curr ...
4 years, 9 months ago (2016-03-07 03:42:27 UTC) #36
majidvp
https://codereview.chromium.org/1188563005/diff/500001/third_party/WebKit/Source/core/layout/LayoutBox.cpp File third_party/WebKit/Source/core/layout/LayoutBox.cpp (right): https://codereview.chromium.org/1188563005/diff/500001/third_party/WebKit/Source/core/layout/LayoutBox.cpp#newcode173 third_party/WebKit/Source/core/layout/LayoutBox.cpp:173: for (LayoutObject* curr = parent(); curr && !curr-isLayoutView(); curr ...
4 years, 7 months ago (2016-05-03 17:23:36 UTC) #37
majidvp
@skobes: PTAL :)
4 years, 7 months ago (2016-05-03 18:27:09 UTC) #38
skobes
lgtm w/ nit https://codereview.chromium.org/1188563005/diff/580001/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp File third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp (right): https://codereview.chromium.org/1188563005/diff/580001/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp#newcode123 third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp:123: WTFLogAlways("repeat: %f, scrollSize: %f, clientSize:%f", repeat.toFloat(), ...
4 years, 7 months ago (2016-05-03 19:45:30 UTC) #39
majidvp
Thanks skobes@ eae@: PTAL https://codereview.chromium.org/1188563005/diff/580001/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp File third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp (right): https://codereview.chromium.org/1188563005/diff/580001/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp#newcode123 third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp:123: WTFLogAlways("repeat: %f, scrollSize: %f, clientSize:%f", ...
4 years, 7 months ago (2016-05-04 15:40:49 UTC) #41
eae
LGTM
4 years, 7 months ago (2016-05-04 15:51:36 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1188563005/600001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1188563005/600001
4 years, 7 months ago (2016-05-04 15:52:53 UTC) #45
commit-bot: I haz the power
Committed patchset #31 (id:600001)
4 years, 7 months ago (2016-05-04 18:14:15 UTC) #47
commit-bot: I haz the power
Patchset 31 (id:??) landed as https://crrev.com/3194544827727439d99dc72bec19d59a6004db0d Cr-Commit-Position: refs/heads/master@{#391562}
4 years, 7 months ago (2016-05-04 18:15:35 UTC) #49
Mathieu
4 years, 7 months ago (2016-05-04 19:42:01 UTC) #50
Message was sent while issue was closed.
A revert of this CL (patchset #31 id:600001) has been created in
https://codereview.chromium.org/1949843004/ by mathp@chromium.org.

The reason for reverting is: Some snap tests are failing:

https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Android%20%28N....

Powered by Google App Engine
This is Rietveld 408576698