Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust
Rust ai-agentsai-toolsbrowserbrowser-automationcloud-browserheadlessheadless-browserkitesurfplaywrightpuppeteerrustservoweb-crawlerweb-crawlingweb-scraperweb-scraping
fix(geometry): return branded DOMRectList objects
ldm086dbfcafea1c
diff --git a/moli-renderer-v8/src/context_bootstrap.rs b/moli-renderer-v8/src/context_bootstrap.rsindex a7944dc44..a02f8f5d9 100644--- a/moli-renderer-v8/src/context_bootstrap.rs+++ b/moli-renderer-v8/src/context_bootstrap.rs@@ -16,6 +16,7 @@ mod css_fontface_runtime;mod css_runtime;pub(crate) mod css_stylesheet_runtime;mod dom_rect;+mod dom_rect_list;mod event_document;mod event_legacy;pub(crate) mod event_target_dispatch;@@ -263,6 +264,7 @@ pub(crate) use self::css_stylesheet_runtime::{pub(crate) use self::dom_rect::{build_dom_rect_clone_object, build_dom_rect_object, dom_rect_clone_data,};+pub(crate) use self::dom_rect_list::build_dom_rect_list_object;pub(crate) use self::events::{EVENT_DISPATCHING_SLOT, EVENT_PASSIVE_SLOT, EVENT_STOP_IMMEDIATE_PROPAGATION_SLOT,EVENT_STOP_PROPAGATION_SLOT, clear_event_composed_path, construct_original_error_event,diff --git a/moli-renderer-v8/src/context_bootstrap/assets/prototype_bindings.rs b/moli-renderer-v8/src/context_bootstrap/assets/prototype_bindings.rsindex b83455d29..f527a4a43 100644--- a/moli-renderer-v8/src/context_bootstrap/assets/prototype_bindings.rs+++ b/moli-renderer-v8/src/context_bootstrap/assets/prototype_bindings.rs@@ -15,6 +15,7 @@ use super::super::{css_runtime::install_css_typed_om_template_bindings,css_stylesheet_runtime::install_css_stylesheet_template_bindings,dom_rect::install_dom_rect_template_bindings,+ dom_rect_list::install_dom_rect_list_template_bindings,event_template::install_event_template_bindings,file_api::install_file_api_template_bindings,geometry_runtime::install_geometry_template_bindings,@@ -411,6 +412,7 @@ pub(super) fn install_constructor_template_bindings<'s>(install_attr_template_bindings(scope, template, spec.interface.name());install_dom_rect_template_bindings(scope, template, spec.interface.name());install_time_ranges_template_bindings(scope, template, spec.interface.name());+ install_dom_rect_list_template_bindings(scope, template, spec.interface.name());install_dom_exception_template_bindings(scope, template, spec.interface.name());install_dom_implementation_template_bindings(scope, template, spec.interface.name());install_custom_element_registry_template_bindings(scope, template, spec.interface.name());diff --git a/moli-renderer-v8/src/context_bootstrap/dom_rect_list.rs b/moli-renderer-v8/src/context_bootstrap/dom_rect_list.rsnew file mode 100644index 000000000..3768aafcb--- /dev/null+++ b/moli-renderer-v8/src/context_bootstrap/dom_rect_list.rs@@ -0,0 +1,229 @@+use crate::{+ util::{get_private_object, serialize_v8_array, throw_type_error},+ web_api_interfaces, webidl,+};+use moli_webapi_declare::{+ DataPropertyDescriptorDeclaration, WebApiFunctionTemplate, WebApiObject,+};++const DOM_RECT_LIST_VALUES_SLOT: &str = "__moliDomRectListValues";++#[derive(WebApiFunctionTemplate)]+#[webapi(interface = web_api_interfaces::DOMRectList, enumerable)]+struct DomRectListPrototypeDeclaration {+ #[webapi(accessor_property, getter = dom_rect_list_length_getter)]+ length: (),++ #[webapi(method, length = 1, callback = dom_rect_list_item_callback)]+ item: (),+}++#[derive(WebApiObject)]+#[webapi(+ interface = web_api_interfaces::DOMRectList,+ require_prototype,+ fallback_to_string_tag = "DOMRectList"+)]+struct DomRectListObjectDeclaration<'scope> {+ #[webapi(slot = DOM_RECT_LIST_VALUES_SLOT)]+ values: v8::Local<'scope, v8::Array>,+}++#[derive(webidl::WebIdlArgs)]+#[webidl(prefix = "DOMRectList.item")]+struct DomRectListItemArgs {+ #[webidl(required)]+ index: u32,+}++pub(crate) fn build_dom_rect_list_object<'s>(+ scope: &mut v8::PinScope<'s, '_>,+ rects: &[v8::Local<'s, v8::Object>],+) -> v8::Local<'s, v8::Object> {+ let values = serialize_v8_array(scope, rects).unwrap_or_else(|| v8::Array::new(scope, 0));+ let template = v8::ObjectTemplate::new(scope);+ template.set_indexed_property_handler(+ v8::IndexedPropertyHandlerConfiguration::new()+ .getter(dom_rect_list_indexed_getter)+ .setter(dom_rect_list_indexed_setter)+ .query(dom_rect_list_indexed_query)+ .deleter(dom_rect_list_indexed_deleter)+ .enumerator(dom_rect_list_indexed_enumerator)+ .definer(dom_rect_list_indexed_definer)+ .descriptor(dom_rect_list_indexed_descriptor),+ );+ let object = template+ .new_instance(scope)+ .expect("DOMRectList object template should instantiate");+ DomRectListObjectDeclaration::new(values)+ .bind_into(scope, object)+ .expect("DOMRectList declaration should bind");+ object+}++pub(in crate::context_bootstrap) fn install_dom_rect_list_template_bindings<'s>(+ scope: &mut v8::PinScope<'s, '_, ()>,+ template: v8::Local<'s, v8::FunctionTemplate>,+ interface_name: &str,+) {+ if interface_name == "DOMRectList" {+ DomRectListPrototypeDeclaration::initialize_prototype_template(+ scope,+ template.prototype_template(scope),+ );+ }+}++fn dom_rect_list_values<'s>(+ scope: &mut v8::PinScope<'s, '_>,+ object: v8::Local<'s, v8::Object>,+) -> Option<v8::Local<'s, v8::Array>> {+ get_private_object(scope, object, DOM_RECT_LIST_VALUES_SLOT)+ .and_then(|values| v8::Local::<v8::Array>::try_from(values).ok())+}++fn require_dom_rect_list_values<'s>(+ scope: &mut v8::PinScope<'s, '_>,+ object: v8::Local<'s, v8::Object>,+ member: &str,+) -> Option<v8::Local<'s, v8::Array>> {+ dom_rect_list_values(scope, object).or_else(|| {+ throw_type_error(+ scope,+ &format!("Failed to execute '{member}' on 'DOMRectList': Illegal invocation."),+ );+ None+ })+}++fn dom_rect_list_length_getter<'s>(+ scope: &mut v8::PinScope<'s, '_>,+ args: v8::FunctionCallbackArguments<'s>,+ mut rv: v8::ReturnValue<'_, v8::Value>,+) {+ let Some(values) = require_dom_rect_list_values(scope, args.this(), "get length") else {+ return;+ };+ rv.set_uint32(values.length());+}++fn dom_rect_list_item_callback<'s>(+ scope: &mut v8::PinScope<'s, '_>,+ args: v8::FunctionCallbackArguments<'s>,+ mut rv: v8::ReturnValue<'_, v8::Value>,+) {+ let Some(values) = require_dom_rect_list_values(scope, args.this(), "item") else {+ return;+ };+ let Some(parsed) = webidl::parse_args::<DomRectListItemArgs>(scope, &args) else {+ return;+ };+ match values.get_index(scope, parsed.index) {+ Some(value) if !value.is_null_or_undefined() => rv.set(value),+ _ => rv.set(v8::null(scope).into()),+ }+}++fn dom_rect_list_indexed_getter<'s>(+ scope: &mut v8::PinScope<'s, '_>,+ index: u32,+ args: v8::PropertyCallbackArguments<'s>,+ mut rv: v8::ReturnValue<'_, v8::Value>,+) -> v8::Intercepted {+ let Some(value) = dom_rect_list_values(scope, args.holder())+ .filter(|values| index < values.length())+ .and_then(|values| values.get_index(scope, index))+ else {+ return v8::Intercepted::kNo;+ };+ rv.set(value);+ v8::Intercepted::kYes+}++fn dom_rect_list_indexed_query<'s>(+ scope: &mut v8::PinScope<'s, '_>,+ index: u32,+ args: v8::PropertyCallbackArguments<'s>,+ mut rv: v8::ReturnValue<'_, v8::Integer>,+) -> v8::Intercepted {+ let Some(values) = dom_rect_list_values(scope, args.holder()) else {+ return v8::Intercepted::kNo;+ };+ if index >= values.length() {+ return v8::Intercepted::kNo;+ }+ rv.set_int32(v8::PropertyAttribute::READ_ONLY.as_u32() as i32);+ v8::Intercepted::kYes+}++fn dom_rect_list_indexed_setter(+ _scope: &mut v8::PinScope<'_, '_>,+ _index: u32,+ _value: v8::Local<'_, v8::Value>,+ _args: v8::PropertyCallbackArguments<'_>,+ mut rv: v8::ReturnValue<'_, v8::Boolean>,+) -> v8::Intercepted {+ rv.set_bool(false);+ v8::Intercepted::kYes+}++fn dom_rect_list_indexed_deleter<'s>(+ scope: &mut v8::PinScope<'s, '_>,+ index: u32,+ args: v8::PropertyCallbackArguments<'s>,+ mut rv: v8::ReturnValue<'_, v8::Boolean>,+) -> v8::Intercepted {+ let Some(values) = dom_rect_list_values(scope, args.holder()) else {+ return v8::Intercepted::kNo;+ };+ if index >= values.length() {+ return v8::Intercepted::kNo;+ }+ rv.set_bool(false);+ v8::Intercepted::kYes+}++fn dom_rect_list_indexed_definer(+ _scope: &mut v8::PinScope<'_, '_>,+ _index: u32,+ _descriptor: &v8::PropertyDescriptor,+ _args: v8::PropertyCallbackArguments<'_>,+ mut rv: v8::ReturnValue<'_, v8::Boolean>,+) -> v8::Intercepted {+ rv.set_bool(true);+ v8::Intercepted::kYes+}++fn dom_rect_list_indexed_enumerator<'s>(+ scope: &mut v8::PinScope<'s, '_>,+ args: v8::PropertyCallbackArguments<'s>,+ mut rv: v8::ReturnValue<'_, v8::Array>,+) {+ let length = dom_rect_list_values(scope, args.holder())+ .map(|values| values.length())+ .unwrap_or(0);+ let keys = (0..length)+ .map(|index| v8::Integer::new_from_unsigned(scope, index).into())+ .collect::<Vec<_>>();+ rv.set(v8::Array::new_with_elements(scope, &keys));+}++fn dom_rect_list_indexed_descriptor<'s>(+ scope: &mut v8::PinScope<'s, '_>,+ index: u32,+ args: v8::PropertyCallbackArguments<'s>,+ mut rv: v8::ReturnValue<'_, v8::Value>,+) -> v8::Intercepted {+ let Some(value) = dom_rect_list_values(scope, args.holder())+ .filter(|values| index < values.length())+ .and_then(|values| values.get_index(scope, index))+ else {+ return v8::Intercepted::kNo;+ };+ let Ok(descriptor) = DataPropertyDescriptorDeclaration::new(value, false, true).bind(scope)+ else {+ return v8::Intercepted::kNo;+ };+ rv.set(descriptor.into());+ v8::Intercepted::kYes+}diff --git a/moli-renderer-v8/src/context_bootstrap/range_algorithms/geometry.rs b/moli-renderer-v8/src/context_bootstrap/range_algorithms/geometry.rsindex c602e8d8b..7235cb87c 100644--- a/moli-renderer-v8/src/context_bootstrap/range_algorithms/geometry.rs+++ b/moli-renderer-v8/src/context_bootstrap/range_algorithms/geometry.rs@@ -1,5 +1,5 @@use super::*;-use crate::util::{call_object_method, object_string_property, serialize_v8_array};+use crate::util::{call_object_method, object_string_property};enum NativeRangeGeometryQuery {Text,@@ -332,7 +332,7 @@ pub(in crate::context_bootstrap) fn range_geometry_dom_rect<'s>(pub(in crate::context_bootstrap) fn range_geometry_client_rects<'s>(scope: &mut v8::PinScope<'s, '_>,range: v8::Local<'s, v8::Object>,-) -> Option<v8::Local<'s, v8::Array>> {+) -> Option<v8::Local<'s, v8::Object>> {if let Some(rects) = native_range_client_rects(scope, range) {return match rects {Ok(rects) => {@@ -340,7 +340,7 @@ pub(in crate::context_bootstrap) fn range_geometry_client_rects<'s>(.into_iter().filter_map(|rect| new_dom_rect_from_client_rect(scope, rect)).collect::<Vec<_>>();- serialize_v8_array(scope, rects)+ Some(dom_rect_list::build_dom_rect_list_object(scope, &rects))}Err(error) => {throw_range_layout_error(scope, error);@@ -350,12 +350,12 @@ pub(in crate::context_bootstrap) fn range_geometry_client_rects<'s>(}if let Some(rect) = collapsed_text_range_client_rect(scope, range) {let rect = new_dom_rect_from_client_rect(scope, rect)?;- return serialize_v8_array(scope, [rect]);+ return Some(dom_rect_list::build_dom_rect_list_object(scope, &[rect]));}let target = range_geometry_target(scope, range)?;let rect = client_rect_for_object(scope, target)?;let rect = new_dom_rect_from_client_rect(scope, rect)?;- serialize_v8_array(scope, [rect])+ Some(dom_rect_list::build_dom_rect_list_object(scope, &[rect]))}pub(in crate::context_bootstrap) fn new_dom_rect_zero<'s>(diff --git a/moli-renderer-v8/src/context_bootstrap/range_surface/geometry.rs b/moli-renderer-v8/src/context_bootstrap/range_surface/geometry.rsindex e8ea622ac..81cabbf48 100644--- a/moli-renderer-v8/src/context_bootstrap/range_surface/geometry.rs+++ b/moli-renderer-v8/src/context_bootstrap/range_surface/geometry.rs@@ -18,11 +18,10 @@ pub(super) fn range_get_client_rects_callback<'s>(args: v8::FunctionCallbackArguments<'s>,mut rv: v8::ReturnValue<'_, v8::Value>,) {- let rects =- range_geometry_client_rects(scope, args.this()).or_else(|| Some(v8::Array::new(scope, 0)));- if let Some(rects) = rects {- rv.set(rects.into());- } else {- rv.set(v8::undefined(scope).into());- }+ // Build the no-geometry fallback before querying layout. The query may+ // throw, and allocating a wrapper after that would disturb V8's pending+ // exception state.+ let empty = dom_rect_list::build_dom_rect_list_object(scope, &[]);+ let rects = range_geometry_client_rects(scope, args.this()).unwrap_or(empty);+ rv.set(rects.into());}diff --git a/moli-renderer-v8/src/context_bootstrap/specs/registry.rs b/moli-renderer-v8/src/context_bootstrap/specs/registry.rsindex 229f1c3d8..fdff3e420 100644--- a/moli-renderer-v8/src/context_bootstrap/specs/registry.rs+++ b/moli-renderer-v8/src/context_bootstrap/specs/registry.rs@@ -76,6 +76,10 @@ const CONSTRUCTOR_SPECS_BEFORE_STREAMS: &[ConstructorSpec] = &[interface: web_api_interfaces::DOMStringList::DESCRIPTOR,kind: ConstructorKind::Illegal,},+ ConstructorSpec {+ interface: web_api_interfaces::DOMRectList::DESCRIPTOR,+ kind: ConstructorKind::Illegal,+ },ConstructorSpec {interface: web_api_interfaces::PluginArray::DESCRIPTOR,kind: ConstructorKind::Illegal,diff --git a/moli-renderer-v8/src/native_bridge/element/geometry/rects.rs b/moli-renderer-v8/src/native_bridge/element/geometry/rects.rsindex f7b82634f..1ca04223d 100644--- a/moli-renderer-v8/src/native_bridge/element/geometry/rects.rs+++ b/moli-renderer-v8/src/native_bridge/element/geometry/rects.rs@@ -3,8 +3,8 @@ use super::super::super::node::{throw_incompatible_method_receiver,};use super::{ClientRect, read_bounding_client_rect, read_client_rects};-use crate::context_bootstrap::build_dom_rect_object;-use crate::util::{serialize_v8_array, v8_string};+use crate::context_bootstrap::{build_dom_rect_list_object, build_dom_rect_object};+use crate::util::v8_string;pub(crate) fn client_rect_object<'s>(scope: &mut v8::PinScope<'s, '_>,@@ -22,12 +22,12 @@ pub(crate) fn client_rect_object<'s>(fn client_rect_list<'s>(scope: &mut v8::PinScope<'s, '_>,rects: impl IntoIterator<Item = ClientRect>,-) -> Option<v8::Local<'s, v8::Array>> {+) -> v8::Local<'s, v8::Object> {let rects = rects.into_iter().filter_map(|rect| client_rect_object(scope, rect)).collect::<Vec<_>>();- serialize_v8_array(scope, rects)+ build_dom_rect_list_object(scope, &rects)}fn throw_layout_error(scope: &mut v8::PinScope<'_, '_>, error: moli_layout::LayoutError) {@@ -79,7 +79,6 @@ pub(in crate::native_bridge) fn node_get_client_rects_callback(let Ok((runtime_ptr, handle)) = node_runtime_and_handle_from_args_or_detached(scope, &args)else {throw_incompatible_method_receiver(scope, "Element", "getClientRects");- rv.set(v8::Array::new(scope, 0).into());return;};if !require_element_method_receiver(scope, unsafe { &*runtime_ptr }, handle, "getClientRects") {@@ -89,12 +88,8 @@ pub(in crate::native_bridge) fn node_get_client_rects_callback(Ok(rects) => rects,Err(error) => {throw_layout_error(scope, error);- rv.set(v8::Array::new(scope, 0).into());return;}};- let value = client_rect_list(scope, rects)- .map(Into::into)- .unwrap_or_else(|| v8::Array::new(scope, 0).into());- rv.set(value);+ rv.set(client_rect_list(scope, rects).into());}diff --git a/moli-renderer-v8/src/script_vm/tests/dom_elements/detached/detached_document_and_element_surfaces.rs b/moli-renderer-v8/src/script_vm/tests/dom_elements/detached/detached_document_and_element_surfaces.rsindex c446a95ea..14e95859a 100644--- a/moli-renderer-v8/src/script_vm/tests/dom_elements/detached/detached_document_and_element_surfaces.rs+++ b/moli-renderer-v8/src/script_vm/tests/dom_elements/detached/detached_document_and_element_surfaces.rs@@ -543,7 +543,7 @@ fn detached_interaction_brand_checks_accept_standard_prototype_methods() {rootSame: root === host.shadowRoot,rectType: Object.prototype.toString.call(rect),rectWidthType: typeof rect.width,- rectsArray: Array.isArray(rects),+ rectsType: Object.prototype.toString.call(rects),activeAfterFocus,activeAfterBlur,events: events.join(","),@@ -565,7 +565,7 @@ fn detached_interaction_brand_checks_accept_standard_prototype_methods() {assert_eq!(result,- r#"{"rootType":"[object ShadowRoot]","rootSame":true,"rectType":"[object DOMRect]","rectWidthType":"number","rectsArray":true,"activeAfterFocus":true,"activeAfterBlur":true,"events":"focus,click,blur","attachOwn":false,"boundingOwn":false,"rectsOwn":false,"focusOwn":false,"blurOwn":false,"clickOwn":false,"elementOwners":"Element,Element,Element,Element,Element,Element,Element,Element","elementShapes":"true:function:1:true:true:true|true:function:0:true:true:true|true:function:0:true:true:true|true:function:1:true:true:true|true:function:1:true:true:true|true:function:1:true:true:true|true:function:2:true:true:true|true:function:1:true:true:true","actionOwners":"HTMLElement,HTMLElement,HTMLElement","actionShapes":"true:function:0:true:true:true|true:function:0:true:true:true|true:function:0:true:true:true"}"#+ r#"{"rootType":"[object ShadowRoot]","rootSame":true,"rectType":"[object DOMRect]","rectWidthType":"number","rectsType":"[object DOMRectList]","activeAfterFocus":true,"activeAfterBlur":true,"events":"focus,click,blur","attachOwn":false,"boundingOwn":false,"rectsOwn":false,"focusOwn":false,"blurOwn":false,"clickOwn":false,"elementOwners":"Element,Element,Element,Element,Element,Element,Element,Element","elementShapes":"true:function:1:true:true:true|true:function:0:true:true:true|true:function:0:true:true:true|true:function:1:true:true:true|true:function:1:true:true:true|true:function:1:true:true:true|true:function:2:true:true:true|true:function:1:true:true:true","actionOwners":"HTMLElement,HTMLElement,HTMLElement","actionShapes":"true:function:0:true:true:true|true:function:0:true:true:true|true:function:0:true:true:true"}"#);}diff --git a/moli-renderer-v8/src/script_vm/tests/dom_xhr/misc.rs b/moli-renderer-v8/src/script_vm/tests/dom_xhr/misc.rsindex 0fc0dc9f6..2e5581967 100644--- a/moli-renderer-v8/src/script_vm/tests/dom_xhr/misc.rs+++ b/moli-renderer-v8/src/script_vm/tests/dom_xhr/misc.rs@@ -1725,7 +1725,7 @@ const rect = item.getBoundingClientRect();assert_eq!(result, "function|function|0|true");}#[test]-fn geometry_rect_objects_expose_domrect_to_json() {+fn geometry_rect_objects_and_lists_expose_their_webidl_shapes() {let mut vm = new_rendered_test_vm("https://geometry-domrect-shape.test/","<!doctype html><body><div id='node'>text</div></body>",@@ -1756,12 +1756,16 @@ fn geometry_rect_objects_expose_domrect_to_json() {['x', 'y', 'width', 'height', 'top', 'right', 'bottom', 'left'].every(name => json[name] === rect[name]),+ rects instanceof DOMRectList,Array.isArray(rects),+ Object.prototype.toString.call(rects),rects.length,rects[0] instanceof DOMRect,+ rects.item(0) === rects[0],typeof rects[0].toJSON,rangeRect instanceof DOMRect,typeof rangeRect.toJSON,+ rangeRects instanceof DOMRectList,rangeRects[0] instanceof DOMRect,Object.getPrototypeOf(contentRect) === DOMRectReadOnly.prototype,typeof contentRect.toJSON,@@ -1775,7 +1779,81 @@ fn geometry_rect_objects_expose_domrect_to_json() {assert_eq!(result,- "true|true||function|x,y,width,height,top,right,bottom,left|true|true|1|true|function|true|function|true|true|function|true|false"+ concat!(+ "true|true||function|x,y,width,height,top,right,bottom,left|true|",+ "true|false|[object DOMRectList]|1|true|true|function|true|function|",+ "true|true|true|function|true|false"+ )+ );+}++#[test]+fn dom_rect_list_has_readonly_indexed_semantics_and_rejects_structured_clone() {+ let mut vm = new_parsed_test_vm(+ "https://domrect-list.test/",+ "<!doctype html><body><div id='node'>text</div></body>",+ );++ let result = vm+ .eval(+ r#"+(() => {+ const probe = callback => {+ try {+ callback();+ return "ok";+ } catch (error) {+ return error.name;+ }+ };+ const node = document.getElementById("node");+ const list = node.getClientRects();+ const range = document.createRange();+ range.selectNodeContents(node);+ const rangeList = range.getClientRects();+ const indexDescriptor = Object.getOwnPropertyDescriptor(list, "0");+ const lengthDescriptor = Object.getOwnPropertyDescriptor(+ DOMRectList.prototype,+ "length"+ );+ const itemDescriptor = Object.getOwnPropertyDescriptor(+ DOMRectList.prototype,+ "item"+ );+ const fake = Object.create(DOMRectList.prototype);+ return JSON.stringify({+ constructor: [typeof DOMRectList, DOMRectList.length,+ probe(() => DOMRectList()), probe(() => new DOMRectList())].join("|"),+ instance: [list instanceof DOMRectList, list instanceof Array,+ Object.getPrototypeOf(list) === DOMRectList.prototype,+ Object.prototype.toString.call(list), list.constructor === DOMRectList].join("|"),+ values: [list.length, list[-1], list[1], list.item(-1), list.item(1),+ list.item(0) === list[0], list[0] instanceof DOMRect,+ Object.keys(list).join(",")].join("|"),+ indexDescriptor: [indexDescriptor.value === list[0], indexDescriptor.writable,+ indexDescriptor.enumerable, indexDescriptor.configurable].join("|"),+ prototypeDescriptors: [typeof lengthDescriptor.get, lengthDescriptor.get.name,+ lengthDescriptor.get.length, lengthDescriptor.set === undefined,+ lengthDescriptor.enumerable, lengthDescriptor.configurable,+ itemDescriptor.value.name, itemDescriptor.value.length,+ itemDescriptor.enumerable, itemDescriptor.writable,+ itemDescriptor.configurable].join("|"),+ brands: [probe(() => lengthDescriptor.get.call(fake)),+ probe(() => itemDescriptor.value.call(fake, 0))].join("|"),+ range: [rangeList instanceof DOMRectList,+ Object.prototype.toString.call(rangeList), rangeList.item(0) === rangeList[0]].join("|"),+ clone: probe(() => structuredClone(list)),+ visibleSlots: Object.getOwnPropertyNames(list)+ .filter(name => name.startsWith("__moliDomRectList")).join(",")+ });+})()+"#,+ )+ .expect("DOMRectList WebIDL probe should evaluate");++ assert_eq!(+ result,+ r#"{"constructor":"function|0|TypeError|TypeError","instance":"true|false|true|[object DOMRectList]|true","values":"1|||||true|true|0","indexDescriptor":"true|false|true|true","prototypeDescriptors":"function|get length|0|true|true|true|item|1|true|true|true","brands":"TypeError|TypeError","range":"true|[object DOMRectList]|true","clone":"DataCloneError","visibleSlots":""}"#);}diff --git a/moli-renderer-v8/src/web_api_interfaces.rs b/moli-renderer-v8/src/web_api_interfaces.rsindex add869b46..497edc7ed 100644--- a/moli-renderer-v8/src/web_api_interfaces.rs+++ b/moli-renderer-v8/src/web_api_interfaces.rs@@ -124,6 +124,7 @@ interfaces! {DOMPointReadOnly;DOMQuad;DOMRect: DOMRectReadOnly;+ DOMRectList;DOMRectReadOnly;DOMStringList;DOMStringMap;