Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1194)

Unified Diff: Source/core/rendering/RenderFlexibleBox.cpp

Issue 439063002: flexbox: incorrect flexbox height with overflow:auto on flex item (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/css3/flexbox/flexbox-height-with-overflow-auto-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderFlexibleBox.cpp
diff --git a/Source/core/rendering/RenderFlexibleBox.cpp b/Source/core/rendering/RenderFlexibleBox.cpp
index c00acbefc313719cac27c313e843e82d5934b162..ddbc258b1d77c93d1527420b15a248fc4ad14588 100644
--- a/Source/core/rendering/RenderFlexibleBox.cpp
+++ b/Source/core/rendering/RenderFlexibleBox.cpp
@@ -1104,6 +1104,7 @@ void RenderFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, cons
updateAutoMarginsInMainAxis(child, autoMarginOffset);
LayoutUnit childCrossAxisMarginBoxExtent;
+ LayoutUnit crossAxisScrollbarExtentForChild = !isColumnFlow() ? child->scrollbarLogicalHeight() : child->instrinsicScrollbarLogicalWidth();
cbiesinger 2014/08/07 02:57:01 I'd really prefer you to flip the ?: around so you
harpreet.sk 2014/08/07 12:46:39 Modified the solution to use isHorizontalFlow and
if (alignmentForChild(child) == ItemPositionBaseline && !hasAutoMarginsInCrossAxis(child)) {
LayoutUnit ascent = marginBoxAscentForChild(child);
LayoutUnit descent = (crossAxisMarginExtentForChild(child) + crossAxisExtentForChild(child)) - ascent;
@@ -1111,9 +1112,9 @@ void RenderFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, cons
maxAscent = std::max(maxAscent, ascent);
maxDescent = std::max(maxDescent, descent);
- childCrossAxisMarginBoxExtent = maxAscent + maxDescent;
+ childCrossAxisMarginBoxExtent = maxAscent + maxDescent + crossAxisScrollbarExtentForChild;
tony 2014/08/06 16:47:22 I don't see any align-item baseline test cases tha
harpreet.sk 2014/08/07 12:46:39 Actually we should not add crossAxisScrollbarExten
} else {
- childCrossAxisMarginBoxExtent = crossAxisIntrinsicExtentForChild(child) + crossAxisMarginExtentForChild(child);
+ childCrossAxisMarginBoxExtent = crossAxisIntrinsicExtentForChild(child) + crossAxisMarginExtentForChild(child) + crossAxisScrollbarExtentForChild;
}
if (!isColumnFlow())
setLogicalHeight(std::max(logicalHeight(), crossAxisOffset + flowAwareBorderAfter() + flowAwarePaddingAfter() + childCrossAxisMarginBoxExtent + crossAxisScrollbarExtent()));
« no previous file with comments | « LayoutTests/css3/flexbox/flexbox-height-with-overflow-auto-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698