wpt / css / css-cascade / scope-import-inner-scope.html

Status: FAIL | Duration: 43ms | Subtests: 1/2 | Open test on wpt.live | wpt.fyi

Data from commit:
a50cb89 wpt: run reference-named files which are themselves tests (#836) (2026-09-03)

SubtestStatusMessage
@scope within scope-imported stylesheet matchesFAILassert_equals: expected "1" but got ""
@scope within scope-imported does not ignore import scopePASS

/css/css-cascade/scope-import-inner-scope.html

<!DOCTYPE html>
<title>@import scope(), :scope rules in imported stylesheet</title>
<link rel="help" href="https://drafts.csswg.org/css-cascade-6/#at-import">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@import url("resources/scope-imported.css") scope((.scope));
</style>
<main id=main>
  <div class=scope>
    <div class=inner-scope>
      <div class=z>Inside</div>
    </div>
  </div>
  <div class=inner-scope>
    <div class=z>Outside</div>
  </div>
</main>
<script>
  test(() => {
    let e = main.querySelector('.scope > .inner-scope > .z');
    assert_equals(getComputedStyle(e).getPropertyValue('--z'), '1');
  }, '@scope within scope-imported stylesheet matches');

  test(() => {
    let e = main.querySelector('#main > .inner-scope > .z');
    assert_equals(getComputedStyle(e).getPropertyValue('--z'), '');
  }, '@scope within scope-imported does not ignore import scope');
</script>