From 09f2b8be5252643ad76eda31f1ae1c963ea7edb3 Mon Sep 17 00:00:00 2001 From: rjwright Date: Thu, 28 Jul 2016 11:18:04 +1000 Subject: [PATCH 1/2] Add constructor for CSSSkew with CSSAngleValues --- css-typed-om/Overview.bs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/css-typed-om/Overview.bs b/css-typed-om/Overview.bs index 1f891666..56e448b1 100644 --- a/css-typed-om/Overview.bs +++ b/css-typed-om/Overview.bs @@ -478,7 +478,8 @@ interface CSSScale : CSSTransformComponent { readonly attribute double z; }; -[Constructor(double ax, double ay)] +[Constructor(double dx, double dy), + Constructor(CSSAngleValue ax, CSSAngleValue ay)] interface CSSSkew : CSSTransformComponent { readonly attribute double ax; readonly attribute double ay; @@ -518,7 +519,9 @@ and y & z values of 0 could be: When a {{CSSRotation}} is constructed with a double (as opposed to a -{{CSSAngleValue}}), the angle is taken to be in degrees. +{{CSSAngleValue}}), the angle is taken to be in degrees. Likewise, when +{{CSSSkew}} is constructed with doubles, both arguments are taken to be angles +in degrees.
The following two CSSRotations are equivalent: @@ -526,6 +529,11 @@ The following two CSSRotations are equivalent: CSSRotation(angle); CSSRotation(CSSAngleValue(angle, "deg")); +Likewise, the following two CSSSkews are equivalent: +
+    CSSSkew(ax, ay);
+    CSSSkew(CSSAngleValue(ax, "deg"), CSSAngleValue(ay, "deg"));
+
When a {{CSSTransformValue}} is read from a {{StylePropertyMap}}, each From ccb89a54247fb3dd366bf4ffef9c7f5f0987e6cc Mon Sep 17 00:00:00 2001 From: rjwright Date: Tue, 16 Aug 2016 11:22:10 +1000 Subject: [PATCH 2/2] Remove double constructors for CSSRotation and CSSSkew, and change angles to be stored as CSSAngleValues --- css-typed-om/Overview.bs | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/css-typed-om/Overview.bs b/css-typed-om/Overview.bs index 56e448b1..3f33a55d 100644 --- a/css-typed-om/Overview.bs +++ b/css-typed-om/Overview.bs @@ -459,15 +459,13 @@ interface CSSTranslation : CSSTransformComponent { readonly attribute CSSLengthValue z; }; -[Constructor(double degrees), - Constructor(CSSAngleValue angle), - Constructor(double x, double y, double z, double degrees), +[Constructor(CSSAngleValue angle), Constructor(double x, double y, double z, CSSAngleValue angle)] interface CSSRotation : CSSTransformComponent { readonly attribute double x; readonly attribute double y; readonly attribute double z; - readonly attribute double angle; + readonly attribute CSSAngleValue angle; }; [Constructor(double x, double y), @@ -478,11 +476,10 @@ interface CSSScale : CSSTransformComponent { readonly attribute double z; }; -[Constructor(double dx, double dy), - Constructor(CSSAngleValue ax, CSSAngleValue ay)] +[Constructor(CSSAngleValue ax, CSSAngleValue ay)] interface CSSSkew : CSSTransformComponent { - readonly attribute double ax; - readonly attribute double ay; + readonly attribute CSSAngleValue ax; + readonly attribute CSSAngleValue ay; }; [Constructor(CSSLengthValue length)] @@ -518,24 +515,6 @@ and y & z values of 0 could be: -When a {{CSSRotation}} is constructed with a double (as opposed to a -{{CSSAngleValue}}), the angle is taken to be in degrees. Likewise, when -{{CSSSkew}} is constructed with doubles, both arguments are taken to be angles -in degrees. - -
-The following two CSSRotations are equivalent: -
-		CSSRotation(angle);
-		CSSRotation(CSSAngleValue(angle, "deg"));
-
-Likewise, the following two CSSSkews are equivalent: -
-    CSSSkew(ax, ay);
-    CSSSkew(CSSAngleValue(ax, "deg"), CSSAngleValue(ay, "deg"));
-
-
- When a {{CSSTransformValue}} is read from a {{StylePropertyMap}}, each {{CSSTransformComponent}} will maintain the relevant transform function in its cssText attribute. However, newly constructed {{CSSTransformValue}}s