Re: CSSStyleDeclaration: Setting only a value or a priority

On Wed, Aug 21, 2013 at 4:09 PM, L. David Baron <dbaron@dbaron.org> wrote:
> On Wednesday 2013-08-21 15:59 -0700, Tab Atkins Jr. wrote:
>> This is getting rather tangential, but which drafts?  (We were unaware
>> of this when drafting Cascade, which treats everything from cascaded
>> value onward as unordered.)
>
> Well, I think they've been removed from all WG drafts, but I think
> it's what the last copies that were in WG drafts said.

Okay.  That's something that we should discuss in more detail in another thread.

>> >> More importantly, though, I think it's very natural for omitting an
>> >> argument to mean "don't do anything special", which is what is
>> >> happening here.  You'd only give the third argument if you're
>> >> specifically trying to set the importance to a particular value; if
>> >> you omit it, you're just not thinking about importance at all, and
>> >> don't want to be bothered by it.
>> >
>> > I don't think authors "not thinking about importance at all" should
>> > get random importance as a function of what's already there.
>>
>> There's your problem!  The cascade's not really understandable to most
>> people in the first place, so making them think about when using an
>> API that *actively hides the important parts of the cascade* (the
>> ordering aspect) probably isn't a good idea.
>>
>> It's not about "[getting] random importance", it's about just changing
>> the value of a declaration *without touching the importance*.  You
>> don't care about the importance 99% of the time - you're in JS, the
>> cascade is unimportant, you're just trying to set a value.
>
> That's an argument for making it always set "!important".  But I
> don't see how it's an argument for preserving existing !important or
> lack thereof.

My hope is that it's an argument for "don't mess with data the author
isn't specifying", and "the OM is an unordered data structure, so
don't expose ordering details in confusing ways - just paper over them
instead".

But more importantly, no, the use-cases actually presented (going
through the stylesheet and modifying some properties) definitely do
*not* want !important auto-added.  Once again, they're just trying to
set a value.  They're *not* trying to set the importance, so dont'
tweak it.

~TJ

Received on Wednesday, 21 August 2013 23:26:50 UTC