Bug 222733
Summary: | The :host() function pseudo-class should only accept a single compound-selector | ||
---|---|---|---|
Product: | WebKit | Reporter: | Anders Hartvoll Ruud <andruud> |
Component: | CSS | Assignee: | Ryosuke Niwa <rniwa> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | emilio, koivisto, nlawson, rniwa, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 13 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | |||
Bug Blocks: | 148695 |
Anders Hartvoll Ruud
It appears that Webkit currently accepts a <compound-selector-list> parse-time (but then it doesn't fully work at selector-matching-time)?
In any case, the correct grammar is now: :host( <compound-selector> )
https://drafts.csswg.org/css-scoping/#selectordef-host
Test:
<!DOCTYPE html>
<template id=template>
<style>
:host(#host1) slot { color: green; }
:host(#host2, #host3) slot { color: green; }
</style>
<slot></slot>
</template>
<div id=host1><span>Should be green</span></div>
<div id=host2><span>Should not be green</span></div>
<div id=host3><span>Should not be green</span></div>
<script>
host1.attachShadow({mode:'open'}).append(template.content.cloneNode(true));
host2.attachShadow({mode:'open'}).append(template.content.cloneNode(true));
host3.attachShadow({mode:'open'}).append(template.content.cloneNode(true));
</script>
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/75311716>
Ryosuke Niwa
Pull request: https://github.com/WebKit/WebKit/pull/2045
EWS
Committed 252110@main (e91f2366aef4): <https://commits.webkit.org/252110@main>
Reviewed commits have been landed. Closing PR #2045 and removing active labels.
Tim Nguyen (:ntim)
*** Bug 249420 has been marked as a duplicate of this bug. ***