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

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

Issue 1007623003: Fix incorrect percentage top for positioned elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update an expected value of web-animations-api/animations-responsive-to-style-change.html Created 5 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
« no previous file with comments | « Source/core/layout/LayoutBox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBox.cpp
diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp
index b0bc6ed38731bbb1bda53c56c62643d6083660c5..0788dee631a4958fd22799571c48ff9ee6ebe741 100644
--- a/Source/core/layout/LayoutBox.cpp
+++ b/Source/core/layout/LayoutBox.cpp
@@ -1524,6 +1524,21 @@ LayoutUnit LayoutBox::shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStar
return width;
}
+LayoutUnit LayoutBox::containingBlockLogicalHeightForGetComputedStyle() const
+{
+ if (hasOverrideContainingBlockLogicalHeight())
+ return overrideContainingBlockContentLogicalHeight();
+
+ if (!isPositioned())
+ return containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding);
+
+ LayoutBoxModelObject* cb = toLayoutBoxModelObject(container());
+ LayoutUnit height = containingBlockLogicalHeightForPositioned(cb);
+ if (styleRef().position() != AbsolutePosition)
+ height -= cb->paddingLogicalHeight();
+ return height;
+}
+
LayoutUnit LayoutBox::containingBlockLogicalWidthForContent() const
{
if (hasOverrideContainingBlockLogicalWidth())
« no previous file with comments | « Source/core/layout/LayoutBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698