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

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:

https://dvcs.w3.org/hg/csswg/diff/d44ebeae0dc4/cssom/Overview.src.html

https://dvcs.w3.org/hg/csswg/raw-file/d44ebeae0dc4/cssom/Overview.html#dom-cssstyledeclaration-removeproperty

zw

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