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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 1876123002: Absolute positioned child with percent should include containing block padding (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add commit message Created 4 years, 8 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
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 1731bfdc8fb11f2106df08cf8099ecb01905d4c0..b3b7ca8190e4d48a47442fa5ee67b84ea5b0479b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1606,6 +1606,21 @@ LayoutUnit LayoutBox::shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStar
return width;
}
+LayoutUnit LayoutBox::containingBlockLogicalWidthForGetComputedStyle() const
+{
+ if (hasOverrideContainingBlockLogicalWidth())
+ return overrideContainingBlockContentLogicalWidth();
+
+ if (!isPositioned())
+ return containingBlockLogicalWidthForContent();
+
+ LayoutBoxModelObject* cb = toLayoutBoxModelObject(container());
esprehn 2016/04/14 18:43:09 why is container correct vs containingBlock?
Deokjin Kim 2016/04/20 13:42:09 I think this issue is caused by the difference bet
+ LayoutUnit width = containingBlockLogicalWidthForPositioned(cb);
+ if (styleRef().position() != AbsolutePosition)
+ width -= cb->paddingLogicalWidth();
+ return width;
+}
+
LayoutUnit LayoutBox::containingBlockLogicalHeightForGetComputedStyle() const
{
if (hasOverrideContainingBlockLogicalHeight())

Powered by Google App Engine
This is Rietveld 408576698