Re: CSSStyleDeclaration: Setting only a value or a priority

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.

> >> 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.

> Something
> stupid you did to make the cascade work in your actual stylesheet has
> no relevance to what you're trying to do right now, in JS.  If it
> *is*, then you know what importance means and can live with providing
> an extra argument.  Forcing authors who don't care about importance to
> in fact care *more* about importance (you have to actively query the
> current importance, something that virtually no one ever has a reason
> to do) is backwards.

I still disagree, but it's clear we're not going to make progress
with this on the list; let's discuss it at the telecon on September
4.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Received on Wednesday, 21 August 2013 23:10:01 UTC