Re: [csswg-drafts] [css-cascade] `revert-layer` keyword in style attribute (#6743)

Not a strong opinion, but I would like to see if an alternative idea may work.

a64a842 says if we have `style="foo: revert-layer !important"`, it will make all important author styles ignored, and land on the normal level of the top author layer. While this follows from the spec text "as if no rules were specified in the current cascade layer—or between its normal and important levels in the cascade", it's a bit unintuitive to me as now the author layers are half-ignored. In contrast, `revert-layer` in regular style sheets always makes any layer either fully ignored or fully retained; similarly, `revert` always makes any origin fully ignored or fully retained. It will also make the implementation in Blink a bit more tricky (though still doable).

My original mental model is that `revert-layer` makes everything in the current layer and all layer above ignored, so `style="foo: revert-layer !important"` will revert to the important level of the top author layer. I'm not sure how to specify that nicely, though. The closest thing I've come up with is by revising the definition of `revert-layer` into:

... so that the specified value is calculated as if no rules were specified in the current cascade layer and any succeeding layer in the layer ordering for this property on this element.

The only problem is that the `style` attribute is not in the layer ordering, and it cannot be simply treated as a layer or origin due to `!important`...

Anyway, this is not an opposition. I have some concerns with a64a842 and I'll be happier if my original mental model works, but I can still accept a64a842 as the final spec.

-- 
GitHub Notification of comment by xiaochengh
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6743#issuecomment-970669172 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 16 November 2021 20:52:48 UTC