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

Issue 129873004: RenderBlock::isSelfCollapsingBlock() should only be used when an object does not require layout. (Closed)

Created:
6 years, 11 months ago by rhogan
Modified:
6 years, 10 months ago
Reviewers:
pdr., esprehn, ojan
CC:
blink-reviews, bemjb+rendering_chromium.org, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, zoltan1
Visibility:
Public.

Description

RenderBlock::isSelfCollapsingBlock() should only be used when an object does not require layout. |isSelfCollapsingBlock| should only be called on an object after it has had layout. In order to enforce this with an ASSERT I had to account for a couple of things I hadn't previously considered: - In a couple of places we look at the previous child sibling and check whether it's selfCollapsing. When we do that we need to be sure that it's a normal flow block we're looking at. - Placeholder elements are not laid out until the dimensions of their parent text control are known, so they don't get layout until their parent has had layout - this is unique in the layout tree and unfortunately when we call isSelfCollapsingBlock on them we find that they still need layout. Since placeholder elements only exist when they have content we can enforce the rule that they are never self-collapsing. - When we are in partial layout and have entered layoutBlockChildren to layout one or more children we should return early when we are done. The current behaviour, which ignores the rest of the children and then adjusts the height of the parent block with the current margin information, is unnecessary and likely to be wrong. BUG= Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=165099

Patch Set 1 #

Patch Set 2 : Updated #

Patch Set 3 : Update #

Patch Set 4 : Updated #

Patch Set 5 : Updated #

Patch Set 6 : Update #

Total comments: 5

Patch Set 7 : Updated #

Patch Set 8 : Update #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -45 lines) Patch
M Source/core/core.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderBlock.cpp View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderBlockFlow.h View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderBlockFlow.cpp View 1 2 3 5 chunks +14 lines, -12 lines 0 comments Download
M Source/core/rendering/RenderObject.cpp View 1 2 3 4 5 2 chunks +4 lines, -0 lines 1 comment Download
A + Source/core/rendering/RenderTextControlPlaceholder.h View 1 2 3 4 5 6 7 2 chunks +13 lines, -21 lines 0 comments Download
A + Source/core/rendering/RenderTextControlPlaceholder.cpp View 1 2 3 4 5 2 chunks +8 lines, -8 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
ojan
pdr, can you look at the partialLayout change? https://codereview.chromium.org/129873004/diff/200001/Source/core/rendering/RenderBlockFlow.cpp File Source/core/rendering/RenderBlockFlow.cpp (right): https://codereview.chromium.org/129873004/diff/200001/Source/core/rendering/RenderBlockFlow.cpp#newcode1012 Source/core/rendering/RenderBlockFlow.cpp:1012: RenderBlockFlow* ...
6 years, 11 months ago (2014-01-14 00:34:18 UTC) #1
pdr.
On 2014/01/14 00:34:18, ojan wrote: > pdr, can you look at the partialLayout change? The ...
6 years, 11 months ago (2014-01-14 00:50:29 UTC) #2
rhogan
https://codereview.chromium.org/129873004/diff/200001/Source/core/rendering/RenderBlockFlow.cpp File Source/core/rendering/RenderBlockFlow.cpp (right): https://codereview.chromium.org/129873004/diff/200001/Source/core/rendering/RenderBlockFlow.cpp#newcode1012 Source/core/rendering/RenderBlockFlow.cpp:1012: RenderBlockFlow* previousBlockFlow = prev && prev->isRenderBlockFlow() && !prev->isFloatingOrOutOfFlowPositioned() ? ...
6 years, 11 months ago (2014-01-14 19:23:01 UTC) #3
rhogan
On 2014/01/14 19:23:01, rhogan wrote: > https://codereview.chromium.org/129873004/diff/200001/Source/core/rendering/RenderBlockFlow.cpp > File Source/core/rendering/RenderBlockFlow.cpp (right): > > https://codereview.chromium.org/129873004/diff/200001/Source/core/rendering/RenderBlockFlow.cpp#newcode1012 > ...
6 years, 11 months ago (2014-01-14 19:29:15 UTC) #4
ojan
lgtm
6 years, 11 months ago (2014-01-14 21:58:14 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/robhogan@gmail.com/129873004/380001
6 years, 11 months ago (2014-01-14 22:00:16 UTC) #6
commit-bot: I haz the power
Change committed as 165099
6 years, 11 months ago (2014-01-14 23:48:40 UTC) #7
ojan
6 years, 10 months ago (2014-01-28 23:59:47 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/129873004/diff/380001/Source/core/rendering/R...
File Source/core/rendering/RenderObject.cpp (right):

https://codereview.chromium.org/129873004/diff/380001/Source/core/rendering/R...
Source/core/rendering/RenderObject.cpp:165: if (element->shadowPseudoId() ==
"-webkit-input-placeholder")
esprehn nagged me that we really shouldn't be adding special-cases like this if
we can at all avoid them. I think we should revert this part of the patch, which
I realize means putting back in the FIXME in
RenderBlock::isSelfCollapsingBlock().

Powered by Google App Engine
This is Rietveld 408576698