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

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

Issue 2097383002: Added support of calc() for SVGLength (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 5 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: third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
index e263bc718fbdd23cb2aa84f76bf205f953e3314d..64b5fe37b6e6e71330f99841b81503b55e02440c 100644
--- a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
@@ -179,6 +179,10 @@ CSSPrimitiveValue::UnitType CSSPrimitiveValue::typeWithCalcResolved() const
return UnitType::CalcPercentageWithNumber;
case CalcPercentLength:
return UnitType::CalcPercentageWithLength;
+ case CalcLengthNumber:
+ return UnitType::CalcLengthWithNumber;
+ case CalcPercentLengthNumber:
+ return UnitType::CalcPercentageWithLengthAndNumber;
case CalcTime:
return UnitType::Milliseconds;
case CalcOther:
@@ -645,6 +649,8 @@ const char* CSSPrimitiveValue::unitTypeToString(UnitType type)
case UnitType::Calc:
case UnitType::CalcPercentageWithNumber:
case UnitType::CalcPercentageWithLength:
+ case UnitType::CalcLengthWithNumber:
+ case UnitType::CalcPercentageWithLengthAndNumber:
break;
};
ASSERT_NOT_REACHED();
@@ -706,6 +712,8 @@ String CSSPrimitiveValue::customCSSText() const
break;
case UnitType::CalcPercentageWithNumber:
case UnitType::CalcPercentageWithLength:
+ case UnitType::CalcLengthWithNumber:
+ case UnitType::CalcPercentageWithLengthAndNumber:
ASSERT_NOT_REACHED();
break;
}
@@ -761,6 +769,8 @@ bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const
case UnitType::Chs:
case UnitType::CalcPercentageWithNumber:
case UnitType::CalcPercentageWithLength:
+ case UnitType::CalcLengthWithNumber:
+ case UnitType::CalcPercentageWithLengthAndNumber:
case UnitType::QuirkyEms:
return false;
}

Powered by Google App Engine
This is Rietveld 408576698