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

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

Issue 1603193002: Move two shape related properties into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 11 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 | « no previous file | third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp b/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp
index 432805181e45b1292d8cc04b37eb99bcdf730828..265a08e2636c73955585c90ca04e5acdb7d03c5d 100644
--- a/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp
+++ b/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp
@@ -80,6 +80,10 @@ static PassRefPtrWillBeRawPtr<CSSValuePair> buildSerializablePositionOffset(Pass
} else if (offset->isValuePair()) {
side = toCSSPrimitiveValue(toCSSValuePair(*offset).first()).getValueID();
amount = &toCSSPrimitiveValue(toCSSValuePair(*offset).second());
+ if ((side == CSSValueRight || side == CSSValueBottom) && amount->isPercentage()) {
+ side = defaultSide;
+ amount = cssValuePool().createValue(100 - amount->getFloatValue(), CSSPrimitiveValue::UnitType::Percentage);
+ }
} else {
amount = toCSSPrimitiveValue(offset.get());
}
@@ -87,11 +91,7 @@ static PassRefPtrWillBeRawPtr<CSSValuePair> buildSerializablePositionOffset(Pass
if (side == CSSValueCenter) {
side = defaultSide;
amount = cssValuePool().createValue(50, CSSPrimitiveValue::UnitType::Percentage);
- } else if ((side == CSSValueRight || side == CSSValueBottom)
- && amount->isPercentage()) {
- side = defaultSide;
- amount = cssValuePool().createValue(100 - amount->getFloatValue(), CSSPrimitiveValue::UnitType::Percentage);
- } else if (amount->isLength() && !amount->getFloatValue()) {
+ } else if (!amount || (amount->isLength() && !amount->getFloatValue())) {
if (side == CSSValueRight || side == CSSValueBottom)
amount = cssValuePool().createValue(100, CSSPrimitiveValue::UnitType::Percentage);
else
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698