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

Issue 880113002: Fix crash when establishing an inline continuation inside a block continuation. (Closed)

Created:
5 years, 11 months ago by mstensho (USE GERRIT)
Modified:
5 years, 10 months ago
CC:
mstensho (USE GERRIT), blink-reviews, blink-reviews-rendering, Dominik Röttsches, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Fix crash when establishing an inline continuation inside a block continuation. When attempting to add a child into a block continuation C (RenderBlock::addChildToContinuation()), and there's a beforeChild specified, we used to jump directly to the parent of beforeChild, and insert it there (by calling addChildIgnoringContinuation() on beforeChild->parent()). Normal behavior (when block continuations aren't involved) would be to analyze the renderers in the ancestry chain between beforeChild and C. This way we perform necessary adjustments to the tree, such as inserting additional anonymous table part objects. However, this wasn't done when block continuations were involved. What really caused the crash in this case was that there's no override for addChildIgnoringContinuation() in LayoutTable, so it'd just use the one in RenderBlock, and that way we'd never get to LayoutTable::addChild(), which is exactly where we make sure that children aren't inserted at invalid places (like putting a RenderInline as a direct child of LayoutTable). The solution is to find the nearest RenderBlockFlow ancestor of beforeChild and try to insert it there, and additionally add an addChildIgnoringContinuation() override in LayoutTable for good measure (since it's dangerous to use the one in RenderBlock). Note that block continuations are only used in the old / current multicol code, and even then only if there's a spanner that's not a direct child of a multicol container. Support for block continuations can be removed when the old multicol code is removed. BUG=451059 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=189206

Patch Set 1 #

Total comments: 22

Patch Set 2 : Add some assertions + code review. #

Patch Set 3 : code review #

Total comments: 2

Patch Set 4 : Code review, and add one more test. #

Patch Set 5 : Remove assertion in LayoutTable::addChildIgnoringContinuation() - crashed fast/table/crash-bad-chil… #

Messages

Total messages: 19 (4 generated)
mstensho (USE GERRIT)
Should add some more tests, but I'll wait and see what you guys think first. ...
5 years, 10 months ago (2015-01-28 10:43:16 UTC) #2
dsinclair
https://codereview.chromium.org/880113002/diff/1/Source/core/rendering/RenderInline.cpp File Source/core/rendering/RenderInline.cpp (right): https://codereview.chromium.org/880113002/diff/1/Source/core/rendering/RenderInline.cpp#newcode511 Source/core/rendering/RenderInline.cpp:511: post->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); On 2015/01/28 at 10:43:16, mstensho wrote: > If ...
5 years, 10 months ago (2015-01-28 16:35:01 UTC) #3
mstensho (USE GERRIT)
Any comments on the other parts of the patch? https://codereview.chromium.org/880113002/diff/1/Source/core/rendering/RenderInline.cpp File Source/core/rendering/RenderInline.cpp (right): https://codereview.chromium.org/880113002/diff/1/Source/core/rendering/RenderInline.cpp#newcode511 Source/core/rendering/RenderInline.cpp:511: ...
5 years, 10 months ago (2015-01-28 16:51:19 UTC) #4
dsinclair
With the mentioned change, this LGTM. It's marked against M42 which hasn't branched yet, so ...
5 years, 10 months ago (2015-01-28 17:08:06 UTC) #5
mstensho (USE GERRIT)
https://codereview.chromium.org/880113002/diff/1/Source/core/rendering/RenderInline.cpp File Source/core/rendering/RenderInline.cpp (right): https://codereview.chromium.org/880113002/diff/1/Source/core/rendering/RenderInline.cpp#newcode511 Source/core/rendering/RenderInline.cpp:511: post->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); On 2015/01/28 17:08:06, dsinclair wrote: > On 2015/01/28 ...
5 years, 10 months ago (2015-01-28 17:19:55 UTC) #6
Julien - ping for review
Would you have a dump before the issue to see what's wrong? Without it, it ...
5 years, 10 months ago (2015-01-28 17:29:53 UTC) #7
mstensho (USE GERRIT)
https://codereview.chromium.org/880113002/diff/1/Source/core/layout/LayoutTable.h File Source/core/layout/LayoutTable.h (right): https://codereview.chromium.org/880113002/diff/1/Source/core/layout/LayoutTable.h#newcode125 Source/core/layout/LayoutTable.h:125: virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) override ...
5 years, 10 months ago (2015-01-28 17:51:26 UTC) #8
Julien - ping for review
lgtm The bug has several cases, it seems like we should land them for the ...
5 years, 10 months ago (2015-01-29 10:28:31 UTC) #9
mstensho (USE GERRIT)
Also added one additional interesting test. https://codereview.chromium.org/880113002/diff/1/Source/core/layout/LayoutTable.h File Source/core/layout/LayoutTable.h (right): https://codereview.chromium.org/880113002/diff/1/Source/core/layout/LayoutTable.h#newcode126 Source/core/layout/LayoutTable.h:126: virtual void addChildIgnoringContinuation(RenderObject* ...
5 years, 10 months ago (2015-01-29 12:08:42 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/880113002/60001
5 years, 10 months ago (2015-01-29 12:10:31 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: win_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/win_blink_rel/builds/48301)
5 years, 10 months ago (2015-01-29 13:34:30 UTC) #14
mstensho (USE GERRIT)
https://codereview.chromium.org/880113002/diff/1/Source/core/layout/LayoutTable.h File Source/core/layout/LayoutTable.h (right): https://codereview.chromium.org/880113002/diff/1/Source/core/layout/LayoutTable.h#newcode126 Source/core/layout/LayoutTable.h:126: virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObject* beforeChild = 0) override; ...
5 years, 10 months ago (2015-01-29 17:49:48 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/880113002/80001
5 years, 10 months ago (2015-01-29 17:52:11 UTC) #17
mstensho (USE GERRIT)
https://codereview.chromium.org/880113002/diff/1/Source/core/layout/LayoutTable.h File Source/core/layout/LayoutTable.h (right): https://codereview.chromium.org/880113002/diff/1/Source/core/layout/LayoutTable.h#newcode126 Source/core/layout/LayoutTable.h:126: virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObject* beforeChild = 0) override; ...
5 years, 10 months ago (2015-01-29 18:05:41 UTC) #18
commit-bot: I haz the power
5 years, 10 months ago (2015-01-29 19:03:53 UTC) #19
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=189206

Powered by Google App Engine
This is Rietveld 408576698