Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
| index ecc2c5f603b3f702b735d680bb7c5d9a35b678e4..72befd142163eec50660fc0a61a10d627f923bf8 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
| @@ -1007,7 +1007,7 @@ bool LayoutBlock::createsNewFormattingContext() const |
| { |
| return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated() |
| || style()->specifiesColumns() || isLayoutFlowThread() || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() |
| - || isDocumentElement() || isColumnSpanAll() || isGridItem() || style()->containsPaint(); |
| + || isDocumentElement() || isColumnSpanAll() || isGridItem() || style()->containsPaint() || style()->containsLayout(); |
| } |
| void LayoutBlock::updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, LayoutBox& child) |
| @@ -1957,6 +1957,10 @@ int LayoutBlock::columnGap() const |
| void LayoutBlock::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const |
| { |
| + // Layout-contained elements don't consider their contents for preferred sizing. |
| + if (style()->containsLayout()) |
| + return; |
| + |
| if (childrenInline()) { |
| // FIXME: Remove this const_cast. |
| toLayoutBlockFlow(const_cast<LayoutBlock*>(this))->computeInlinePreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); |
| @@ -2237,8 +2241,11 @@ int LayoutBlock::inlineBlockBaseline(LineDirectionMode lineDirection) const |
| // either no in-flow line boxes or if its 'overflow' property has a computed |
| // value other than 'visible', in which case the baseline is the bottom |
| // margin edge. |
| + // We likewise avoid using the last line box in the case of layout containment, |
| + // where the block's contents shouldn't be considered when laying out its |
| + // ancestors or siblings. |
| - if (!style()->isOverflowVisible() && !shouldIgnoreOverflowPropertyForInlineBlockBaseline()) { |
| + if ((!style()->isOverflowVisible() && !shouldIgnoreOverflowPropertyForInlineBlockBaseline()) || style()->containsLayout()) { |
|
ojan
2015/12/18 18:21:14
I think this is the right behavior, although I'm n
leviw_travelin_and_unemployed
2016/01/12 19:36:31
I did add some info to the above comment to try an
|
| // We are not calling LayoutBox::baselinePosition here because the caller should add the margin-top/margin-right, not us. |
| return lineDirection == HorizontalLine ? size().height() + marginBottom() : size().width() + marginLeft(); |
| } |