Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-scoping] :host and compound selectors. #2424

Closed
emilio opened this issue Mar 8, 2018 · 1 comment
Closed

[css-scoping] :host and compound selectors. #2424

emilio opened this issue Mar 8, 2018 · 1 comment

Comments

@emilio
Copy link
Collaborator

emilio commented Mar 8, 2018

There's nothing said in https://drafts.csswg.org/css-scoping/#host-selector about whether :host is the only thing allowed in a compound selector.

However the following shows red in both Blink and WebKit, when I expected it to show green:

<!doctype html>
<div id="host"><span>In host</span></div>
<script>
  let root = host.attachShadow({ mode: "open" });
  root.innerHTML = `
    <style>:host { background: red }</style>
    <style>#host:host { background: green }</style>
    <span>In root</span>
  `;
</script>

Should this be specified better? Am I misreading the spec or missing something? I'm looking into implementing this in Firefox and I really didn't expect to have to just copy whatever WebKit and Blink are doing.

@emilio
Copy link
Collaborator Author

emilio commented Mar 8, 2018

@lilles pointed out in #2423 the section of the spec I was missing.

@emilio emilio closed this as completed Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant