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

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

Issue 720003002: Fixed positioned element with relative percentage positioned parent is wrongly placed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index 7e63fe333b7890e7e5c48a84f0ad34a67eb493fb..f60375f6c683c1d4b275c218ae8a1715967072b0 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -2699,9 +2699,9 @@ static void computeInlineStaticDistance(Length& logicalLeft, Length& logicalRigh
} else if (curr->isInline()) {
if (curr->isRelPositioned()) {
if (!curr->style()->logicalLeft().isAuto())
- staticPosition += curr->style()->logicalLeft().value();
+ staticPosition += valueForLength(curr->style()->logicalLeft(), curr->containingBlock()->availableWidth());
else
- staticPosition -= curr->style()->logicalRight().value();
+ staticPosition -= valueForLength(curr->style()->logicalRight(), curr->containingBlock()->availableWidth());
}
}
}
@@ -2721,9 +2721,9 @@ static void computeInlineStaticDistance(Length& logicalLeft, Length& logicalRigh
} else if (curr->isInline()) {
if (curr->isRelPositioned()) {
if (!curr->style()->logicalLeft().isAuto())
- staticPosition -= curr->style()->logicalLeft().value();
+ staticPosition -= valueForLength(curr->style()->logicalLeft(), curr->containingBlock()->availableWidth());
else
- staticPosition += curr->style()->logicalRight().value();
+ staticPosition += valueForLength(curr->style()->logicalRight(), curr->containingBlock()->availableWidth());
}
}
if (curr == containerBlock)
« no previous file with comments | « LayoutTests/fast/css/css-properties-position-relative-as-parent-fixed-expected.html ('k') | Source/platform/Length.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698