fix(geometry): construct DOMRectReadOnly instances

This commit is contained in:
ldm0
2026-11-21 19:24:42 +08:00
parent 1ca78bd24a
commit 0577c16dbd
2 changed files with 21 additions and 0 deletions
@@ -531,6 +531,11 @@ pub(in crate::context_bootstrap) fn build_constructor_template_for_profile<'s>(
ConstructorKind::DomRectReadOnly => {
super::super::dom_rect::build_dom_rect_readonly_constructor_template(scope)
}
ConstructorKind::DomRectReadOnly => v8::FunctionTemplate::builder(
super::super::dom_rect::dom_rect_readonly_constructor_callback,
)
.length(0)
.build(scope),
ConstructorKind::DomRect => {
super::super::dom_rect::build_dom_rect_constructor_template(scope)
}
+16
View File
@@ -22,6 +22,22 @@ struct DomRectObjectDeclaration {}
#[webapi(interface = web_api_interfaces::DOMRectReadOnly)]
struct DomRectReadOnlyObjectDeclaration {}
#[derive(WebApiObject)]
#[webapi(interface = "DOMRectReadOnly")]
struct DomRectReadOnlyObjectDeclaration {
#[webapi(slot = DOM_RECT_BRAND_SLOT, init = true)]
brand: (),
#[webapi(slot = DOM_RECT_X_SLOT)]
x: f64,
#[webapi(slot = DOM_RECT_Y_SLOT)]
y: f64,
#[webapi(slot = DOM_RECT_WIDTH_SLOT)]
width: f64,
#[webapi(slot = DOM_RECT_HEIGHT_SLOT)]
height: f64,
}
#[derive(WebApiFunctionTemplate)]
#[webapi(interface = web_api_interfaces::DOMRectReadOnly)]
struct DomRectReadOnlyPrototypeDeclaration {