Bug 677173 - Remove 3D transforms IDL properties because they are disabled. r=dbaron
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 01 Sep 2011 11:35:10 +1200
changeset 76361 0c6cbf58eaa02b2650b6173fb1c9b4838b3f2af4
parent 76360 2bf8e6118af4b84b321e39ba19fb23d2031c1240
child 76362 1898a3e3a1891a5a5801fe592c752ef26403e5b4
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersdbaron
bugs677173
milestone9.0a1
Bug 677173 - Remove 3D transforms IDL properties because they are disabled. r=dbaron
dom/interfaces/css/nsIDOMCSS2Properties.idl
layout/style/nsCSSProps.cpp
layout/style/nsDOMCSSDeclaration.h
layout/style/test/ListCSSProperties.cpp
layout/style/test/property_database.js
layout/style/test/test_transitions_per_property.html
--- a/dom/interfaces/css/nsIDOMCSS2Properties.idl
+++ b/dom/interfaces/css/nsIDOMCSS2Properties.idl
@@ -46,17 +46,17 @@
  * The nsIDOMCSS2Properties interface is a datatype for additional
  * reflection of data already provided in nsIDOMCSSStyleDeclaration in
  * the Document Object Model.
  *
  * For more information on this interface please see
  * http://www.w3.org/TR/DOM-Level-2-Style
  */
 
-[builtinclass, scriptable, uuid(519ae4fa-0fee-4aaa-bcb9-34b503236801)]
+[builtinclass, scriptable, uuid(79b66107-f9d2-42ac-bc68-b558d79037ec)]
 interface nsIDOMCSS2Properties : nsISupports
 {
            attribute DOMString        background;
                                         // raises(DOMException) on setting
 
            attribute DOMString        backgroundAttachment;
                                         // raises(DOMException) on setting
 
@@ -679,28 +679,16 @@ interface nsIDOMCSS2Properties : nsISupp
                                         // raises(DOMException) on setting
 
            attribute DOMString        MozTransform;
                                         // raises(DOMException) on setting
 
            attribute DOMString        MozTransformOrigin;
                                         // raises(DOMException) on setting 
 
-           attribute DOMString        MozPerspective;
-                                        // raises(DOMException) on setting
-
-           attribute DOMString        MozPerspectiveOrigin;
-                                        // raises(DOMException) on setting
-
-           attribute DOMString        MozBackfaceVisibility;
-                                        // raises(DOMException) on setting
-
-           attribute DOMString        MozTransformStyle;
-                                        // raises(DOMException) on setting
-
            attribute DOMString        MozWindowShadow;
                                         // raises(DOMException) on setting
 
            attribute DOMString        backgroundSize;
                                         // raises(DOMException) on setting
 
            attribute DOMString        MozTextBlink;
                                         // raises(DOMException) on setting
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -346,16 +346,22 @@ nsCSSProps::LookupProperty(const nsACStr
                             *alias_end = gAliases + NS_ARRAY_LENGTH(gAliases);
          alias < alias_end; ++alias) {
       if (aProperty.LowerCaseEqualsASCII(alias->name)) {
         res = alias->id;
         break;
       }
     }
   }
+  
+  if (res == eCSSProperty_perspective || res == eCSSProperty_perspective_origin || 
+      res == eCSSProperty_backface_visibility || res == eCSSProperty_transform_style) {
+    return eCSSProperty_UNKNOWN;
+  }
+
   return res;
 }
 
 nsCSSProperty
 nsCSSProps::LookupProperty(const nsAString& aProperty)
 {
   // This is faster than converting and calling
   // LookupProperty(nsACString&).  The table will do its own
@@ -367,16 +373,22 @@ nsCSSProps::LookupProperty(const nsAStri
                             *alias_end = gAliases + NS_ARRAY_LENGTH(gAliases);
          alias < alias_end; ++alias) {
       if (aProperty.LowerCaseEqualsASCII(alias->name)) {
         res = alias->id;
         break;
       }
     }
   }
+  
+  if (res == eCSSProperty_perspective || res == eCSSProperty_perspective_origin || 
+      res == eCSSProperty_backface_visibility || res == eCSSProperty_transform_style) {
+    return eCSSProperty_UNKNOWN;
+  }
+
   return res;
 }
 
 nsCSSFontDesc
 nsCSSProps::LookupFontDesc(const nsACString& aFontDesc)
 {
   NS_ABORT_IF_FALSE(gFontDescTable, "no lookup table, needs addref");
   return nsCSSFontDesc(gFontDescTable->Lookup(aFontDesc));
--- a/layout/style/nsDOMCSSDeclaration.h
+++ b/layout/style/nsDOMCSSDeclaration.h
@@ -62,16 +62,25 @@ class nsDOMCSSDeclaration : public nsICS
 {
 public:
   // Only implement QueryInterface; subclasses have the responsibility
   // of implementing AddRef/Release.
   NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
 
   NS_DECL_NSICSSDECLARATION
 
+  NS_IMETHOD GetMozPerspective(nsAString_internal&);
+  NS_IMETHOD SetMozPerspective(const nsAString_internal&);
+  NS_IMETHOD GetMozPerspectiveOrigin(nsAString_internal&);
+  NS_IMETHOD SetMozPerspectiveOrigin(const nsAString_internal&);
+  NS_IMETHOD GetMozBackfaceVisibility(nsAString_internal&);
+  NS_IMETHOD SetMozBackfaceVisibility(const nsAString_internal&);
+  NS_IMETHOD GetMozTransformStyle(nsAString_internal&);
+  NS_IMETHOD SetMozTransformStyle(const nsAString_internal&);
+
   // Require subclasses to implement |GetParentRule|.
   //NS_DECL_NSIDOMCSSSTYLEDECLARATION
   NS_IMETHOD GetCssText(nsAString & aCssText);
   NS_IMETHOD SetCssText(const nsAString & aCssText);
   NS_IMETHOD GetPropertyValue(const nsAString & propertyName,
                               nsAString & _retval);
   NS_IMETHOD GetPropertyCSSValue(const nsAString & propertyName,
                                  nsIDOMCSSValue **_retval);
--- a/layout/style/test/ListCSSProperties.cpp
+++ b/layout/style/test/ListCSSProperties.cpp
@@ -188,16 +188,24 @@ print_array(const char *aName,
         const PropertyInfo *p = aProps + i;
 
         if (is_inaccessible(p->propName))
             // inaccessible properties never have DOM props, so don't
             // worry about incrementing j.  The assertion below will
             // catch if they do.
             continue;
 
+        if (strcmp(p->propName, "-moz-perspective") == 0 ||
+            strcmp(p->propName, "-moz-perspective-origin") == 0 ||
+            strcmp(p->propName, "-moz-backface-visibility") == 0 ||
+            strcmp(p->propName, "-moz-transform-style") == 0) {
+            ++j;
+            continue;
+        }
+
         if (first)
             first = 0;
         else
             printf(",\n");
 
         printf("\t{ name: \"%s\", prop: ", p->propName);
         if (j >= aDOMPropsLength || strcmp(p->propName, aDOMProps[j]) != 0)
             printf("null");
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -976,67 +976,16 @@ var gCSSProperties = {
 			"-moz-calc(20px + 50%) -moz-calc(50% - 10px)",
 			"-moz-calc(-20px) -moz-calc(-50%)",
 			"-moz-calc(-20%) -moz-calc(-50%)"
 		],
 		invalid_values: ["red", "auto", "none", "0.5 0.5", "40px #0000ff",
 						 "border", "center red", "right diagonal",
 						 "#00ffff bottom"]
 	},
-    "-moz-perspective-origin": {
-        domProp: "MozPerspectiveOrigin",
-        inherited: false,
-        type: CSS_TYPE_LONGHAND,
-        /* no subproperties */
-        prerequisites: { "width": "10px", "height": "10px", "display": "block"},
-        initial_values: [ "50% 50%", "center", "center center" ],
-        other_values: [ "25% 25%", "5px 5px", "20% 3em", "0 0", "0in 1in",
-                        "top", "bottom","top left", "top right",
-                        "top center", "center left", "center right",
-                        "bottom left", "bottom right", "bottom center",
-                        "20% center", "5px center", "13in bottom",
-                        "left 50px", "right 13%", "center 40px",
-                        "-moz-calc(20px)",
-                        "-moz-calc(20px) 10px",
-                        "10px -moz-calc(20px)",
-                        "-moz-calc(20px) 25%",
-                        "25% -moz-calc(20px)",
-                        "-moz-calc(20px) -moz-calc(20px)",
-                        "-moz-calc(20px + 1em) -moz-calc(20px / 2)",
-                        "-moz-calc(20px + 50%) -moz-calc(50% - 10px)",
-                        "-moz-calc(-20px) -moz-calc(-50%)",
-                        "-moz-calc(-20%) -moz-calc(-50%)" ],
-        invalid_values: [ "red", "auto", "none", "0.5 0.5", "40px #0000ff",
-                          "border", "center red", "right diagonal",
-                          "#00ffff bottom"]
-    },
-    "-moz-perspective": {
-		domProp: "MozPerspective",
-		inherited: false,
-		type: CSS_TYPE_LONGHAND,
-		initial_values: [ "none", "0" ],
-		other_values: [ "1000px", "500.2px", "-100px", "-27.2em" ],
-		invalid_values: [ "pants", "200" ]
-	},
-    "-moz-backface-visibility": {
-        domProp: "MozBackfaceVisibility",
-        inherited: false,
-        type: CSS_TYPE_LONGHAND,
-        initial_values: [ "visible" ],
-        other_values: [ "hidden" ],
-        invalid_values: [ "collapse" ]
-    },
-	"-moz-transform-style": {
-		domProp: "MozTransformStyle",
-		inherited: false,
-		type: CSS_TYPE_LONGHAND,
-		initial_values: [ "flat" ],
-		other_values: [ "preserve-3d" ],
-		invalid_values: []
-	},
 	"-moz-user-focus": {
 		domProp: "MozUserFocus",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "none" ],
 		other_values: [ "normal", "ignore", "select-all", "select-before", "select-after", "select-same", "select-menu" ],
 		invalid_values: []
 	},
--- a/layout/style/test/test_transitions_per_property.html
+++ b/layout/style/test/test_transitions_per_property.html
@@ -75,19 +75,16 @@ var supported_properties = {
     "-moz-outline-radius-topleft": [ test_radius_transition ],
     "-moz-outline-radius-topright": [ test_radius_transition ],
     "-moz-text-decoration-color": [ test_color_transition,
                                     test_border_color_transition ],
     "-moz-transform": [ test_transform_transition ],
     "-moz-transform-origin": [ test_length_pair_transition,
                                test_length_percent_pair_transition,
                                test_length_percent_pair_unclamped ],
-    "-moz-perspective-origin": [ test_length_pair_transition,
-                                 test_length_percent_pair_transition,
-                                 test_length_percent_pair_unclamped ],
     "background-color": [ test_color_transition ],
     "background-position": [ test_background_position_transition,
                              // FIXME: We don't currently test clamping,
                              // since background-position uses calc() as
                              // an intermediate form.
                              /* test_length_percent_pair_unclamped */ ],
     "background-size": [ test_background_size_transition,
                          // FIXME: We don't currently test clamping,
@@ -188,17 +185,16 @@ var supported_properties = {
                       test_length_percent_calc_transition,
                       test_length_clamped, test_percent_clamped ],
     "padding-right": [ test_length_transition, test_percent_transition,
                        test_length_percent_calc_transition,
                        test_length_clamped, test_percent_clamped ],
     "padding-top": [ test_length_transition, test_percent_transition,
                      test_length_percent_calc_transition,
                      test_length_clamped, test_percent_clamped ],
-    "-moz-perspective": [ test_length_transition ],
     "right": [ test_length_transition, test_percent_transition,
                test_length_percent_calc_transition,
                test_length_unclamped, test_percent_unclamped ],
     "stop-color": [ test_color_transition ],
     "stop-opacity" : [ test_float_zeroToOne_transition,
                        // opacity is clamped in computed style
                        // (not parsing/interpolation)
                        test_float_zeroToOne_clamped ],