Title: [145736] trunk
- Revision
- 145736
- Author
- t...@chromium.org
- Date
- 2013-03-13 12:28:59 -0700 (Wed, 13 Mar 2013)
Log Message
Regression(r143542): -webkit-align-items: center with overflow: auto/scroll has extra bottom padding
https://bugs.webkit.org/show_bug.cgi?id=112047
Reviewed by Ojan Vafai.
Source/WebCore:
Add a new pass for computing the client bottom edge that runs after we've repositioned children
due to wrap-reverse, flex-end or vertical centering.
Test: css3/flexbox/negative-overflow.html
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock): Remove the code to use clientLogicalBottom() that was computed before
repositioning. The repositioning can change the edge.
(WebCore::RenderFlexibleBox::clientLogicalBottomAfterRepositioning): Compute the new bottom based on the final position
of flex items.
* rendering/RenderFlexibleBox.h:
(RenderFlexibleBox):
LayoutTests:
* css3/flexbox/negative-overflow-expected.txt: Added.
* css3/flexbox/negative-overflow.html: Added.
* resources/check-layout.js: Add attributes for checking scroll width and scroll height.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (145735 => 145736)
--- trunk/LayoutTests/ChangeLog 2013-03-13 19:14:31 UTC (rev 145735)
+++ trunk/LayoutTests/ChangeLog 2013-03-13 19:28:59 UTC (rev 145736)
@@ -1,3 +1,14 @@
+2013-03-13 Tony Chang <t...@chromium.org>
+
+ Regression(r143542): -webkit-align-items: center with overflow: auto/scroll has extra bottom padding
+ https://bugs.webkit.org/show_bug.cgi?id=112047
+
+ Reviewed by Ojan Vafai.
+
+ * css3/flexbox/negative-overflow-expected.txt: Added.
+ * css3/flexbox/negative-overflow.html: Added.
+ * resources/check-layout.js: Add attributes for checking scroll width and scroll height.
+
2013-03-13 Nate Chapin <jap...@chromium.org>
Test for https://bugs.webkit.org/show_bug.cgi?id=112194.
Added: trunk/LayoutTests/css3/flexbox/negative-overflow-expected.txt (0 => 145736)
--- trunk/LayoutTests/css3/flexbox/negative-overflow-expected.txt (rev 0)
+++ trunk/LayoutTests/css3/flexbox/negative-overflow-expected.txt 2013-03-13 19:28:59 UTC (rev 145736)
@@ -0,0 +1,8 @@
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
Added: trunk/LayoutTests/css3/flexbox/negative-overflow.html (0 => 145736)
--- trunk/LayoutTests/css3/flexbox/negative-overflow.html (rev 0)
+++ trunk/LayoutTests/css3/flexbox/negative-overflow.html 2013-03-13 19:28:59 UTC (rev 145736)
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="" rel="stylesheet">
+<style>
+.flexbox {
+ overflow: auto;
+ height: 50px;
+ width: 50px;
+ background-color: red;
+}
+
+.vertical-padding {
+ padding-top: 5px;
+ padding-bottom: 10px;
+ background-color: lime;
+}
+
+.flexbox > div {
+ width: 100%;
+ height: 100px;
+ background-color: green;
+}
+</style>
+<script src=""
+<script>
+window._onload_ = function() {
+ checkLayout('.flexbox');
+
+ // Make failures more obvious by showing the red background that should have been clipped.
+ Array.prototype.forEach.call(document.querySelectorAll(".flexbox"), function(element) {
+ element.scrollTop = 1000;
+ });
+};
+</script>
+</head>
+<body>
+
+<div class="flexbox align-items-flex-end" data-expected-scroll-height="50">
+ <div></div>
+</div>
+
+<div class="flexbox align-items-center" data-expected-scroll-height="75">
+ <div></div>
+</div>
+
+<div class="flexbox" data-expected-scroll-height="100">
+ <div></div>
+</div>
+
+<div class="flexbox wrap-reverse" data-expected-scroll-height="50">
+ <div></div>
+ <div></div>
+</div>
+
+<div class="flexbox align-items-flex-end vertical-padding" data-expected-scroll-height="65">
+ <div></div>
+</div>
+
+<div class="flexbox align-items-center vertical-padding" data-expected-scroll-height="80">
+ <div></div>
+</div>
+
+<div class="flexbox vertical-padding" data-expected-scroll-height="105">
+ <div></div>
+</div>
+
+<div class="flexbox wrap-reverse vertical-padding" data-expected-scroll-height="65">
+ <div></div>
+ <div></div>
+</div>
+</body>
+</html>
Modified: trunk/LayoutTests/resources/check-layout.js (145735 => 145736)
--- trunk/LayoutTests/resources/check-layout.js 2013-03-13 19:14:31 UTC (rev 145735)
+++ trunk/LayoutTests/resources/check-layout.js 2013-03-13 19:28:59 UTC (rev 145736)
@@ -62,6 +62,18 @@
failures.push("Expected " + expectedHeight + " for clientHeight, but got " + node.clientHeight + ". ");
}
+ var expectedWidth = node.getAttribute && node.getAttribute("data-expected-scroll-width");
+ if (expectedWidth) {
+ if (node.scrollWidth != parseInt(expectedWidth))
+ failures.push("Expected " + expectedWidth + " for scrollWidth, but got " + node.scrollWidth + ". ");
+ }
+
+ var expectedHeight = node.getAttribute && node.getAttribute("data-expected-scroll-height");
+ if (expectedHeight) {
+ if (node.scrollHeight != parseInt(expectedHeight))
+ failures.push("Expected " + expectedHeight + " for scrollHeight, but got " + node.scrollHeight + ". ");
+ }
+
var expectedOffset = node.getAttribute && node.getAttribute("data-total-x");
if (expectedOffset) {
var totalLeft = node.clientLeft + node.offsetLeft;
Modified: trunk/Source/WebCore/ChangeLog (145735 => 145736)
--- trunk/Source/WebCore/ChangeLog 2013-03-13 19:14:31 UTC (rev 145735)
+++ trunk/Source/WebCore/ChangeLog 2013-03-13 19:28:59 UTC (rev 145736)
@@ -1,3 +1,23 @@
+2013-03-13 Tony Chang <t...@chromium.org>
+
+ Regression(r143542): -webkit-align-items: center with overflow: auto/scroll has extra bottom padding
+ https://bugs.webkit.org/show_bug.cgi?id=112047
+
+ Reviewed by Ojan Vafai.
+
+ Add a new pass for computing the client bottom edge that runs after we've repositioned children
+ due to wrap-reverse, flex-end or vertical centering.
+
+ Test: css3/flexbox/negative-overflow.html
+
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::layoutBlock): Remove the code to use clientLogicalBottom() that was computed before
+ repositioning. The repositioning can change the edge.
+ (WebCore::RenderFlexibleBox::clientLogicalBottomAfterRepositioning): Compute the new bottom based on the final position
+ of flex items.
+ * rendering/RenderFlexibleBox.h:
+ (RenderFlexibleBox):
+
2013-03-13 Nate Chapin <jap...@chromium.org>
REGRESSION(r137607): Redirecting a post to a get then reloading triggers resubmit warning
Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (145735 => 145736)
--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp 2013-03-13 19:14:31 UTC (rev 145735)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp 2013-03-13 19:28:59 UTC (rev 145736)
@@ -355,7 +355,6 @@
appendChildFrameRects(oldChildRects);
layoutFlexItems(relayoutChildren, lineContexts);
- LayoutUnit oldClientAfterEdge = clientLogicalBottom();
updateLogicalHeight();
repositionLogicalHeightDependentFlexItems(lineContexts);
@@ -370,7 +369,7 @@
repaintChildrenDuringLayoutIfMoved(oldChildRects);
// FIXME: css3/flexbox/repaint-rtl-column.html seems to repaint more overflow than it needs to.
- computeOverflow(oldClientAfterEdge);
+ computeOverflow(clientLogicalBottomAfterRepositioning());
statePusher.pop();
updateLayerTransform();
@@ -435,6 +434,18 @@
flipForRightToLeftColumn();
}
+LayoutUnit RenderFlexibleBox::clientLogicalBottomAfterRepositioning()
+{
+ LayoutUnit maxChildLogicalBottom = 0;
+ for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
+ if (child->isOutOfFlowPositioned())
+ continue;
+ LayoutUnit childLogicalBottom = logicalTopForChild(child) + logicalHeightForChild(child) + marginAfterForChild(child);
+ maxChildLogicalBottom = std::max(maxChildLogicalBottom, childLogicalBottom);
+ }
+ return std::max(clientLogicalBottom(), maxChildLogicalBottom);
+}
+
bool RenderFlexibleBox::hasOrthogonalFlow(RenderBox* child) const
{
// FIXME: If the child is a flexbox, then we need to check isHorizontalFlow.
Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.h (145735 => 145736)
--- trunk/Source/WebCore/rendering/RenderFlexibleBox.h 2013-03-13 19:14:31 UTC (rev 145735)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.h 2013-03-13 19:28:59 UTC (rev 145736)
@@ -146,6 +146,7 @@
bool hasAutoMarginsInCrossAxis(RenderBox* child) const;
bool updateAutoMarginsInCrossAxis(RenderBox* child, LayoutUnit availableAlignmentSpace);
void repositionLogicalHeightDependentFlexItems(Vector<LineContext>&);
+ LayoutUnit clientLogicalBottomAfterRepositioning();
void appendChildFrameRects(ChildFrameRects&);
void repaintChildrenDuringLayoutIfMoved(const ChildFrameRects&);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes