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

Issue 2733633002: Handle nested position:sticky elements correctly (compositor) (Closed)

Created:
3 years, 9 months ago by smcgruer
Modified:
3 years, 9 months ago
Reviewers:
flackr, chrishtr, ajuma
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-layout_chromium.org, cc-bugs_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, jchaffraix+rendering, kenneth.christiansen, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Handle nested position:sticky elements correctly (compositor) In order to correctly calculate the sticky offset for nested sticky, we must track the accumulated sticky offset from our ancestor sticky elements. This accumulation must then be used to adjust the location of the two constraint rects. On the compositor side, the goal of the sticky calculation is to adjust the rectangle by any additional composited scroll offset on top of the main thread scroll position (as the sticky calculation will already have adjusted for that scroll). BUG=672710 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Review-Url: https://codereview.chromium.org/2733633002 Cr-Commit-Position: refs/heads/master@{#459419} Committed: https://chromium.googlesource.com/chromium/src/+/29014fffc71e122447fb29f32915ae421b8eded4

Patch Set 1 #

Patch Set 2 : Make LayoutTests same style as previous main thread CL #

Patch Set 3 : Fix unittest #

Total comments: 38

Patch Set 4 : Rebase #

Patch Set 5 : Addressed the easier reviewer comments. #

Total comments: 1

Patch Set 6 : Address reviewer comments #

Patch Set 7 : Update #

Patch Set 8 : Rebase #

Patch Set 9 : Correct the main_thread_offset handling #

Patch Set 10 : remove two sources of rounding/flooring #

Patch Set 11 : Switch to using layer ids #

Patch Set 12 : Punt layouttest that fails due to crbug.com/702229 #

Patch Set 13 : Add comment referencing crbug.com/702229 #

Total comments: 22

Patch Set 14 : Address reviewer comments #

Total comments: 10

Patch Set 15 : Use invalid id consts, name variables properly #

Patch Set 16 : More layer id fixes #

Total comments: 4

Patch Set 17 : Use FindNodeIndexFromOwningLayerId #

Total comments: 14

Patch Set 18 : Address easier reviewer comments #

Patch Set 19 : Revert some of the float changes, and remove the composited ancestor walks #

Patch Set 20 : Revert float changes to unittests too #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+1040 lines, -71 lines) Patch
M cc/blink/web_layer_impl.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -0 lines 3 comments Download
M cc/layers/layer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +3 lines, -0 lines 0 comments Download
M cc/layers/layer_sticky_position_constraint.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +11 lines, -0 lines 0 comments Download
M cc/layers/layer_sticky_position_constraint.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +21 lines, -3 lines 0 comments Download
M cc/trees/layer_tree_host_common_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +103 lines, -0 lines 0 comments Download
M cc/trees/property_tree.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +30 lines, -11 lines 0 comments Download
M cc/trees/property_tree.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +50 lines, -28 lines 2 comments Download
M cc/trees/property_tree_builder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +26 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/composited-nested-sticky-deep.html View 1 2 3 4 5 6 1 chunk +85 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/composited-nested-sticky-deep-expected.html View 1 2 3 4 5 6 1 chunk +73 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/composited-nested-sticky-left.html View 1 2 3 4 5 6 1 chunk +95 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/composited-nested-sticky-left-expected.html View 1 2 3 4 5 6 1 chunk +75 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/composited-nested-sticky-table.html View 1 2 3 4 5 6 1 chunk +75 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/composited-nested-sticky-table-expected.html View 1 2 3 4 5 6 1 chunk +38 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/composited-nested-sticky-top.html View 1 2 3 4 5 6 1 chunk +92 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/compositing/overflow/composited-nested-sticky-top-expected.html View 1 2 3 4 5 6 1 chunk +76 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +53 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp View 1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 17 18 19 1 chunk +94 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp View 1 chunk +2 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinderTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +15 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebLayer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebLayerStickyPositionConstraint.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +9 lines, -1 line 0 comments Download

Messages

Total messages: 49 (20 generated)
smcgruer
3 years, 9 months ago (2017-03-06 22:17:35 UTC) #4
flackr
https://codereview.chromium.org/2733633002/diff/20002/cc/layers/layer.cc File cc/layers/layer.cc (right): https://codereview.chromium.org/2733633002/diff/20002/cc/layers/layer.cc#newcode597 cc/layers/layer.cc:597: // scroll. Unless we add a data channel for ...
3 years, 9 months ago (2017-03-09 20:22:09 UTC) #9
flackr
https://codereview.chromium.org/2733633002/diff/20002/third_party/WebKit/LayoutTests/compositing/overflow/composited-nested-sticky-deep.html File third_party/WebKit/LayoutTests/compositing/overflow/composited-nested-sticky-deep.html (right): https://codereview.chromium.org/2733633002/diff/20002/third_party/WebKit/LayoutTests/compositing/overflow/composited-nested-sticky-deep.html#newcode21 third_party/WebKit/LayoutTests/compositing/overflow/composited-nested-sticky-deep.html:21: will-change: transform; I don't think you have a test ...
3 years, 9 months ago (2017-03-09 20:25:21 UTC) #10
smcgruer
https://codereview.chromium.org/2733633002/diff/20002/cc/trees/draw_property_utils.cc File cc/trees/draw_property_utils.cc (right): https://codereview.chromium.org/2733633002/diff/20002/cc/trees/draw_property_utils.cc#newcode1506 cc/trees/draw_property_utils.cc:1506: // Find nearest ancestor which is sticky, up to ...
3 years, 9 months ago (2017-03-10 16:37:11 UTC) #11
smcgruer
https://codereview.chromium.org/2733633002/diff/20002/cc/trees/draw_property_utils.cc File cc/trees/draw_property_utils.cc (right): https://codereview.chromium.org/2733633002/diff/20002/cc/trees/draw_property_utils.cc#newcode1506 cc/trees/draw_property_utils.cc:1506: // Find nearest ancestor which is sticky, up to ...
3 years, 9 months ago (2017-03-10 16:38:39 UTC) #12
flackr
https://codereview.chromium.org/2733633002/diff/20002/cc/trees/property_tree_builder.cc File cc/trees/property_tree_builder.cc (right): https://codereview.chromium.org/2733633002/diff/20002/cc/trees/property_tree_builder.cc#newcode786 cc/trees/property_tree_builder.cc:786: sticky_box_offset.OffsetFromOrigin(); On 2017/03/10 16:37:10, smcgruer wrote: > On 2017/03/09 ...
3 years, 9 months ago (2017-03-13 19:49:45 UTC) #13
smcgruer
Large update (sorry!) ahead of our sync tomorrow. I think I've hit most of the ...
3 years, 9 months ago (2017-03-14 22:04:06 UTC) #14
smcgruer
PTAL, I believe I've addressed the main points we discussed yesterday. Remaining are just a ...
3 years, 9 months ago (2017-03-16 13:55:18 UTC) #15
flackr
https://codereview.chromium.org/2733633002/diff/230001/cc/layers/layer.cc File cc/layers/layer.cc (right): https://codereview.chromium.org/2733633002/diff/230001/cc/layers/layer.cc#newcode32 cc/layers/layer.cc:32: #include "cc/trees/scroll_node.h" Obsolete? https://codereview.chromium.org/2733633002/diff/230001/cc/layers/layer.cc#newcode594 cc/layers/layer.cc:594: // element that is ...
3 years, 9 months ago (2017-03-17 15:01:56 UTC) #16
smcgruer
https://codereview.chromium.org/2733633002/diff/230001/cc/layers/layer.cc File cc/layers/layer.cc (right): https://codereview.chromium.org/2733633002/diff/230001/cc/layers/layer.cc#newcode32 cc/layers/layer.cc:32: #include "cc/trees/scroll_node.h" On 2017/03/17 15:01:55, flackr wrote: > Obsolete? ...
3 years, 9 months ago (2017-03-17 17:36:52 UTC) #17
flackr
https://codereview.chromium.org/2733633002/diff/230001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp File third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/2733633002/diff/230001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp#newcode395 third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:395: .getTotalContainingBlockStickyOffset()); On 2017/03/17 17:36:52, smcgruer wrote: > On 2017/03/17 ...
3 years, 9 months ago (2017-03-17 18:04:08 UTC) #18
smcgruer
https://codereview.chromium.org/2733633002/diff/230001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp File third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/2733633002/diff/230001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp#newcode395 third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:395: .getTotalContainingBlockStickyOffset()); On 2017/03/17 18:04:08, flackr wrote: > On 2017/03/17 ...
3 years, 9 months ago (2017-03-17 18:42:42 UTC) #19
flackr
LGTM
3 years, 9 months ago (2017-03-17 19:15:00 UTC) #22
smcgruer
+ajuma for cc OWNERS +chrishtr for Blink OWNERS
3 years, 9 months ago (2017-03-17 19:15:55 UTC) #24
ajuma
cc lgtm https://codereview.chromium.org/2733633002/diff/290001/cc/trees/layer_tree_host_common_unittest.cc File cc/trees/layer_tree_host_common_unittest.cc (right): https://codereview.chromium.org/2733633002/diff/290001/cc/trees/layer_tree_host_common_unittest.cc#newcode8005 cc/trees/layer_tree_host_common_unittest.cc:8005: // keep going as it hasnt reached ...
3 years, 9 months ago (2017-03-17 23:59:52 UTC) #27
smcgruer
https://codereview.chromium.org/2733633002/diff/290001/cc/trees/layer_tree_host_common_unittest.cc File cc/trees/layer_tree_host_common_unittest.cc (right): https://codereview.chromium.org/2733633002/diff/290001/cc/trees/layer_tree_host_common_unittest.cc#newcode8005 cc/trees/layer_tree_host_common_unittest.cc:8005: // keep going as it hasnt reached its position ...
3 years, 9 months ago (2017-03-20 13:36:30 UTC) #28
chrishtr
https://codereview.chromium.org/2733633002/diff/310001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp File third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/2733633002/diff/310001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp#newcode176 third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:176: static const LayoutBoxModelObject* nearestCompositedStickyAncestor( I assume one of the ...
3 years, 9 months ago (2017-03-20 17:24:52 UTC) #29
smcgruer
https://codereview.chromium.org/2733633002/diff/310001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp File third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/2733633002/diff/310001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp#newcode176 third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:176: static const LayoutBoxModelObject* nearestCompositedStickyAncestor( On 2017/03/20 17:24:52, chrishtr wrote: ...
3 years, 9 months ago (2017-03-21 13:54:55 UTC) #30
smcgruer
3 years, 9 months ago (2017-03-21 13:54:56 UTC) #31
smcgruer
https://codereview.chromium.org/2733633002/diff/310001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp File third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/2733633002/diff/310001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp#newcode176 third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:176: static const LayoutBoxModelObject* nearestCompositedStickyAncestor( Ok, flackr and I discussed ...
3 years, 9 months ago (2017-03-21 16:01:25 UTC) #32
smcgruer
https://codereview.chromium.org/2733633002/diff/310001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp File third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/2733633002/diff/310001/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp#newcode176 third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:176: static const LayoutBoxModelObject* nearestCompositedStickyAncestor( On 2017/03/21 16:01:25, smcgruer wrote: ...
3 years, 9 months ago (2017-03-21 17:37:48 UTC) #33
chrishtr
https://codereview.chromium.org/2733633002/diff/370001/cc/blink/web_layer_impl.cc File cc/blink/web_layer_impl.cc (right): https://codereview.chromium.org/2733633002/diff/370001/cc/blink/web_layer_impl.cc#newcode408 cc/blink/web_layer_impl.cc:408: web_constraint.nearestLayerShiftingContainingBlock; This seems unused.
3 years, 9 months ago (2017-03-21 22:18:28 UTC) #38
smcgruer
https://codereview.chromium.org/2733633002/diff/370001/cc/blink/web_layer_impl.cc File cc/blink/web_layer_impl.cc (right): https://codereview.chromium.org/2733633002/diff/370001/cc/blink/web_layer_impl.cc#newcode408 cc/blink/web_layer_impl.cc:408: web_constraint.nearestLayerShiftingContainingBlock; On 2017/03/21 22:18:28, chrishtr wrote: > This seems ...
3 years, 9 months ago (2017-03-21 22:41:36 UTC) #39
chrishtr
https://codereview.chromium.org/2733633002/diff/370001/cc/blink/web_layer_impl.cc File cc/blink/web_layer_impl.cc (right): https://codereview.chromium.org/2733633002/diff/370001/cc/blink/web_layer_impl.cc#newcode408 cc/blink/web_layer_impl.cc:408: web_constraint.nearestLayerShiftingContainingBlock; On 2017/03/21 at 22:41:35, smcgruer wrote: > On ...
3 years, 9 months ago (2017-03-21 23:26:05 UTC) #40
smcgruer
https://codereview.chromium.org/2733633002/diff/370001/cc/trees/property_tree.cc File cc/trees/property_tree.cc (right): https://codereview.chromium.org/2733633002/diff/370001/cc/trees/property_tree.cc#newcode398 cc/trees/property_tree.cc:398: ancestor_containing_block_offset; On 2017/03/21 23:26:05, chrishtr wrote: > Your code ...
3 years, 9 months ago (2017-03-22 15:15:03 UTC) #41
chrishtr
lgtm
3 years, 9 months ago (2017-03-23 23:15:29 UTC) #42
chrishtr
Ok, thanks for the explanations. Complicated, but sticky seems to be inherently so.
3 years, 9 months ago (2017-03-23 23:15:52 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2733633002/370001
3 years, 9 months ago (2017-03-24 12:33:37 UTC) #46
commit-bot: I haz the power
3 years, 9 months ago (2017-03-24 14:35:35 UTC) #49
Message was sent while issue was closed.
Committed patchset #20 (id:370001) as
https://chromium.googlesource.com/chromium/src/+/29014fffc71e122447fb29f32915...

Powered by Google App Engine
This is Rietveld 408576698