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

Unified Diff: third_party/WebKit/LayoutTests/typedcssom/cssPerspective.html

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/LayoutTests/typedcssom/cssPerspective.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssPerspective.html b/third_party/WebKit/LayoutTests/typedcssom/cssPerspective.html
index 4f19b993b5569953907599d9efeea96681d90550..297762f3d61ab96c7e90e76580591d7931681463 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/cssPerspective.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/cssPerspective.html
@@ -11,18 +11,27 @@ test(() => {
assert_throws(new TypeError(), () => { new CSSPerspective(angleValue) });
}, "Constructor should throw an error for invalid CSSUnitValues");
-test(function() {
- var simpleLength = new CSSUnitValue(10, 'percent');
- assert_throws(new TypeError(), function() { new CSSPerspective(simpleLength) });
-}, "Constructor should throw an error for CSSUnitValues with a percentage type");
+test(() => {
+ let perspective = new CSSPerspective(new CSSUnitValue(1, 'px'));
+ assert_equals(perspective.length.value, 1);
+ assert_equals(perspective.length.unit, 'px');
+
+ perspective.length = new CSSUnitValue(2, 'in');
+ assert_equals(perspective.length.value, 2);
+ assert_equals(perspective.length.unit, 'in');
+}, "Setting length with valid values.");
+
+test(() => {
+ let perspective = new CSSPerspective(new CSSUnitValue(1, 'px'));
+ let percentUnit = new CSSUnitValue(2, 'percent');
+ assert_throws(new TypeError(), () => { perspective.length = percentUnit; })
+}, "Setting length with invalid values.");
+
+test(() => {
+ let perspective = new CSSPerspective(new CSSUnitValue(10, 'px'));
-test(function() {
- var perspectiveTransformSimple = new CSSPerspective(
- new CSSUnitValue(10, 'px'));
- assert_equals(perspectiveTransformSimple.toString(), 'perspective(10px)');
-}, "toString should return perspective(<CSSUnitValue.cssString()>)");
+ assert_equals(perspective.toString(), 'perspective(10px)');
+}, "toString should return perspective(<CSSNumericValue.cssString()>)");
</script>
-<body>
-</body>

Powered by Google App Engine
This is Rietveld 408576698