Re: [csswg-drafts] [css-cascade] Cascade layers, `!important` and the style attribute (#6872)

I don't see any spec issue in your example.

The [spec](https://www.w3.org/TR/css-cascade-5/#cascade-context) says context (tree scope) is a higher-priority criterion than the style attr, and:

> When comparing two declarations that are sourced from different encapsulation contexts, then for normal rules the declaration from the outer context wins, and for important rules the declaration from the inner context wins.

So `background-color: green !important` from the shadow tree wins, and the div should be green.

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


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

Received on Thursday, 9 December 2021 17:36:52 UTC