mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Use #[must_root] for HTMLElements
This commit is contained in:
parent
30014c3919
commit
f5087e1490
70 changed files with 138 additions and 5 deletions
|
@ -24,6 +24,7 @@ pub enum HeadingLevel {
|
|||
}
|
||||
|
||||
#[deriving(Encodable)]
|
||||
#[must_root]
|
||||
pub struct HTMLHeadingElement {
|
||||
pub htmlelement: HTMLElement,
|
||||
pub level: HeadingLevel,
|
||||
|
@ -43,6 +44,7 @@ impl HTMLHeadingElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>, level: HeadingLevel) -> Temporary<HTMLHeadingElement> {
|
||||
let element = HTMLHeadingElement::new_inherited(localName, document, level);
|
||||
Node::reflect_node(box element, document, HTMLHeadingElementBinding::Wrap)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue