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
34 lines
832 B
HTML
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> |