aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rees <mrees@noeontheend.com>2025-03-25 14:27:38 -0500
committerGitHub <noreply@github.com>2025-03-25 19:27:38 +0000
commit09041e77a044fdc771338d8e3023a830608d4264 (patch)
tree2e3e960493eb6b5e59ba6c6cb45ddb423a927085
parent80fc64d0631244b4e165ecd1151b079bdfc2a2a4 (diff)
downloadservo-09041e77a044fdc771338d8e3023a830608d4264.tar.gz
servo-09041e77a044fdc771338d8e3023a830608d4264.zip
Fix check in get_array_index_from_id to return early on ASCII char (#36136)
* fix: wrong ascii check in get_array_index_from_id Signed-off-by: Michael Rees <mrees@noeontheend.com> * Update WPT expectations Signed-off-by: Michael Rees <mrees@noeontheend.com> --------- Signed-off-by: Michael Rees <mrees@noeontheend.com>
-rw-r--r--components/script/dom/bindings/utils.rs2
-rw-r--r--tests/wpt/meta/dom/collections/HTMLCollection-supported-property-indices.html.ini6
-rw-r--r--tests/wpt/meta/html/browsers/the-window-object/window-indexed-properties-strict.html.ini3
-rw-r--r--tests/wpt/meta/html/browsers/the-window-object/window-indexed-properties.html.ini3
4 files changed, 1 insertions, 13 deletions
diff --git a/components/script/dom/bindings/utils.rs b/components/script/dom/bindings/utils.rs
index 1fb26186d2e..cf89f8379cd 100644
--- a/components/script/dom/bindings/utils.rs
+++ b/components/script/dom/bindings/utils.rs
@@ -196,7 +196,7 @@ pub(crate) unsafe fn get_array_index_from_id(_cx: *mut JSContext, id: HandleId)
let first_char = char::decode_utf16(chars.iter().cloned())
.next()
.map_or('\0', |r| r.unwrap_or('\0'));
- if !first_char.is_ascii_lowercase() {
+ if first_char.is_ascii_lowercase() {
return None;
}
diff --git a/tests/wpt/meta/dom/collections/HTMLCollection-supported-property-indices.html.ini b/tests/wpt/meta/dom/collections/HTMLCollection-supported-property-indices.html.ini
index 5d12c434b5f..5fe1b80d8d6 100644
--- a/tests/wpt/meta/dom/collections/HTMLCollection-supported-property-indices.html.ini
+++ b/tests/wpt/meta/dom/collections/HTMLCollection-supported-property-indices.html.ini
@@ -1,10 +1,4 @@
[HTMLCollection-supported-property-indices.html]
- [Handling of property names that look like integers around 2^31]
- expected: FAIL
-
- [Handling of property names that look like integers around 2^32]
- expected: FAIL
-
[Trying to set an expando that would shadow an already-existing indexed property]
expected: FAIL
diff --git a/tests/wpt/meta/html/browsers/the-window-object/window-indexed-properties-strict.html.ini b/tests/wpt/meta/html/browsers/the-window-object/window-indexed-properties-strict.html.ini
index 441f1b382be..cdcdfd1a646 100644
--- a/tests/wpt/meta/html/browsers/the-window-object/window-indexed-properties-strict.html.ini
+++ b/tests/wpt/meta/html/browsers/the-window-object/window-indexed-properties-strict.html.ini
@@ -1,6 +1,3 @@
[window-indexed-properties-strict.html]
[Indexed properties of the window object (strict mode) 1]
expected: FAIL
-
- [Borderline numeric key: 2 ** 32 - 2 is an index (strict mode)]
- expected: FAIL
diff --git a/tests/wpt/meta/html/browsers/the-window-object/window-indexed-properties.html.ini b/tests/wpt/meta/html/browsers/the-window-object/window-indexed-properties.html.ini
index 2b6f67705a4..d61bd27a119 100644
--- a/tests/wpt/meta/html/browsers/the-window-object/window-indexed-properties.html.ini
+++ b/tests/wpt/meta/html/browsers/the-window-object/window-indexed-properties.html.ini
@@ -1,6 +1,3 @@
[window-indexed-properties.html]
[Indexed properties of the window object (non-strict mode) 1]
expected: FAIL
-
- [Borderline numeric key: 2 ** 32 - 2 is an index]
- expected: FAIL