Support arbitrary protos when wrapping DOM objects with constructors.

This commit is contained in:
Josh Matthews 2023-05-28 22:43:55 -04:00
parent d9600ff50f
commit dbff26bce0
197 changed files with 2028 additions and 586 deletions

View file

@ -8,6 +8,7 @@ use crate::dom::htmlelement::HTMLElement;
use crate::dom::node::Node;
use dom_struct::dom_struct;
use html5ever::{LocalName, Prefix};
use js::rust::HandleObject;
#[derive(JSTraceable, MallocSizeOf)]
pub enum HeadingLevel {
@ -43,13 +44,15 @@ impl HTMLHeadingElement {
local_name: LocalName,
prefix: Option<Prefix>,
document: &Document,
proto: Option<HandleObject>,
level: HeadingLevel,
) -> DomRoot<HTMLHeadingElement> {
Node::reflect_node(
Node::reflect_node_with_proto(
Box::new(HTMLHeadingElement::new_inherited(
local_name, prefix, document, level,
)),
document,
proto,
)
}
}