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

Unified Diff: third_party/WebKit/Source/core/css/cssom/CSSPerspective.cpp

Issue 2903413002: Restructure type tracking in StyleValues to work better with new numeric types (Closed)
Patch Set: rebase Created 3 years, 6 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/cssom/CSSPerspective.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSPerspective.cpp b/third_party/WebKit/Source/core/css/cssom/CSSPerspective.cpp
index 7c688000482ee8e66dacc0fb4bf24775d15ac94a..2036c166d0d69d22e6c1515c147e4603c0ca93b4 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSPerspective.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSPerspective.cpp
@@ -23,15 +23,18 @@ CSSPerspective* CSSPerspective::FromCSSValue(const CSSFunctionValue& value) {
DCHECK_EQ(value.length(), 1U);
CSSNumericValue* length =
CSSNumericValue::FromCSSValue(ToCSSPrimitiveValue(value.Item(0)));
+ // TODO(meade): This shouldn't happen once CSSNumericValue is fully
+ // implemented, so once that happens this check can be removed.
+ if (!length)
+ return nullptr;
DCHECK(!length->ContainsPercent());
return new CSSPerspective(length);
}
CSSFunctionValue* CSSPerspective::ToCSSValue() const {
- return nullptr;
- // CSSFunctionValue* result = CSSFunctionValue::Create(CSSValuePerspective);
- // result->Append(*length_->ToCSSValue());
- // return result;
+ CSSFunctionValue* result = CSSFunctionValue::Create(CSSValuePerspective);
+ result->Append(*length_->ToCSSValue());
+ return result;
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698