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

Issue 191693002: Delay scrollContents until the next paint (Closed)

Created:
6 years, 9 months ago by ykyyip
Modified:
6 years, 9 months ago
CC:
blink-reviews, bemjb+rendering_chromium.org, dsinclair, zoltan1, eae+blinkwatch, leviw+renderwatch, blink-layers+watch_chromium.org, Julien - ping for review, pdr., leviw_travelin_and_unemployed
Visibility:
Public.

Description

Delay scrollContents until the next paint Fix a ChickenAndEgg issue by delaying scroll until the next paint when the compositing layers are up to date. The amount scrolled but not painted is stored in ScrollView::m_pendingScrollDelta. Rearrange the code such that if there are fixed position elements, do the following before painting: 1. Walk the tree and do updateLayerPosition 2. Mark that we need to update compositing layers since layers may have changed as a result of scrolling if there are fixed elements. 3. Update compositing layers. 4. Invalidate fixed position elements. 5. Update repaint rects for fixed position elements to reflect the new scroll position. Also, when calculating repaint rects for fixed elements, take into account both the scroll position and the scroll delta. This way we can invalidate the previous scroll position for the fixed element if it is promoted to a layer as a result of scrolling. BUG=343766 BUG=343767 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170086

Patch Set 1 #

Total comments: 9

Patch Set 2 : renamed scrollDelta and delete unused code #

Patch Set 3 : #

Patch Set 4 : fix layout tests #

Total comments: 25

Patch Set 5 : fix iframe scrolling, addressed comments #

Patch Set 6 : fixed typos #

Total comments: 4

Patch Set 7 : fix nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+540 lines, -212 lines) Patch
M LayoutTests/compositing/absolute-inside-out-of-view-fixed.html View 1 2 3 4 5 6 2 chunks +13 lines, -6 lines 0 comments Download
M LayoutTests/compositing/iframes/resources/fixed-position-transformed-subframe.html View 1 2 3 1 chunk +8 lines, -6 lines 0 comments Download
M LayoutTests/compositing/layer-creation/fixed-position-out-of-view-positioning.html View 1 2 2 chunks +6 lines, -1 line 0 comments Download
M LayoutTests/compositing/repaint/fixed-pos-inside-composited-intermediate-layer.html View 1 2 3 4 5 6 1 chunk +6 lines, -4 lines 0 comments Download
M LayoutTests/compositing/repaint/fixed-pos-with-composited-child.html View 1 2 3 4 5 6 1 chunk +7 lines, -5 lines 0 comments Download
M LayoutTests/compositing/rtl/rtl-fixed-overflow-scrolled.html View 1 2 2 chunks +6 lines, -3 lines 0 comments Download
M LayoutTests/compositing/squashing/squash-above-fixed-1.html View 1 2 3 4 5 3 chunks +74 lines, -24 lines 0 comments Download
M LayoutTests/compositing/squashing/squash-above-fixed-2.html View 1 2 3 chunks +10 lines, -2 lines 0 comments Download
M LayoutTests/compositing/squashing/squash-above-fixed-3.html View 1 2 3 chunks +22 lines, -12 lines 0 comments Download
M LayoutTests/fast/repaint/absolute-position-changed.html View 1 2 3 4 1 chunk +22 lines, -6 lines 0 comments Download
M LayoutTests/fast/repaint/fixed.html View 1 2 3 4 1 chunk +18 lines, -7 lines 0 comments Download
M LayoutTests/fast/repaint/fixed-after-scroll.html View 1 2 3 4 2 chunks +14 lines, -5 lines 0 comments Download
M LayoutTests/fast/repaint/fixed-and-absolute-position-scrolled.html View 1 2 3 4 1 chunk +16 lines, -5 lines 0 comments Download
M LayoutTests/fast/repaint/fixed-child-move-after-scroll.html View 1 2 3 1 chunk +10 lines, -1 line 0 comments Download
M LayoutTests/fast/repaint/fixed-child-of-fixed-move-after-scroll.html View 1 2 3 1 chunk +10 lines, -1 line 0 comments Download
M LayoutTests/fast/repaint/fixed-move-after-scroll.html View 1 2 3 1 chunk +10 lines, -1 line 0 comments Download
M LayoutTests/fast/repaint/fixed-scale.html View 1 2 3 4 2 chunks +15 lines, -5 lines 0 comments Download
M LayoutTests/fast/repaint/fixed-table-cell.html View 1 2 3 4 2 chunks +16 lines, -5 lines 0 comments Download
M LayoutTests/fast/repaint/fixed-table-overflow.html View 1 2 3 4 2 chunks +15 lines, -5 lines 0 comments Download
M LayoutTests/fast/repaint/fixed-table-overflow-zindex.html View 1 2 3 4 5 2 chunks +15 lines, -5 lines 0 comments Download
M LayoutTests/fast/repaint/fixed-tranformed.html View 1 2 3 1 chunk +37 lines, -29 lines 0 comments Download
M LayoutTests/fast/repaint/overflow-auto-in-overflow-auto-scrolled.html View 1 2 3 4 2 chunks +25 lines, -13 lines 0 comments Download
M LayoutTests/fast/repaint/resources/fixed-move-after-keyboard-scroll-iframe.html View 1 2 3 2 chunks +11 lines, -1 line 0 comments Download
M LayoutTests/fast/repaint/scroll-fixed-layer-with-no-visible-content.html View 1 2 3 4 2 chunks +15 lines, -5 lines 0 comments Download
M LayoutTests/fast/repaint/scroll-fixed-layer-with-reflection.html View 1 2 3 4 3 chunks +15 lines, -5 lines 0 comments Download
M LayoutTests/fast/repaint/scroll-fixed-reflected-layer.html View 1 2 3 4 3 chunks +15 lines, -5 lines 0 comments Download
M LayoutTests/fast/repaint/scroll-in-fixed-layer.html View 1 2 3 4 3 chunks +15 lines, -5 lines 0 comments Download
M Source/core/frame/FrameView.h View 1 2 3 4 4 chunks +5 lines, -2 lines 0 comments Download
M Source/core/frame/FrameView.cpp View 1 2 3 4 5 6 9 chunks +68 lines, -23 lines 0 comments Download
M Source/core/rendering/RenderLayer.cpp View 1 2 3 4 5 6 2 chunks +2 lines, -7 lines 0 comments Download
M Source/core/rendering/RenderView.cpp View 1 2 3 4 5 6 1 chunk +6 lines, -1 line 0 comments Download
M Source/platform/scroll/ScrollView.h View 1 2 3 4 chunks +3 lines, -4 lines 0 comments Download
M Source/platform/scroll/ScrollView.cpp View 1 2 3 2 chunks +10 lines, -3 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
ykyyip
Can you PTAL at this patchset? If this approach looks OK to you, I think ...
6 years, 9 months ago (2014-03-08 00:10:44 UTC) #1
abarth-chromium
> B=343766 > BUG=343766 I think the "B" line isn't needed. The BUG line should ...
6 years, 9 months ago (2014-03-08 06:45:49 UTC) #2
abarth-chromium
I don't feel like I'm that much of an expert in this code. Below are ...
6 years, 9 months ago (2014-03-08 06:54:51 UTC) #3
ykyyip
https://codereview.chromium.org/191693002/diff/1/Source/core/frame/FrameView.h File Source/core/frame/FrameView.h (right): https://codereview.chromium.org/191693002/diff/1/Source/core/frame/FrameView.h#newcode150 Source/core/frame/FrameView.h:150: virtual void repaintFixedElementsAfterScrolling() OVERRIDE; On 2014/03/08 06:54:52, abarth wrote: ...
6 years, 9 months ago (2014-03-11 01:59:38 UTC) #4
Ian Vollick
On 2014/03/11 01:59:38, ykyyip wrote: > https://codereview.chromium.org/191693002/diff/1/Source/core/frame/FrameView.h > File Source/core/frame/FrameView.h (right): > > https://codereview.chromium.org/191693002/diff/1/Source/core/frame/FrameView.h#newcode150 > ...
6 years, 9 months ago (2014-03-11 02:20:05 UTC) #5
abarth-chromium
> Adam, if that's correct, does this fast path still exist? The shift and blit ...
6 years, 9 months ago (2014-03-11 02:27:59 UTC) #6
ykyyip
On 2014/03/11 02:20:05, Ian Vollick wrote: > I see that you've updated the code in ...
6 years, 9 months ago (2014-03-12 23:36:42 UTC) #7
Ian Vollick
I'm sorry it's taken me so long to respond! This change looks VERY cool, but ...
6 years, 9 months ago (2014-03-21 00:14:14 UTC) #8
eseidel
6 years, 9 months ago (2014-03-24 17:17:21 UTC) #9
esprehn
bunch of nits, but this looks okay. https://codereview.chromium.org/191693002/diff/60001/LayoutTests/compositing/squashing/squash-above-fixed-1.html File LayoutTests/compositing/squashing/squash-above-fixed-1.html (right): https://codereview.chromium.org/191693002/diff/60001/LayoutTests/compositing/squashing/squash-above-fixed-1.html#newcode131 LayoutTests/compositing/squashing/squash-above-fixed-1.html:131: }); You ...
6 years, 9 months ago (2014-03-24 21:50:42 UTC) #10
ykyyip
https://codereview.chromium.org/191693002/diff/60001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/191693002/diff/60001/Source/core/frame/FrameView.cpp#newcode1478 Source/core/frame/FrameView.cpp:1478: scrolledRect.move(-scrollDelta); On 2014/03/21 00:14:14, Ian Vollick wrote: > Whoa. ...
6 years, 9 months ago (2014-03-24 21:56:10 UTC) #11
ykyyip
https://codereview.chromium.org/191693002/diff/60001/LayoutTests/compositing/squashing/squash-above-fixed-1.html File LayoutTests/compositing/squashing/squash-above-fixed-1.html (right): https://codereview.chromium.org/191693002/diff/60001/LayoutTests/compositing/squashing/squash-above-fixed-1.html#newcode131 LayoutTests/compositing/squashing/squash-above-fixed-1.html:131: }); On 2014/03/24 21:50:43, esprehn wrote: > You need ...
6 years, 9 months ago (2014-03-24 22:15:02 UTC) #12
esprehn
lgtm, couple comments. https://codereview.chromium.org/191693002/diff/100001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/191693002/diff/100001/Source/core/frame/FrameView.cpp#newcode1729 Source/core/frame/FrameView.cpp:1729: if (!renderer->style()->hasViewportConstrainedPosition()) It seems really weird ...
6 years, 9 months ago (2014-03-25 02:37:43 UTC) #13
esprehn
btw can you update the BUG= line to include the chicken and egg bug?
6 years, 9 months ago (2014-03-25 02:42:20 UTC) #14
ykyyip
https://codereview.chromium.org/191693002/diff/100001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/191693002/diff/100001/Source/core/frame/FrameView.cpp#newcode1729 Source/core/frame/FrameView.cpp:1729: if (!renderer->style()->hasViewportConstrainedPosition()) On 2014/03/25 02:37:44, esprehn wrote: > It ...
6 years, 9 months ago (2014-03-25 23:01:59 UTC) #15
ykyyip
The CQ bit was checked by ykyyip@chromium.org
6 years, 9 months ago (2014-03-26 18:53:37 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ykyyip@chromium.org/191693002/130001
6 years, 9 months ago (2014-03-26 18:53:43 UTC) #17
commit-bot: I haz the power
6 years, 9 months ago (2014-03-26 18:54:19 UTC) #18
Message was sent while issue was closed.
Change committed as 170086

Powered by Google App Engine
This is Rietveld 408576698