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:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121728
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-07-02 Dan Bernstein <mitz@apple.com>
+
+ 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 <yosin@chromium.org>
Build fix for Chromium
--- /dev/null
+<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>
--- /dev/null
+<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>
+2012-07-02 Dan Bernstein <mitz@apple.com>
+
+ 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 <chris.guan@torchmobile.com.cn>
[BlackBerry] Refactor : move the implementation of getMIMETypeForExtension and getPreferredExtensionForMIMEType into BlackBerry platform
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();
// 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) {
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;
}