W3C home > Mailing lists > Public > www-style@w3.org > July 2012

[cssom] Need to clarify handling of "priority" argument to CSSStyleDeclaration.setProperty

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 06 Jul 2012 11:24:56 -0400
Message-ID: <4FF70348.7010205@mit.edu>
To: www-style@w3.org
Consider this testcase:

   <!DOCTYPE html>
   <body><div>
       <script>
       document.body.firstChild.style.setProperty("font-size",
                                                  "2em", null);
       document.body.firstChild.style.setProperty("font-style",
                                                  "italic", "null");
       </script>
       Is this twice the size and italic?
     </div>
     Normal text
   </body>

The first line of text is rendered at 2x the font size of the second one 
in Gecko, WebKit, Presto, and Trident (IE9 standards mode).  It's also 
rendered as italic in WebKit and Presto.

It looks like WebKit and Presto simply allow arbitrary priority values, 
so I can't tell much about their behavior here.

It looks like Gecko and Trident only allow valid priority values ("" and 
"important", treating others like they do syntax errors in values), but 
treat null as "".

I suspect that as a minimum for web compat this argument should be 
listed as [TreatNullAs=EmptyString].  But in general, the behavior for 
invalid priorities needs to be defined.

-Boris
Received on Friday, 6 July 2012 15:25:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:56 GMT