servo: Merge #12443 - Inline DOM element creation into box expressions in components/script/dom/ (from ice9js:cleanup/inline-dom-element-creation); r=Ms2ger
authorKuba Birecki <kuba.birecki@crystalplanet.io>
Thu, 14 Jul 2016 01:30:22 -0700
changeset 339288 e81a3fd3aad8b1ac2712f57467baa95ce4f37a29
parent 339287 00ec7947707f2e724f846e23930529df91424ab2
child 339289 b6797748ba864b9d9c019e7f9d22d643cff345b8
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger
servo: Merge #12443 - Inline DOM element creation into box expressions in components/script/dom/ (from ice9js:cleanup/inline-dom-element-creation); r=Ms2ger Takes care of #12436. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #12436. <!-- Either: --> - [X] These changes do not require tests because the changes do not affect any functionality. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: f3f134707506c311ad89deb8f9177c05f59bd483
servo/components/script/dom/documenttype.rs
servo/components/script/dom/htmlanchorelement.rs
servo/components/script/dom/htmlappletelement.rs
servo/components/script/dom/htmlareaelement.rs
servo/components/script/dom/htmlaudioelement.rs
servo/components/script/dom/htmlbaseelement.rs
servo/components/script/dom/htmlbodyelement.rs
servo/components/script/dom/htmlbrelement.rs
servo/components/script/dom/htmlbuttonelement.rs
servo/components/script/dom/htmlcanvaselement.rs
servo/components/script/dom/htmldataelement.rs
servo/components/script/dom/htmldatalistelement.rs
servo/components/script/dom/htmldetailselement.rs
servo/components/script/dom/htmldialogelement.rs
servo/components/script/dom/htmldirectoryelement.rs
servo/components/script/dom/htmldlistelement.rs
servo/components/script/dom/htmlelement.rs
servo/components/script/dom/htmlembedelement.rs
servo/components/script/dom/htmlfieldsetelement.rs
servo/components/script/dom/htmlfontelement.rs
servo/components/script/dom/htmlformelement.rs
servo/components/script/dom/htmlframeelement.rs
servo/components/script/dom/htmlframesetelement.rs
servo/components/script/dom/htmlheadelement.rs
servo/components/script/dom/htmlheadingelement.rs
servo/components/script/dom/htmlhrelement.rs
servo/components/script/dom/htmlhtmlelement.rs
servo/components/script/dom/htmliframeelement.rs
servo/components/script/dom/htmlimageelement.rs
servo/components/script/dom/htmlinputelement.rs
servo/components/script/dom/htmllabelelement.rs
servo/components/script/dom/htmllegendelement.rs
servo/components/script/dom/htmllielement.rs
servo/components/script/dom/htmllinkelement.rs
servo/components/script/dom/htmlmapelement.rs
servo/components/script/dom/htmlmetaelement.rs
servo/components/script/dom/htmlmeterelement.rs
servo/components/script/dom/htmlmodelement.rs
servo/components/script/dom/htmlobjectelement.rs
servo/components/script/dom/htmlolistelement.rs
servo/components/script/dom/htmloptgroupelement.rs
servo/components/script/dom/htmloptionelement.rs
servo/components/script/dom/htmloutputelement.rs
servo/components/script/dom/htmlparagraphelement.rs
servo/components/script/dom/htmlparamelement.rs
servo/components/script/dom/htmlpreelement.rs
servo/components/script/dom/htmlprogresselement.rs
servo/components/script/dom/htmlquoteelement.rs
servo/components/script/dom/htmlscriptelement.rs
servo/components/script/dom/htmlselectelement.rs
servo/components/script/dom/htmlsourceelement.rs
servo/components/script/dom/htmlspanelement.rs
servo/components/script/dom/htmlstyleelement.rs
servo/components/script/dom/htmltablecaptionelement.rs
servo/components/script/dom/htmltablecolelement.rs
servo/components/script/dom/htmltableelement.rs
servo/components/script/dom/htmltableheadercellelement.rs
servo/components/script/dom/htmltablesectionelement.rs
servo/components/script/dom/htmltemplateelement.rs
servo/components/script/dom/htmltextareaelement.rs
servo/components/script/dom/htmltimeelement.rs
servo/components/script/dom/htmltitleelement.rs
servo/components/script/dom/htmltrackelement.rs
servo/components/script/dom/htmlulistelement.rs
servo/components/script/dom/htmlunknownelement.rs
servo/components/script/dom/htmlvideoelement.rs
--- a/servo/components/script/dom/documenttype.rs
+++ b/servo/components/script/dom/documenttype.rs
@@ -36,18 +36,19 @@ impl DocumentType {
         }
     }
     #[allow(unrooted_must_root)]
     pub fn new(name: DOMString,
                public_id: Option<DOMString>,
                system_id: Option<DOMString>,
                document: &Document)
                -> Root<DocumentType> {
-        let documenttype = DocumentType::new_inherited(name, public_id, system_id, document);
-        Node::reflect_node(box documenttype, document, DocumentTypeBinding::Wrap)
+        Node::reflect_node(box DocumentType::new_inherited(name, public_id, system_id, document),
+                           document,
+                           DocumentTypeBinding::Wrap)
     }
 
     #[inline]
     pub fn name(&self) -> &DOMString {
         &self.name
     }
 
     #[inline]
--- a/servo/components/script/dom/htmlanchorelement.rs
+++ b/servo/components/script/dom/htmlanchorelement.rs
@@ -49,18 +49,19 @@ impl HTMLAnchorElement {
             url: DOMRefCell::new(None),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLAnchorElement> {
-        let element = HTMLAnchorElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLAnchorElementBinding::Wrap)
+        Node::reflect_node(box HTMLAnchorElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLAnchorElementBinding::Wrap)
     }
 
     // https://html.spec.whatwg.org/multipage/#concept-hyperlink-url-set
     fn set_url(&self) {
         let attribute = self.upcast::<Element>().get_attribute(&ns!(), &atom!("href"));
         *self.url.borrow_mut() = attribute.and_then(|attribute| {
             let document = document_from_node(self);
             document.base_url().join(&attribute.value()).ok()
--- a/servo/components/script/dom/htmlappletelement.rs
+++ b/servo/components/script/dom/htmlappletelement.rs
@@ -28,18 +28,19 @@ impl HTMLAppletElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLAppletElement> {
-        let element = HTMLAppletElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLAppletElementBinding::Wrap)
+        Node::reflect_node(box HTMLAppletElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLAppletElementBinding::Wrap)
     }
 }
 
 impl HTMLAppletElementMethods for HTMLAppletElement {
     // https://html.spec.whatwg.org/multipage/#the-applet-element:dom-applet-name
     make_getter!(Name, "name");
 
     // https://html.spec.whatwg.org/multipage/#the-applet-element:dom-applet-name
--- a/servo/components/script/dom/htmlareaelement.rs
+++ b/servo/components/script/dom/htmlareaelement.rs
@@ -29,18 +29,19 @@ impl HTMLAreaElement {
             rel_list: Default::default(),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLAreaElement> {
-        let element = HTMLAreaElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLAreaElementBinding::Wrap)
+        Node::reflect_node(box HTMLAreaElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLAreaElementBinding::Wrap)
     }
 }
 
 impl VirtualMethods for HTMLAreaElement {
     fn super_type(&self) -> Option<&VirtualMethods> {
         Some(self.upcast::<HTMLElement>() as &VirtualMethods)
     }
 
--- a/servo/components/script/dom/htmlaudioelement.rs
+++ b/servo/components/script/dom/htmlaudioelement.rs
@@ -24,12 +24,13 @@ impl HTMLAudioElement {
                 HTMLMediaElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLAudioElement> {
-        let element = HTMLAudioElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLAudioElementBinding::Wrap)
+        Node::reflect_node(box HTMLAudioElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLAudioElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlbaseelement.rs
+++ b/servo/components/script/dom/htmlbaseelement.rs
@@ -28,18 +28,19 @@ impl HTMLBaseElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLBaseElement> {
-        let element = HTMLBaseElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLBaseElementBinding::Wrap)
+        Node::reflect_node(box HTMLBaseElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLBaseElementBinding::Wrap)
     }
 
     /// https://html.spec.whatwg.org/multipage/#frozen-base-url
     pub fn frozen_base_url(&self) -> Url {
         let href = self.upcast::<Element>().get_attribute(&ns!(), &atom!("href"))
             .expect("The frozen base url is only defined for base elements \
                      that have a base url.");
         let document = document_from_node(self);
--- a/servo/components/script/dom/htmlbodyelement.rs
+++ b/servo/components/script/dom/htmlbodyelement.rs
@@ -37,18 +37,19 @@ impl HTMLBodyElement {
         HTMLBodyElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document)
                -> Root<HTMLBodyElement> {
-        let element = HTMLBodyElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLBodyElementBinding::Wrap)
+        Node::reflect_node(box HTMLBodyElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLBodyElementBinding::Wrap)
     }
 
     /// https://drafts.csswg.org/cssom-view/#the-html-body-element
     pub fn is_the_html_body_element(&self) -> bool {
         let self_node = self.upcast::<Node>();
         let root_elem = self.upcast::<Element>().root_element();
         let root_node = root_elem.upcast::<Node>();
         root_node.is_parent_of(self_node) &&
--- a/servo/components/script/dom/htmlbrelement.rs
+++ b/servo/components/script/dom/htmlbrelement.rs
@@ -21,12 +21,13 @@ impl HTMLBRElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLBRElement> {
-        let element = HTMLBRElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLBRElementBinding::Wrap)
+        Node::reflect_node(box HTMLBRElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLBRElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlbuttonelement.rs
+++ b/servo/components/script/dom/htmlbuttonelement.rs
@@ -53,18 +53,19 @@ impl HTMLButtonElement {
             button_type: Cell::new(ButtonType::Submit)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLButtonElement> {
-        let element = HTMLButtonElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLButtonElementBinding::Wrap)
+        Node::reflect_node(box HTMLButtonElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLButtonElementBinding::Wrap)
     }
 }
 
 impl HTMLButtonElementMethods for HTMLButtonElement {
     // https://html.spec.whatwg.org/multipage/#dom-cva-validity
     fn Validity(&self) -> Root<ValidityState> {
         let window = window_from_node(self);
         ValidityState::new(window.r(), self.upcast())
--- a/servo/components/script/dom/htmlcanvaselement.rs
+++ b/servo/components/script/dom/htmlcanvaselement.rs
@@ -62,18 +62,19 @@ impl HTMLCanvasElement {
             context: DOMRefCell::new(None),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLCanvasElement> {
-        let element = HTMLCanvasElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLCanvasElementBinding::Wrap)
+        Node::reflect_node(box HTMLCanvasElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLCanvasElementBinding::Wrap)
     }
 
     fn recreate_contexts(&self) {
         let size = self.get_size();
         if let Some(ref context) = *self.context.borrow() {
             match *context {
                 CanvasContext::Context2d(ref context) => context.set_bitmap_dimensions(size),
                 CanvasContext::WebGL(ref context) => context.recreate(size),
--- a/servo/components/script/dom/htmldataelement.rs
+++ b/servo/components/script/dom/htmldataelement.rs
@@ -23,12 +23,13 @@ impl HTMLDataElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLDataElement> {
-        let element = HTMLDataElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLDataElementBinding::Wrap)
+        Node::reflect_node(box HTMLDataElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLDataElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmldatalistelement.rs
+++ b/servo/components/script/dom/htmldatalistelement.rs
@@ -29,18 +29,19 @@ impl HTMLDataListElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLDataListElement> {
-        let element = HTMLDataListElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLDataListElementBinding::Wrap)
+        Node::reflect_node(box HTMLDataListElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLDataListElementBinding::Wrap)
     }
 }
 
 impl HTMLDataListElementMethods for HTMLDataListElement {
     // https://html.spec.whatwg.org/multipage/#dom-datalist-options
     fn Options(&self) -> Root<HTMLCollection> {
         #[derive(JSTraceable, HeapSizeOf)]
         struct HTMLDataListOptionsFilter;
--- a/servo/components/script/dom/htmldetailselement.rs
+++ b/servo/components/script/dom/htmldetailselement.rs
@@ -36,18 +36,19 @@ impl HTMLDetailsElement {
             toggle_counter: Cell::new(0)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLDetailsElement> {
-        let element = HTMLDetailsElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLDetailsElementBinding::Wrap)
+        Node::reflect_node(box HTMLDetailsElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLDetailsElementBinding::Wrap)
     }
 
     pub fn check_toggle_count(&self, number: u32) -> bool {
         number == self.toggle_counter.get()
     }
 }
 
 impl HTMLDetailsElementMethods for HTMLDetailsElement {
--- a/servo/components/script/dom/htmldialogelement.rs
+++ b/servo/components/script/dom/htmldialogelement.rs
@@ -28,18 +28,19 @@ impl HTMLDialogElement {
             return_value: DOMRefCell::new(DOMString::new()),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLDialogElement> {
-        let element = HTMLDialogElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLDialogElementBinding::Wrap)
+        Node::reflect_node(box HTMLDialogElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLDialogElementBinding::Wrap)
     }
 }
 
 impl HTMLDialogElementMethods for HTMLDialogElement {
     // https://html.spec.whatwg.org/multipage/#dom-dialog-open
     make_bool_getter!(Open, "open");
 
     // https://html.spec.whatwg.org/multipage/#dom-dialog-open
--- a/servo/components/script/dom/htmldirectoryelement.rs
+++ b/servo/components/script/dom/htmldirectoryelement.rs
@@ -24,12 +24,13 @@ impl HTMLDirectoryElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLDirectoryElement> {
-        let element = HTMLDirectoryElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLDirectoryElementBinding::Wrap)
+        Node::reflect_node(box HTMLDirectoryElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLDirectoryElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmldlistelement.rs
+++ b/servo/components/script/dom/htmldlistelement.rs
@@ -22,12 +22,13 @@ impl HTMLDListElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLDListElement> {
-        let element = HTMLDListElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLDListElementBinding::Wrap)
+        Node::reflect_node(box HTMLDListElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLDListElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlelement.rs
+++ b/servo/components/script/dom/htmlelement.rs
@@ -58,18 +58,19 @@ impl HTMLElement {
                 Element::new_inherited_with_state(state, tag_name, ns!(html), prefix, document),
             style_decl: Default::default(),
             dataset: Default::default(),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) -> Root<HTMLElement> {
-        let element = HTMLElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLElementBinding::Wrap)
+        Node::reflect_node(box HTMLElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLElementBinding::Wrap)
     }
 
     fn is_body_or_frameset(&self) -> bool {
         let eventtarget = self.upcast::<EventTarget>();
         eventtarget.is::<HTMLBodyElement>() || eventtarget.is::<HTMLFrameSetElement>()
     }
 
     fn update_sequentially_focusable_status(&self) {
--- a/servo/components/script/dom/htmlembedelement.rs
+++ b/servo/components/script/dom/htmlembedelement.rs
@@ -21,12 +21,13 @@ impl HTMLEmbedElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLEmbedElement> {
-        let element = HTMLEmbedElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLEmbedElementBinding::Wrap)
+        Node::reflect_node(box HTMLEmbedElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLEmbedElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlfieldsetelement.rs
+++ b/servo/components/script/dom/htmlfieldsetelement.rs
@@ -35,18 +35,19 @@ impl HTMLFieldSetElement {
                                                       localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLFieldSetElement> {
-        let element = HTMLFieldSetElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLFieldSetElementBinding::Wrap)
+        Node::reflect_node(box HTMLFieldSetElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLFieldSetElementBinding::Wrap)
     }
 }
 
 impl HTMLFieldSetElementMethods for HTMLFieldSetElement {
     // https://html.spec.whatwg.org/multipage/#dom-fieldset-elements
     fn Elements(&self) -> Root<HTMLCollection> {
         #[derive(JSTraceable, HeapSizeOf)]
         struct ElementsFilter;
--- a/servo/components/script/dom/htmlfontelement.rs
+++ b/servo/components/script/dom/htmlfontelement.rs
@@ -30,18 +30,19 @@ impl HTMLFontElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLFontElement> {
-        let element = HTMLFontElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLFontElementBinding::Wrap)
+        Node::reflect_node(box HTMLFontElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLFontElementBinding::Wrap)
     }
 }
 
 impl HTMLFontElementMethods for HTMLFontElement {
     // https://html.spec.whatwg.org/multipage/#dom-font-color
     make_getter!(Color, "color");
 
     // https://html.spec.whatwg.org/multipage/#dom-font-color
--- a/servo/components/script/dom/htmlformelement.rs
+++ b/servo/components/script/dom/htmlformelement.rs
@@ -77,18 +77,19 @@ impl HTMLFormElement {
             generation_id: Cell::new(GenerationId(0))
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLFormElement> {
-        let element = HTMLFormElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLFormElementBinding::Wrap)
+        Node::reflect_node(box HTMLFormElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLFormElementBinding::Wrap)
     }
 
     pub fn generation_id(&self) -> GenerationId {
         self.generation_id.get()
     }
 }
 
 impl HTMLFormElementMethods for HTMLFormElement {
--- a/servo/components/script/dom/htmlframeelement.rs
+++ b/servo/components/script/dom/htmlframeelement.rs
@@ -21,12 +21,13 @@ impl HTMLFrameElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLFrameElement> {
-        let element = HTMLFrameElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLFrameElementBinding::Wrap)
+        Node::reflect_node(box HTMLFrameElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLFrameElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlframesetelement.rs
+++ b/servo/components/script/dom/htmlframesetelement.rs
@@ -27,17 +27,18 @@ impl HTMLFrameSetElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLFrameSetElement> {
-        let element = HTMLFrameSetElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLFrameSetElementBinding::Wrap)
+        Node::reflect_node(box HTMLFrameSetElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLFrameSetElementBinding::Wrap)
     }
 }
 
 impl HTMLFrameSetElementMethods for HTMLFrameSetElement {
     // https://html.spec.whatwg.org/multipage/#windoweventhandlers
     window_event_handlers!(ForwardToWindow);
 }
--- a/servo/components/script/dom/htmlheadelement.rs
+++ b/servo/components/script/dom/htmlheadelement.rs
@@ -29,18 +29,19 @@ impl HTMLHeadElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLHeadElement> {
-        let element = HTMLHeadElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLHeadElementBinding::Wrap)
+        Node::reflect_node(box HTMLHeadElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLHeadElementBinding::Wrap)
     }
 
     /// https://html.spec.whatwg.org/multipage/#meta-referrer
     pub fn set_document_referrer(&self) {
         let doc = document_from_node(self);
 
         if doc.GetHead().r() != Some(self) {
             return;
--- a/servo/components/script/dom/htmlheadingelement.rs
+++ b/servo/components/script/dom/htmlheadingelement.rs
@@ -38,12 +38,13 @@ impl HTMLHeadingElement {
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document,
                level: HeadingLevel) -> Root<HTMLHeadingElement> {
-        let element = HTMLHeadingElement::new_inherited(localName, prefix, document, level);
-        Node::reflect_node(box element, document, HTMLHeadingElementBinding::Wrap)
+        Node::reflect_node(box HTMLHeadingElement::new_inherited(localName, prefix, document, level),
+                           document,
+                           HTMLHeadingElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlhrelement.rs
+++ b/servo/components/script/dom/htmlhrelement.rs
@@ -26,18 +26,19 @@ impl HTMLHRElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLHRElement> {
-        let element = HTMLHRElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLHRElementBinding::Wrap)
+        Node::reflect_node(box HTMLHRElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLHRElementBinding::Wrap)
     }
 }
 
 impl HTMLHRElementMethods for HTMLHRElement {
     // https://html.spec.whatwg.org/multipage/#dom-hr-align
     make_getter!(Align, "align");
 
     // https://html.spec.whatwg.org/multipage/#dom-hr-align
--- a/servo/components/script/dom/htmlhtmlelement.rs
+++ b/servo/components/script/dom/htmlhtmlelement.rs
@@ -21,12 +21,13 @@ impl HTMLHtmlElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLHtmlElement> {
-        let element = HTMLHtmlElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLHtmlElementBinding::Wrap)
+        Node::reflect_node(box HTMLHtmlElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLHtmlElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmliframeelement.rs
+++ b/servo/components/script/dom/htmliframeelement.rs
@@ -207,18 +207,19 @@ impl HTMLIFrameElement {
             visibility: Cell::new(true),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLIFrameElement> {
-        let element = HTMLIFrameElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLIFrameElementBinding::Wrap)
+        Node::reflect_node(box HTMLIFrameElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLIFrameElementBinding::Wrap)
     }
 
     #[inline]
     pub fn pipeline_id(&self) -> Option<PipelineId> {
         self.pipeline_id.get()
     }
 
     #[inline]
--- a/servo/components/script/dom/htmlimageelement.rs
+++ b/servo/components/script/dom/htmlimageelement.rs
@@ -208,18 +208,19 @@ impl HTMLImageElement {
             }),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLImageElement> {
-        let element = HTMLImageElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLImageElementBinding::Wrap)
+        Node::reflect_node(box HTMLImageElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLImageElementBinding::Wrap)
     }
 
     pub fn Image(global: GlobalRef,
                  width: Option<u32>,
                  height: Option<u32>) -> Fallible<Root<HTMLImageElement>> {
         let document = global.as_window().Document();
         let image = HTMLImageElement::new(atom!("img"), None, document.r());
         if let Some(w) = width {
--- a/servo/components/script/dom/htmlinputelement.rs
+++ b/servo/components/script/dom/htmlinputelement.rs
@@ -142,18 +142,19 @@ impl HTMLInputElement {
             filelist: MutNullableHeap::new(None),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLInputElement> {
-        let element = HTMLInputElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLInputElementBinding::Wrap)
+        Node::reflect_node(box HTMLInputElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLInputElementBinding::Wrap)
     }
 
     pub fn type_(&self) -> Atom {
         self.upcast::<Element>()
             .get_attribute(&ns!(), &atom!("type"))
             .map_or_else(|| atom!(""), |a| a.value().as_atom().to_owned())
     }
 
--- a/servo/components/script/dom/htmllabelelement.rs
+++ b/servo/components/script/dom/htmllabelelement.rs
@@ -33,18 +33,19 @@ impl HTMLLabelElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLLabelElement> {
-        let element = HTMLLabelElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLLabelElementBinding::Wrap)
+        Node::reflect_node(box HTMLLabelElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLLabelElementBinding::Wrap)
     }
 }
 
 impl Activatable for HTMLLabelElement {
     fn as_element(&self) -> &Element {
         self.upcast::<Element>()
     }
 
--- a/servo/components/script/dom/htmllegendelement.rs
+++ b/servo/components/script/dom/htmllegendelement.rs
@@ -30,18 +30,19 @@ impl HTMLLegendElement {
         HTMLLegendElement { htmlelement: HTMLElement::new_inherited(localName, prefix, document) }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document)
                -> Root<HTMLLegendElement> {
-        let element = HTMLLegendElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLLegendElementBinding::Wrap)
+        Node::reflect_node(box HTMLLegendElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLLegendElementBinding::Wrap)
     }
 }
 
 impl VirtualMethods for HTMLLegendElement {
     fn super_type(&self) -> Option<&VirtualMethods> {
         Some(self.upcast::<HTMLElement>() as &VirtualMethods)
     }
 
--- a/servo/components/script/dom/htmllielement.rs
+++ b/servo/components/script/dom/htmllielement.rs
@@ -21,12 +21,13 @@ impl HTMLLIElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLLIElement> {
-        let element = HTMLLIElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLLIElementBinding::Wrap)
+        Node::reflect_node(box HTMLLIElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLLIElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmllinkelement.rs
+++ b/servo/components/script/dom/htmllinkelement.rs
@@ -67,18 +67,19 @@ impl HTMLLinkElement {
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document,
                creator: ElementCreator) -> Root<HTMLLinkElement> {
-        let element = HTMLLinkElement::new_inherited(localName, prefix, document, creator);
-        Node::reflect_node(box element, document, HTMLLinkElementBinding::Wrap)
+        Node::reflect_node(box HTMLLinkElement::new_inherited(localName, prefix, document, creator),
+                           document,
+                           HTMLLinkElementBinding::Wrap)
     }
 
     pub fn get_stylesheet(&self) -> Option<Arc<Stylesheet>> {
         self.stylesheet.borrow().clone()
     }
 }
 
 fn get_attr(element: &Element, local_name: &Atom) -> Option<String> {
--- a/servo/components/script/dom/htmlmapelement.rs
+++ b/servo/components/script/dom/htmlmapelement.rs
@@ -23,12 +23,13 @@ impl HTMLMapElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLMapElement> {
-        let element = HTMLMapElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLMapElementBinding::Wrap)
+        Node::reflect_node(box HTMLMapElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLMapElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlmetaelement.rs
+++ b/servo/components/script/dom/htmlmetaelement.rs
@@ -40,18 +40,19 @@ impl HTMLMetaElement {
             stylesheet: DOMRefCell::new(None),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLMetaElement> {
-        let element = HTMLMetaElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLMetaElementBinding::Wrap)
+        Node::reflect_node(box HTMLMetaElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLMetaElementBinding::Wrap)
     }
 
     pub fn get_stylesheet(&self) -> Option<Arc<Stylesheet>> {
         self.stylesheet.borrow().clone()
     }
 
     fn process_attributes(&self) {
         let element = self.upcast::<Element>();
--- a/servo/components/script/dom/htmlmeterelement.rs
+++ b/servo/components/script/dom/htmlmeterelement.rs
@@ -25,18 +25,19 @@ impl HTMLMeterElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLMeterElement> {
-        let element = HTMLMeterElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLMeterElementBinding::Wrap)
+        Node::reflect_node(box HTMLMeterElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLMeterElementBinding::Wrap)
     }
 }
 
 impl HTMLMeterElementMethods for HTMLMeterElement {
     // https://html.spec.whatwg.org/multipage/#dom-lfe-labels
     fn Labels(&self) -> Root<NodeList> {
         self.upcast::<HTMLElement>().labels()
     }
--- a/servo/components/script/dom/htmlmodelement.rs
+++ b/servo/components/script/dom/htmlmodelement.rs
@@ -24,12 +24,13 @@ impl HTMLModElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLModElement> {
-        let element = HTMLModElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLModElementBinding::Wrap)
+        Node::reflect_node(box HTMLModElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLModElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlobjectelement.rs
+++ b/servo/components/script/dom/htmlobjectelement.rs
@@ -37,18 +37,19 @@ impl HTMLObjectElement {
             image: DOMRefCell::new(None),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLObjectElement> {
-        let element = HTMLObjectElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLObjectElementBinding::Wrap)
+        Node::reflect_node(box HTMLObjectElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLObjectElementBinding::Wrap)
     }
 }
 
 trait ProcessDataURL {
     fn process_data_url(&self);
 }
 
 impl<'a> ProcessDataURL for &'a HTMLObjectElement {
--- a/servo/components/script/dom/htmlolistelement.rs
+++ b/servo/components/script/dom/htmlolistelement.rs
@@ -23,12 +23,13 @@ impl HTMLOListElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLOListElement> {
-        let element = HTMLOListElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLOListElementBinding::Wrap)
+        Node::reflect_node(box HTMLOListElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLOListElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmloptgroupelement.rs
+++ b/servo/components/script/dom/htmloptgroupelement.rs
@@ -32,18 +32,19 @@ impl HTMLOptGroupElement {
                                                       localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLOptGroupElement> {
-        let element = HTMLOptGroupElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLOptGroupElementBinding::Wrap)
+        Node::reflect_node(box HTMLOptGroupElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLOptGroupElementBinding::Wrap)
     }
 }
 
 impl HTMLOptGroupElementMethods for HTMLOptGroupElement {
     // https://html.spec.whatwg.org/multipage/#dom-optgroup-disabled
     make_bool_getter!(Disabled, "disabled");
 
     // https://html.spec.whatwg.org/multipage/#dom-optgroup-disabled
--- a/servo/components/script/dom/htmloptionelement.rs
+++ b/servo/components/script/dom/htmloptionelement.rs
@@ -47,18 +47,19 @@ impl HTMLOptionElement {
             dirtiness: Cell::new(false),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLOptionElement> {
-        let element = HTMLOptionElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLOptionElementBinding::Wrap)
+        Node::reflect_node(box HTMLOptionElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLOptionElementBinding::Wrap)
     }
 
     pub fn set_selectedness(&self, selected: bool) {
         self.selectedness.set(selected);
     }
 
     fn pick_if_selected_and_reset(&self) {
         if let Some(select) = self.upcast::<Node>().ancestors()
--- a/servo/components/script/dom/htmloutputelement.rs
+++ b/servo/components/script/dom/htmloutputelement.rs
@@ -29,18 +29,19 @@ impl HTMLOutputElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLOutputElement> {
-        let element = HTMLOutputElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLOutputElementBinding::Wrap)
+        Node::reflect_node(box HTMLOutputElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLOutputElementBinding::Wrap)
     }
 }
 
 impl HTMLOutputElementMethods for HTMLOutputElement {
     // https://html.spec.whatwg.org/multipage/#dom-cva-validity
     fn Validity(&self) -> Root<ValidityState> {
         let window = window_from_node(self);
         ValidityState::new(window.r(), self.upcast())
--- a/servo/components/script/dom/htmlparagraphelement.rs
+++ b/servo/components/script/dom/htmlparagraphelement.rs
@@ -24,12 +24,13 @@ impl HTMLParagraphElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLParagraphElement> {
-        let element = HTMLParagraphElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLParagraphElementBinding::Wrap)
+        Node::reflect_node(box HTMLParagraphElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLParagraphElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlparamelement.rs
+++ b/servo/components/script/dom/htmlparamelement.rs
@@ -24,12 +24,13 @@ impl HTMLParamElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLParamElement> {
-        let element = HTMLParamElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLParamElementBinding::Wrap)
+        Node::reflect_node(box HTMLParamElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLParamElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlpreelement.rs
+++ b/servo/components/script/dom/htmlpreelement.rs
@@ -24,12 +24,13 @@ impl HTMLPreElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLPreElement> {
-        let element = HTMLPreElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLPreElementBinding::Wrap)
+        Node::reflect_node(box HTMLPreElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLPreElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlprogresselement.rs
+++ b/servo/components/script/dom/htmlprogresselement.rs
@@ -26,18 +26,19 @@ impl HTMLProgressElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLProgressElement> {
-        let element = HTMLProgressElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLProgressElementBinding::Wrap)
+        Node::reflect_node(box HTMLProgressElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLProgressElementBinding::Wrap)
     }
 }
 
 impl HTMLProgressElementMethods for HTMLProgressElement {
     // https://html.spec.whatwg.org/multipage/#dom-lfe-labels
     fn Labels(&self) -> Root<NodeList> {
         self.upcast::<HTMLElement>().labels()
     }
--- a/servo/components/script/dom/htmlquoteelement.rs
+++ b/servo/components/script/dom/htmlquoteelement.rs
@@ -24,12 +24,13 @@ impl HTMLQuoteElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLQuoteElement> {
-        let element = HTMLQuoteElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLQuoteElementBinding::Wrap)
+        Node::reflect_node(box HTMLQuoteElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLQuoteElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlscriptelement.rs
+++ b/servo/components/script/dom/htmlscriptelement.rs
@@ -84,18 +84,19 @@ impl HTMLScriptElement {
             load: DOMRefCell::new(None),
             block_character_encoding: Cell::new(None),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document,
                creator: ElementCreator) -> Root<HTMLScriptElement> {
-        let element = HTMLScriptElement::new_inherited(localName, prefix, document, creator);
-        Node::reflect_node(box element, document, HTMLScriptElementBinding::Wrap)
+        Node::reflect_node(box HTMLScriptElement::new_inherited(localName, prefix, document, creator),
+                           document,
+                           HTMLScriptElementBinding::Wrap)
     }
 }
 
 
 /// Supported script types as defined by
 /// <https://html.spec.whatwg.org/multipage/#javascript-mime-type>.
 static SCRIPT_JS_MIMES: StaticStringVec = &[
     "application/ecmascript",
--- a/servo/components/script/dom/htmlselectelement.rs
+++ b/servo/components/script/dom/htmlselectelement.rs
@@ -43,18 +43,19 @@ impl HTMLSelectElement {
                                                       localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLSelectElement> {
-        let element = HTMLSelectElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLSelectElementBinding::Wrap)
+        Node::reflect_node(box HTMLSelectElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLSelectElementBinding::Wrap)
     }
 
     // https://html.spec.whatwg.org/multipage/#ask-for-a-reset
     pub fn ask_for_reset(&self) {
         if self.Multiple() {
             return;
         }
 
--- a/servo/components/script/dom/htmlsourceelement.rs
+++ b/servo/components/script/dom/htmlsourceelement.rs
@@ -24,12 +24,13 @@ impl HTMLSourceElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLSourceElement> {
-        let element = HTMLSourceElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLSourceElementBinding::Wrap)
+        Node::reflect_node(box HTMLSourceElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLSourceElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlspanelement.rs
+++ b/servo/components/script/dom/htmlspanelement.rs
@@ -21,12 +21,13 @@ impl HTMLSpanElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLSpanElement> {
-        let element = HTMLSpanElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLSpanElementBinding::Wrap)
+        Node::reflect_node(box HTMLSpanElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLSpanElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlstyleelement.rs
+++ b/servo/components/script/dom/htmlstyleelement.rs
@@ -37,18 +37,19 @@ impl HTMLStyleElement {
             stylesheet: DOMRefCell::new(None),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLStyleElement> {
-        let element = HTMLStyleElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLStyleElementBinding::Wrap)
+        Node::reflect_node(box HTMLStyleElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLStyleElementBinding::Wrap)
     }
 
     pub fn parse_own_css(&self) {
         let node = self.upcast::<Node>();
         let element = self.upcast::<Element>();
         assert!(node.is_in_doc());
 
         let win = window_from_node(node);
--- a/servo/components/script/dom/htmltablecaptionelement.rs
+++ b/servo/components/script/dom/htmltablecaptionelement.rs
@@ -24,12 +24,13 @@ impl HTMLTableCaptionElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLTableCaptionElement> {
-        let element = HTMLTableCaptionElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLTableCaptionElementBinding::Wrap)
+        Node::reflect_node(box HTMLTableCaptionElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLTableCaptionElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmltablecolelement.rs
+++ b/servo/components/script/dom/htmltablecolelement.rs
@@ -24,12 +24,13 @@ impl HTMLTableColElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLTableColElement> {
-        let element = HTMLTableColElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLTableColElementBinding::Wrap)
+        Node::reflect_node(box HTMLTableColElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLTableColElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmltableelement.rs
+++ b/servo/components/script/dom/htmltableelement.rs
@@ -43,18 +43,19 @@ impl HTMLTableElement {
             cellspacing: Cell::new(None),
             tbodies: Default::default(),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document)
                -> Root<HTMLTableElement> {
-        let element = HTMLTableElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLTableElementBinding::Wrap)
+        Node::reflect_node(box HTMLTableElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLTableElementBinding::Wrap)
     }
 
     pub fn get_border(&self) -> Option<u32> {
         self.border.get()
     }
 
     // https://html.spec.whatwg.org/multipage/#dom-table-thead
     // https://html.spec.whatwg.org/multipage/#dom-table-tfoot
--- a/servo/components/script/dom/htmltableheadercellelement.rs
+++ b/servo/components/script/dom/htmltableheadercellelement.rs
@@ -24,12 +24,13 @@ impl HTMLTableHeaderCellElement {
                 HTMLTableCellElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLTableHeaderCellElement> {
-        let element = HTMLTableHeaderCellElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLTableHeaderCellElementBinding::Wrap)
+        Node::reflect_node(box HTMLTableHeaderCellElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLTableHeaderCellElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmltablesectionelement.rs
+++ b/servo/components/script/dom/htmltablesectionelement.rs
@@ -30,18 +30,19 @@ impl HTMLTableSectionElement {
         HTMLTableSectionElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document)
                -> Root<HTMLTableSectionElement> {
-        let element = HTMLTableSectionElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLTableSectionElementBinding::Wrap)
+        Node::reflect_node(box HTMLTableSectionElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLTableSectionElementBinding::Wrap)
     }
 }
 
 #[derive(JSTraceable)]
 struct RowsFilter;
 impl CollectionFilter for RowsFilter {
     fn filter(&self, elem: &Element, root: &Node) -> bool {
         elem.is::<HTMLTableRowElement>() &&
--- a/servo/components/script/dom/htmltemplateelement.rs
+++ b/servo/components/script/dom/htmltemplateelement.rs
@@ -34,18 +34,19 @@ impl HTMLTemplateElement {
             contents: MutNullableHeap::new(None),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLTemplateElement> {
-        let element = HTMLTemplateElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLTemplateElementBinding::Wrap)
+        Node::reflect_node(box HTMLTemplateElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLTemplateElementBinding::Wrap)
     }
 }
 
 impl HTMLTemplateElementMethods for HTMLTemplateElement {
     /// https://html.spec.whatwg.org/multipage/#dom-template-content
     fn Content(&self) -> Root<DocumentFragment> {
         self.contents.or_init(|| {
             let doc = document_from_node(self);
--- a/servo/components/script/dom/htmltextareaelement.rs
+++ b/servo/components/script/dom/htmltextareaelement.rs
@@ -109,18 +109,19 @@ impl HTMLTextAreaElement {
             value_changed: Cell::new(false),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLTextAreaElement> {
-        let element = HTMLTextAreaElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLTextAreaElementBinding::Wrap)
+        Node::reflect_node(box HTMLTextAreaElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLTextAreaElementBinding::Wrap)
     }
 }
 
 impl HTMLTextAreaElementMethods for HTMLTextAreaElement {
     // TODO A few of these attributes have default values and additional
     // constraints
 
     // https://html.spec.whatwg.org/multipage/#dom-textarea-cols
--- a/servo/components/script/dom/htmltimeelement.rs
+++ b/servo/components/script/dom/htmltimeelement.rs
@@ -21,12 +21,13 @@ impl HTMLTimeElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLTimeElement> {
-        let element = HTMLTimeElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLTimeElementBinding::Wrap)
+        Node::reflect_node(box HTMLTimeElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLTimeElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmltitleelement.rs
+++ b/servo/components/script/dom/htmltitleelement.rs
@@ -27,18 +27,19 @@ impl HTMLTitleElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLTitleElement> {
-        let element = HTMLTitleElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLTitleElementBinding::Wrap)
+        Node::reflect_node(box HTMLTitleElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLTitleElementBinding::Wrap)
     }
 }
 
 impl HTMLTitleElementMethods for HTMLTitleElement {
     // https://html.spec.whatwg.org/multipage/#dom-title-text
     fn Text(&self) -> DOMString {
         let mut content = String::new();
         for child in self.upcast::<Node>().children() {
--- a/servo/components/script/dom/htmltrackelement.rs
+++ b/servo/components/script/dom/htmltrackelement.rs
@@ -21,12 +21,13 @@ impl HTMLTrackElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLTrackElement> {
-        let element = HTMLTrackElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLTrackElementBinding::Wrap)
+        Node::reflect_node(box HTMLTrackElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLTrackElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlulistelement.rs
+++ b/servo/components/script/dom/htmlulistelement.rs
@@ -21,12 +21,13 @@ impl HTMLUListElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLUListElement> {
-        let element = HTMLUListElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLUListElementBinding::Wrap)
+        Node::reflect_node(box HTMLUListElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLUListElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlunknownelement.rs
+++ b/servo/components/script/dom/htmlunknownelement.rs
@@ -24,12 +24,13 @@ impl HTMLUnknownElement {
                 HTMLElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLUnknownElement> {
-        let element = HTMLUnknownElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLUnknownElementBinding::Wrap)
+        Node::reflect_node(box HTMLUnknownElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLUnknownElementBinding::Wrap)
     }
 }
--- a/servo/components/script/dom/htmlvideoelement.rs
+++ b/servo/components/script/dom/htmlvideoelement.rs
@@ -22,12 +22,13 @@ impl HTMLVideoElement {
                 HTMLMediaElement::new_inherited(localName, prefix, document)
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLVideoElement> {
-        let element = HTMLVideoElement::new_inherited(localName, prefix, document);
-        Node::reflect_node(box element, document, HTMLVideoElementBinding::Wrap)
+        Node::reflect_node(box HTMLVideoElement::new_inherited(localName, prefix, document),
+                           document,
+                           HTMLVideoElementBinding::Wrap)
     }
 }