commit 1d835a4c2f3897f277a155127a45eb3515dc6bd5
parent 8baa2b423b3ed3389026e6b8191d0f739504e2ea
Author: Yeonghan Kim <soosungp33@gmail.com>
Date: Mon, 10 Nov 2025 22:20:36 +0000
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
Diffstat:
1 file changed, 35 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/dom/xpath-result-single-node-value-nullable.html b/testing/web-platform/tests/dom/xpath-result-single-node-value-nullable.html
@@ -0,0 +1,34 @@
+<!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>
+\ No newline at end of file