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

Unified Diff: Source/core/css/LayoutStyleCSSValueMapping.cpp

Issue 1007623003: Fix incorrect percentage top for positioned elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: New approach by adding a more simple api to get containingBlock's height 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/css/LayoutStyleCSSValueMapping.cpp
diff --git a/Source/core/css/LayoutStyleCSSValueMapping.cpp b/Source/core/css/LayoutStyleCSSValueMapping.cpp
index c47287c7fdc23ba411d88908a809859cb0015e4c..09abddc679738167e31bc08d8642498a0801b616 100644
--- a/Source/core/css/LayoutStyleCSSValueMapping.cpp
+++ b/Source/core/css/LayoutStyleCSSValueMapping.cpp
@@ -170,10 +170,10 @@ static PassRefPtrWillBeRawPtr<CSSValue> valueForPositionOffset(const LayoutStyle
return nullptr;
}
- if (offset.isPercent() && renderer && renderer->isBox()) {
+ if (offset.isPercent() && renderer && renderer->isBox() && renderer->isPositioned()) {
LayoutUnit containingBlockSize = (propertyID == CSSPropertyLeft || propertyID == CSSPropertyRight) ?
toLayoutBox(renderer)->containingBlockLogicalWidthForContent() :
- toLayoutBox(renderer)->containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding);
+ toLayoutBox(renderer)->containingBlockLogicalHeight();
return zoomAdjustedPixelValue(valueForLength(offset, containingBlockSize), style);
}
if (offset.isAuto()) {

Powered by Google App Engine
This is Rietveld 408576698