fune/testing/web-platform/tests/css/css-scoping/host-context-specificity-003.html
Rune Lillesveen 6993dfc515 Bug 1497125 [wpt PR 13414] - Make :host account for its own pseudo-class specificity., a=testonly
Automatic update from web-platform-testsMake :host account for its own pseudo-class specificity.

Otherwise `:host div` is equally specific to `div`, which seems
undesirable and doesn't match any spec.

This is only done for Shadow DOM v1 since there are backward compat
issues with Polymer and WebUI.

Intent to ship:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/gYrR2nR6quI

Bug: 857415
Change-Id: Ieaaf9b835ae7136806ced8f6e72fb30f9adf02af
Reviewed-on: https://chromium-review.googlesource.com/c/1250963
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Emilio Cobos Álvarez <emilio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597549}

--

wpt-commits: 5810d070c87063deb718734562e8e2340efacdf1
wpt-pr: 13414
2018-10-12 16:44:40 +00:00

22 lines
605 B
HTML

<!doctype html>
<meta charset="utf-8">
<title>CSS Test: the :host-context() selector affects specificity</title>
<link rel="help" href="https://drafts.csswg.org/css-scoping/#host-selector">
<link rel="match" href="reference/green-box.html">
<p>Test passes if you see a single 100px by 100px green box below.</p>
<div id="host"></div>
<script>
host.attachShadow({ mode: 'open' }).innerHTML = `
<style>
:host-context(*) div {
width: 100px;
height: 100px;
background: green;
}
div {
background: red;
}
</style>
<div></div>
`;
</script>