Re: [csswg-drafts] [css-scoping-1] Specificity of :host, ::slotted, and :host-context doesn't seem to be defined?

Oh, the incompatibility is more subtle:

```html
<!doctype html>
<div id="host"></div>
<script>
  host.attachShadow({ mode: "open" }).innerHTML = `
    <style>
      :host div[foo] {
        width: 100px;
        height: 100px;
        background: green;
      }
      div[foo] {
        background: red;
      }
    </style>
    <div foo></div>
  `;
</script>
```

Gecko shows red because it accounts the `:host` pseudo-element specificity plus the inner selector's specificity. Blink only seems to account for the inner selector's specificity only.

Is this expected? I'd expect the specificity to be added, and thus `:host div` be a more specific selector than `div`.

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

Received on Friday, 21 September 2018 15:37:09 UTC