New issue
Advanced search Search tips

Issue 702229 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

position:sticky - composited sticky inside non-composited sticky does not work

Project Member Reported by smcgruer@chromium.org, Mar 16 2017

Issue description

Punting from this CL: https://codereview.chromium.org/2733633002/

If you have a non-composited sticky element which contains composited sticky elements, CompositedLayerMapping will calculate an incorrect parentRelativeStickyBoxOffset as we don't account for the main-thread sticky offset of our ancestor.

Repro: http://output.jsbin.com/hawefav/quiet

Options are to:

1. Pass this information through in the sticky constraints. However this would require updating descendants when an ancestor changes - expensive?

2. Force promotion of a sticky element if it has sticky descendants.

#2 is likely the best solution.
 

Comment 1 by flackr@chromium.org, Mar 16 2017

My vote is for #2, it makes sense that if you have composited descendant sticky position elements we should composite their ancestor sticky position elements. You can add a reason to CompositingReasonComboCompositedDescendants and in fact we already do this for fixed position, see CompositingReasonPositionFixedWithCompositedDescendants.
Status: Started (was: Available)
Additional test case: http://output.jsbin.com/kahixo uses an overflow scroller rather than the body scroller.

Comment 4 Deleted

Project Member

Comment 5 by bugdroid1@chromium.org, May 12 2017

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

commit de4c11424c87b46a8f5ce0935f9367a868baa507
Author: smcgruer <smcgruer@chromium.org>
Date: Fri May 12 04:16:56 2017

Composite sticky-positioned elements when they have composited descendants

In the case of nested sticky elements, if the descendant elements are promoted
but their ancestor is not we will position them incorrectly. Instead of trying
to re-compute main-thread positioning on the compositor, we can just promote
any sticky element that has promoted sticky descendants.

This CL goes slightly further and promotes any sticky element that has
composited descendants regardless of whether they are sticky - doing so makes
the code much simpler and the performance impact should be limited by the fact
that sticky is not common.

BUG= 702229 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2754983002
Cr-Commit-Position: refs/heads/master@{#471217}

[modify] https://crrev.com/de4c11424c87b46a8f5ce0935f9367a868baa507/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
[add] https://crrev.com/de4c11424c87b46a8f5ce0935f9367a868baa507/third_party/WebKit/LayoutTests/compositing/overflow/mixed-composited-nested-sticky-expected.html
[add] https://crrev.com/de4c11424c87b46a8f5ce0935f9367a868baa507/third_party/WebKit/LayoutTests/compositing/overflow/mixed-composited-nested-sticky-overflow-scroller-expected.html
[add] https://crrev.com/de4c11424c87b46a8f5ce0935f9367a868baa507/third_party/WebKit/LayoutTests/compositing/overflow/mixed-composited-nested-sticky-overflow-scroller.html
[add] https://crrev.com/de4c11424c87b46a8f5ce0935f9367a868baa507/third_party/WebKit/LayoutTests/compositing/overflow/mixed-composited-nested-sticky.html
[modify] https://crrev.com/de4c11424c87b46a8f5ce0935f9367a868baa507/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
[modify] https://crrev.com/de4c11424c87b46a8f5ce0935f9367a868baa507/third_party/WebKit/Source/platform/graphics/CompositingReasons.cpp
[modify] https://crrev.com/de4c11424c87b46a8f5ce0935f9367a868baa507/third_party/WebKit/Source/platform/graphics/CompositingReasons.h

Status: Fixed (was: Started)

Sign in to add a comment