- Revision
- 167707
- Author
- commit-qu...@webkit.org
- Date
- 2014-04-23 06:36:30 -0700 (Wed, 23 Apr 2014)
Log Message
[New Multicolumn] fast/multicol/overflow-content.html displays red
https://bugs.webkit.org/show_bug.cgi?id=131809
Patch by Morten Stenshorne <msten...@opera.com> on 2014-04-23
Reviewed by David Hyatt.
Source/WebCore:
Insert a break at end of content on our own in the multicol code, to make sure
that overflow is accounted for, and also to make sure that we account for all
content in non-final sets (i.e. those preceding spanners).
In other words, this will additionally fix balancing issues in sets preceding
a spanner. Added a test for that.
Tests: fast/multicol/break-in-columns-before-spanner.html
fast/multicol/newmulticol/compare-with-old-impl/overflow-content.html
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::regionInRange): Deleted.
* rendering/RenderFlowThread.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::distributeImplicitBreaks):
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::applyBreakAfterContent):
* rendering/RenderNamedFlowThread.h:
LayoutTests:
* fast/multicol/break-in-columns-before-spanner-expected.html: Added.
* fast/multicol/break-in-columns-before-spanner.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/overflow-content-expected.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/overflow-content.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (167706 => 167707)
--- trunk/LayoutTests/ChangeLog 2014-04-23 13:32:56 UTC (rev 167706)
+++ trunk/LayoutTests/ChangeLog 2014-04-23 13:36:30 UTC (rev 167707)
@@ -1,5 +1,17 @@
2014-04-23 Morten Stenshorne <msten...@opera.com>
+ [New Multicolumn] fast/multicol/overflow-content.html displays red
+ https://bugs.webkit.org/show_bug.cgi?id=131809
+
+ Reviewed by David Hyatt.
+
+ * fast/multicol/break-in-columns-before-spanner-expected.html: Added.
+ * fast/multicol/break-in-columns-before-spanner.html: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/overflow-content-expected.html: Added.
+ * fast/multicol/newmulticol/compare-with-old-impl/overflow-content.html: Added.
+
+2014-04-23 Morten Stenshorne <msten...@opera.com>
+
Overflow propagation broken in BTT and RTL writing-modes
https://bugs.webkit.org/show_bug.cgi?id=113781
Added: trunk/LayoutTests/fast/multicol/break-in-columns-before-spanner-expected.html (0 => 167707)
--- trunk/LayoutTests/fast/multicol/break-in-columns-before-spanner-expected.html (rev 0)
+++ trunk/LayoutTests/fast/multicol/break-in-columns-before-spanner-expected.html 2014-04-23 13:36:30 UTC (rev 167707)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<script>
+ if (window.internals)
+ internals.settings.setRegionBasedColumnsEnabled(true);
+</script>
+<p>There should be a blue <em>square</em> below.</p>
+<div style="-webkit-columns:3; columns:3; -webkit-column-gap:0; column-gap:0; column-fill:auto; width:300px; height:200px;">
+
+ <div style="-webkit-column-break-before:always; break-before:column; height:400px; background:blue;"></div>
+</div>
Added: trunk/LayoutTests/fast/multicol/break-in-columns-before-spanner.html (0 => 167707)
--- trunk/LayoutTests/fast/multicol/break-in-columns-before-spanner.html (rev 0)
+++ trunk/LayoutTests/fast/multicol/break-in-columns-before-spanner.html 2014-04-23 13:36:30 UTC (rev 167707)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<script>
+ if (window.internals)
+ internals.settings.setRegionBasedColumnsEnabled(true);
+</script>
+<p>There should be a blue <em>square</em> below.</p>
+<div style="-webkit-columns:3; columns:3; -webkit-column-gap:0; column-gap:0; width:300px;">
+
+ <div style="-webkit-column-break-before:always; break-before:column; height:400px; background:blue;"></div>
+ <div style="-webkit-column-span:all; column-span:all;"> </div>
+</div>
Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/overflow-content-expected.html (0 => 167707)
--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/overflow-content-expected.html (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/overflow-content-expected.html 2014-04-23 13:36:30 UTC (rev 167707)
@@ -0,0 +1,74 @@
+<style>
+ div.test {
+ -webkit-logical-width: 100px;
+ -webkit-border-before: 5px solid;
+ -webkit-border-after: 15px solid;
+ -webkit-column-count: 2;
+ -webkit-column-gap: 0;
+ -webkit-column-fill: auto;
+ column-count: 2;
+ column-gap: 0;
+ column-fill: auto;
+ background-color: lightblue;
+ }
+ div.container {
+ -webkit-logical-height: 120px;
+ background-color: red;
+ -webkit-logical-width: 100px;
+ -webkit-margin-after: 8px;
+ }
+</style>
+<div>
+ <div class="container">
+ <div class="test" style="-webkit-logical-height: 100px;">
+ <div style="-webkit-logical-height: 20px;">
+ <div style="-webkit-logical-height: 300px; background-color: yellow;"></div>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+ <div class="test">
+ <div style="-webkit-logical-height: 20px;">
+ <div style="-webkit-logical-height: 200px; background-color: yellow;"></div>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+ <div class="test">
+ <div style="-webkit-logical-height: 10px;"></div>
+ <div style="-webkit-column-break-before: always; -webkit-logical-height: 10px;">
+ <div style="-webkit-logical-height: 100px; background-color: yellow;"></div>
+ </div>
+ <div style="-webkit-logical-height: 20px;"></div>
+ </div>
+ </div>
+</div>
+<div style="-webkit-writing-mode: vertical-rl;">
+ <div class="container">
+ <div class="test" style="-webkit-logical-height: 100px;">
+ <div style="-webkit-logical-height: 20px;">
+ <div style="-webkit-logical-height: 300px; background-color: yellow;"></div>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+ <div class="test">
+ <div style="-webkit-logical-height: 20px;">
+ <div style="-webkit-logical-height: 200px; background-color: yellow;"></div>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+ <div class="test">
+ <div style="-webkit-logical-height: 10px;"></div>
+ <div style="-webkit-column-break-before: always; -webkit-logical-height: 10px;">
+ <div style="-webkit-logical-height: 100px; background-color: yellow;"></div>
+ </div>
+ <div style="-webkit-logical-height: 20px;"></div>
+ </div>
+ </div>
+</div>
Added: trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/overflow-content.html (0 => 167707)
--- trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/overflow-content.html (rev 0)
+++ trunk/LayoutTests/fast/multicol/newmulticol/compare-with-old-impl/overflow-content.html 2014-04-23 13:36:30 UTC (rev 167707)
@@ -0,0 +1,78 @@
+<script>
+ if (window.internals)
+ internals.settings.setRegionBasedColumnsEnabled(true);
+</script>
+<style>
+ div.test {
+ -webkit-logical-width: 100px;
+ -webkit-border-before: 5px solid;
+ -webkit-border-after: 15px solid;
+ -webkit-column-count: 2;
+ -webkit-column-gap: 0;
+ -webkit-column-fill: auto;
+ column-count: 2;
+ column-gap: 0;
+ column-fill: auto;
+ background-color: lightblue;
+ }
+ div.container {
+ -webkit-logical-height: 120px;
+ background-color: red;
+ -webkit-logical-width: 100px;
+ -webkit-margin-after: 8px;
+ }
+</style>
+<div>
+ <div class="container">
+ <div class="test" style="-webkit-logical-height: 100px;">
+ <div style="-webkit-logical-height: 20px;">
+ <div style="-webkit-logical-height: 300px; background-color: yellow;"></div>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+ <div class="test">
+ <div style="-webkit-logical-height: 20px;">
+ <div style="-webkit-logical-height: 200px; background-color: yellow;"></div>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+ <div class="test">
+ <div style="-webkit-logical-height: 10px;"></div>
+ <div style="-webkit-column-break-before: always; -webkit-logical-height: 10px;">
+ <div style="-webkit-logical-height: 100px; background-color: yellow;"></div>
+ </div>
+ <div style="-webkit-logical-height: 20px;"></div>
+ </div>
+ </div>
+</div>
+<div style="-webkit-writing-mode: vertical-rl;">
+ <div class="container">
+ <div class="test" style="-webkit-logical-height: 100px;">
+ <div style="-webkit-logical-height: 20px;">
+ <div style="-webkit-logical-height: 300px; background-color: yellow;"></div>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+ <div class="test">
+ <div style="-webkit-logical-height: 20px;">
+ <div style="-webkit-logical-height: 200px; background-color: yellow;"></div>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+ <div class="test">
+ <div style="-webkit-logical-height: 10px;"></div>
+ <div style="-webkit-column-break-before: always; -webkit-logical-height: 10px;">
+ <div style="-webkit-logical-height: 100px; background-color: yellow;"></div>
+ </div>
+ <div style="-webkit-logical-height: 20px;"></div>
+ </div>
+ </div>
+</div>
Modified: trunk/Source/WebCore/ChangeLog (167706 => 167707)
--- trunk/Source/WebCore/ChangeLog 2014-04-23 13:32:56 UTC (rev 167706)
+++ trunk/Source/WebCore/ChangeLog 2014-04-23 13:36:30 UTC (rev 167707)
@@ -1,5 +1,31 @@
2014-04-23 Morten Stenshorne <msten...@opera.com>
+ [New Multicolumn] fast/multicol/overflow-content.html displays red
+ https://bugs.webkit.org/show_bug.cgi?id=131809
+
+ Reviewed by David Hyatt.
+
+ Insert a break at end of content on our own in the multicol code, to make sure
+ that overflow is accounted for, and also to make sure that we account for all
+ content in non-final sets (i.e. those preceding spanners).
+
+ In other words, this will additionally fix balancing issues in sets preceding
+ a spanner. Added a test for that.
+
+ Tests: fast/multicol/break-in-columns-before-spanner.html
+ fast/multicol/newmulticol/compare-with-old-impl/overflow-content.html
+
+ * rendering/RenderFlowThread.cpp:
+ (WebCore::RenderFlowThread::regionInRange): Deleted.
+ * rendering/RenderFlowThread.h:
+ * rendering/RenderMultiColumnSet.cpp:
+ (WebCore::RenderMultiColumnSet::distributeImplicitBreaks):
+ * rendering/RenderNamedFlowThread.cpp:
+ (WebCore::RenderNamedFlowThread::applyBreakAfterContent):
+ * rendering/RenderNamedFlowThread.h:
+
+2014-04-23 Morten Stenshorne <msten...@opera.com>
+
Overflow propagation broken in BTT and RTL writing-modes
https://bugs.webkit.org/show_bug.cgi?id=113781
Modified: trunk/Source/WebCore/rendering/RenderFlowThread.cpp (167706 => 167707)
--- trunk/Source/WebCore/rendering/RenderFlowThread.cpp 2014-04-23 13:32:56 UTC (rev 167706)
+++ trunk/Source/WebCore/rendering/RenderFlowThread.cpp 2014-04-23 13:36:30 UTC (rev 167707)
@@ -789,13 +789,6 @@
return false;
}
-void RenderFlowThread::applyBreakAfterContent(LayoutUnit clientHeight)
-{
- // Simulate a region break at height. If it points inside an auto logical height region,
- // then it may determine the region computed autoheight.
- addForcedRegionBreak(this, clientHeight, this, false);
-}
-
bool RenderFlowThread::regionInRange(const RenderRegion* targetRegion, const RenderRegion* startRegion, const RenderRegion* endRegion) const
{
ASSERT(targetRegion);
Modified: trunk/Source/WebCore/rendering/RenderFlowThread.h (167706 => 167707)
--- trunk/Source/WebCore/rendering/RenderFlowThread.h 2014-04-23 13:32:56 UTC (rev 167706)
+++ trunk/Source/WebCore/rendering/RenderFlowThread.h 2014-04-23 13:36:30 UTC (rev 167707)
@@ -147,7 +147,7 @@
void markRegionsForOverflowLayoutIfNeeded();
virtual bool addForcedRegionBreak(const RenderBlock*, LayoutUnit, RenderBox* breakChild, bool isBefore, LayoutUnit* offsetBreakAdjustment = 0);
- void applyBreakAfterContent(LayoutUnit);
+ virtual void applyBreakAfterContent(LayoutUnit) { }
virtual bool isPageLogicalHeightKnown() const { return true; }
bool pageLogicalSizeChanged() const { return m_pageLogicalSizeChanged; }
Modified: trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp (167706 => 167707)
--- trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp 2014-04-23 13:32:56 UTC (rev 167706)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp 2014-04-23 13:36:30 UTC (rev 167707)
@@ -191,20 +191,16 @@
void RenderMultiColumnSet::distributeImplicitBreaks()
{
- unsigned breakCount = forcedBreaksCount();
-
#ifndef NDEBUG
// There should be no implicit breaks assumed at this point.
- for (unsigned i = 0; i < breakCount; i++)
+ for (unsigned i = 0; i < forcedBreaksCount(); i++)
ASSERT(!m_contentRuns[i].assumedImplicitBreaks());
#endif // NDEBUG
- if (!breakCount) {
- // The flow thread would normally insert a forced break at end of content, but if this set
- // isn't last in the multicol container, we have to do it ourselves.
- addForcedBreak(logicalBottomInFlowThread());
- breakCount = 1;
- }
+ // Insert a final content run to encompass all content. This will include overflow if this is
+ // the last set.
+ addForcedBreak(logicalBottomInFlowThread());
+ unsigned breakCount = forcedBreaksCount();
// If there is room for more breaks (to reach the used value of column-count), imagine that we
// insert implicit breaks at suitable locations. At any given time, the content run with the
Modified: trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp (167706 => 167707)
--- trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp 2014-04-23 13:32:56 UTC (rev 167706)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp 2014-04-23 13:36:30 UTC (rev 167707)
@@ -796,6 +796,13 @@
}
}
+void RenderNamedFlowThread::applyBreakAfterContent(LayoutUnit clientHeight)
+{
+ // Simulate a region break at height. If it points inside an auto logical height region,
+ // then it may determine the region computed autoheight.
+ addForcedRegionBreak(this, clientHeight, this, false);
+}
+
bool RenderNamedFlowThread::collectsGraphicsLayersUnderRegions() const
{
// We only need to map layers to regions for named flow threads.
Modified: trunk/Source/WebCore/rendering/RenderNamedFlowThread.h (167706 => 167707)
--- trunk/Source/WebCore/rendering/RenderNamedFlowThread.h 2014-04-23 13:32:56 UTC (rev 167706)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowThread.h 2014-04-23 13:36:30 UTC (rev 167707)
@@ -81,6 +81,8 @@
bool isMarkedForDestruction() const;
void getRanges(Vector<RefPtr<Range>>&, const RenderNamedFlowFragment*) const;
+ virtual void applyBreakAfterContent(LayoutUnit) override final;
+
virtual bool collectsGraphicsLayersUnderRegions() const override;
// Check if the content is flown into at least a region with region styling rules.