Title: [121728] trunk
- Revision
- 121728
- Author
- [email protected]
- Date
- 2012-07-02 21:08:04 -0700 (Mon, 02 Jul 2012)
Log Message
Column height and count calculation ignores most overflow
https://bugs.webkit.org/show_bug.cgi?id=90392
Reviewed by Dean Jackson.
Source/WebCore:
Test: fast/multicol/overflow-content.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::relayoutForPagination): Changed to compute the overflow from children
and use the layout overflow height rather the content height.
LayoutTests:
* fast/multicol/overflow-content-expected.html: Added.
* fast/multicol/overflow-content.html: Added.
* fast/multicol/vertical-rl/rules-with-border-before-expected.png:
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (121727 => 121728)
--- trunk/LayoutTests/ChangeLog 2012-07-03 03:43:19 UTC (rev 121727)
+++ trunk/LayoutTests/ChangeLog 2012-07-03 04:08:04 UTC (rev 121728)
@@ -1,3 +1,14 @@
+2012-07-02 Dan Bernstein <[email protected]>
+
+ Column height and count calculation ignores most overflow
+ https://bugs.webkit.org/show_bug.cgi?id=90392
+
+ Reviewed by Dean Jackson.
+
+ * fast/multicol/overflow-content-expected.html: Added.
+ * fast/multicol/overflow-content.html: Added.
+ * fast/multicol/vertical-rl/rules-with-border-before-expected.png:
+
2012-07-02 Yoshifumi Inoue <[email protected]>
Build fix for Chromium
Added: trunk/LayoutTests/fast/multicol/overflow-content-expected.html (0 => 121728)
--- trunk/LayoutTests/fast/multicol/overflow-content-expected.html (rev 0)
+++ trunk/LayoutTests/fast/multicol/overflow-content-expected.html 2012-07-03 04:08:04 UTC (rev 121728)
@@ -0,0 +1,70 @@
+<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;
+ 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>
+ <div style="-webkit-logical-height: 300px; background-color: yellow;"></div>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+ <div class="test">
+ <div>
+ <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;">
+ <div style="-webkit-logical-height: 100px; background-color: yellow;"></div>
+ </div>
+ <div></div>
+ </div>
+ </div>
+</div>
+<div style="-webkit-writing-mode: vertical-rl;">
+ <div class="container">
+ <div class="test" style="-webkit-logical-height: 100px;">
+ <div>
+ <div style="-webkit-logical-height: 300px; background-color: yellow;"></div>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+ <div class="test">
+ <div>
+ <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;">
+ <div style="-webkit-logical-height: 100px; background-color: yellow;"></div>
+ </div>
+ <div></div>
+ </div>
+ </div>
+</div>
Added: trunk/LayoutTests/fast/multicol/overflow-content.html (0 => 121728)
--- trunk/LayoutTests/fast/multicol/overflow-content.html (rev 0)
+++ trunk/LayoutTests/fast/multicol/overflow-content.html 2012-07-03 04:08:04 UTC (rev 121728)
@@ -0,0 +1,70 @@
+<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;
+ 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/LayoutTests/fast/multicol/vertical-rl/rules-with-border-before-expected.png
(Binary files differ)
Modified: trunk/Source/WebCore/ChangeLog (121727 => 121728)
--- trunk/Source/WebCore/ChangeLog 2012-07-03 03:43:19 UTC (rev 121727)
+++ trunk/Source/WebCore/ChangeLog 2012-07-03 04:08:04 UTC (rev 121728)
@@ -1,3 +1,16 @@
+2012-07-02 Dan Bernstein <[email protected]>
+
+ Column height and count calculation ignores most overflow
+ https://bugs.webkit.org/show_bug.cgi?id=90392
+
+ Reviewed by Dean Jackson.
+
+ Test: fast/multicol/overflow-content.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::relayoutForPagination): Changed to compute the overflow from children
+ and use the layout overflow height rather the content height.
+
2012-07-02 Chris Guan <[email protected]>
[BlackBerry] Refactor : move the implementation of getMIMETypeForExtension and getPreferredExtensionForMIMEType into BlackBerry platform
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (121727 => 121728)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2012-07-03 03:43:19 UTC (rev 121727)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2012-07-03 04:08:04 UTC (rev 121728)
@@ -5083,6 +5083,13 @@
if (!hasColumns())
return false;
+ OwnPtr<RenderOverflow> savedOverflow = m_overflow.release();
+ if (childrenInline())
+ addOverflowFromInlineChildren();
+ else
+ addOverflowFromBlockChildren();
+ LayoutUnit layoutOverflowLogicalBottom = (isHorizontalWritingMode() ? layoutOverflowRect().maxY() : layoutOverflowRect().maxX()) - borderBefore() - paddingBefore();
+
// FIXME: We don't balance properly at all in the presence of forced page breaks. We need to understand what
// the distance between forced page breaks is so that we can avoid making the minimum column height too tall.
ColumnInfo* colInfo = columnInfo();
@@ -5095,12 +5102,12 @@
// maximum page break distance.
if (!pageLogicalHeight) {
LayoutUnit distanceBetweenBreaks = max<LayoutUnit>(colInfo->maximumDistanceBetweenForcedBreaks(),
- view()->layoutState()->pageLogicalOffset(this, borderBefore() + paddingBefore() + contentLogicalHeight()) - colInfo->forcedBreakOffset());
+ view()->layoutState()->pageLogicalOffset(this, borderBefore() + paddingBefore() + layoutOverflowLogicalBottom) - colInfo->forcedBreakOffset());
columnHeight = max(colInfo->minimumColumnHeight(), distanceBetweenBreaks);
}
- } else if (contentLogicalHeight() > boundedMultiply(pageLogicalHeight, desiredColumnCount)) {
+ } else if (layoutOverflowLogicalBottom > boundedMultiply(pageLogicalHeight, desiredColumnCount)) {
// Now that we know the intrinsic height of the columns, we have to rebalance them.
- columnHeight = max<LayoutUnit>(colInfo->minimumColumnHeight(), ceilf((float)contentLogicalHeight() / desiredColumnCount));
+ columnHeight = max<LayoutUnit>(colInfo->minimumColumnHeight(), ceilf((float)layoutOverflowLogicalBottom / desiredColumnCount));
}
if (columnHeight && columnHeight != pageLogicalHeight) {
@@ -5110,14 +5117,15 @@
return true;
}
}
-
+
if (pageLogicalHeight)
- colInfo->setColumnCountAndHeight(ceilf((float)contentLogicalHeight() / pageLogicalHeight), pageLogicalHeight);
+ colInfo->setColumnCountAndHeight(ceilf((float)layoutOverflowLogicalBottom / pageLogicalHeight), pageLogicalHeight);
if (columnCount(colInfo)) {
setLogicalHeight(borderBefore() + paddingBefore() + colInfo->columnHeight() + borderAfter() + paddingAfter() + scrollbarLogicalHeight());
m_overflow.clear();
- }
+ } else
+ m_overflow = savedOverflow.release();
return false;
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes