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

Issue 2716583005: Do not promote position sticky or fixed elements unless they move with scroll. (Closed)

Created:
3 years, 10 months ago by flackr
Modified:
3 years, 9 months ago
Reviewers:
smcgruer, chrishtr, pdr.
CC:
blink-reviews, blink-reviews-layout_chromium.org, blink-reviews-paint_chromium.org, blink-reviews-style_chromium.org, chromium-reviews, dshwang, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Do not promote position sticky or fixed elements unless they move with scroll. BUG=696058 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Patch Set 1 #

Total comments: 3

Patch Set 2 : Merge with master. #

Patch Set 3 : Create a stacking context for sticky. #

Total comments: 8

Patch Set 4 : Avoid computing constraints for non-anchored sticky and add/update tests. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+245 lines, -104 lines) Patch
M third_party/WebKit/Source/core/frame/FrameView.cpp View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameViewTest.cpp View 1 2 3 1 chunk +36 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp View 1 2 3 4 chunks +8 lines, -5 lines 4 comments Download
M third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp View 1 2 3 6 chunks +41 lines, -18 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.h View 1 2 3 2 chunks +9 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp View 1 2 3 7 chunks +26 lines, -19 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinderTest.cpp View 1 2 3 1 chunk +50 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp View 2 chunks +7 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayer.h View 1 2 3 1 chunk +7 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayer.cpp View 1 2 3 3 chunks +21 lines, -18 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayerTest.cpp View 1 2 3 4 chunks +25 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyle.h View 1 2 3 1 chunk +6 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyle.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 16 (5 generated)
flackr
Hey, I left a few comments throughout to explain the changes. I'm sure there are ...
3 years, 10 months ago (2017-02-24 22:59:44 UTC) #3
flackr
ping?
3 years, 9 months ago (2017-03-14 21:59:01 UTC) #5
pdr.
On 2017/03/14 at 21:59:01, flackr wrote: > ping? Sorry, I'm behind on reviews this week. ...
3 years, 9 months ago (2017-03-15 22:23:44 UTC) #7
chrishtr
https://codereview.chromium.org/2716583005/diff/40001/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2716583005/diff/40001/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp#newcode253 third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:253: style()->hasStickyConstrainedPosition()) This was a bug before? https://codereview.chromium.org/2716583005/diff/40001/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.h File third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.h ...
3 years, 9 months ago (2017-03-16 00:24:04 UTC) #8
flackr
I can probably split this up into three patches: - Walk inline container chain for ...
3 years, 9 months ago (2017-03-20 21:04:59 UTC) #10
smcgruer
https://codereview.chromium.org/2716583005/diff/60001/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2716583005/diff/60001/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp#newcode83 third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:83: ? maybeStickyAncestor->container() On 2017/03/20 21:04:59, flackr wrote: > Stephen ...
3 years, 9 months ago (2017-03-21 14:06:20 UTC) #11
smcgruer
3 years, 9 months ago (2017-03-21 14:06:22 UTC) #12
chrishtr
On 2017/03/20 at 21:04:59, flackr wrote: > I can probably split this up into three ...
3 years, 9 months ago (2017-03-21 16:43:10 UTC) #13
chrishtr
https://codereview.chromium.org/2716583005/diff/60001/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2716583005/diff/60001/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp#newcode83 third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:83: ? maybeStickyAncestor->container() On 2017/03/21 at 14:06:19, smcgruer wrote: > ...
3 years, 9 months ago (2017-03-21 16:43:16 UTC) #14
flackr
Okay, will split this up and post new reviews. https://codereview.chromium.org/2716583005/diff/60001/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2716583005/diff/60001/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp#newcode83 third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:83: ...
3 years, 9 months ago (2017-03-21 16:56:33 UTC) #15
flackr
3 years, 9 months ago (2017-03-24 04:51:03 UTC) #16
Message was sent while issue was closed.
On 2017/03/21 16:43:10, chrishtr wrote:
> On 2017/03/20 at 21:04:59, flackr wrote:
> > I can probably split this up into three patches:
> > - Walk inline container chain for nested sticky
> > - Don't composite non-anchored sticky elements
> > - Don't compute constraints for non-anchored sticky elements
> > The 2nd and 3rd are fairly small distributed changes, but this might make it
> easier to review?
> 
> Yes please, that would be great.

Split into three separate reviews and closed this one:
Walk inline container chain for nested sticky:
https://codereview.chromium.org/2776643002/
Don't composite non-anchored sticky elements:
https://codereview.chromium.org/2776563003/
Don't compute constraints for non-anchored sticky:
https://codereview.chromium.org/2769353002/ (dependent on previous patch)
> 
> > 
> >
>
https://codereview.chromium.org/2716583005/diff/40001/third_party/WebKit/Sour...
> > File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right):
> > 
> >
>
https://codereview.chromium.org/2716583005/diff/40001/third_party/WebKit/Sour...
> > third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:253:
> style()->hasStickyConstrainedPosition())
> > On 2017/03/16 00:24:03, chrishtr wrote:
> > > This was a bug before?
> > 
> > Not so much a bug, just hasStickyConstrainedPosition now also checks that it
> is actually constrained by one of top/bottom/left/right. If it's not we should
> treat position sticky as if it is position relative (i.e. not cause slow
> scrolling, not promote it, etc). I realized this also needs to be updated in
> CompositingInputsUpdater, so I've updated it there and added some tests.
> Interestingly, as far as I can tell the SPv2 version never adds sticky
position
> to the frameview viewport constrained set (but with root layer scrolling we
> don't need this anymore).
> > 
> >
>
https://codereview.chromium.org/2716583005/diff/40001/third_party/WebKit/Sour...
> > File
> third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.h
> (right):
> > 
> >
>
https://codereview.chromium.org/2716583005/diff/40001/third_party/WebKit/Sour...
> >
>
third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.h:29:
> CompositingReasons directReasons(const PaintLayer*, bool ignoreLCDText) const;
> > On 2017/03/16 00:24:04, chrishtr wrote:
> > > Please add a comment explaining what ignoreLCDText does here.
> > 
> > Done.
> > 
> >
>
https://codereview.chromium.org/2716583005/diff/40001/third_party/WebKit/Sour...
> > File
>
third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinderTest.cpp
> (right):
> > 
> >
>
https://codereview.chromium.org/2716583005/diff/40001/third_party/WebKit/Sour...
> >
>
third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinderTest.cpp:88:
> document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true);
> > On 2017/03/16 00:24:04, chrishtr wrote:
> > > Does this just composite the class='scroller' element? Alternatively
> > > you can put will-change: transform on it.
> > 
> > Done.
> > 
> >
>
https://codereview.chromium.org/2716583005/diff/40001/third_party/WebKit/Sour...
> > File third_party/WebKit/Source/core/paint/PaintLayer.h (right):
> > 
> >
>
https://codereview.chromium.org/2716583005/diff/40001/third_party/WebKit/Sour...
> > third_party/WebKit/Source/core/paint/PaintLayer.h:620: bool
sticksToScroller()
> const;
> > On 2017/03/16 00:24:04, chrishtr wrote:
> > > Please add comments documenting these.
> > 
> > Done.
> > 
> >
>
https://codereview.chromium.org/2716583005/diff/60001/third_party/WebKit/Sour...
> > File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right):
> > 
> >
>
https://codereview.chromium.org/2716583005/diff/60001/third_party/WebKit/Sour...
> > third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:83: ?
> maybeStickyAncestor->container()
> > Stephen I noticed when I added an unanchored sticky parent that if you had
> deeply nested inlines this code used to skip straight past the first parent to
> the containing block.

Powered by Google App Engine
This is Rietveld 408576698