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

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 UTC