mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Support arbitrary protos when wrapping DOM objects with constructors.
This commit is contained in:
parent
d9600ff50f
commit
dbff26bce0
197 changed files with 2028 additions and 586 deletions
|
@ -9,6 +9,7 @@ use crate::dom::htmlelement::HTMLElement;
|
|||
use crate::dom::node::Node;
|
||||
use dom_struct::dom_struct;
|
||||
use html5ever::{LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct HTMLHtmlElement {
|
||||
|
@ -32,10 +33,12 @@ impl HTMLHtmlElement {
|
|||
localName: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document,
|
||||
proto: Option<HandleObject>,
|
||||
) -> DomRoot<HTMLHtmlElement> {
|
||||
let n = Node::reflect_node(
|
||||
let n = Node::reflect_node_with_proto(
|
||||
Box::new(HTMLHtmlElement::new_inherited(localName, prefix, document)),
|
||||
document,
|
||||
proto,
|
||||
);
|
||||
|
||||
n.upcast::<Node>().set_weird_parser_insertion_mode();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue