New issue
Advanced search Search tips

Issue 877196 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Oct 8
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 414283



Sign in to add a comment

[Blink] Sticky offset should not affect paint offset, and implemented as transform instead

Project Member Reported by trchen@chromium.org, Aug 23

Issue description

What steps will reproduce the problem?
(1) Open https://output.jsbin.com/yekubit/quiet
(2) Scroll down the scroller, so the sticky box (green) hits the edge of its container

What is the expected result?
The sticky box should remain the same size.

What happens instead?
The border box of the sticky box goes from 7x7 to 7x6.



 
cc'ing a few people working on fractional scrolling, since this bug can potentially block the implementation of non-composited fractional scrolling.

The bug is due to sticky offset being treat similarly to relative offset, see LayoutBoxModelObject::OffsetForInFlowPosition(): https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/layout/layout_box_model_object.cc?rcl=d7fd86e06774dfeaa0ed8d5e6c6d4180eee22e1b&l=1131

This value will be ultimately included into paint offset, which is a part of the pre-snapping coordinate, and will affect layout snapping, but scrolling really shouldn't affect layout.

Note that this will potentially affect fractional scrolling, since fractional scroll offset will result in fractional sticky offset. This is NOT reproducible today, because non-composited scrollers doesn't support fractional scrolling (always round down). Composited scroller/sticky are fine too, because there is code to exclude sticky offset:
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc?rcl=549f5891aa1b2ece42d80154c5a4bb76ff5a37fb&l=960
And instead the sticky offset will be applied in cc as transform.
Cc: chrishtr@chromium.org pdr@chromium.org
Adding a few more people who may be interested. 
Cc: sunyunjia@chromium.org
FYI: sunyunjia@ is looking at fixing bug 414283 which would store fractional scroll offsets in Blink as this has been a big source pain and complexity for us.
Blocking: 414283
Project Member

Comment 5 by bugdroid1@chromium.org, Sep 12

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f

commit 8661a7c51be77ca3e6a154e7fbade0b799eb6d9f
Author: Tien-Ren Chen <trchen@chromium.org>
Date: Wed Sep 12 02:30:35 2018

[Blink/BGPT+SPv2] Implement sticky position as transform node

This CL extracts sticky offset from paint offset and apply it as a
transform node instead.

BUG= 762098 , 838018 , 877196 

Cq-Include-Trybots: luci.chromium.try:linux-blink-gen-property-trees;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I6706f09e26ca4549f58500e45153970edfcedc28
Reviewed-on: https://chromium-review.googlesource.com/1208449
Commit-Queue: Tien-Ren Chen <trchen@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590578}
[modify] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-gen-property-trees
[modify] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
[add] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-normal-scroller-expected.html
[add] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-normal-scroller.html
[add] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-overflow-hidden-expected.html
[add] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-overflow-hidden.html
[modify] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc
[modify] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/blink/renderer/core/paint/compositing/compositing_layer_property_updater.cc
[modify] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/blink/renderer/core/paint/object_paint_properties.h
[modify] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/blink/renderer/core/paint/paint_and_raster_invalidation_test.cc
[modify] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc
[modify] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
[modify] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc
[modify] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.cc
[modify] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/blink/renderer/platform/graphics/compositor_element_id.cc
[modify] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/blink/renderer/platform/graphics/compositor_element_id.h
[modify] https://crrev.com/8661a7c51be77ca3e6a154e7fbade0b799eb6d9f/third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.h

Project Member

Comment 6 by bugdroid1@chromium.org, Oct 8

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/342b655ece728586ae3559c6cc37e61ff576d9b8

commit 342b655ece728586ae3559c6cc37e61ff576d9b8
Author: Philip Rogers <pdr@chromium.org>
Date: Mon Oct 08 16:32:40 2018

[BlinkGenPropertyTrees] Update property tree printer after sticky node

A sticky transform node was added in https://crrev.com/590578 but the
paint property tree printer was not updated to dump this value. This
patch also synchronizes the effect node printing which was missing some
values.

Bug:  877196 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I26f887e12ecef4eee94b66de57c6edfa3af59648
Reviewed-on: https://chromium-review.googlesource.com/c/1268245
Commit-Queue: Philip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597583}
[modify] https://crrev.com/342b655ece728586ae3559c6cc37e61ff576d9b8/third_party/blink/renderer/core/paint/paint_property_tree_printer.cc

Status: Fixed (was: Available)

Sign in to add a comment