Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/selectors/selectors-attr-many-2.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Selectors: Many attribute selectors, and one that is only set</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
[x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"],
[x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"],
[x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"],
[x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"],
[x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"],
[x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"],
[x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"], [x="y"],
[a="b"][x] { color: green; }
</style>
<div id="target" a="b" x="z">This text should be green.</div>
<script>
test(() => {
let target = document.getElementById('target');
assert_equals(getComputedStyle(target).color, 'rgb(0, 128, 0)');
});
</script>