Automatic update from web-platform-tests Fix a WPT test that was originally not test anything Change-Id: Id69558275d2f16d22ae3b6e85a18de9df7d54f92 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7623839 Reviewed-by: Fredrik Söderquist <fs@opera.com> Commit-Queue: Jason Leo <cgqaq@chromium.org> Cr-Commit-Position: refs/heads/main@{#1592432} -- wpt-commits: 26398bc62531b9374c8f7b99190a10739c256b8f wpt-pr: 58173
33 lines
922 B
HTML
33 lines
922 B
HTML
<!DOCTYPE html>
|
|
<title>Mixed declarations and rules</title>
|
|
<link rel="author" title="CGQAQ" href="mailto:cgqaq@chromium.org">
|
|
<link rel="help" href="https://drafts.csswg.org/css-nesting/#nested-declarations-rule">
|
|
<link rel="help" href="https://web.dev/blog/css-nesting-cssnesteddeclarations">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
|
|
<style>
|
|
div {
|
|
width: 100px;
|
|
height: 100px;
|
|
background-color: blue;
|
|
@media all {
|
|
background-color: red;
|
|
}
|
|
background-color: green;
|
|
}
|
|
</style>
|
|
|
|
<body>
|
|
<p>Tests pass if <strong>block is green</strong></p>
|
|
<div class="test"></div>
|
|
|
|
<script>
|
|
test(() => {
|
|
const div = document.querySelector(".test");
|
|
const style = getComputedStyle(div);
|
|
assert_equals(style.backgroundColor, "rgb(0, 128, 0)");
|
|
}, "Nested declarations and rules should be handled correctly")
|
|
</script>
|
|
</body>
|