mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +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
|
@ -29,6 +29,7 @@ static DefaultWidth: u32 = 300;
|
|||
static DefaultHeight: u32 = 150;
|
||||
|
||||
#[deriving(Encodable)]
|
||||
#[must_root]
|
||||
pub struct HTMLCanvasElement {
|
||||
pub htmlelement: HTMLElement,
|
||||
context: Traceable<Cell<Option<JS<CanvasRenderingContext2D>>>>,
|
||||
|
@ -52,6 +53,7 @@ impl HTMLCanvasElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLCanvasElement> {
|
||||
let element = HTMLCanvasElement::new_inherited(localName, document);
|
||||
Node::reflect_node(box element, document, HTMLCanvasElementBinding::Wrap)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue