mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -22,6 +22,7 @@ use crate::dom::virtualmethods::VirtualMethods;
|
|||
use cssparser::RGBA;
|
||||
use dom_struct::dom_struct;
|
||||
use html5ever::{LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use style::attr::AttrValue;
|
||||
|
||||
#[derive(JSTraceable)]
|
||||
|
@ -56,12 +57,14 @@ impl HTMLTableRowElement {
|
|||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document,
|
||||
proto: Option<HandleObject>,
|
||||
) -> DomRoot<HTMLTableRowElement> {
|
||||
let n = Node::reflect_node(
|
||||
let n = Node::reflect_node_with_proto(
|
||||
Box::new(HTMLTableRowElement::new_inherited(
|
||||
local_name, prefix, document,
|
||||
)),
|
||||
document,
|
||||
proto,
|
||||
);
|
||||
|
||||
n.upcast::<Node>().set_weird_parser_insertion_mode();
|
||||
|
@ -100,7 +103,7 @@ impl HTMLTableRowElementMethods for HTMLTableRowElement {
|
|||
node.insert_cell_or_row(
|
||||
index,
|
||||
|| self.Cells(),
|
||||
|| HTMLTableCellElement::new(local_name!("td"), None, &node.owner_doc()),
|
||||
|| HTMLTableCellElement::new(local_name!("td"), None, &node.owner_doc(), None),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue