Files
sousa-gecko/testing/web-platform/tests/dom/xpath-result-single-node-value-nullable.html
T
Yeonghan Kim 1d835a4c2f Bug 1999093 [wpt PR 55952] - Make singleNodeValue nullable to match DOM spec, a=testonly
Automatic update from web-platform-tests
Make singleNodeValue nullable to match DOM spec

This patch updates the singleNodeValue attribute from non-nullable to
nullable to match the DOM specification. Since null was already returned
regardless of the IDL change, this patch is not an actual behavior
change.

Bug: 456874035
Change-Id: Ib6b69c8c991a6a21d531242c87bcdf4e51bc40ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7109180
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: YeongHan Kim <soosungp33@gmail.com>
Reviewed-by: Jinho Bang <zino@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1542186}

--

wpt-commits: 6f197498db7799ad4f82ba90d76a1656f29573f5
wpt-pr: 55952
2025-11-11 15:31:52 +00:00

34 lines
832 B
HTML

<!DOCTYPE html>
<meta charset="UTF-8">
<title>XPathResult singleNodeValue should be nullable</title>
<link rel=help href="https://dom.spec.whatwg.org/#dom-xpathresult-singlenodevalue">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<div id="div">
<span id="exist"></span>
</div>
<script>
test(() => {
const div = document.getElementById('div');
const isNull = document.evaluate(
'//non-span',
div,
null,
XPathResult.FIRST_ORDERED_NODE_TYPE,
null
);
assert_equals(isNull.singleNodeValue, null);
const isNotNull = document.evaluate(
'//span',
div,
null,
XPathResult.FIRST_ORDERED_NODE_TYPE,
null
);
assert_not_equals(isNotNull.singleNodeValue, null);
}, 'singleNodeValue should be nullable');
</script>
</body>