mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
Use #[must_root] for HTMLElements
This commit is contained in:
@@ -22,7 +22,7 @@ use servo_util::namespace;
|
||||
use servo_util::str::DOMString;
|
||||
|
||||
#[deriving(Encodable)]
|
||||
#[allow(unrooted_must_root)]
|
||||
#[must_root]
|
||||
pub struct HTMLElement {
|
||||
pub element: Element
|
||||
}
|
||||
@@ -44,6 +44,7 @@ impl HTMLElement {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLElement> {
|
||||
let element = HTMLElement::new_inherited(HTMLElementTypeId, localName, document);
|
||||
Node::reflect_node(box element, document, HTMLElementBinding::Wrap)
|
||||
|
||||
Reference in New Issue
Block a user