Files
sousa-gecko/testing/web-platform/tests/css/selectors/old-tests/css3-modsel-d4.xml
T
Kent Tamura a74febe09b Bug 2052877 [wpt PR 61088] - css/selectors: Automate a part of legacy selectors tests (180 to 183, d*), a=testonly
Automatic update from web-platform-tests
css/selectors: Automate a part of legacy selectors tests (180 to 183, d*)

reference/br-this-line-green-color.xht is renamed to
br4em-this-line-green-color.xht, and br-this-line-green-color.xht is
added for 180a.

Change-Id: I684ae5d7574cf9b2a8293b1bd467ea77d4882858
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7952980
Commit-Queue: Koji Ishii <kojii@chromium.org>
Auto-Submit: Kent Tamura <tkent@chromium.org>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1657151}

--

wpt-commits: 0e3ae676de364b42c0e8ed277246bcdf8668c5b1
wpt-pr: 61088
2026-07-10 09:25:56 +00:00

41 lines
1.5 KiB
XML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Dynamic updating of :first-child and :last-child</title>
<style type="text/css"><![CDATA[
#two:first-child { background: red; }
#three:last-child { background: lime; }
]]></style>
<link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
<link rel="help" href="https://www.w3.org/TR/css3-selectors/#selectors"/> <!-- bogus link to make sure it gets found -->
<meta name="flags" content=" dom" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="common.js"></script>
</head>
<body>
<div>
<div><p id="two">This line should be unstyled. (2)</p><p id="three">This line should have a green background. (3)</p><p id="four">This line should be unstyled. (4 moving to 1)</p></div>
</div>
<script><![CDATA[
test(function() {
const el2 = document.getElementById('two');
const el3 = document.getElementById('three');
// Perform the DOM manipulation
el2.parentNode.insertBefore(el3.nextSibling, el2);
// Check styles
// #two is no longer :first-child, so it should not be red
assert_not_background_color(el2, RED, '#two should not be red');
// #three is now :last-child, so it should be lime
assert_background_color(el3, LIME, '#three should be lime');
}, "Dynamic updating of :first-child and :last-child");
]]></script>
</body>
</html>