Re: [CSSOM] Behavior of setting .style.foo to null

On 8/28/12, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Tue, Aug 28, 2012 at 2:05 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
>> Consider this testcase:
>>
>>   <style>
>>     body { color: green; }
>>   </style>
>>   <body>
>>     Some text
>>     <script>
>>       document.body.style.color = "red";
>>       document.body.style.color = null;
>>     </script>
>>   </body>
>>
>> This renders the text green in WebKit and Presto and shipping Gecko,
>> which
>> all seem to treat null as empty string here.  It renders the text red in
>> Trident, which seems to treat null as "null" here.
>>
[...]

> I'd prefer nulling it to remove the declaration, personally.  Weight
> of compatibility favors that, it seems.
>
Boris said what happens in two different cases. No declaration is
removed. In either case, the value of the color property... Ah,
neverrmind. It was said well enough the first time.
-- 
Garrett
Twitter: @xkit
personx.tumblr.com

Received on Tuesday, 28 August 2012 21:58:08 UTC