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

Unified Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 1988813002: getComputedStyle should handle over-constrained properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test case Created 4 years, 7 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 | « third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-over-constrained-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
index 6f6d9465840e73bf9bd1165904ccfc566da9bce8..02c3a79f8461dcb21b43590fe08566371b6d850a 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -247,6 +247,14 @@ static CSSValue* valueForPositionOffset(const ComputedStyle& style, CSSPropertyI
if (offset.isAuto())
return cssValuePool().createIdentifierValue(CSSValueAuto);
+ if (layoutObject) {
+ if (!offset.isAuto() && layoutObject->isInFlowPositioned()) {
rune 2016/05/18 21:41:07 offset is not auto at this point, so no need to ch
Deokjin Kim 2016/05/18 23:29:55 You're right. It's typo. I intended to use opposit
mstensho (USE GERRIT) 2016/05/19 05:57:52 No tests failed because of the typo? Then I think
Deokjin Kim 2016/05/19 12:57:24 I added 1 more test case(fast/css/getComputedStyle
+ LayoutBlock* container = layoutObject->containingBlock();
+ bool ltr = container->style()->isLeftToRightDirection();
+ if ((propertyID == CSSPropertyLeft && !ltr) || (propertyID == CSSPropertyRight && ltr) || (propertyID == CSSPropertyBottom))
+ return zoomAdjustedPixelValue(-opposite.pixels(), style);
+ }
+ }
return zoomAdjustedPixelValueForLength(offset, style);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-over-constrained-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698