Re: [cssom] Remove setPropertyValue and setPropertyPriority?

On Thursday, October 2, 2014, Peter Sloetjes <pjs.nl@live.com> wrote:

> On 02/10/2014 10:03, Simon Pieters wrote:>   > Since setPropertyValue and
> setPropertyPriority were added as a compromise > solution when the behavior
> of setProperty was discussed last year[1], and > setProperty has now
> changed to match Firefox[2], should we remove > setPropertyValue and
> setPropertyPriority?
>

The main reason for the change was that elem.style.color = 'green'; is
equivalent to element.style.setProperty('color','green',''); and we wanted
to avoid a noop there.


>  I think they haven't been > implemented anywhere. The current resolution
> for setProperty is fine, but it does not make "s.setPropertyValue(p,v)"
> less useful as a shorthand for
> "s.setProperty(p,v,s.getPropertyPriority(p))".
>

Right. setProperty for when you want to change both at the same time, the
others when you want to change just one.

There is utility there, but I don't know if it's enough to warrant two
methods that no one has implemented. Are there bugs filed asking for this
functionality?


>  Adding the proposed functions makes the interface more symmetric,
>

Agreed, but unnecessary API surface isn't great either.


> easier to use and probably slightly faster in the relevant use cases.
> Peter J. Sloetjes Firefox add-on developer
>


-- 
Mike Sherov

Received on Friday, 3 October 2014 11:08:08 UTC