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

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

Issue 2939273003: [CSS Typed OM] Make the attributes of CSSPerspective mutable. (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 0cfda4436e14cb27569f8cad4bfa26b9600473f9..d32ad93aeca241ca2fca041782645952701ae1d6 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSPerspective.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSPerspective.cpp
@@ -11,7 +11,7 @@ namespace blink {
CSSPerspective* CSSPerspective::Create(CSSNumericValue* length,
ExceptionState& exception_state) {
if (length->GetType() != CSSStyleValue::StyleValueType::kLengthType) {
- exception_state.ThrowTypeError("Must pass length to CSSNumericValue");
+ exception_state.ThrowTypeError("Must pass length to CSSPerspective");
return nullptr;
}
if (length->ContainsPercent()) {
@@ -22,6 +22,20 @@ CSSPerspective* CSSPerspective::Create(CSSNumericValue* length,
return new CSSPerspective(length);
}
+void CSSPerspective::setLength(CSSNumericValue* length,
+ ExceptionState& exception_state) {
+ if (length->GetType() != CSSStyleValue::StyleValueType::kLengthType) {
+ exception_state.ThrowTypeError("Must pass length to CSSPerspective");
+ return;
+ }
+ if (length->ContainsPercent()) {
+ exception_state.ThrowTypeError(
+ "CSSPerspective does not support CSSNumericValues with percent units");
+ return;
+ }
+ length_ = length;
+}
+
CSSPerspective* CSSPerspective::FromCSSValue(const CSSFunctionValue& value) {
DCHECK_EQ(value.FunctionType(), CSSValuePerspective);
DCHECK_EQ(value.length(), 1U);
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSPerspective.h ('k') | third_party/WebKit/Source/core/css/cssom/CSSPerspective.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698