Bug 655478 - CSSStyleDeclaration.setProperty shouldn't require the third parameter to be set; r=bzbarsky
authorAryeh Gregor <ayg@aryeh.name>
Wed, 15 Feb 2012 16:31:40 -0500
changeset 89882 18208d0bb8d1a9c07f945859ffd517cdfefcba14
parent 89881 79e5d61b3d594f17368aa2619da6a9a7b9417713
child 89883 2389419e7c08beb8d3639c40c889667a1f0fd987
push idunknown
push userunknown
push dateunknown
reviewersbzbarsky
bugs655478
milestone13.0a1
Bug 655478 - CSSStyleDeclaration.setProperty shouldn't require the third parameter to be set; r=bzbarsky
dom/interfaces/css/nsIDOMCSSStyleDeclaration.idl
layout/style/test/test_priority_preservation.html
--- a/dom/interfaces/css/nsIDOMCSSStyleDeclaration.idl
+++ b/dom/interfaces/css/nsIDOMCSSStyleDeclaration.idl
@@ -55,14 +55,14 @@ interface nsIDOMCSSStyleDeclaration : ns
 
   DOMString          getPropertyValue(in DOMString propertyName);
   nsIDOMCSSValue     getPropertyCSSValue(in DOMString propertyName);
   DOMString          removeProperty(in DOMString propertyName)
                                         raises(DOMException);
   DOMString          getPropertyPriority(in DOMString propertyName);
   void               setProperty(in DOMString propertyName, 
                                  in DOMString value, 
-                                 in DOMString priority)
+                                 [optional] in DOMString priority)
                                         raises(DOMException);
   readonly attribute unsigned long    length;
   DOMString          item(in unsigned long index);
   readonly attribute nsIDOMCSSRule    parentRule;
 };
--- a/layout/style/test/test_priority_preservation.html
+++ b/layout/style/test/test_priority_preservation.html
@@ -83,17 +83,18 @@ is(s.getPropertyValue("text-decoration")
 is(s.getPropertyPriority("text-decoration"), "important",
    "text-decoration priority still stored");
 is(s.getPropertyValue("z-index"), "3",
    "z-index still stored");
 is(s.getPropertyPriority("z-index"), "",
    "z-index priority still stored");
 
   // and overriding one element of that shorthand with some longhand
-s.setProperty("font-style", "normal", "");
+  // test omitting the third argument to setProperty too (bug 655478)
+s.setProperty("font-style", "normal");
 
 is(s.getPropertyValue("font-style"), "normal", "font-style overridden");
 is(s.getPropertyPriority("font-style"), "", "font-style priority overridden");
 
 is(s.getPropertyValue("font-weight"), "bold", "font-weight unchanged");
 is(s.getPropertyPriority("font-weight"), "important",
    "font-weight priority unchanged");
 is(s.getPropertyValue("font-size"), "12px", "font-size unchanged");