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

Issue 1218023004: Fix a regression when position:static with absolute child changed to relative (Closed)

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

Description

Fix a regression when position:static with absolute child changed to relative This patch fixes a regression that was introduced by a CL[1] that fixed incorrect order of the positioned objects list. As part of the fix, the CL replaced a partial duplication of the containingBlock() implementation with a call to containingBlock(). This part of the fix was wrong. It was a code path for when an element has absolute descendants and becomes a new container for them. In this case, the absolute descendants are not removed from the list of the old containing block, and thus belong to two containing blocks simultaneously. To fix this, the new containing block is not position:absolute either in styleWillChange/styleDidChange, but it needs to calculate by pretending it is position:absolute. Rather than reverting to the copy of the logic, this patch extracts the logic from containingBlock() to containingBlockForAbsolutePosition(). [1] https://codereview.chromium.org/1181983002 BUG=505389, 407356, 416210, 351709, 144608, 500511 TEST=fast/dynamic/static-to-relative-with-absolute-and-static-child.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=198389

Patch Set 1 #

Total comments: 1

Patch Set 2 : Add ASSERT(gPositionedContainerMap->get(o)->size() == 1) #

Total comments: 4

Patch Set 3 : mstensho@ review in #10, and test from #11 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+74 lines, -19 lines) Patch
A LayoutTests/fast/dynamic/static-to-relative-with-absolute-child-in-multicol.html View 1 2 1 chunk +23 lines, -0 lines 0 comments Download
A LayoutTests/fast/dynamic/static-to-relative-with-absolute-child-in-multicol-expected.html View 1 2 1 chunk +18 lines, -0 lines 0 comments Download
M Source/core/layout/LayoutBlock.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/layout/LayoutObject.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/layout/LayoutObject.cpp View 1 2 1 chunk +31 lines, -18 lines 0 comments Download

Messages

Total messages: 19 (2 generated)
kojii
PTAL.
5 years, 5 months ago (2015-06-30 17:48:52 UTC) #2
mstensho (USE GERRIT)
https://codereview.chromium.org/1218023004/diff/1/Source/core/layout/LayoutBlock.cpp File Source/core/layout/LayoutBlock.cpp (right): https://codereview.chromium.org/1218023004/diff/1/Source/core/layout/LayoutBlock.cpp#newcode290 Source/core/layout/LayoutBlock.cpp:290: if (LayoutBlock* cb = containerForAbsolutePosition()) How about doing this ...
5 years, 5 months ago (2015-06-30 19:47:17 UTC) #3
kojii
On 2015/06/30 19:47:17, mstensho wrote: > https://codereview.chromium.org/1218023004/diff/1/Source/core/layout/LayoutBlock.cpp > File Source/core/layout/LayoutBlock.cpp (right): > > https://codereview.chromium.org/1218023004/diff/1/Source/core/layout/LayoutBlock.cpp#newcode290 > ...
5 years, 5 months ago (2015-07-01 01:05:14 UTC) #4
mstensho (USE GERRIT)
On 2015/07/01 01:05:14, kojii wrote: > On 2015/06/30 19:47:17, mstensho wrote: > > > https://codereview.chromium.org/1218023004/diff/1/Source/core/layout/LayoutBlock.cpp ...
5 years, 5 months ago (2015-07-01 09:14:29 UTC) #5
kojii
On 2015/07/01 09:14:29, mstensho wrote: > > I'm not that concerned about performance here. It's ...
5 years, 5 months ago (2015-07-01 13:39:24 UTC) #6
mstensho (USE GERRIT)
On 2015/07/01 13:39:24, kojii wrote: > I need time to understand your CL to see ...
5 years, 5 months ago (2015-07-02 13:46:19 UTC) #7
kojii
On 2015/07/02 13:46:19, mstensho wrote: > On 2015/07/01 13:39:24, kojii wrote: > > I need ...
5 years, 5 months ago (2015-07-03 15:47:43 UTC) #8
kojii
PTAL. WDYT? PS2 added the ASSERT(gPositionedContainerMap->get(o)->size() == 1). I confirmed: 1. This ASSERT does not ...
5 years, 5 months ago (2015-07-06 03:45:25 UTC) #9
mstensho (USE GERRIT)
No, gPositionedContainerMap doesn't seem useful at all to me. It was originally introduced by leviw. ...
5 years, 5 months ago (2015-07-06 09:46:25 UTC) #10
mstensho (USE GERRIT)
Oh, look! I managed to come up with a test case that fails visually without ...
5 years, 5 months ago (2015-07-06 10:18:51 UTC) #11
kojii
Thank you mstensho@, this is far beyond my knowledge, but I confirmed this CL fix ...
5 years, 5 months ago (2015-07-07 08:40:38 UTC) #12
mstensho (USE GERRIT)
This sentence in the description doesn't parse: "As part of the fix, the CL replaced ...
5 years, 5 months ago (2015-07-07 09:02:53 UTC) #13
kojii
Thank you for your prompt review, along with all the reviews so far. On 2015/07/07 ...
5 years, 5 months ago (2015-07-07 09:59:23 UTC) #14
mstensho (USE GERRIT)
Could you say something like this instead: "As part of the fix, the CL replaced ...
5 years, 5 months ago (2015-07-07 10:08:08 UTC) #15
kojii
On 2015/07/07 10:08:08, mstensho wrote: > Could you say something like this instead: > "As ...
5 years, 5 months ago (2015-07-07 10:51:21 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1218023004/40001
5 years, 5 months ago (2015-07-07 10:52:20 UTC) #18
commit-bot: I haz the power
5 years, 5 months ago (2015-07-07 10:57:23 UTC) #19
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=198389

Powered by Google App Engine
This is Rietveld 408576698