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

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: Addressed comments Created 5 years, 9 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: Source/core/layout/LayoutBox.cpp
diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp
index a24c390b55c02b4bb0875bc2132b7c71861930ea..4a01ca9f14d6ad0093bb4b41921200820118549e 100644
--- a/Source/core/layout/LayoutBox.cpp
+++ b/Source/core/layout/LayoutBox.cpp
@@ -1521,6 +1521,24 @@ LayoutUnit LayoutBox::shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStar
return width;
}
+LayoutUnit LayoutBox::containingBlockLogicalHeightForComputedStyle() const
+{
+ if (hasOverrideContainingBlockLogicalHeight())
+ return overrideContainingBlockContentLogicalHeight();
+
+ LayoutUnit height;
+ if (isPositioned()) {
+ LayoutBoxModelObject* cb = toLayoutBoxModelObject(container());
+ height = containingBlockLogicalHeightForPositioned(cb);
+ if (styleRef().position() != AbsolutePosition)
+ height -= cb->paddingLogicalHeight();
+ } else {
+ height = containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding);
mstensho (USE GERRIT) 2015/04/13 21:40:04 Blink coding style prefers early returns. You coul
changseok 2015/04/14 06:27:21 Done.
+ }
+
+ return height;
+}
+
LayoutUnit LayoutBox::containingBlockLogicalWidthForContent() const
{
if (hasOverrideContainingBlockLogicalWidth())

Powered by Google App Engine
This is Rietveld 408576698