W3C home > Mailing lists > Public > www-style@w3.org > September 2013

Re: objection re: RESOLVED: setProperty's handling of importance logically behaves same as appending a declaraiton (like IE/WebKit)

From: Zack Weinberg <zackw@panix.com>
Date: Wed, 11 Sep 2013 16:57:32 -0400
Message-ID: <5230D93C.4010403@panix.com>
To: François REMY <francois.remy.dev@outlook.com>
CC: www-style list <www-style@w3.org>
On 2013-09-11 12:53 PM, François REMY wrote:
> ... what you say is that the resolution means that:
> var backup = { value: style.getPropertyValue(prop),
>                priority: style.getPropertyPriority(prop) };
 > style.setProperty(prop, tempValue, 'important');
> doSomeStuff();
> style.setProperty(prop,
 >                   backup.value ? backup.value : '',
>                   backup.priority);
> doesn't work as expected (ie the backup may be restored at important
> priority)

Indeed, under the resolution, this will not work as expected, but not in 
the way you suggest.  The second call to `setProperty` will have
*no effect*, unless backup.value is the empty string (in which case
`setProperty` behaves as `removeProperty` and the priority is irrelevant).

... That's an additional inconsistency I had not noticed before:

     setProperty(prop, '', '');

will delete a property whether or not the current value is !important, 
so it is even more surprising for `setProperty(prop, value, '')` not to 
replace the old value when it's !important.

> I'm at least able to confirm that
> style.setProperty('color', 'blue', 'important')
> style.setProperty('color', '', '')
> resets the property in IE which seem to be the reference that has
> been chosen as the way to go.

That's not the case under discussion, though; try

   style.setProperty('color', 'blue', 'important');
   style.setProperty('color', 'green', '');

> PS: By the way, it's usually a bad idea to contest resolutions based
> on raw notes and not polished minutes, because there are parts of the
> discussion you cannot see all the details.

I'm basing my objections on the change already made to the ED:



Received on Wednesday, 11 September 2013 20:58:01 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:32 UTC