Commit 1c9b66ff authored by mstensho's avatar mstensho Committed by Commit bot

A column-span:all element should always establish a new formatting context.

This also applies when the element isn't contained by a multicol container
(which means that we shouldn't require the spanner placeholder to be present).

BUG=709362

Review-Url: https://codereview.chromium.org/2799363003
Cr-Commit-Position: refs/heads/master@{#462865}
parent 825abe65
<!DOCTYPE html>
<p>There should be a green square below.</p>
<div style="position:relative;">
<div style="float:left; width:50px; height:100px; background:green;"></div>
<div id="invalidSpanner" style="column-span:all; width:50px; background:green;">
<div style="float:left; width:50px; height:100px;"></div>
</div>
</div>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script>
test(function() {
var invalidSpanner = document.getElementById("invalidSpanner");
// It should not overlap with floats in the same block formatting
// context.
assert_equals(invalidSpanner.offsetLeft, 50);
// It should establish a new block formatting context, so that it
// stretches to contain all floats inside.
assert_equals(invalidSpanner.offsetHeight, 100);
}, "Column spanner without ancestor multicol");
</script>
...@@ -559,7 +559,8 @@ bool LayoutBlock::createsNewFormattingContext() const { ...@@ -559,7 +559,8 @@ bool LayoutBlock::createsNewFormattingContext() const {
hasOverflowClip() || isFlexItemIncludingDeprecated() || hasOverflowClip() || isFlexItemIncludingDeprecated() ||
style()->specifiesColumns() || isLayoutFlowThread() || isTableCell() || style()->specifiesColumns() || isLayoutFlowThread() || isTableCell() ||
isTableCaption() || isFieldset() || isWritingModeRoot() || isTableCaption() || isFieldset() || isWritingModeRoot() ||
isDocumentElement() || isColumnSpanAll() || isGridItem() || isDocumentElement() || isGridItem() ||
style()->getColumnSpan() == ColumnSpanAll ||
style()->containsPaint() || style()->containsLayout() || style()->containsPaint() || style()->containsLayout() ||
isSVGForeignObject() || style()->display() == EDisplay::kFlowRoot; isSVGForeignObject() || style()->display() == EDisplay::kFlowRoot;
} }
......
...@@ -4761,6 +4761,7 @@ bool LayoutBox::avoidsFloats() const { ...@@ -4761,6 +4761,7 @@ bool LayoutBox::avoidsFloats() const {
// crbug.com/460704: This should be merged with createsNewFormattingContext(). // crbug.com/460704: This should be merged with createsNewFormattingContext().
return shouldBeConsideredAsReplaced() || hasOverflowClip() || isHR() || return shouldBeConsideredAsReplaced() || hasOverflowClip() || isHR() ||
isLegend() || isWritingModeRoot() || isFlexItemIncludingDeprecated() || isLegend() || isWritingModeRoot() || isFlexItemIncludingDeprecated() ||
style()->getColumnSpan() == ColumnSpanAll ||
style()->containsPaint() || style()->containsLayout() || style()->containsPaint() || style()->containsLayout() ||
style()->display() == EDisplay::kFlowRoot; style()->display() == EDisplay::kFlowRoot;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment