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

Issue 1181983002: Ensure that positioned objects' list is always in parent first order (Closed)

Created:
5 years, 6 months ago by kojii
Modified:
5 years, 6 months ago
CC:
blink-reviews, blink-reviews-rendering, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Ensure that positioned objects list is always in parent first order This patch fixes a case where the positioned objects list may contain an element after its descendant. RenderBlock::layoutPositionedObjects()'s logic relies on "parent first" positioned object ordering. Wrong ordering could end up having dirty children, after finishing layouting positioned objects. When an element's position property is changed from a non-static value to to another non-static value, if its descendants have non-static position value, it may be inserted into the new containing block's positioned objects list after the descendants. Three changes to the logic are: 1. Invalidation of descendants from the list of containing block (of newStyle) occurs not only when non-static-to-static but also non-static-to-non-static (e.g., absolute->fixed) changes. 2. LayoutBlock::styleWillChange had a copy of the logic in contaningBlock() that assumes position:absolute, which gets wrong result for position:fixed. Changed to call contaningBlock(). 3. LayoutBlock::styleDidChange invalidates the list of new containing block in case the containing block changes by the property change, and the new containing block already has descendants. Test debug build with some real content: http://binged.it/K9uLcw http://www.bing.com/maps/ http://www.nytimes.com (scroll down) http://www.awwwards.com/22-experimental-webgl-demo-examples.html (scroll down) Patch was developed by Zalan Bujtas <zbujtas@gmail.com>; see original bug https://bugs.webkit.org/show_bug.cgi?id=93891 then polished by alexanderk@opera.com https://codereview.chromium.org/875563003/ BUG=407356, 416210, 351709, 144608, 500511 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197189

Patch Set 1 : Copied from https://codereview.chromium.org/875563003/ and rebase #

Patch Set 2 : Re-constructed #

Patch Set 3 : Avoid invalidations too often than necessary #

Patch Set 4 : Simplified logic #

Patch Set 5 : More comprehensive test cases #

Total comments: 2

Patch Set 6 : Rebase #

Patch Set 7 : mstensho's review and transform fix for crbug.com/500511 #

Patch Set 8 : Invalidate both in styleWillChange and styleDidChange #

Patch Set 9 : Rebaseline one repaint order change for https://storage.googleapis.com/chromium-layout-test-archives/linux_blink_rel/66793/layout-test-results/results.html #

Total comments: 8

Patch Set 10 : Rebase #

Patch Set 11 : mstensho's nits and change test to avoid timeouts #

Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -15 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A LayoutTests/fast/dynamic/position-change-to-absolute-with-positioned-child-crash.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +129 lines, -0 lines 0 comments Download
A LayoutTests/fast/dynamic/transform-removed-from-absolute-with-fixed-children.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +13 lines, -0 lines 0 comments Download
A LayoutTests/fast/dynamic/transform-removed-from-absolute-with-fixed-children-expected.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/layout/LayoutBlock.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +17 lines, -15 lines 0 comments Download

Messages

Total messages: 12 (4 generated)
kojii
PTAL. One design option I couldn't decide was whether it's ok to add overrideStyle argument ...
5 years, 6 months ago (2015-06-14 14:35:48 UTC) #3
mstensho (USE GERRIT)
https://codereview.chromium.org/1181983002/diff/90001/Source/core/layout/LayoutBlock.cpp File Source/core/layout/LayoutBlock.cpp (left): https://codereview.chromium.org/1181983002/diff/90001/Source/core/layout/LayoutBlock.cpp#oldcode285 Source/core/layout/LayoutBlock.cpp:285: // Remove our absolutely positioned descendants from their current ...
5 years, 6 months ago (2015-06-15 10:02:55 UTC) #4
kojii
Cleanup
5 years, 6 months ago (2015-06-16 06:52:50 UTC) #5
mstensho (USE GERRIT)
lgtm with a few nits. https://codereview.chromium.org/1181983002/diff/180001/LayoutTests/fast/dynamic/transform-removed-from-absolute-with-fixed-children-expected.html File LayoutTests/fast/dynamic/transform-removed-from-absolute-with-fixed-children-expected.html (right): https://codereview.chromium.org/1181983002/diff/180001/LayoutTests/fast/dynamic/transform-removed-from-absolute-with-fixed-children-expected.html#newcode3 LayoutTests/fast/dynamic/transform-removed-from-absolute-with-fixed-children-expected.html:3: <div style="position:relative; background:lime;"> Don't ...
5 years, 6 months ago (2015-06-16 14:22:37 UTC) #7
kojii
Thank you for your prompt review. All nits done. The script test was refactored to ...
5 years, 6 months ago (2015-06-16 18:56:20 UTC) #8
mstensho (USE GERRIT)
lgtm
5 years, 6 months ago (2015-06-16 19:04:57 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1181983002/220001
5 years, 6 months ago (2015-06-16 19:05:30 UTC) #11
commit-bot: I haz the power
5 years, 6 months ago (2015-06-16 19:59:55 UTC) #12
Message was sent while issue was closed.
Committed patchset #11 (id:220001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=197189

Powered by Google App Engine
This is Rietveld 408576698