servo: Merge #15715 - Make #[dom_struct] a proc_macro attribute (from nox:custom-derive); r=SimonSapin
authorAnthony Ramine <n.oxyde@gmail.com>
Fri, 24 Feb 2017 05:56:30 -0800
changeset 344730 b439aae221f2298caa3f41781ce3dfbd0b36d8ad
parent 344729 b02bffae9133e13c0ccee089642a223e9050bf7b
child 344731 fefe9ce9ccc285021cdae74c555314ebdc76320c
push id31416
push userkwierso@gmail.com
push dateSat, 25 Feb 2017 00:41:26 +0000
treeherdermozilla-central@c3ea1dcedccd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersSimonSapin
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #15715 - Make #[dom_struct] a proc_macro attribute (from nox:custom-derive); r=SimonSapin The rustup is needed for https://github.com/rust-lang/rust/pull/40039. Source-Repo: https://github.com/servo/servo Source-Revision: a204c4176dcccdad8ec99d74055c66794c3f64ba
servo/Cargo.lock
servo/components/dom_struct/Cargo.toml
servo/components/dom_struct/lib.rs
servo/components/script/Cargo.toml
servo/components/script/docs/JS-Servos-only-GC.md
servo/components/script/dom/attr.rs
servo/components/script/dom/beforeunloadevent.rs
servo/components/script/dom/bindings/iterable.rs
servo/components/script/dom/blob.rs
servo/components/script/dom/bluetooth.rs
servo/components/script/dom/bluetoothadvertisingevent.rs
servo/components/script/dom/bluetoothcharacteristicproperties.rs
servo/components/script/dom/bluetoothdevice.rs
servo/components/script/dom/bluetoothpermissionresult.rs
servo/components/script/dom/bluetoothremotegattcharacteristic.rs
servo/components/script/dom/bluetoothremotegattdescriptor.rs
servo/components/script/dom/bluetoothremotegattserver.rs
servo/components/script/dom/bluetoothremotegattservice.rs
servo/components/script/dom/bluetoothuuid.rs
servo/components/script/dom/browsingcontext.rs
servo/components/script/dom/canvasgradient.rs
servo/components/script/dom/canvaspattern.rs
servo/components/script/dom/canvasrenderingcontext2d.rs
servo/components/script/dom/characterdata.rs
servo/components/script/dom/client.rs
servo/components/script/dom/closeevent.rs
servo/components/script/dom/comment.rs
servo/components/script/dom/crypto.rs
servo/components/script/dom/css.rs
servo/components/script/dom/cssconditionrule.rs
servo/components/script/dom/cssfontfacerule.rs
servo/components/script/dom/cssgroupingrule.rs
servo/components/script/dom/cssimportrule.rs
servo/components/script/dom/csskeyframerule.rs
servo/components/script/dom/csskeyframesrule.rs
servo/components/script/dom/cssmediarule.rs
servo/components/script/dom/cssnamespacerule.rs
servo/components/script/dom/cssrule.rs
servo/components/script/dom/cssrulelist.rs
servo/components/script/dom/cssstyledeclaration.rs
servo/components/script/dom/cssstylerule.rs
servo/components/script/dom/cssstylesheet.rs
servo/components/script/dom/csssupportsrule.rs
servo/components/script/dom/cssviewportrule.rs
servo/components/script/dom/customevent.rs
servo/components/script/dom/dedicatedworkerglobalscope.rs
servo/components/script/dom/dissimilaroriginlocation.rs
servo/components/script/dom/dissimilaroriginwindow.rs
servo/components/script/dom/document.rs
servo/components/script/dom/documentfragment.rs
servo/components/script/dom/documenttype.rs
servo/components/script/dom/domexception.rs
servo/components/script/dom/domimplementation.rs
servo/components/script/dom/dommatrix.rs
servo/components/script/dom/dommatrixreadonly.rs
servo/components/script/dom/domparser.rs
servo/components/script/dom/dompoint.rs
servo/components/script/dom/dompointreadonly.rs
servo/components/script/dom/domquad.rs
servo/components/script/dom/domrect.rs
servo/components/script/dom/domrectlist.rs
servo/components/script/dom/domrectreadonly.rs
servo/components/script/dom/domstringmap.rs
servo/components/script/dom/domtokenlist.rs
servo/components/script/dom/element.rs
servo/components/script/dom/errorevent.rs
servo/components/script/dom/event.rs
servo/components/script/dom/eventsource.rs
servo/components/script/dom/eventtarget.rs
servo/components/script/dom/extendableevent.rs
servo/components/script/dom/extendablemessageevent.rs
servo/components/script/dom/file.rs
servo/components/script/dom/filelist.rs
servo/components/script/dom/filereader.rs
servo/components/script/dom/filereadersync.rs
servo/components/script/dom/focusevent.rs
servo/components/script/dom/forcetouchevent.rs
servo/components/script/dom/formdata.rs
servo/components/script/dom/globalscope.rs
servo/components/script/dom/hashchangeevent.rs
servo/components/script/dom/headers.rs
servo/components/script/dom/history.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/htmlcollection.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/htmldivelement.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/htmlformcontrolscollection.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/htmlmediaelement.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/htmloptionscollection.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/htmltablecellelement.rs
servo/components/script/dom/htmltablecolelement.rs
servo/components/script/dom/htmltabledatacellelement.rs
servo/components/script/dom/htmltableelement.rs
servo/components/script/dom/htmltableheadercellelement.rs
servo/components/script/dom/htmltablerowelement.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
servo/components/script/dom/imagedata.rs
servo/components/script/dom/keyboardevent.rs
servo/components/script/dom/location.rs
servo/components/script/dom/mediaerror.rs
servo/components/script/dom/medialist.rs
servo/components/script/dom/mediaquerylist.rs
servo/components/script/dom/mediaquerylistevent.rs
servo/components/script/dom/messageevent.rs
servo/components/script/dom/mimetype.rs
servo/components/script/dom/mimetypearray.rs
servo/components/script/dom/mouseevent.rs
servo/components/script/dom/namednodemap.rs
servo/components/script/dom/navigator.rs
servo/components/script/dom/node.rs
servo/components/script/dom/nodeiterator.rs
servo/components/script/dom/nodelist.rs
servo/components/script/dom/pagetransitionevent.rs
servo/components/script/dom/performance.rs
servo/components/script/dom/performancetiming.rs
servo/components/script/dom/permissions.rs
servo/components/script/dom/permissionstatus.rs
servo/components/script/dom/plugin.rs
servo/components/script/dom/pluginarray.rs
servo/components/script/dom/popstateevent.rs
servo/components/script/dom/processinginstruction.rs
servo/components/script/dom/progressevent.rs
servo/components/script/dom/promise.rs
servo/components/script/dom/promisenativehandler.rs
servo/components/script/dom/radionodelist.rs
servo/components/script/dom/range.rs
servo/components/script/dom/request.rs
servo/components/script/dom/response.rs
servo/components/script/dom/screen.rs
servo/components/script/dom/serviceworker.rs
servo/components/script/dom/serviceworkercontainer.rs
servo/components/script/dom/serviceworkerglobalscope.rs
servo/components/script/dom/serviceworkerregistration.rs
servo/components/script/dom/servoparser/mod.rs
servo/components/script/dom/storage.rs
servo/components/script/dom/storageevent.rs
servo/components/script/dom/stylesheet.rs
servo/components/script/dom/stylesheetlist.rs
servo/components/script/dom/svgelement.rs
servo/components/script/dom/svggraphicselement.rs
servo/components/script/dom/svgsvgelement.rs
servo/components/script/dom/testbinding.rs
servo/components/script/dom/testbindingiterable.rs
servo/components/script/dom/testbindingpairiterable.rs
servo/components/script/dom/testbindingproxy.rs
servo/components/script/dom/testrunner.rs
servo/components/script/dom/text.rs
servo/components/script/dom/textdecoder.rs
servo/components/script/dom/textencoder.rs
servo/components/script/dom/touch.rs
servo/components/script/dom/touchevent.rs
servo/components/script/dom/touchlist.rs
servo/components/script/dom/transitionevent.rs
servo/components/script/dom/treewalker.rs
servo/components/script/dom/uievent.rs
servo/components/script/dom/url.rs
servo/components/script/dom/urlsearchparams.rs
servo/components/script/dom/validitystate.rs
servo/components/script/dom/vr.rs
servo/components/script/dom/vrdisplay.rs
servo/components/script/dom/vrdisplaycapabilities.rs
servo/components/script/dom/vrdisplayevent.rs
servo/components/script/dom/vreyeparameters.rs
servo/components/script/dom/vrfieldofview.rs
servo/components/script/dom/vrframedata.rs
servo/components/script/dom/vrpose.rs
servo/components/script/dom/vrstageparameters.rs
servo/components/script/dom/webglactiveinfo.rs
servo/components/script/dom/webglbuffer.rs
servo/components/script/dom/webglcontextevent.rs
servo/components/script/dom/webglframebuffer.rs
servo/components/script/dom/webglobject.rs
servo/components/script/dom/webglprogram.rs
servo/components/script/dom/webglrenderbuffer.rs
servo/components/script/dom/webglrenderingcontext.rs
servo/components/script/dom/webglshader.rs
servo/components/script/dom/webglshaderprecisionformat.rs
servo/components/script/dom/webgltexture.rs
servo/components/script/dom/webgluniformlocation.rs
servo/components/script/dom/websocket.rs
servo/components/script/dom/window.rs
servo/components/script/dom/worker.rs
servo/components/script/dom/workerglobalscope.rs
servo/components/script/dom/workerlocation.rs
servo/components/script/dom/workernavigator.rs
servo/components/script/dom/xmldocument.rs
servo/components/script/dom/xmlhttprequest.rs
servo/components/script/dom/xmlhttprequesteventtarget.rs
servo/components/script/dom/xmlhttprequestupload.rs
servo/components/script/lib.rs
servo/components/script_plugins/jstraceable.rs
servo/components/script_plugins/lib.rs
servo/rust-commit-hash
servo/tests/unit/script/size_of.rs
--- a/servo/Cargo.lock
+++ b/servo/Cargo.lock
@@ -625,16 +625,23 @@ dependencies = [
  "msg 0.0.1",
  "serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_derive 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "servo_url 0.0.1",
  "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
+name = "dom_struct"
+version = "0.0.1"
+dependencies = [
+ "quote 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
 name = "domobject_derive"
 version = "0.0.1"
 dependencies = [
  "quote 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
  "syn 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -2199,16 +2206,17 @@ dependencies = [
  "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "canvas_traits 0.0.1",
  "caseless 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "cmake 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
  "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "cssparser 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "deny_public_fields 0.0.1",
  "devtools_traits 0.0.1",
+ "dom_struct 0.0.1",
  "domobject_derive 0.0.1",
  "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "gfx_traits 0.0.1",
  "heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "heapsize_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "html5ever 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
copy from servo/components/domobject_derive/Cargo.toml
copy to servo/components/dom_struct/Cargo.toml
--- a/servo/components/domobject_derive/Cargo.toml
+++ b/servo/components/dom_struct/Cargo.toml
@@ -1,14 +1,13 @@
 [package]
-name = "domobject_derive"
+name = "dom_struct"
 version = "0.0.1"
 authors = ["The Servo Project Developers"]
 license = "MPL-2.0"
 publish = false
 
 [lib]
 path = "lib.rs"
 proc-macro = true
 
 [dependencies]
-syn = "0.10"
 quote = "0.3"
new file mode 100644
--- /dev/null
+++ b/servo/components/dom_struct/lib.rs
@@ -0,0 +1,28 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#![feature(proc_macro)]
+
+extern crate proc_macro;
+#[macro_use] extern crate quote;
+
+use proc_macro::TokenStream;
+
+#[proc_macro_attribute]
+pub fn dom_struct(args: TokenStream, input: TokenStream) -> TokenStream {
+    if !args.to_string().is_empty() {
+        panic!("#[dom_struct] takes no arguments");
+    }
+    expand_string(&input.to_string()).parse().unwrap()
+}
+
+fn expand_string(input: &str) -> String {
+    let mut tokens = quote! {
+        #[derive(DenyPublicFields, DomObject, HeapSizeOf, JSTraceable)]
+        #[must_root]
+        #[repr(C)]
+    };
+    tokens.append(input);
+    tokens.to_string()
+}
--- a/servo/components/script/Cargo.toml
+++ b/servo/components/script/Cargo.toml
@@ -32,16 +32,17 @@ bitflags = "0.7"
 bluetooth_traits = {path = "../bluetooth_traits"}
 byteorder = "1.0"
 canvas_traits = {path = "../canvas_traits"}
 caseless = "0.1.0"
 cookie = "0.2.5"
 cssparser = {version = "0.10", features = ["heapsize", "serde"]}
 deny_public_fields = {path = "../deny_public_fields"}
 devtools_traits = {path = "../devtools_traits"}
+dom_struct = {path = "../dom_struct"}
 domobject_derive = {path = "../domobject_derive"}
 encoding = "0.2"
 euclid = "0.11"
 fnv = "1.0"
 gfx_traits = {path = "../gfx_traits"}
 heapsize = "0.3.6"
 heapsize_derive = "0.1"
 html5ever = {version = "0.13", features = ["heap_size", "unstable"]}
--- a/servo/components/script/docs/JS-Servos-only-GC.md
+++ b/servo/components/script/docs/JS-Servos-only-GC.md
@@ -133,16 +133,18 @@ or a custom attribute `#[dom_struct]` wh
 
 Let's look at [Servo's implementation][document-rs] of the DOM's
 [`Document`][document-mdn] interface:
 
 [document-rs]: https://github.com/servo/servo/blob/master/components/script/dom/document.rs
 [document-mdn]: https://developer.mozilla.org/en-US/docs/Web/API/document
 
 ```rust
+use dom_struct::dom_struct;
+
 #[dom_struct]
 pub struct Document {
     node: Node,
     window: JS<Window>,
     is_html_document: bool,
     ...
 }
 ```
--- a/servo/components/script/dom/attr.rs
+++ b/servo/components/script/dom/attr.rs
@@ -7,16 +7,17 @@ use dom::bindings::cell::DOMRefCell;
 use dom::bindings::codegen::Bindings::AttrBinding::{self, AttrMethods};
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{LayoutJS, MutNullableJS, Root, RootedReference};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::element::{AttributeMutation, Element};
 use dom::virtualmethods::vtable_for;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use html5ever_atoms::{Prefix, LocalName, Namespace};
 use servo_atoms::Atom;
 use std::borrow::ToOwned;
 use std::cell::Ref;
 use std::mem;
 use style::attr::{AttrIdentifier, AttrValue};
 
 // https://dom.spec.whatwg.org/#interface-attr
--- a/servo/components/script/dom/beforeunloadevent.rs
+++ b/servo/components/script/dom/beforeunloadevent.rs
@@ -9,16 +9,17 @@ use dom::bindings::codegen::Bindings::Be
 use dom::bindings::codegen::Bindings::BeforeUnloadEventBinding::BeforeUnloadEventMethods;
 use dom::bindings::codegen::Bindings::EventBinding::EventMethods;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::event::{Event, EventBubbles, EventCancelable};
 use dom::window::Window;
+use dom_struct::dom_struct;
 use servo_atoms::Atom;
 
 // https://html.spec.whatwg.org/multipage/#beforeunloadevent
 #[dom_struct]
 pub struct BeforeUnloadEvent {
     event: Event,
     return_value: DOMRefCell<DOMString>,
 }
--- a/servo/components/script/dom/bindings/iterable.rs
+++ b/servo/components/script/dom/bindings/iterable.rs
@@ -9,16 +9,17 @@
 use core::nonzero::NonZero;
 use dom::bindings::codegen::Bindings::IterableIteratorBinding::IterableKeyAndValueResult;
 use dom::bindings::codegen::Bindings::IterableIteratorBinding::IterableKeyOrValueResult;
 use dom::bindings::error::Fallible;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bindings::trace::JSTraceable;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use js::conversions::ToJSValConvertible;
 use js::jsapi::{HandleValue, Heap, JSContext, JSObject, MutableHandleObject};
 use js::jsval::UndefinedValue;
 use std::cell::Cell;
 use std::ptr;
 
 /// The values that an iterator will iterate over.
 #[derive(JSTraceable, HeapSizeOf)]
--- a/servo/components/script/dom/blob.rs
+++ b/servo/components/script/dom/blob.rs
@@ -6,16 +6,17 @@ use dom::bindings::cell::DOMRefCell;
 use dom::bindings::codegen::Bindings::BlobBinding;
 use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods;
 use dom::bindings::codegen::UnionTypes::BlobOrString;
 use dom::bindings::error::{Error, Fallible};
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use encoding::all::UTF_8;
 use encoding::types::{EncoderTrap, Encoding};
 use ipc_channel::ipc;
 use net_traits::{CoreResourceMsg, IpcSend};
 use net_traits::blob_url_store::{BlobBuf, get_blob_origin};
 use net_traits::filemanager_thread::{FileManagerThreadMsg, ReadFileProgress, RelativePos};
 use std::cell::Cell;
 use std::mem;
--- a/servo/components/script/dom/bluetooth.rs
+++ b/servo/components/script/dom/bluetooth.rs
@@ -25,16 +25,17 @@ use dom::bindings::reflector::{DomObject
 use dom::bindings::str::DOMString;
 use dom::bluetoothdevice::BluetoothDevice;
 use dom::bluetoothpermissionresult::BluetoothPermissionResult;
 use dom::bluetoothuuid::{BluetoothServiceUUID, BluetoothUUID, UUID};
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
 use dom::permissions::{get_descriptor_permission_state, PermissionAlgorithm};
 use dom::promise::Promise;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::{self, IpcSender};
 use ipc_channel::router::ROUTER;
 use js::conversions::ConversionResult;
 use js::jsapi::{JSAutoCompartment, JSContext, JSObject};
 use js::jsval::{ObjectValue, UndefinedValue};
 use script_thread::Runnable;
 use std::cell::Ref;
 use std::collections::HashMap;
--- a/servo/components/script/dom/bluetoothadvertisingevent.rs
+++ b/servo/components/script/dom/bluetoothadvertisingevent.rs
@@ -9,16 +9,17 @@ use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{JS, Root, RootedReference};
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::bluetoothdevice::BluetoothDevice;
 use dom::event::{Event, EventBubbles, EventCancelable};
 use dom::globalscope::GlobalScope;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use servo_atoms::Atom;
 
 // https://webbluetoothcg.github.io/web-bluetooth/#bluetoothadvertisingevent
 #[dom_struct]
 pub struct BluetoothAdvertisingEvent {
     event: Event,
     device: JS<BluetoothDevice>,
     name: Option<DOMString>,
--- a/servo/components/script/dom/bluetoothcharacteristicproperties.rs
+++ b/servo/components/script/dom/bluetoothcharacteristicproperties.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::BluetoothCharacteristicPropertiesBinding;
 use dom::bindings::codegen::Bindings::BluetoothCharacteristicPropertiesBinding::
     BluetoothCharacteristicPropertiesMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 
 // https://webbluetoothcg.github.io/web-bluetooth/#characteristicproperties
  #[dom_struct]
 pub struct BluetoothCharacteristicProperties {
     reflector_: Reflector,
     broadcast: bool,
     read: bool,
     write_without_response: bool,
--- a/servo/components/script/dom/bluetoothdevice.rs
+++ b/servo/components/script/dom/bluetoothdevice.rs
@@ -19,16 +19,17 @@ use dom::bluetooth::{AsyncBluetoothListe
 use dom::bluetoothcharacteristicproperties::BluetoothCharacteristicProperties;
 use dom::bluetoothremotegattcharacteristic::BluetoothRemoteGATTCharacteristic;
 use dom::bluetoothremotegattdescriptor::BluetoothRemoteGATTDescriptor;
 use dom::bluetoothremotegattserver::BluetoothRemoteGATTServer;
 use dom::bluetoothremotegattservice::BluetoothRemoteGATTService;
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
 use dom::promise::Promise;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::{self, IpcSender};
 use js::jsapi::JSContext;
 use std::cell::Cell;
 use std::collections::HashMap;
 use std::rc::Rc;
 
 // https://webbluetoothcg.github.io/web-bluetooth/#bluetoothdevice
 #[dom_struct]
--- a/servo/components/script/dom/bluetoothpermissionresult.rs
+++ b/servo/components/script/dom/bluetoothpermissionresult.rs
@@ -13,16 +13,17 @@ use dom::bindings::error::Error;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{DomObject, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::bluetooth::{AsyncBluetoothListener, Bluetooth, AllowedBluetoothDevice};
 use dom::bluetoothdevice::BluetoothDevice;
 use dom::globalscope::GlobalScope;
 use dom::permissionstatus::PermissionStatus;
 use dom::promise::Promise;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::IpcSender;
 use js::jsapi::JSContext;
 use std::rc::Rc;
 
 // https://webbluetoothcg.github.io/web-bluetooth/#bluetoothpermissionresult
 #[dom_struct]
 pub struct BluetoothPermissionResult {
     status: PermissionStatus,
--- a/servo/components/script/dom/bluetoothremotegattcharacteristic.rs
+++ b/servo/components/script/dom/bluetoothremotegattcharacteristic.rs
@@ -20,16 +20,17 @@ use dom::bindings::reflector::{DomObject
 use dom::bindings::str::{ByteString, DOMString};
 use dom::bluetooth::{AsyncBluetoothListener, get_gatt_children, response_async};
 use dom::bluetoothcharacteristicproperties::BluetoothCharacteristicProperties;
 use dom::bluetoothremotegattservice::BluetoothRemoteGATTService;
 use dom::bluetoothuuid::{BluetoothDescriptorUUID, BluetoothUUID};
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
 use dom::promise::Promise;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::IpcSender;
 use js::jsapi::JSContext;
 use std::rc::Rc;
 
 // Maximum length of an attribute value.
 // https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=286439 (Vol. 3, page 2169)
 pub const MAXIMUM_ATTRIBUTE_LENGTH: usize = 512;
 
--- a/servo/components/script/dom/bluetoothremotegattdescriptor.rs
+++ b/servo/components/script/dom/bluetoothremotegattdescriptor.rs
@@ -14,16 +14,17 @@ use dom::bindings::codegen::Bindings::Bl
 use dom::bindings::error::Error::{self, InvalidModification, Network, Security};
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bindings::str::{ByteString, DOMString};
 use dom::bluetooth::{AsyncBluetoothListener, response_async};
 use dom::bluetoothremotegattcharacteristic::{BluetoothRemoteGATTCharacteristic, MAXIMUM_ATTRIBUTE_LENGTH};
 use dom::globalscope::GlobalScope;
 use dom::promise::Promise;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::IpcSender;
 use js::jsapi::JSContext;
 use std::rc::Rc;
 
 // http://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattdescriptor
 #[dom_struct]
 pub struct BluetoothRemoteGATTDescriptor {
     reflector_: Reflector,
--- a/servo/components/script/dom/bluetoothremotegattserver.rs
+++ b/servo/components/script/dom/bluetoothremotegattserver.rs
@@ -10,16 +10,17 @@ use dom::bindings::error::Error;
 use dom::bindings::error::ErrorResult;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bluetooth::{AsyncBluetoothListener, get_gatt_children, response_async};
 use dom::bluetoothdevice::BluetoothDevice;
 use dom::bluetoothuuid::{BluetoothServiceUUID, BluetoothUUID};
 use dom::globalscope::GlobalScope;
 use dom::promise::Promise;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::IpcSender;
 use js::jsapi::JSContext;
 use std::cell::Cell;
 use std::rc::Rc;
 
 // https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattserver
 #[dom_struct]
 pub struct BluetoothRemoteGATTServer {
--- a/servo/components/script/dom/bluetoothremotegattservice.rs
+++ b/servo/components/script/dom/bluetoothremotegattservice.rs
@@ -12,16 +12,17 @@ use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::bluetooth::{AsyncBluetoothListener, get_gatt_children};
 use dom::bluetoothdevice::BluetoothDevice;
 use dom::bluetoothuuid::{BluetoothCharacteristicUUID, BluetoothServiceUUID, BluetoothUUID};
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
 use dom::promise::Promise;
+use dom_struct::dom_struct;
 use js::jsapi::JSContext;
 use std::rc::Rc;
 
 // https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattservice
 #[dom_struct]
 pub struct BluetoothRemoteGATTService {
     eventtarget: EventTarget,
     device: JS<BluetoothDevice>,
--- a/servo/components/script/dom/bluetoothuuid.rs
+++ b/servo/components/script/dom/bluetoothuuid.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::UnionTypes::StringOrUnsignedLong;
 use dom::bindings::error::Error::Type;
 use dom::bindings::error::Fallible;
 use dom::bindings::reflector::Reflector;
 use dom::bindings::str::DOMString;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use regex::Regex;
 
 pub type UUID = DOMString;
 pub type BluetoothServiceUUID = StringOrUnsignedLong;
 pub type BluetoothCharacteristicUUID = StringOrUnsignedLong;
 pub type BluetoothDescriptorUUID = StringOrUnsignedLong;
 
 // https://webbluetoothcg.github.io/web-bluetooth/#bluetoothuuid
--- a/servo/components/script/dom/browsingcontext.rs
+++ b/servo/components/script/dom/browsingcontext.rs
@@ -10,16 +10,17 @@ use dom::bindings::proxyhandler::{fill_p
 use dom::bindings::reflector::{DomObject, Reflector};
 use dom::bindings::trace::JSTraceable;
 use dom::bindings::utils::WindowProxyHandler;
 use dom::bindings::utils::get_array_index_from_id;
 use dom::dissimilaroriginwindow::DissimilarOriginWindow;
 use dom::element::Element;
 use dom::globalscope::GlobalScope;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use js::JSCLASS_IS_GLOBAL;
 use js::glue::{CreateWrapperProxyHandler, ProxyTraps, NewWindowProxy};
 use js::glue::{GetProxyPrivate, SetProxyExtra, GetProxyExtra};
 use js::jsapi::{Handle, HandleId, HandleObject, HandleValue};
 use js::jsapi::{JSAutoCompartment, JSContext, JSErrNum, JSFreeOp, JSObject};
 use js::jsapi::{JSPROP_READONLY, JSTracer, JS_DefinePropertyById};
 use js::jsapi::{JS_ForwardGetPropertyTo, JS_ForwardSetPropertyTo};
 use js::jsapi::{JS_GetOwnPropertyDescriptorById, JS_HasPropertyById, JS_HasOwnPropertyById};
--- a/servo/components/script/dom/canvasgradient.rs
+++ b/servo/components/script/dom/canvasgradient.rs
@@ -9,16 +9,17 @@ use dom::bindings::cell::DOMRefCell;
 use dom::bindings::codegen::Bindings::CanvasGradientBinding;
 use dom::bindings::codegen::Bindings::CanvasGradientBinding::CanvasGradientMethods;
 use dom::bindings::error::{Error, ErrorResult};
 use dom::bindings::js::Root;
 use dom::bindings::num::Finite;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 
 // https://html.spec.whatwg.org/multipage/#canvasgradient
 #[dom_struct]
 pub struct CanvasGradient {
     reflector_: Reflector,
     style: CanvasGradientStyle,
     stops: DOMRefCell<Vec<CanvasGradientStop>>,
 }
--- a/servo/components/script/dom/canvaspattern.rs
+++ b/servo/components/script/dom/canvaspattern.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use canvas_traits::{FillOrStrokeStyle, RepetitionStyle, SurfaceStyle};
 use dom::bindings::codegen::Bindings::CanvasPatternBinding;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::canvasgradient::ToFillOrStrokeStyle;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use euclid::size::Size2D;
 
 // https://html.spec.whatwg.org/multipage/#canvaspattern
 #[dom_struct]
 pub struct CanvasPattern {
     reflector_: Reflector,
     surface_data: Vec<u8>,
     surface_size: Size2D<i32>,
--- a/servo/components/script/dom/canvasrenderingcontext2d.rs
+++ b/servo/components/script/dom/canvasrenderingcontext2d.rs
@@ -28,16 +28,17 @@ use dom::bindings::str::DOMString;
 use dom::canvasgradient::{CanvasGradient, CanvasGradientStyle, ToFillOrStrokeStyle};
 use dom::canvaspattern::CanvasPattern;
 use dom::globalscope::GlobalScope;
 use dom::htmlcanvaselement::HTMLCanvasElement;
 use dom::htmlcanvaselement::utils as canvas_utils;
 use dom::htmlimageelement::HTMLImageElement;
 use dom::imagedata::ImageData;
 use dom::node::{Node, NodeDamage, window_from_node};
+use dom_struct::dom_struct;
 use euclid::matrix2d::Matrix2D;
 use euclid::point::Point2D;
 use euclid::rect::Rect;
 use euclid::size::Size2D;
 use ipc_channel::ipc::{self, IpcSender};
 use net_traits::image::base::PixelFormat;
 use net_traits::image_cache_thread::ImageResponse;
 use num_traits::ToPrimitive;
--- a/servo/components/script/dom/characterdata.rs
+++ b/servo/components/script/dom/characterdata.rs
@@ -14,16 +14,17 @@ use dom::bindings::inheritance::Castable
 use dom::bindings::js::{LayoutJS, Root};
 use dom::bindings::str::DOMString;
 use dom::comment::Comment;
 use dom::document::Document;
 use dom::element::Element;
 use dom::node::{Node, NodeDamage};
 use dom::processinginstruction::ProcessingInstruction;
 use dom::text::Text;
+use dom_struct::dom_struct;
 use servo_config::opts;
 use std::cell::Ref;
 
 // https://dom.spec.whatwg.org/#characterdata
 #[dom_struct]
 pub struct CharacterData {
     node: Node,
     data: DOMRefCell<DOMString>,
--- a/servo/components/script/dom/client.rs
+++ b/servo/components/script/dom/client.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::ClientBinding::{ClientMethods, Wrap};
 use dom::bindings::codegen::Bindings::ClientBinding::FrameType;
 use dom::bindings::js::{Root, MutNullableJS};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::{DOMString, USVString};
 use dom::serviceworker::ServiceWorker;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use servo_url::ServoUrl;
 use std::default::Default;
 use uuid::Uuid;
 
 #[dom_struct]
 pub struct Client {
     reflector_: Reflector,
     active_worker: MutNullableJS<ServiceWorker>,
--- a/servo/components/script/dom/closeevent.rs
+++ b/servo/components/script/dom/closeevent.rs
@@ -7,16 +7,17 @@ use dom::bindings::codegen::Bindings::Cl
 use dom::bindings::codegen::Bindings::EventBinding::EventMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::event::{Event, EventBubbles, EventCancelable};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use servo_atoms::Atom;
 
 #[dom_struct]
 pub struct CloseEvent {
     event: Event,
     was_clean: bool,
     code: u16,
     reason: DOMString,
--- a/servo/components/script/dom/comment.rs
+++ b/servo/components/script/dom/comment.rs
@@ -6,16 +6,17 @@ use dom::bindings::codegen::Bindings::Co
 use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::characterdata::CharacterData;
 use dom::document::Document;
 use dom::node::Node;
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 /// An HTML comment.
 #[dom_struct]
 pub struct Comment {
     characterdata: CharacterData,
 }
 
 impl Comment {
--- a/servo/components/script/dom/crypto.rs
+++ b/servo/components/script/dom/crypto.rs
@@ -5,16 +5,17 @@
 use core::nonzero::NonZero;
 use dom::bindings::cell::DOMRefCell;
 use dom::bindings::codegen::Bindings::CryptoBinding;
 use dom::bindings::codegen::Bindings::CryptoBinding::CryptoMethods;
 use dom::bindings::error::{Error, Fallible};
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use js::jsapi::{JSContext, JSObject};
 use js::jsapi::Type;
 use servo_rand::{ServoRng, Rng};
 
 unsafe_no_jsmanaged_fields!(ServoRng);
 
 // https://developer.mozilla.org/en-US/docs/Web/API/Crypto
 #[dom_struct]
--- a/servo/components/script/dom/css.rs
+++ b/servo/components/script/dom/css.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use cssparser::{Parser, serialize_identifier};
 use dom::bindings::codegen::Bindings::WindowBinding::WindowBinding::WindowMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::reflector::Reflector;
 use dom::bindings::str::DOMString;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use style::parser::ParserContext;
 use style::supports::{Declaration, parse_condition_or_declaration};
 
 #[dom_struct]
 pub struct CSS {
     reflector_: Reflector,
 }
 
--- a/servo/components/script/dom/cssconditionrule.rs
+++ b/servo/components/script/dom/cssconditionrule.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::CSSConditionRuleBinding::CSSConditionRuleMethods;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::str::DOMString;
 use dom::cssgroupingrule::CSSGroupingRule;
 use dom::cssmediarule::CSSMediaRule;
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::csssupportsrule::CSSSupportsRule;
+use dom_struct::dom_struct;
 use parking_lot::RwLock;
 use std::sync::Arc;
 use style::stylesheets::CssRules as StyleCssRules;
 
 #[dom_struct]
 pub struct CSSConditionRule {
     cssgroupingrule: CSSGroupingRule,
 }
--- a/servo/components/script/dom/cssfontfacerule.rs
+++ b/servo/components/script/dom/cssfontfacerule.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::CSSFontFaceRuleBinding;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::cssrule::{CSSRule, SpecificCSSRule};
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use parking_lot::RwLock;
 use std::sync::Arc;
 use style::font_face::FontFaceRule;
 use style_traits::ToCss;
 
 #[dom_struct]
 pub struct CSSFontFaceRule {
     cssrule: CSSRule,
--- a/servo/components/script/dom/cssgroupingrule.rs
+++ b/servo/components/script/dom/cssgroupingrule.rs
@@ -6,16 +6,17 @@ use dom::bindings::codegen::Bindings::CS
 use dom::bindings::error::{ErrorResult, Fallible};
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{MutNullableJS, Root};
 use dom::bindings::reflector::DomObject;
 use dom::bindings::str::DOMString;
 use dom::cssrule::CSSRule;
 use dom::cssrulelist::{CSSRuleList, RulesSource};
 use dom::cssstylesheet::CSSStyleSheet;
+use dom_struct::dom_struct;
 use parking_lot::RwLock;
 use std::sync::Arc;
 use style::stylesheets::CssRules as StyleCssRules;
 
 #[dom_struct]
 pub struct CSSGroupingRule {
     cssrule: CSSRule,
     #[ignore_heap_size_of = "Arc"]
--- a/servo/components/script/dom/cssimportrule.rs
+++ b/servo/components/script/dom/cssimportrule.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::CSSImportRuleBinding;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::cssrule::{CSSRule, SpecificCSSRule};
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use parking_lot::RwLock;
 use std::sync::Arc;
 use style::stylesheets::ImportRule;
 use style_traits::ToCss;
 
 #[dom_struct]
 pub struct CSSImportRule {
     cssrule: CSSRule,
--- a/servo/components/script/dom/csskeyframerule.rs
+++ b/servo/components/script/dom/csskeyframerule.rs
@@ -6,16 +6,17 @@ use dom::bindings::codegen::Bindings::CS
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{JS, MutNullableJS, Root};
 use dom::bindings::reflector::{DomObject, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::cssrule::{CSSRule, SpecificCSSRule};
 use dom::cssstyledeclaration::{CSSModificationAccess, CSSStyleDeclaration, CSSStyleOwner};
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use parking_lot::RwLock;
 use std::sync::Arc;
 use style::keyframes::Keyframe;
 use style_traits::ToCss;
 
 #[dom_struct]
 pub struct CSSKeyframeRule {
     cssrule: CSSRule,
--- a/servo/components/script/dom/csskeyframesrule.rs
+++ b/servo/components/script/dom/csskeyframesrule.rs
@@ -10,16 +10,17 @@ use dom::bindings::inheritance::Castable
 use dom::bindings::js::{MutNullableJS, Root};
 use dom::bindings::reflector::{DomObject, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::csskeyframerule::CSSKeyframeRule;
 use dom::cssrule::{CSSRule, SpecificCSSRule};
 use dom::cssrulelist::{CSSRuleList, RulesSource};
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use parking_lot::RwLock;
 use servo_atoms::Atom;
 use std::sync::Arc;
 use style::keyframes::{Keyframe, KeyframeSelector};
 use style::parser::ParserContextExtraData;
 use style::stylesheets::KeyframesRule;
 use style_traits::ToCss;
 
--- a/servo/components/script/dom/cssmediarule.rs
+++ b/servo/components/script/dom/cssmediarule.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::CS
 use dom::bindings::js::{MutNullableJS, Root};
 use dom::bindings::reflector::{DomObject, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::cssconditionrule::CSSConditionRule;
 use dom::cssrule::SpecificCSSRule;
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::medialist::MediaList;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use parking_lot::RwLock;
 use std::sync::Arc;
 use style::media_queries::parse_media_query_list;
 use style::stylesheets::MediaRule;
 use style_traits::ToCss;
 
 #[dom_struct]
 pub struct CSSMediaRule {
--- a/servo/components/script/dom/cssnamespacerule.rs
+++ b/servo/components/script/dom/cssnamespacerule.rs
@@ -5,16 +5,17 @@
 use dom::bindings::codegen::Bindings::CSSNamespaceRuleBinding;
 use dom::bindings::codegen::Bindings::CSSNamespaceRuleBinding::CSSNamespaceRuleMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::cssrule::{CSSRule, SpecificCSSRule};
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use parking_lot::RwLock;
 use std::sync::Arc;
 use style::stylesheets::NamespaceRule;
 use style_traits::ToCss;
 
 #[dom_struct]
 pub struct CSSNamespaceRule {
     cssrule: CSSRule,
--- a/servo/components/script/dom/cssrule.rs
+++ b/servo/components/script/dom/cssrule.rs
@@ -13,16 +13,17 @@ use dom::csskeyframerule::CSSKeyframeRul
 use dom::csskeyframesrule::CSSKeyframesRule;
 use dom::cssmediarule::CSSMediaRule;
 use dom::cssnamespacerule::CSSNamespaceRule;
 use dom::cssstylerule::CSSStyleRule;
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::csssupportsrule::CSSSupportsRule;
 use dom::cssviewportrule::CSSViewportRule;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use std::cell::Cell;
 use style::stylesheets::CssRule as StyleCssRule;
 
 
 #[dom_struct]
 pub struct CSSRule {
     reflector_: Reflector,
     parent_stylesheet: JS<CSSStyleSheet>,
--- a/servo/components/script/dom/cssrulelist.rs
+++ b/servo/components/script/dom/cssrulelist.rs
@@ -7,16 +7,17 @@ use dom::bindings::codegen::Bindings::CS
 use dom::bindings::codegen::Bindings::CSSRuleListBinding::CSSRuleListMethods;
 use dom::bindings::error::{Error, ErrorResult, Fallible};
 use dom::bindings::js::{JS, MutNullableJS, Root};
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::csskeyframerule::CSSKeyframeRule;
 use dom::cssrule::CSSRule;
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use parking_lot::RwLock;
 use std::sync::Arc;
 use style::stylesheets::{CssRules, KeyframesRule, RulesMutateError};
 
 #[allow(unsafe_code)]
 unsafe_no_jsmanaged_fields!(RulesSource);
 
 unsafe_no_jsmanaged_fields!(CssRules);
--- a/servo/components/script/dom/cssstyledeclaration.rs
+++ b/servo/components/script/dom/cssstyledeclaration.rs
@@ -8,16 +8,17 @@ use dom::bindings::error::{Error, ErrorR
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::cssrule::CSSRule;
 use dom::element::Element;
 use dom::node::{Node, window_from_node};
 use dom::window::Window;
+use dom_struct::dom_struct;
 use parking_lot::RwLock;
 use servo_url::ServoUrl;
 use std::ascii::AsciiExt;
 use std::sync::Arc;
 use style::attr::AttrValue;
 use style::parser::ParserContextExtraData;
 use style::properties::{Importance, PropertyDeclarationBlock, PropertyId, LonghandId, ShorthandId};
 use style::properties::{parse_one_declaration, parse_style_attribute};
--- a/servo/components/script/dom/cssstylerule.rs
+++ b/servo/components/script/dom/cssstylerule.rs
@@ -6,16 +6,17 @@ use dom::bindings::codegen::Bindings::CS
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{JS, MutNullableJS, Root};
 use dom::bindings::reflector::{DomObject, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::cssrule::{CSSRule, SpecificCSSRule};
 use dom::cssstyledeclaration::{CSSModificationAccess, CSSStyleDeclaration, CSSStyleOwner};
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use parking_lot::RwLock;
 use std::sync::Arc;
 use style::stylesheets::StyleRule;
 use style_traits::ToCss;
 
 #[dom_struct]
 pub struct CSSStyleRule {
     cssrule: CSSRule,
--- a/servo/components/script/dom/cssstylesheet.rs
+++ b/servo/components/script/dom/cssstylesheet.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::Wi
 use dom::bindings::error::{Error, ErrorResult, Fallible};
 use dom::bindings::js::{JS, MutNullableJS, Root};
 use dom::bindings::reflector::{reflect_dom_object, DomObject};
 use dom::bindings::str::DOMString;
 use dom::cssrulelist::{CSSRuleList, RulesSource};
 use dom::element::Element;
 use dom::stylesheet::StyleSheet;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use std::cell::Cell;
 use std::sync::Arc;
 use style::stylesheets::Stylesheet as StyleStyleSheet;
 
 #[dom_struct]
 pub struct CSSStyleSheet {
     stylesheet: StyleSheet,
     owner: JS<Element>,
--- a/servo/components/script/dom/csssupportsrule.rs
+++ b/servo/components/script/dom/csssupportsrule.rs
@@ -7,16 +7,17 @@ use dom::bindings::codegen::Bindings::CS
 use dom::bindings::codegen::Bindings::WindowBinding::WindowBinding::WindowMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{DomObject, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::cssconditionrule::CSSConditionRule;
 use dom::cssrule::SpecificCSSRule;
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use parking_lot::RwLock;
 use std::sync::Arc;
 use style::parser::ParserContext;
 use style::stylesheets::SupportsRule;
 use style::supports::SupportsCondition;
 use style_traits::ToCss;
 
 #[dom_struct]
--- a/servo/components/script/dom/cssviewportrule.rs
+++ b/servo/components/script/dom/cssviewportrule.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::CSSViewportRuleBinding;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::cssrule::{CSSRule, SpecificCSSRule};
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use parking_lot::RwLock;
 use std::sync::Arc;
 use style::viewport::ViewportRule;
 use style_traits::ToCss;
 
 #[dom_struct]
 pub struct CSSViewportRule {
     cssrule: CSSRule,
--- a/servo/components/script/dom/customevent.rs
+++ b/servo/components/script/dom/customevent.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::Ev
 use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{MutHeapJSVal, Root};
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::bindings::trace::RootedTraceableBox;
 use dom::event::Event;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use js::jsapi::{HandleValue, JSContext};
 use js::jsval::JSVal;
 use servo_atoms::Atom;
 
 // https://dom.spec.whatwg.org/#interface-customevent
 #[dom_struct]
 pub struct CustomEvent {
     event: Event,
--- a/servo/components/script/dom/dedicatedworkerglobalscope.rs
+++ b/servo/components/script/dom/dedicatedworkerglobalscope.rs
@@ -15,16 +15,17 @@ use dom::bindings::inheritance::Castable
 use dom::bindings::js::{Root, RootCollection};
 use dom::bindings::reflector::DomObject;
 use dom::bindings::str::DOMString;
 use dom::bindings::structuredclone::StructuredCloneData;
 use dom::globalscope::GlobalScope;
 use dom::messageevent::MessageEvent;
 use dom::worker::{TrustedWorkerAddress, WorkerErrorHandler, WorkerMessageHandler};
 use dom::workerglobalscope::WorkerGlobalScope;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
 use ipc_channel::router::ROUTER;
 use js::jsapi::{HandleValue, JS_SetInterruptCallback};
 use js::jsapi::{JSAutoCompartment, JSContext};
 use js::jsval::UndefinedValue;
 use js::rust::Runtime;
 use msg::constellation_msg::FrameId;
 use net_traits::{IpcSend, load_whole_resource};
--- a/servo/components/script/dom/dissimilaroriginlocation.rs
+++ b/servo/components/script/dom/dissimilaroriginlocation.rs
@@ -6,16 +6,17 @@ use dom::bindings::codegen::Bindings::Di
 use dom::bindings::codegen::Bindings::DissimilarOriginLocationBinding::DissimilarOriginLocationMethods;
 use dom::bindings::error::{Error, ErrorResult, Fallible};
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::Reflector;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::bindings::str::USVString;
 use dom::dissimilaroriginwindow::DissimilarOriginWindow;
+use dom_struct::dom_struct;
 
 /// Represents a dissimilar-origin `Location` that exists in another script thread.
 ///
 /// Since the `Location` is in a different script thread, we cannot access it
 /// directly, but some of its accessors (for example setting `location.href`)
 /// still need to function.
 
 #[dom_struct]
--- a/servo/components/script/dom/dissimilaroriginwindow.rs
+++ b/servo/components/script/dom/dissimilaroriginwindow.rs
@@ -5,16 +5,17 @@
 use dom::bindings::codegen::Bindings::DissimilarOriginWindowBinding;
 use dom::bindings::codegen::Bindings::DissimilarOriginWindowBinding::DissimilarOriginWindowMethods;
 use dom::bindings::js::{JS, MutNullableJS, Root};
 use dom::bindings::reflector::DomObject;
 use dom::bindings::str::DOMString;
 use dom::browsingcontext::BrowsingContext;
 use dom::dissimilaroriginlocation::DissimilarOriginLocation;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use ipc_channel::ipc;
 use js::jsapi::{JSContext, HandleValue};
 use js::jsval::{JSVal, UndefinedValue};
 use msg::constellation_msg::PipelineId;
 
 /// Represents a dissimilar-origin `Window` that exists in another script thread.
 ///
 /// Since the `Window` is in a different script thread, we cannot access it
--- a/servo/components/script/dom/document.rs
+++ b/servo/components/script/dom/document.rs
@@ -82,16 +82,17 @@ use dom::stylesheetlist::StyleSheetList;
 use dom::text::Text;
 use dom::touch::Touch;
 use dom::touchevent::TouchEvent;
 use dom::touchlist::TouchList;
 use dom::treewalker::TreeWalker;
 use dom::uievent::UIEvent;
 use dom::webglcontextevent::WebGLContextEvent;
 use dom::window::{ReflowReason, Window};
+use dom_struct::dom_struct;
 use encoding::EncodingRef;
 use encoding::all::UTF_8;
 use euclid::point::Point2D;
 use gfx_traits::ScrollRootId;
 use html5ever_atoms::{LocalName, QualName};
 use hyper::header::{Header, SetCookie};
 use hyper_serde::Serde;
 use ipc_channel::ipc::{self, IpcSender};
--- a/servo/components/script/dom/documentfragment.rs
+++ b/servo/components/script/dom/documentfragment.rs
@@ -11,16 +11,17 @@ use dom::bindings::inheritance::Castable
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::Element;
 use dom::htmlcollection::HTMLCollection;
 use dom::node::{Node, window_from_node};
 use dom::nodelist::NodeList;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use servo_atoms::Atom;
 
 // https://dom.spec.whatwg.org/#documentfragment
 #[dom_struct]
 pub struct DocumentFragment {
     node: Node,
 }
 
--- a/servo/components/script/dom/documenttype.rs
+++ b/servo/components/script/dom/documenttype.rs
@@ -6,16 +6,17 @@ use dom::bindings::codegen::Bindings::Do
 use dom::bindings::codegen::Bindings::DocumentTypeBinding::DocumentTypeMethods;
 use dom::bindings::codegen::UnionTypes::NodeOrString;
 use dom::bindings::error::ErrorResult;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::node::Node;
+use dom_struct::dom_struct;
 
 // https://dom.spec.whatwg.org/#documenttype
 /// The `DOCTYPE` tag.
 #[dom_struct]
 pub struct DocumentType {
     node: Node,
     name: DOMString,
     public_id: DOMString,
--- a/servo/components/script/dom/domexception.rs
+++ b/servo/components/script/dom/domexception.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::DOMExceptionBinding;
 use dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionConstants;
 use dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 
 #[repr(u16)]
 #[derive(JSTraceable, Copy, Clone, Debug, HeapSizeOf)]
 pub enum DOMErrorName {
     IndexSizeError = DOMExceptionConstants::INDEX_SIZE_ERR,
     HierarchyRequestError = DOMExceptionConstants::HIERARCHY_REQUEST_ERR,
     WrongDocumentError = DOMExceptionConstants::WRONG_DOCUMENT_ERR,
     InvalidCharacterError = DOMExceptionConstants::INVALID_CHARACTER_ERR,
--- a/servo/components/script/dom/domimplementation.rs
+++ b/servo/components/script/dom/domimplementation.rs
@@ -18,16 +18,17 @@ use dom::document::DocumentSource;
 use dom::documenttype::DocumentType;
 use dom::htmlbodyelement::HTMLBodyElement;
 use dom::htmlheadelement::HTMLHeadElement;
 use dom::htmlhtmlelement::HTMLHtmlElement;
 use dom::htmltitleelement::HTMLTitleElement;
 use dom::node::Node;
 use dom::text::Text;
 use dom::xmldocument::XMLDocument;
+use dom_struct::dom_struct;
 use script_traits::DocumentActivity;
 
 // https://dom.spec.whatwg.org/#domimplementation
 #[dom_struct]
 pub struct DOMImplementation {
     reflector_: Reflector,
     document: JS<Document>,
 }
--- a/servo/components/script/dom/dommatrix.rs
+++ b/servo/components/script/dom/dommatrix.rs
@@ -5,16 +5,17 @@
 use dom::bindings::codegen::Bindings::DOMMatrixBinding::{Wrap, DOMMatrixMethods, DOMMatrixInit};
 use dom::bindings::codegen::Bindings::DOMMatrixReadOnlyBinding::DOMMatrixReadOnlyMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::dommatrixreadonly::{dommatrixinit_to_matrix, DOMMatrixReadOnly, entries_to_matrix};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use euclid::Matrix4D;
 
 
 #[dom_struct]
 pub struct DOMMatrix {
     parent: DOMMatrixReadOnly
 }
 
--- a/servo/components/script/dom/dommatrixreadonly.rs
+++ b/servo/components/script/dom/dommatrixreadonly.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::DO
 use dom::bindings::codegen::Bindings::DOMPointBinding::DOMPointInit;
 use dom::bindings::error;
 use dom::bindings::error::Fallible;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
 use dom::dommatrix::DOMMatrix;
 use dom::dompoint::DOMPoint;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use euclid::{Matrix4D, Point4D, Radians};
 use std::cell::{Cell, Ref};
 use std::f64;
 
 #[dom_struct]
 pub struct DOMMatrixReadOnly {
     reflector_: Reflector,
     matrix: DOMRefCell<Matrix4D<f64>>,
--- a/servo/components/script/dom/domparser.rs
+++ b/servo/components/script/dom/domparser.rs
@@ -14,16 +14,17 @@ use dom::bindings::codegen::Bindings::Wi
 use dom::bindings::error::Fallible;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::document::{Document, HasBrowsingContext, IsHTMLDocument};
 use dom::document::DocumentSource;
 use dom::servoparser::ServoParser;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use script_traits::DocumentActivity;
 
 #[dom_struct]
 pub struct DOMParser {
     reflector_: Reflector,
     window: JS<Window>, // XXXjdm Document instead?
 }
 
--- a/servo/components/script/dom/dompoint.rs
+++ b/servo/components/script/dom/dompoint.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::DOMPointBinding::{DOMPointInit, DOMPointMethods, Wrap};
 use dom::bindings::codegen::Bindings::DOMPointReadOnlyBinding::DOMPointReadOnlyMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::dompointreadonly::{DOMPointReadOnly, DOMPointWriteMethods};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 
 // http://dev.w3.org/fxtf/geometry/Overview.html#dompoint
 #[dom_struct]
 pub struct DOMPoint {
     point: DOMPointReadOnly,
 }
 
 impl DOMPoint {
--- a/servo/components/script/dom/dompointreadonly.rs
+++ b/servo/components/script/dom/dompointreadonly.rs
@@ -2,16 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::DOMPointReadOnlyBinding::{DOMPointReadOnlyMethods, Wrap};
 use dom::bindings::error::Fallible;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use std::cell::Cell;
 
 // http://dev.w3.org/fxtf/geometry/Overview.html#dompointreadonly
 #[dom_struct]
 pub struct DOMPointReadOnly {
     reflector_: Reflector,
     x: Cell<f64>,
     y: Cell<f64>,
--- a/servo/components/script/dom/domquad.rs
+++ b/servo/components/script/dom/domquad.rs
@@ -6,16 +6,17 @@ use dom::bindings::codegen::Bindings::DO
 use dom::bindings::codegen::Bindings::DOMQuadBinding::{DOMQuadInit, DOMQuadMethods, Wrap};
 use dom::bindings::codegen::Bindings::DOMRectReadOnlyBinding::DOMRectInit;
 use dom::bindings::error::Fallible;
 use dom::bindings::js::{Root, JS};
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::dompoint::DOMPoint;
 use dom::domrect::DOMRect;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 
 // https://drafts.fxtf.org/geometry/#DOMQuad
 #[dom_struct]
 pub struct DOMQuad {
     reflector_: Reflector,
     p1: JS<DOMPoint>,
     p2: JS<DOMPoint>,
     p3: JS<DOMPoint>,
--- a/servo/components/script/dom/domrect.rs
+++ b/servo/components/script/dom/domrect.rs
@@ -5,16 +5,17 @@
 use dom::bindings::codegen::Bindings::DOMRectBinding;
 use dom::bindings::codegen::Bindings::DOMRectBinding::DOMRectMethods;
 use dom::bindings::codegen::Bindings::DOMRectReadOnlyBinding::DOMRectReadOnlyMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::domrectreadonly::DOMRectReadOnly;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct DOMRect {
     rect: DOMRectReadOnly,
 }
 
 impl DOMRect {
     fn new_inherited(x: f64, y: f64, width: f64, height: f64) -> DOMRect {
--- a/servo/components/script/dom/domrectlist.rs
+++ b/servo/components/script/dom/domrectlist.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::DOMRectListBinding;
 use dom::bindings::codegen::Bindings::DOMRectListBinding::DOMRectListMethods;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::domrect::DOMRect;
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct DOMRectList {
     reflector_: Reflector,
     rects: Vec<JS<DOMRect>>,
 }
 
 impl DOMRectList {
--- a/servo/components/script/dom/domrectreadonly.rs
+++ b/servo/components/script/dom/domrectreadonly.rs
@@ -2,16 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::DOMRectReadOnlyBinding::{DOMRectReadOnlyMethods, Wrap};
 use dom::bindings::error::Fallible;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use std::cell::Cell;
 
 #[dom_struct]
 pub struct DOMRectReadOnly {
     reflector_: Reflector,
     x: Cell<f64>,
     y: Cell<f64>,
     width: Cell<f64>,
--- a/servo/components/script/dom/domstringmap.rs
+++ b/servo/components/script/dom/domstringmap.rs
@@ -5,16 +5,17 @@
 use dom::bindings::codegen::Bindings::DOMStringMapBinding;
 use dom::bindings::codegen::Bindings::DOMStringMapBinding::DOMStringMapMethods;
 use dom::bindings::error::ErrorResult;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::htmlelement::HTMLElement;
 use dom::node::window_from_node;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct DOMStringMap {
     reflector_: Reflector,
     element: JS<HTMLElement>,
 }
 
 impl DOMStringMap {
--- a/servo/components/script/dom/domtokenlist.rs
+++ b/servo/components/script/dom/domtokenlist.rs
@@ -6,16 +6,17 @@ use dom::attr::Attr;
 use dom::bindings::codegen::Bindings::DOMTokenListBinding;
 use dom::bindings::codegen::Bindings::DOMTokenListBinding::DOMTokenListMethods;
 use dom::bindings::error::{Error, ErrorResult, Fallible};
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::element::Element;
 use dom::node::window_from_node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use servo_atoms::Atom;
 use style::str::HTML_SPACE_CHARACTERS;
 
 #[dom_struct]
 pub struct DOMTokenList {
     reflector_: Reflector,
     element: JS<Element>,
--- a/servo/components/script/dom/element.rs
+++ b/servo/components/script/dom/element.rs
@@ -67,16 +67,17 @@ use dom::node::{NodeDamage, SEQUENTIALLY
 use dom::node::{document_from_node, window_from_node};
 use dom::nodelist::NodeList;
 use dom::promise::Promise;
 use dom::servoparser::ServoParser;
 use dom::text::Text;
 use dom::validation::Validatable;
 use dom::virtualmethods::{VirtualMethods, vtable_for};
 use dom::window::ReflowReason;
+use dom_struct::dom_struct;
 use html5ever::serialize;
 use html5ever::serialize::SerializeOpts;
 use html5ever::serialize::TraversalScope;
 use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode};
 use html5ever_atoms::{Prefix, LocalName, Namespace, QualName};
 use js::jsapi::{HandleValue, JSAutoCompartment};
 use net_traits::request::CorsSettings;
 use parking_lot::RwLock;
--- a/servo/components/script/dom/errorevent.rs
+++ b/servo/components/script/dom/errorevent.rs
@@ -9,16 +9,17 @@ use dom::bindings::codegen::Bindings::Ev
 use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{MutHeapJSVal, Root};
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::bindings::trace::RootedTraceableBox;
 use dom::event::{Event, EventBubbles, EventCancelable};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use js::jsapi::{HandleValue, JSContext};
 use js::jsval::JSVal;
 use servo_atoms::Atom;
 use std::cell::Cell;
 
 #[dom_struct]
 pub struct ErrorEvent {
     event: Event,
--- a/servo/components/script/dom/event.rs
+++ b/servo/components/script/dom/event.rs
@@ -14,16 +14,17 @@ use dom::bindings::refcounted::Trusted;
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::eventtarget::{CompiledEventListener, EventTarget, ListenerPhase};
 use dom::globalscope::GlobalScope;
 use dom::node::Node;
 use dom::virtualmethods::vtable_for;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use script_thread::Runnable;
 use servo_atoms::Atom;
 use std::cell::Cell;
 use std::default::Default;
 use time;
 
 #[dom_struct]
 pub struct Event {
--- a/servo/components/script/dom/eventsource.rs
+++ b/servo/components/script/dom/eventsource.rs
@@ -10,16 +10,17 @@ use dom::bindings::inheritance::Castable
 use dom::bindings::js::Root;
 use dom::bindings::refcounted::Trusted;
 use dom::bindings::reflector::{DomObject, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::event::Event;
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
 use dom::messageevent::MessageEvent;
+use dom_struct::dom_struct;
 use encoding::Encoding;
 use encoding::all::UTF_8;
 use euclid::length::Length;
 use hyper::header::{Accept, qitem};
 use ipc_channel::ipc;
 use ipc_channel::router::ROUTER;
 use js::conversions::ToJSValConvertible;
 use js::jsapi::JSAutoCompartment;
--- a/servo/components/script/dom/eventtarget.rs
+++ b/servo/components/script/dom/eventtarget.rs
@@ -21,16 +21,17 @@ use dom::bindings::js::Root;
 use dom::bindings::reflector::{DomObject, Reflector};
 use dom::bindings::str::DOMString;
 use dom::element::Element;
 use dom::errorevent::ErrorEvent;
 use dom::event::{Event, EventBubbles, EventCancelable, EventStatus};
 use dom::node::document_from_node;
 use dom::virtualmethods::VirtualMethods;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use fnv::FnvHasher;
 use heapsize::HeapSizeOf;
 use js::jsapi::{CompileFunction, JS_GetFunctionObject, JSAutoCompartment};
 use js::rust::{AutoObjectVectorWrapper, CompileOptionsWrapper};
 use libc::{c_char, size_t};
 use servo_atoms::Atom;
 use servo_url::ServoUrl;
 use std::collections::HashMap;
--- a/servo/components/script/dom/extendableevent.rs
+++ b/servo/components/script/dom/extendableevent.rs
@@ -6,16 +6,17 @@ use dom::bindings::codegen::Bindings::Ev
 use dom::bindings::codegen::Bindings::ExtendableEventBinding;
 use dom::bindings::error::{Error, ErrorResult, Fallible};
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::event::Event;
 use dom::serviceworkerglobalscope::ServiceWorkerGlobalScope;
+use dom_struct::dom_struct;
 use js::jsapi::{HandleValue, JSContext};
 use servo_atoms::Atom;
 
 // https://w3c.github.io/ServiceWorker/#extendable-event
 #[dom_struct]
 pub struct ExtendableEvent {
     event: Event,
     extensions_allowed: bool
--- a/servo/components/script/dom/extendablemessageevent.rs
+++ b/servo/components/script/dom/extendablemessageevent.rs
@@ -10,16 +10,17 @@ use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::bindings::trace::RootedTraceableBox;
 use dom::event::Event;
 use dom::eventtarget::EventTarget;
 use dom::extendableevent::ExtendableEvent;
 use dom::globalscope::GlobalScope;
 use dom::serviceworkerglobalscope::ServiceWorkerGlobalScope;
+use dom_struct::dom_struct;
 use js::jsapi::{HandleValue, Heap, JSContext};
 use js::jsval::JSVal;
 use servo_atoms::Atom;
 
 #[dom_struct]
 pub struct ExtendableMessageEvent {
     event: ExtendableEvent,
     data: Heap<JSVal>,
--- a/servo/components/script/dom/file.rs
+++ b/servo/components/script/dom/file.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::UnionTypes::
 use dom::bindings::error::{Error, Fallible};
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::blob::{Blob, BlobImpl, blob_parts_to_bytes};
 use dom::globalscope::GlobalScope;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use net_traits::filemanager_thread::SelectedFile;
 use time;
 
 #[dom_struct]
 pub struct File {
     blob: Blob,
     name: DOMString,
     modified: i64,
--- a/servo/components/script/dom/filelist.rs
+++ b/servo/components/script/dom/filelist.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::FileListBinding;
 use dom::bindings::codegen::Bindings::FileListBinding::FileListMethods;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::file::File;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use std::slice::Iter;
 
 // https://w3c.github.io/FileAPI/#dfn-filelist
 #[dom_struct]
 pub struct FileList {
     reflector_: Reflector,
     list: Vec<JS<File>>
 }
--- a/servo/components/script/dom/filereader.rs
+++ b/servo/components/script/dom/filereader.rs
@@ -14,16 +14,17 @@ use dom::bindings::refcounted::Trusted;
 use dom::bindings::reflector::{DomObject, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::blob::Blob;
 use dom::domexception::{DOMErrorName, DOMException};
 use dom::event::{Event, EventBubbles, EventCancelable};
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
 use dom::progressevent::ProgressEvent;
+use dom_struct::dom_struct;
 use encoding::all::UTF_8;
 use encoding::label::encoding_from_whatwg_label;
 use encoding::types::{DecoderTrap, EncodingRef};
 use hyper::mime::{Attr, Mime};
 use js::jsapi::Heap;
 use js::jsapi::JSAutoCompartment;
 use js::jsapi::JSContext;
 use js::jsval::{self, JSVal};
--- a/servo/components/script/dom/filereadersync.rs
+++ b/servo/components/script/dom/filereadersync.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::FileReaderSyncBinding;
 use dom::bindings::error::Fallible;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct FileReaderSync {
     eventtarget: EventTarget
 }
 
 impl FileReaderSync {
     pub fn new_inherited() -> FileReaderSync {
--- a/servo/components/script/dom/focusevent.rs
+++ b/servo/components/script/dom/focusevent.rs
@@ -9,16 +9,17 @@ use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{MutNullableJS, Root, RootedReference};
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::event::{EventBubbles, EventCancelable};
 use dom::eventtarget::EventTarget;
 use dom::uievent::UIEvent;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use std::default::Default;
 
 #[dom_struct]
 pub struct FocusEvent {
     uievent: UIEvent,
     related_target: MutNullableJS<EventTarget>,
 }
 
--- a/servo/components/script/dom/forcetouchevent.rs
+++ b/servo/components/script/dom/forcetouchevent.rs
@@ -7,16 +7,17 @@ use dom::bindings::codegen::Bindings::Fo
 use dom::bindings::codegen::Bindings::UIEventBinding::UIEventMethods;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::num::Finite;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::uievent::UIEvent;
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct ForceTouchEvent {
     uievent: UIEvent,
     force: f32,
 }
 
 impl ForceTouchEvent {
--- a/servo/components/script/dom/formdata.rs
+++ b/servo/components/script/dom/formdata.rs
@@ -10,16 +10,17 @@ use dom::bindings::error::Fallible;
 use dom::bindings::iterable::Iterable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bindings::str::{DOMString, USVString};
 use dom::blob::{Blob, BlobImpl};
 use dom::file::File;
 use dom::globalscope::GlobalScope;
 use dom::htmlformelement::{HTMLFormElement, FormDatumValue, FormDatum};
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use std::collections::HashMap;
 use std::collections::hash_map::Entry::{Occupied, Vacant};
 use std::iter;
 
 #[dom_struct]
 pub struct FormData {
     reflector_: Reflector,
--- a/servo/components/script/dom/globalscope.rs
+++ b/servo/components/script/dom/globalscope.rs
@@ -14,16 +14,17 @@ use dom::bindings::settings_stack::{Auto
 use dom::bindings::str::DOMString;
 use dom::crypto::Crypto;
 use dom::dedicatedworkerglobalscope::DedicatedWorkerGlobalScope;
 use dom::errorevent::ErrorEvent;
 use dom::event::{Event, EventBubbles, EventCancelable, EventStatus};
 use dom::eventtarget::EventTarget;
 use dom::window::Window;
 use dom::workerglobalscope::WorkerGlobalScope;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::IpcSender;
 use js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL};
 use js::glue::{IsWrapper, UnwrapObject};
 use js::jsapi::{CurrentGlobalOrNull, GetGlobalForObjectCrossCompartment};
 use js::jsapi::{HandleValue, Evaluate2, JSAutoCompartment, JSContext};
 use js::jsapi::{JSObject, JS_GetContext};
 use js::jsapi::{JS_GetObjectRuntime, MutableHandleValue};
 use js::panic::maybe_resume_unwind;
--- a/servo/components/script/dom/hashchangeevent.rs
+++ b/servo/components/script/dom/hashchangeevent.rs
@@ -7,16 +7,17 @@ use dom::bindings::codegen::Bindings::Ha
 use dom::bindings::codegen::Bindings::HashChangeEventBinding::HashChangeEventMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::{DOMString, USVString};
 use dom::event::Event;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use servo_atoms::Atom;
 
 // https://html.spec.whatwg.org/multipage/#hashchangeevent
 #[dom_struct]
 pub struct HashChangeEvent {
     event: Event,
     old_url: String,
     new_url: String,
--- a/servo/components/script/dom/headers.rs
+++ b/servo/components/script/dom/headers.rs
@@ -5,16 +5,17 @@
 use dom::bindings::cell::DOMRefCell;
 use dom::bindings::codegen::Bindings::HeadersBinding::{HeadersInit, HeadersMethods, HeadersWrap};
 use dom::bindings::error::{Error, ErrorResult, Fallible};
 use dom::bindings::iterable::Iterable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::{ByteString, is_token};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use hyper::header::Headers as HyperHeaders;
 use mime::{Mime, TopLevel, SubLevel};
 use std::cell::Cell;
 use std::result::Result;
 use std::str;
 
 #[dom_struct]
 pub struct Headers {
--- a/servo/components/script/dom/history.rs
+++ b/servo/components/script/dom/history.rs
@@ -6,16 +6,17 @@ use dom::bindings::codegen::Bindings::Hi
 use dom::bindings::codegen::Bindings::HistoryBinding::HistoryMethods;
 use dom::bindings::codegen::Bindings::LocationBinding::LocationMethods;
 use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::globalscope::GlobalScope;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use ipc_channel::ipc;
 use msg::constellation_msg::TraversalDirection;
 use script_traits::ScriptMsg as ConstellationMsg;
 
 // https://html.spec.whatwg.org/multipage/#the-history-interface
 #[dom_struct]
 pub struct History {
     reflector_: Reflector,
--- a/servo/components/script/dom/htmlanchorelement.rs
+++ b/servo/components/script/dom/htmlanchorelement.rs
@@ -19,16 +19,17 @@ use dom::element::Element;
 use dom::event::Event;
 use dom::eventtarget::EventTarget;
 use dom::htmlelement::HTMLElement;
 use dom::htmlimageelement::HTMLImageElement;
 use dom::mouseevent::MouseEvent;
 use dom::node::{Node, document_from_node};
 use dom::urlhelper::UrlHelper;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use net_traits::ReferrerPolicy;
 use num_traits::ToPrimitive;
 use script_traits::MozBrowserEvent;
 use servo_config::prefs::PREFS;
 use servo_url::ServoUrl;
 use std::default::Default;
 use style::attr::AttrValue;
--- a/servo/components/script/dom/htmlappletelement.rs
+++ b/servo/components/script/dom/htmlappletelement.rs
@@ -6,16 +6,17 @@ use dom::bindings::codegen::Bindings::HT
 use dom::bindings::codegen::Bindings::HTMLAppletElementBinding::HTMLAppletElementMethods;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use style::attr::AttrValue;
 
 #[dom_struct]
 pub struct HTMLAppletElement {
     htmlelement: HTMLElement
 }
 
--- a/servo/components/script/dom/htmlareaelement.rs
+++ b/servo/components/script/dom/htmlareaelement.rs
@@ -13,16 +13,17 @@ use dom::document::Document;
 use dom::domtokenlist::DOMTokenList;
 use dom::element::Element;
 use dom::event::Event;
 use dom::eventtarget::EventTarget;
 use dom::htmlanchorelement::follow_hyperlink;
 use dom::htmlelement::HTMLElement;
 use dom::node::{Node, document_from_node};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use euclid::point::Point2D;
 use html5ever_atoms::LocalName;
 use net_traits::ReferrerPolicy;
 use std::default::Default;
 use std::f32;
 use style::attr::AttrValue;
 
 #[derive(PartialEq)]
--- a/servo/components/script/dom/htmlaudioelement.rs
+++ b/servo/components/script/dom/htmlaudioelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLAudioElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlmediaelement::HTMLMediaElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLAudioElement {
     htmlmediaelement: HTMLMediaElement
 }
 
 impl HTMLAudioElement {
--- a/servo/components/script/dom/htmlbaseelement.rs
+++ b/servo/components/script/dom/htmlbaseelement.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::HT
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::{AttributeMutation, Element};
 use dom::htmlelement::HTMLElement;
 use dom::node::{Node, UnbindContext, document_from_node};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use servo_url::ServoUrl;
 use style::attr::AttrValue;
 
 #[dom_struct]
 pub struct HTMLBaseElement {
     htmlelement: HTMLElement
 }
--- a/servo/components/script/dom/htmlbodyelement.rs
+++ b/servo/components/script/dom/htmlbodyelement.rs
@@ -12,16 +12,17 @@ use dom::bindings::js::{LayoutJS, Root};
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
 use dom::htmlelement::HTMLElement;
 use dom::node::{Node, document_from_node, window_from_node};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use script_traits::ScriptMsg as ConstellationMsg;
 use servo_url::ServoUrl;
 use style::attr::AttrValue;
 use time;
 
 /// How long we should wait before performing the initial reflow after `<body>` is parsed, in
 /// nanoseconds.
--- a/servo/components/script/dom/htmlbrelement.rs
+++ b/servo/components/script/dom/htmlbrelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLBRElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLBRElement {
     htmlelement: HTMLElement,
 }
 
 impl HTMLBRElement {
--- a/servo/components/script/dom/htmlbuttonelement.rs
+++ b/servo/components/script/dom/htmlbuttonelement.rs
@@ -18,16 +18,17 @@ use dom::htmlfieldsetelement::HTMLFieldS
 use dom::htmlformelement::{FormControl, FormDatum, FormDatumValue};
 use dom::htmlformelement::{FormSubmitter, ResetFrom, SubmittedFrom};
 use dom::htmlformelement::HTMLFormElement;
 use dom::node::{Node, UnbindContext, document_from_node, window_from_node};
 use dom::nodelist::NodeList;
 use dom::validation::Validatable;
 use dom::validitystate::{ValidityState, ValidationFlags};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use std::cell::Cell;
 use style::element_state::*;
 
 #[derive(JSTraceable, PartialEq, Copy, Clone)]
 #[derive(HeapSizeOf)]
 enum ButtonType {
     Submit,
--- a/servo/components/script/dom/htmlcanvaselement.rs
+++ b/servo/components/script/dom/htmlcanvaselement.rs
@@ -19,16 +19,17 @@ use dom::bindings::str::DOMString;
 use dom::canvasrenderingcontext2d::{CanvasRenderingContext2D, LayoutCanvasRenderingContext2DHelpers};
 use dom::document::Document;
 use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
 use dom::globalscope::GlobalScope;
 use dom::htmlelement::HTMLElement;
 use dom::node::{Node, window_from_node};
 use dom::virtualmethods::VirtualMethods;
 use dom::webglrenderingcontext::{LayoutCanvasWebGLRenderingContextHelpers, WebGLRenderingContext};
+use dom_struct::dom_struct;
 use euclid::size::Size2D;
 use html5ever_atoms::LocalName;
 use image::ColorType;
 use image::png::PNGEncoder;
 use ipc_channel::ipc::{self, IpcSender};
 use js::error::throw_type_error;
 use js::jsapi::{HandleValue, JSContext};
 use offscreen_gl_context::GLContextAttributes;
--- a/servo/components/script/dom/htmlcollection.rs
+++ b/servo/components/script/dom/htmlcollection.rs
@@ -8,16 +8,17 @@ use dom::bindings::inheritance::Castable
 use dom::bindings::js::{JS, Root, MutNullableJS};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::bindings::trace::JSTraceable;
 use dom::bindings::xmlname::namespace_from_domstring;
 use dom::element::Element;
 use dom::node::Node;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use html5ever_atoms::{LocalName, QualName};
 use servo_atoms::Atom;
 use std::cell::Cell;
 use style::str::split_html_space_chars;
 
 pub trait CollectionFilter : JSTraceable {
     fn filter<'a>(&self, elem: &'a Element, root: &'a Node) -> bool;
 }
--- a/servo/components/script/dom/htmldataelement.rs
+++ b/servo/components/script/dom/htmldataelement.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::HTMLDataElementBinding;
 use dom::bindings::codegen::Bindings::HTMLDataElementBinding::HTMLDataElementMethods;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLDataElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLDataElement {
--- a/servo/components/script/dom/htmldatalistelement.rs
+++ b/servo/components/script/dom/htmldatalistelement.rs
@@ -8,16 +8,17 @@ use dom::bindings::inheritance::Castable
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::Element;
 use dom::htmlcollection::{CollectionFilter, HTMLCollection};
 use dom::htmlelement::HTMLElement;
 use dom::htmloptionelement::HTMLOptionElement;
 use dom::node::{Node, window_from_node};
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLDataListElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLDataListElement {
--- a/servo/components/script/dom/htmldetailselement.rs
+++ b/servo/components/script/dom/htmldetailselement.rs
@@ -10,16 +10,17 @@ use dom::bindings::js::Root;
 use dom::bindings::refcounted::Trusted;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::AttributeMutation;
 use dom::eventtarget::EventTarget;
 use dom::htmlelement::HTMLElement;
 use dom::node::{Node, window_from_node};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use script_thread::Runnable;
 use std::cell::Cell;
 use task_source::TaskSource;
 
 #[dom_struct]
 pub struct HTMLDetailsElement {
     htmlelement: HTMLElement,
--- a/servo/components/script/dom/htmldialogelement.rs
+++ b/servo/components/script/dom/htmldialogelement.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::HT
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::Element;
 use dom::eventtarget::EventTarget;
 use dom::htmlelement::HTMLElement;
 use dom::node::{Node, window_from_node};
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLDialogElement {
     htmlelement: HTMLElement,
     return_value: DOMRefCell<DOMString>,
 }
 
--- a/servo/components/script/dom/htmldirectoryelement.rs
+++ b/servo/components/script/dom/htmldirectoryelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLDirectoryElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLDirectoryElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLDirectoryElement {
--- a/servo/components/script/dom/htmldivelement.rs
+++ b/servo/components/script/dom/htmldivelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLDivElementBinding::{self, HTMLDivElementMethods};
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLDivElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLDivElement {
--- a/servo/components/script/dom/htmldlistelement.rs
+++ b/servo/components/script/dom/htmldlistelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLDListElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLDListElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLDListElement {
--- a/servo/components/script/dom/htmlelement.rs
+++ b/servo/components/script/dom/htmlelement.rs
@@ -24,16 +24,17 @@ use dom::htmlbodyelement::HTMLBodyElemen
 use dom::htmlframesetelement::HTMLFrameSetElement;
 use dom::htmlhtmlelement::HTMLHtmlElement;
 use dom::htmlinputelement::HTMLInputElement;
 use dom::htmllabelelement::HTMLLabelElement;
 use dom::node::{Node, SEQUENTIALLY_FOCUSABLE};
 use dom::node::{document_from_node, window_from_node};
 use dom::nodelist::NodeList;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use std::ascii::AsciiExt;
 use std::borrow::ToOwned;
 use std::default::Default;
 use std::rc::Rc;
 use style::attr::AttrValue;
 use style::element_state::*;
 
--- a/servo/components/script/dom/htmlembedelement.rs
+++ b/servo/components/script/dom/htmlembedelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLEmbedElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLEmbedElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLEmbedElement {
--- a/servo/components/script/dom/htmlfieldsetelement.rs
+++ b/servo/components/script/dom/htmlfieldsetelement.rs
@@ -12,16 +12,17 @@ use dom::document::Document;
 use dom::element::{AttributeMutation, Element};
 use dom::htmlcollection::{CollectionFilter, HTMLCollection};
 use dom::htmlelement::HTMLElement;
 use dom::htmlformelement::{FormControl, HTMLFormElement};
 use dom::htmllegendelement::HTMLLegendElement;
 use dom::node::{Node, window_from_node};
 use dom::validitystate::ValidityState;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use style::element_state::*;
 
 #[dom_struct]
 pub struct HTMLFieldSetElement {
     htmlelement: HTMLElement
 }
 
--- a/servo/components/script/dom/htmlfontelement.rs
+++ b/servo/components/script/dom/htmlfontelement.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::HT
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{LayoutJS, Root};
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::{Element, RawLayoutElementHelpers};
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use servo_atoms::Atom;
 use style::attr::AttrValue;
 use style::str::{HTML_SPACE_CHARACTERS, read_numbers};
 use style::values::specified;
 
 #[dom_struct]
 pub struct HTMLFontElement {
--- a/servo/components/script/dom/htmlformcontrolscollection.rs
+++ b/servo/components/script/dom/htmlformcontrolscollection.rs
@@ -9,16 +9,17 @@ use dom::bindings::codegen::UnionTypes::
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{DomObject, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::element::Element;
 use dom::htmlcollection::{CollectionFilter, HTMLCollection};
 use dom::node::Node;
 use dom::radionodelist::RadioNodeList;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use std::iter;
 
 #[dom_struct]
 pub struct HTMLFormControlsCollection {
     collection: HTMLCollection,
 }
 
 impl HTMLFormControlsCollection {
--- a/servo/components/script/dom/htmlformelement.rs
+++ b/servo/components/script/dom/htmlformelement.rs
@@ -32,16 +32,17 @@ use dom::htmlformcontrolscollection::HTM
 use dom::htmlinputelement::HTMLInputElement;
 use dom::htmlobjectelement::HTMLObjectElement;
 use dom::htmloutputelement::HTMLOutputElement;
 use dom::htmlselectelement::HTMLSelectElement;
 use dom::htmltextareaelement::HTMLTextAreaElement;
 use dom::node::{Node, document_from_node, window_from_node};
 use dom::validitystate::ValidationFlags;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use encoding::EncodingRef;
 use encoding::all::UTF_8;
 use encoding::label::encoding_from_whatwg_label;
 use html5ever_atoms::LocalName;
 use hyper::header::{Charset, ContentDisposition, ContentType, DispositionParam, DispositionType};
 use hyper::method::Method;
 use msg::constellation_msg::PipelineId;
 use script_thread::{MainThreadScriptMsg, Runnable};
--- a/servo/components/script/dom/htmlframeelement.rs
+++ b/servo/components/script/dom/htmlframeelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLFrameElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLFrameElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLFrameElement {
--- a/servo/components/script/dom/htmlframesetelement.rs
+++ b/servo/components/script/dom/htmlframesetelement.rs
@@ -6,16 +6,17 @@ use dom::bindings::codegen::Bindings::Ev
 use dom::bindings::codegen::Bindings::HTMLFrameSetElementBinding;
 use dom::bindings::codegen::Bindings::HTMLFrameSetElementBinding::HTMLFrameSetElementMethods;
 use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::{Node, document_from_node};
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLFrameSetElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLFrameSetElement {
--- a/servo/components/script/dom/htmlheadelement.rs
+++ b/servo/components/script/dom/htmlheadelement.rs
@@ -9,16 +9,17 @@ use dom::bindings::js::{Root, RootedRefe
 use dom::bindings::str::DOMString;
 use dom::document::{Document, determine_policy_for_token};
 use dom::element::Element;
 use dom::htmlelement::HTMLElement;
 use dom::htmlmetaelement::HTMLMetaElement;
 use dom::node::{Node, document_from_node};
 use dom::userscripts::load_script;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLHeadElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLHeadElement {
--- a/servo/components/script/dom/htmlheadingelement.rs
+++ b/servo/components/script/dom/htmlheadingelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLHeadingElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[derive(JSTraceable, HeapSizeOf)]
 pub enum HeadingLevel {
     Heading1,
     Heading2,
     Heading3,
     Heading4,
--- a/servo/components/script/dom/htmlhrelement.rs
+++ b/servo/components/script/dom/htmlhrelement.rs
@@ -7,16 +7,17 @@ use dom::bindings::codegen::Bindings::HT
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{LayoutJS, Root};
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::{Element, RawLayoutElementHelpers};
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use style::attr::{AttrValue, LengthOrPercentageOrAuto};
 
 #[dom_struct]
 pub struct HTMLHRElement {
     htmlelement: HTMLElement,
 }
 
--- a/servo/components/script/dom/htmlhtmlelement.rs
+++ b/servo/components/script/dom/htmlhtmlelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLHtmlElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLHtmlElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLHtmlElement {
--- a/servo/components/script/dom/htmliframeelement.rs
+++ b/servo/components/script/dom/htmliframeelement.rs
@@ -30,16 +30,17 @@ use dom::domtokenlist::DOMTokenList;
 use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
 use dom::event::Event;
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
 use dom::htmlelement::HTMLElement;
 use dom::node::{Node, NodeDamage, UnbindContext, document_from_node, window_from_node};
 use dom::virtualmethods::VirtualMethods;
 use dom::window::{ReflowReason, Window};
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use ipc_channel::ipc;
 use js::jsapi::{JSAutoCompartment, JSContext, MutableHandleValue};
 use js::jsval::{NullValue, UndefinedValue};
 use msg::constellation_msg::{FrameType, FrameId, PipelineId, TraversalDirection};
 use net_traits::response::HttpsState;
 use script_layout_interface::message::ReflowQueryType;
 use script_thread::{ScriptThread, Runnable};
--- a/servo/components/script/dom/htmlimageelement.rs
+++ b/servo/components/script/dom/htmlimageelement.rs
@@ -27,16 +27,17 @@ use dom::eventtarget::EventTarget;
 use dom::htmlareaelement::HTMLAreaElement;
 use dom::htmlelement::HTMLElement;
 use dom::htmlmapelement::HTMLMapElement;
 use dom::mouseevent::MouseEvent;
 use dom::node::{Node, NodeDamage, document_from_node, window_from_node};
 use dom::values::UNSIGNED_LONG_MAX;
 use dom::virtualmethods::VirtualMethods;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use euclid::point::Point2D;
 use html5ever_atoms::LocalName;
 use ipc_channel::ipc;
 use ipc_channel::router::ROUTER;
 use net_traits::{FetchResponseListener, FetchMetadata, NetworkError, FetchResponseMsg};
 use net_traits::image::base::{Image, ImageMetadata};
 use net_traits::image_cache_thread::{ImageResponder, ImageResponse, PendingImageId, ImageState};
 use net_traits::image_cache_thread::{UsePlaceholder, ImageOrMetadataAvailable, CanRequestImages};
--- a/servo/components/script/dom/htmlinputelement.rs
+++ b/servo/components/script/dom/htmlinputelement.rs
@@ -31,16 +31,17 @@ use dom::htmlformelement::{ResetFrom, Su
 use dom::keyboardevent::KeyboardEvent;
 use dom::mouseevent::MouseEvent;
 use dom::node::{Node, NodeDamage, UnbindContext};
 use dom::node::{document_from_node, window_from_node};
 use dom::nodelist::NodeList;
 use dom::validation::Validatable;
 use dom::validitystate::ValidationFlags;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use ipc_channel::ipc::{self, IpcSender};
 use mime_guess;
 use net_traits::{CoreResourceMsg, IpcSend};
 use net_traits::blob_url_store::get_blob_origin;
 use net_traits::filemanager_thread::{FileManagerThreadMsg, FilterPattern};
 use script_layout_interface::rpc::TextIndexResponse;
 use script_traits::ScriptMsg as ConstellationMsg;
--- a/servo/components/script/dom/htmllabelelement.rs
+++ b/servo/components/script/dom/htmllabelelement.rs
@@ -11,16 +11,17 @@ use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::Element;
 use dom::event::Event;
 use dom::eventtarget::EventTarget;
 use dom::htmlelement::HTMLElement;
 use dom::htmlformelement::{FormControl, HTMLFormElement};
 use dom::node::{document_from_node, Node};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use style::attr::AttrValue;
 
 #[dom_struct]
 pub struct HTMLLabelElement {
     htmlelement: HTMLElement,
 }
 
--- a/servo/components/script/dom/htmllegendelement.rs
+++ b/servo/components/script/dom/htmllegendelement.rs
@@ -10,16 +10,17 @@ use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::Element;
 use dom::htmlelement::HTMLElement;
 use dom::htmlfieldsetelement::HTMLFieldSetElement;
 use dom::htmlformelement::{HTMLFormElement, FormControl};
 use dom::node::{Node, UnbindContext};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLLegendElement {
     htmlelement: HTMLElement,
 }
 
 impl HTMLLegendElement {
--- a/servo/components/script/dom/htmllielement.rs
+++ b/servo/components/script/dom/htmllielement.rs
@@ -6,16 +6,17 @@ use dom::bindings::codegen::Bindings::HT
 use dom::bindings::codegen::Bindings::HTMLLIElementBinding::HTMLLIElementMethods;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use style::attr::AttrValue;
 
 #[dom_struct]
 pub struct HTMLLIElement {
     htmlelement: HTMLElement,
 }
 
--- a/servo/components/script/dom/htmllinkelement.rs
+++ b/servo/components/script/dom/htmllinkelement.rs
@@ -16,16 +16,17 @@ use dom::document::Document;
 use dom::domtokenlist::DOMTokenList;
 use dom::element::{AttributeMutation, Element, ElementCreator};
 use dom::element::{cors_setting_for_element, reflect_cross_origin_attribute, set_cross_origin_attribute};
 use dom::globalscope::GlobalScope;
 use dom::htmlelement::HTMLElement;
 use dom::node::{Node, UnbindContext, document_from_node, window_from_node};
 use dom::stylesheet::StyleSheet as DOMStyleSheet;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use net_traits::ReferrerPolicy;
 use script_traits::{MozBrowserEvent, ScriptMsg as ConstellationMsg};
 use std::ascii::AsciiExt;
 use std::borrow::ToOwned;
 use std::cell::Cell;
 use std::default::Default;
 use std::sync::Arc;
--- a/servo/components/script/dom/htmlmapelement.rs
+++ b/servo/components/script/dom/htmlmapelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLMapElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLMapElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLMapElement {
--- a/servo/components/script/dom/htmlmediaelement.rs
+++ b/servo/components/script/dom/htmlmediaelement.rs
@@ -22,16 +22,17 @@ use dom::element::{Element, AttributeMut
 use dom::event::{Event, EventBubbles, EventCancelable};
 use dom::htmlaudioelement::HTMLAudioElement;
 use dom::htmlelement::HTMLElement;
 use dom::htmlsourceelement::HTMLSourceElement;
 use dom::htmlvideoelement::HTMLVideoElement;
 use dom::mediaerror::MediaError;
 use dom::node::{window_from_node, document_from_node, Node, UnbindContext};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use ipc_channel::ipc;
 use ipc_channel::router::ROUTER;
 use net_traits::{FetchResponseListener, FetchMetadata, Metadata, NetworkError};
 use net_traits::request::{CredentialsMode, Destination, RequestInit, Type as RequestType};
 use network_listener::{NetworkListener, PreInvoke};
 use script_thread::{Runnable, ScriptThread};
 use servo_atoms::Atom;
--- a/servo/components/script/dom/htmlmetaelement.rs
+++ b/servo/components/script/dom/htmlmetaelement.rs
@@ -12,16 +12,17 @@ use dom::bindings::js::{MutNullableJS, R
 use dom::bindings::str::DOMString;
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::document::Document;
 use dom::element::{AttributeMutation, Element};
 use dom::htmlelement::HTMLElement;
 use dom::htmlheadelement::HTMLHeadElement;
 use dom::node::{Node, UnbindContext, document_from_node, window_from_node};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use parking_lot::RwLock;
 use servo_config::prefs::PREFS;
 use std::ascii::AsciiExt;
 use std::sync::Arc;
 use std::sync::atomic::AtomicBool;
 use style::attr::AttrValue;
 use style::str::HTML_SPACE_CHARACTERS;
--- a/servo/components/script/dom/htmlmeterelement.rs
+++ b/servo/components/script/dom/htmlmeterelement.rs
@@ -5,16 +5,17 @@
 use dom::bindings::codegen::Bindings::HTMLMeterElementBinding::{self, HTMLMeterElementMethods};
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
 use dom::nodelist::NodeList;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLMeterElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLMeterElement {
--- a/servo/components/script/dom/htmlmodelement.rs
+++ b/servo/components/script/dom/htmlmodelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLModElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLModElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLModElement {
--- a/servo/components/script/dom/htmlobjectelement.rs
+++ b/servo/components/script/dom/htmlobjectelement.rs
@@ -12,16 +12,17 @@ use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::{AttributeMutation, Element};
 use dom::htmlelement::HTMLElement;
 use dom::htmlformelement::{FormControl, HTMLFormElement};
 use dom::node::{Node, window_from_node};
 use dom::validation::Validatable;
 use dom::validitystate::{ValidityState, ValidationFlags};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use net_traits::image::base::Image;
 use std::sync::Arc;
 
 #[dom_struct]
 pub struct HTMLObjectElement {
     htmlelement: HTMLElement,
     #[ignore_heap_size_of = "Arc"]
--- a/servo/components/script/dom/htmlolistelement.rs
+++ b/servo/components/script/dom/htmlolistelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLOListElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLOListElement {
     htmlelement: HTMLElement,
 }
 
 impl HTMLOListElement {
--- a/servo/components/script/dom/htmloptgroupelement.rs
+++ b/servo/components/script/dom/htmloptgroupelement.rs
@@ -9,16 +9,17 @@ use dom::bindings::inheritance::Castable
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::{AttributeMutation, Element};
 use dom::htmlelement::HTMLElement;
 use dom::htmloptionelement::HTMLOptionElement;
 use dom::node::Node;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use style::element_state::*;
 
 #[dom_struct]
 pub struct HTMLOptGroupElement {
     htmlelement: HTMLElement
 }
 
--- a/servo/components/script/dom/htmloptionelement.rs
+++ b/servo/components/script/dom/htmloptionelement.rs
@@ -17,16 +17,17 @@ use dom::element::{AttributeMutation, El
 use dom::htmlelement::HTMLElement;
 use dom::htmlformelement::HTMLFormElement;
 use dom::htmloptgroupelement::HTMLOptGroupElement;
 use dom::htmlscriptelement::HTMLScriptElement;
 use dom::htmlselectelement::HTMLSelectElement;
 use dom::node::{Node, UnbindContext};
 use dom::text::Text;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use std::cell::Cell;
 use style::element_state::*;
 use style::str::{split_html_space_chars, str_join};
 
 #[dom_struct]
 pub struct HTMLOptionElement {
     htmlelement: HTMLElement,
--- a/servo/components/script/dom/htmloptionscollection.rs
+++ b/servo/components/script/dom/htmloptionscollection.rs
@@ -15,16 +15,17 @@ use dom::bindings::js::{Root, RootedRefe
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::element::Element;
 use dom::htmlcollection::{CollectionFilter, HTMLCollection};
 use dom::htmloptionelement::HTMLOptionElement;
 use dom::htmlselectelement::HTMLSelectElement;
 use dom::node::{document_from_node, Node};
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct HTMLOptionsCollection {
     collection: HTMLCollection,
 }
 
 impl HTMLOptionsCollection {
     fn new_inherited(select: &HTMLSelectElement, filter: Box<CollectionFilter + 'static>) -> HTMLOptionsCollection {
--- a/servo/components/script/dom/htmloutputelement.rs
+++ b/servo/components/script/dom/htmloutputelement.rs
@@ -8,16 +8,17 @@ use dom::bindings::inheritance::Castable
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::htmlformelement::{FormControl, HTMLFormElement};
 use dom::node::{Node, window_from_node};
 use dom::nodelist::NodeList;
 use dom::validitystate::ValidityState;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLOutputElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLOutputElement {
--- a/servo/components/script/dom/htmlparagraphelement.rs
+++ b/servo/components/script/dom/htmlparagraphelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLParagraphElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLParagraphElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLParagraphElement {
--- a/servo/components/script/dom/htmlparamelement.rs
+++ b/servo/components/script/dom/htmlparamelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLParamElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLParamElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLParamElement {
--- a/servo/components/script/dom/htmlpreelement.rs
+++ b/servo/components/script/dom/htmlpreelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLPreElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLPreElement {
     htmlelement: HTMLElement,
 }
 
 impl HTMLPreElement {
--- a/servo/components/script/dom/htmlprogresselement.rs
+++ b/servo/components/script/dom/htmlprogresselement.rs
@@ -5,16 +5,17 @@
 use dom::bindings::codegen::Bindings::HTMLProgressElementBinding::{self, HTMLProgressElementMethods};
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
 use dom::nodelist::NodeList;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLProgressElement {
     htmlelement: HTMLElement,
 }
 
 impl HTMLProgressElement {
--- a/servo/components/script/dom/htmlquoteelement.rs
+++ b/servo/components/script/dom/htmlquoteelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLQuoteElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLQuoteElement {
     htmlelement: HTMLElement,
 }
 
 impl HTMLQuoteElement {
--- a/servo/components/script/dom/htmlscriptelement.rs
+++ b/servo/components/script/dom/htmlscriptelement.rs
@@ -18,16 +18,17 @@ use dom::document::Document;
 use dom::element::{AttributeMutation, Element, ElementCreator};
 use dom::element::{cors_setting_for_element, reflect_cross_origin_attribute, set_cross_origin_attribute};
 use dom::event::{Event, EventBubbles, EventCancelable, EventStatus};
 use dom::globalscope::GlobalScope;
 use dom::htmlelement::HTMLElement;
 use dom::node::{ChildrenMutation, CloneChildrenFlag, Node};
 use dom::node::{document_from_node, window_from_node};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use encoding::label::encoding_from_whatwg_label;
 use encoding::types::{DecoderTrap, EncodingRef};
 use html5ever_atoms::LocalName;
 use ipc_channel::ipc;
 use ipc_channel::router::ROUTER;
 use js::jsval::UndefinedValue;
 use net_traits::{FetchMetadata, FetchResponseListener, Metadata, NetworkError};
 use net_traits::request::{CorsSettings, CredentialsMode, Destination, RequestInit, RequestMode, Type as RequestType};
--- a/servo/components/script/dom/htmlselectelement.rs
+++ b/servo/components/script/dom/htmlselectelement.rs
@@ -25,16 +25,17 @@ use dom::htmlformelement::{FormDatumValu
 use dom::htmloptgroupelement::HTMLOptGroupElement;
 use dom::htmloptionelement::HTMLOptionElement;
 use dom::htmloptionscollection::HTMLOptionsCollection;
 use dom::node::{Node, UnbindContext, window_from_node};
 use dom::nodelist::NodeList;
 use dom::validation::Validatable;
 use dom::validitystate::{ValidityState, ValidationFlags};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use std::iter;
 use style::attr::AttrValue;
 use style::element_state::*;
 
 #[derive(JSTraceable, HeapSizeOf)]
 struct OptionsFilter;
 impl CollectionFilter for OptionsFilter {
--- a/servo/components/script/dom/htmlsourceelement.rs
+++ b/servo/components/script/dom/htmlsourceelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLSourceElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLSourceElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLSourceElement {
--- a/servo/components/script/dom/htmlspanelement.rs
+++ b/servo/components/script/dom/htmlspanelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLSpanElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLSpanElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLSpanElement {
--- a/servo/components/script/dom/htmlstyleelement.rs
+++ b/servo/components/script/dom/htmlstyleelement.rs
@@ -13,16 +13,17 @@ use dom::bindings::str::DOMString;
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::document::Document;
 use dom::element::{Element, ElementCreator};
 use dom::eventtarget::EventTarget;
 use dom::htmlelement::HTMLElement;
 use dom::node::{ChildrenMutation, Node, UnbindContext, document_from_node, window_from_node};
 use dom::stylesheet::StyleSheet as DOMStyleSheet;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use net_traits::ReferrerPolicy;
 use script_layout_interface::message::Msg;
 use std::cell::Cell;
 use std::sync::Arc;
 use style::media_queries::parse_media_query_list;
 use style::parser::ParserContextExtraData;
 use style::stylesheets::{Stylesheet, Origin};
--- a/servo/components/script/dom/htmltablecaptionelement.rs
+++ b/servo/components/script/dom/htmltablecaptionelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLTableCaptionElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLTableCaptionElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLTableCaptionElement {
--- a/servo/components/script/dom/htmltablecellelement.rs
+++ b/servo/components/script/dom/htmltablecellelement.rs
@@ -9,16 +9,17 @@ use dom::bindings::inheritance::Castable
 use dom::bindings::js::LayoutJS;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::{Element, RawLayoutElementHelpers};
 use dom::htmlelement::HTMLElement;
 use dom::htmltablerowelement::HTMLTableRowElement;
 use dom::node::Node;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use style::attr::{AttrValue, LengthOrPercentageOrAuto};
 
 const DEFAULT_COLSPAN: u32 = 1;
 const DEFAULT_ROWSPAN: u32 = 1;
 
 #[dom_struct]
 pub struct HTMLTableCellElement {
--- a/servo/components/script/dom/htmltablecolelement.rs
+++ b/servo/components/script/dom/htmltablecolelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLTableColElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLTableColElement {
     htmlelement: HTMLElement,
 }
 
 impl HTMLTableColElement {
--- a/servo/components/script/dom/htmltabledatacellelement.rs
+++ b/servo/components/script/dom/htmltabledatacellelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLTableDataCellElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmltablecellelement::HTMLTableCellElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLTableDataCellElement {
     htmltablecellelement: HTMLTableCellElement,
 }
 
 impl HTMLTableDataCellElement {
--- a/servo/components/script/dom/htmltableelement.rs
+++ b/servo/components/script/dom/htmltableelement.rs
@@ -17,16 +17,17 @@ use dom::element::{AttributeMutation, El
 use dom::htmlcollection::{CollectionFilter, HTMLCollection};
 use dom::htmlelement::HTMLElement;
 use dom::htmltablecaptionelement::HTMLTableCaptionElement;
 use dom::htmltablecolelement::HTMLTableColElement;
 use dom::htmltablerowelement::HTMLTableRowElement;
 use dom::htmltablesectionelement::HTMLTableSectionElement;
 use dom::node::{Node, document_from_node, window_from_node};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use std::cell::Cell;
 use style::attr::{AttrValue, LengthOrPercentageOrAuto, parse_unsigned_integer};
 
 #[dom_struct]
 pub struct HTMLTableElement {
     htmlelement: HTMLElement,
     border: Cell<Option<u32>>,
--- a/servo/components/script/dom/htmltableheadercellelement.rs
+++ b/servo/components/script/dom/htmltableheadercellelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLTableHeaderCellElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmltablecellelement::HTMLTableCellElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLTableHeaderCellElement {
     htmltablecellelement: HTMLTableCellElement,
 }
 
 impl HTMLTableHeaderCellElement {
--- a/servo/components/script/dom/htmltablerowelement.rs
+++ b/servo/components/script/dom/htmltablerowelement.rs
@@ -16,16 +16,17 @@ use dom::element::{Element, RawLayoutEle
 use dom::htmlcollection::{CollectionFilter, HTMLCollection};
 use dom::htmlelement::HTMLElement;
 use dom::htmltabledatacellelement::HTMLTableDataCellElement;
 use dom::htmltableelement::HTMLTableElement;
 use dom::htmltableheadercellelement::HTMLTableHeaderCellElement;
 use dom::htmltablesectionelement::HTMLTableSectionElement;
 use dom::node::{Node, window_from_node};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use style::attr::AttrValue;
 
 #[derive(JSTraceable)]
 struct CellsFilter;
 impl CollectionFilter for CellsFilter {
     fn filter(&self, elem: &Element, root: &Node) -> bool {
         (elem.is::<HTMLTableHeaderCellElement>() || elem.is::<HTMLTableDataCellElement>()) &&
--- a/servo/components/script/dom/htmltablesectionelement.rs
+++ b/servo/components/script/dom/htmltablesectionelement.rs
@@ -11,16 +11,17 @@ use dom::bindings::js::{LayoutJS, Root, 
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::{Element, RawLayoutElementHelpers};
 use dom::htmlcollection::{CollectionFilter, HTMLCollection};
 use dom::htmlelement::HTMLElement;
 use dom::htmltablerowelement::HTMLTableRowElement;
 use dom::node::{Node, window_from_node};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use style::attr::AttrValue;
 
 #[dom_struct]
 pub struct HTMLTableSectionElement {
     htmlelement: HTMLElement,
 }
 
--- a/servo/components/script/dom/htmltemplateelement.rs
+++ b/servo/components/script/dom/htmltemplateelement.rs
@@ -9,16 +9,17 @@ use dom::bindings::codegen::Bindings::No
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{MutNullableJS, Root};
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::documentfragment::DocumentFragment;
 use dom::htmlelement::HTMLElement;
 use dom::node::{CloneChildrenFlag, Node, document_from_node};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLTemplateElement {
     htmlelement: HTMLElement,
 
     /// https://html.spec.whatwg.org/multipage/#template-contents
     contents: MutNullableJS<DocumentFragment>,
--- a/servo/components/script/dom/htmltextareaelement.rs
+++ b/servo/components/script/dom/htmltextareaelement.rs
@@ -20,16 +20,17 @@ use dom::htmlelement::HTMLElement;
 use dom::htmlfieldsetelement::HTMLFieldSetElement;
 use dom::htmlformelement::{FormControl, HTMLFormElement};
 use dom::keyboardevent::KeyboardEvent;
 use dom::node::{ChildrenMutation, Node, NodeDamage, UnbindContext};
 use dom::node::{document_from_node, window_from_node};
 use dom::nodelist::NodeList;
 use dom::validation::Validatable;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use ipc_channel::ipc::IpcSender;
 use script_traits::ScriptMsg as ConstellationMsg;
 use std::cell::Cell;
 use std::ops::Range;
 use style::attr::AttrValue;
 use style::element_state::*;
 use textinput::{KeyReaction, Lines, SelectionDirection, TextInput};
--- a/servo/components/script/dom/htmltimeelement.rs
+++ b/servo/components/script/dom/htmltimeelement.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::HTMLTimeElementBinding;
 use dom::bindings::codegen::Bindings::HTMLTimeElementBinding::HTMLTimeElementMethods;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLTimeElement {
     htmlelement: HTMLElement,
 }
 
 impl HTMLTimeElement {
--- a/servo/components/script/dom/htmltitleelement.rs
+++ b/servo/components/script/dom/htmltitleelement.rs
@@ -7,16 +7,17 @@ use dom::bindings::codegen::Bindings::HT
 use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::{ChildrenMutation, Node};
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLTitleElement {
     htmlelement: HTMLElement,
 }
 
 impl HTMLTitleElement {
--- a/servo/components/script/dom/htmltrackelement.rs
+++ b/servo/components/script/dom/htmltrackelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLTrackElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLTrackElement {
     htmlelement: HTMLElement,
 }
 
 impl HTMLTrackElement {
--- a/servo/components/script/dom/htmlulistelement.rs
+++ b/servo/components/script/dom/htmlulistelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLUListElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLUListElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLUListElement {
--- a/servo/components/script/dom/htmlunknownelement.rs
+++ b/servo/components/script/dom/htmlunknownelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLUnknownElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLUnknownElement {
     htmlelement: HTMLElement
 }
 
 impl HTMLUnknownElement {
--- a/servo/components/script/dom/htmlvideoelement.rs
+++ b/servo/components/script/dom/htmlvideoelement.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::HTMLVideoElementBinding;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::htmlmediaelement::HTMLMediaElement;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 
 #[dom_struct]
 pub struct HTMLVideoElement {
     htmlmediaelement: HTMLMediaElement
 }
 
 impl HTMLVideoElement {
--- a/servo/components/script/dom/imagedata.rs
+++ b/servo/components/script/dom/imagedata.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use core::nonzero::NonZero;
 use dom::bindings::codegen::Bindings::ImageDataBinding;
 use dom::bindings::codegen::Bindings::ImageDataBinding::ImageDataMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use euclid::size::Size2D;
 use js::jsapi::{Heap, JSContext, JSObject};
 use js::rust::Runtime;
 use js::typedarray::{Uint8ClampedArray, CreateWith};
 use std::default::Default;
 use std::ptr;
 use std::vec::Vec;
 
--- a/servo/components/script/dom/keyboardevent.rs
+++ b/servo/components/script/dom/keyboardevent.rs
@@ -9,16 +9,17 @@ use dom::bindings::codegen::Bindings::UI
 use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{Root, RootedReference};
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::event::Event;
 use dom::uievent::UIEvent;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use msg::constellation_msg;
 use msg::constellation_msg::{Key, KeyModifiers};
 use std::borrow::Cow;
 use std::cell::Cell;
 
 unsafe_no_jsmanaged_fields!(Key);
 
 #[dom_struct]
--- a/servo/components/script/dom/location.rs
+++ b/servo/components/script/dom/location.rs
@@ -5,16 +5,17 @@
 use dom::bindings::codegen::Bindings::LocationBinding;
 use dom::bindings::codegen::Bindings::LocationBinding::LocationMethods;
 use dom::bindings::error::{Error, ErrorResult};
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::{DOMString, USVString};
 use dom::urlhelper::UrlHelper;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use servo_url::ServoUrl;
 
 #[dom_struct]
 pub struct Location {
     reflector_: Reflector,
     window: JS<Window>,
 }
 
--- a/servo/components/script/dom/mediaerror.rs
+++ b/servo/components/script/dom/mediaerror.rs
@@ -1,16 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::MediaErrorBinding::{self, MediaErrorMethods};
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct MediaError {
     reflector_: Reflector,
     code: u16,
 }
 
 impl MediaError {
--- a/servo/components/script/dom/medialist.rs
+++ b/servo/components/script/dom/medialist.rs
@@ -5,16 +5,17 @@
 use core::default::Default;
 use cssparser::Parser;
 use dom::bindings::codegen::Bindings::MediaListBinding;
 use dom::bindings::codegen::Bindings::MediaListBinding::MediaListMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use parking_lot::RwLock;
 use std::sync::Arc;
 use style::media_queries::{MediaQuery, parse_media_query_list};
 use style::media_queries::MediaList as StyleMediaList;
 use style_traits::ToCss;
 
 #[dom_struct]
 pub struct MediaList {
--- a/servo/components/script/dom/mediaquerylist.rs
+++ b/servo/components/script/dom/mediaquerylist.rs
@@ -13,16 +13,17 @@ use dom::bindings::reflector::DomObject;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::bindings::trace::JSTraceable;
 use dom::bindings::weakref::{WeakRef, WeakRefVec};
 use dom::document::Document;
 use dom::event::Event;
 use dom::eventtarget::EventTarget;
 use dom::mediaquerylistevent::MediaQueryListEvent;
+use dom_struct::dom_struct;
 use js::jsapi::JSTracer;
 use std::cell::Cell;
 use std::rc::Rc;
 use style::media_queries::{Device, MediaList, MediaType};
 use style_traits::ToCss;
 
 pub enum MediaQueryListMatchState {
     Same(bool),
--- a/servo/components/script/dom/mediaquerylistevent.rs
+++ b/servo/components/script/dom/mediaquerylistevent.rs
@@ -9,16 +9,17 @@ use dom::bindings::codegen::Bindings::Me
 use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::event::Event;
 use dom::globalscope::GlobalScope;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use servo_atoms::Atom;
 use std::cell::Cell;
 
 // https://drafts.csswg.org/cssom-view/#dom-mediaquerylistevent-mediaquerylistevent
 #[dom_struct]
 pub struct MediaQueryListEvent {
     event: Event,
     media: DOMString,
--- a/servo/components/script/dom/messageevent.rs
+++ b/servo/components/script/dom/messageevent.rs
@@ -9,16 +9,17 @@ use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::bindings::trace::RootedTraceableBox;
 use dom::event::Event;
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use js::jsapi::{HandleValue, Heap, JSContext};
 use js::jsval::JSVal;
 use servo_atoms::Atom;
 
 #[dom_struct]
 pub struct MessageEvent {
     event: Event,
     data: Heap<JSVal>,
--- a/servo/components/script/dom/mimetype.rs
+++ b/servo/components/script/dom/mimetype.rs
@@ -2,16 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::MimeTypeBinding::MimeTypeMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::Reflector;
 use dom::bindings::str::DOMString;
 use dom::plugin::Plugin;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct MimeType {
     reflector_: Reflector,
 }
 
 impl MimeTypeMethods for MimeType {
     // https://html.spec.whatwg.org/multipage/#dom-mimetype-type
--- a/servo/components/script/dom/mimetypearray.rs
+++ b/servo/components/script/dom/mimetypearray.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::MimeTypeArrayBinding;
 use dom::bindings::codegen::Bindings::MimeTypeArrayBinding::MimeTypeArrayMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::globalscope::GlobalScope;
 use dom::mimetype::MimeType;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct MimeTypeArray {
     reflector_: Reflector,
 }
 
 impl MimeTypeArray {
     pub fn new_inherited() -> MimeTypeArray {
--- a/servo/components/script/dom/mouseevent.rs
+++ b/servo/components/script/dom/mouseevent.rs
@@ -9,16 +9,17 @@ use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{MutNullableJS, Root, RootedReference};
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::event::{Event, EventBubbles, EventCancelable};
 use dom::eventtarget::EventTarget;
 use dom::uievent::UIEvent;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use servo_config::prefs::PREFS;
 use std::cell::Cell;
 use std::default::Default;
 
 #[dom_struct]
 pub struct MouseEvent {
     uievent: UIEvent,
     screen_x: Cell<i32>,
--- a/servo/components/script/dom/namednodemap.rs
+++ b/servo/components/script/dom/namednodemap.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::Na
 use dom::bindings::codegen::Bindings::NamedNodeMapBinding::NamedNodeMapMethods;
 use dom::bindings::error::{Error, Fallible};
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::bindings::xmlname::namespace_from_domstring;
 use dom::element::Element;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use std::ascii::AsciiExt;
 
 #[dom_struct]
 pub struct NamedNodeMap {
     reflector_: Reflector,
     owner: JS<Element>,
 }
--- a/servo/components/script/dom/navigator.rs
+++ b/servo/components/script/dom/navigator.rs
@@ -10,16 +10,17 @@ use dom::bindings::str::DOMString;
 use dom::bluetooth::Bluetooth;
 use dom::mimetypearray::MimeTypeArray;
 use dom::navigatorinfo;
 use dom::permissions::Permissions;
 use dom::pluginarray::PluginArray;
 use dom::serviceworkercontainer::ServiceWorkerContainer;
 use dom::vr::VR;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use script_traits::WebVREventMsg;
 
 #[dom_struct]
 pub struct Navigator {
     reflector_: Reflector,
     bluetooth: MutNullableJS<Bluetooth>,
     plugins: MutNullableJS<PluginArray>,
     mime_types: MutNullableJS<MimeTypeArray>,
--- a/servo/components/script/dom/node.rs
+++ b/servo/components/script/dom/node.rs
@@ -48,16 +48,17 @@ use dom::htmlstyleelement::HTMLStyleElem
 use dom::htmltextareaelement::{HTMLTextAreaElement, LayoutHTMLTextAreaElementHelpers};
 use dom::nodelist::NodeList;
 use dom::processinginstruction::ProcessingInstruction;
 use dom::range::WeakRangeVec;
 use dom::svgsvgelement::{SVGSVGElement, LayoutSVGSVGElementHelpers};
 use dom::text::Text;
 use dom::virtualmethods::{VirtualMethods, vtable_for};
 use dom::window::Window;
+use dom_struct::dom_struct;
 use euclid::point::Point2D;
 use euclid::rect::Rect;
 use euclid::size::Size2D;
 use heapsize::{HeapSizeOf, heap_size_of};
 use html5ever_atoms::{Prefix, Namespace, QualName};
 use js::jsapi::{JSContext, JSObject, JSRuntime};
 use libc::{self, c_void, uintptr_t};
 use msg::constellation_msg::PipelineId;
--- a/servo/components/script/dom/nodeiterator.rs
+++ b/servo/components/script/dom/nodeiterator.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::No
 use dom::bindings::codegen::Bindings::NodeFilterBinding::NodeFilterConstants;
 use dom::bindings::codegen::Bindings::NodeIteratorBinding;
 use dom::bindings::codegen::Bindings::NodeIteratorBinding::NodeIteratorMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::js::{JS, MutJS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::document::Document;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use std::cell::Cell;
 use std::rc::Rc;
 
 #[dom_struct]
 pub struct NodeIterator {
     reflector_: Reflector,
     root_node: JS<Node>,
     #[ignore_heap_size_of = "Defined in rust-mozjs"]
--- a/servo/components/script/dom/nodelist.rs
+++ b/servo/components/script/dom/nodelist.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
 use dom::bindings::codegen::Bindings::NodeListBinding;
 use dom::bindings::codegen::Bindings::NodeListBinding::NodeListMethods;
 use dom::bindings::js::{JS, MutNullableJS, Root, RootedReference};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::node::{ChildrenMutation, Node};
 use dom::window::Window;
+use dom_struct::dom_struct;
 use std::cell::Cell;
 
 #[derive(JSTraceable, HeapSizeOf)]
 #[must_root]
 pub enum NodeListType {
     Simple(Vec<JS<Node>>),
     Children(ChildrenList),
 }
--- a/servo/components/script/dom/pagetransitionevent.rs
+++ b/servo/components/script/dom/pagetransitionevent.rs
@@ -7,16 +7,17 @@ use dom::bindings::codegen::Bindings::Pa
 use dom::bindings::codegen::Bindings::PageTransitionEventBinding::PageTransitionEventMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::event::Event;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use servo_atoms::Atom;
 use std::cell::Cell;
 
 // https://html.spec.whatwg.org/multipage/#pagetransitionevent
 #[dom_struct]
 pub struct PageTransitionEvent {
     event: Event,
     persisted: Cell<bool>,
--- a/servo/components/script/dom/performance.rs
+++ b/servo/components/script/dom/performance.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::PerformanceBinding;
 use dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceMethods;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::num::Finite;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::performancetiming::PerformanceTiming;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use time;
 
 pub type DOMHighResTimeStamp = Finite<f64>;
 
 #[dom_struct]
 pub struct Performance {
     reflector_: Reflector,
     timing: JS<PerformanceTiming>,
--- a/servo/components/script/dom/performancetiming.rs
+++ b/servo/components/script/dom/performancetiming.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::PerformanceTimingBinding;
 use dom::bindings::codegen::Bindings::PerformanceTimingBinding::PerformanceTimingMethods;
 use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::document::Document;
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct PerformanceTiming {
     reflector_: Reflector,
     navigation_start: u64,
     navigation_start_precise: f64,
     document: JS<Document>,
 }
--- a/servo/components/script/dom/permissions.rs
+++ b/servo/components/script/dom/permissions.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::Pe
 use dom::bindings::error::Error;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bluetooth::Bluetooth;
 use dom::bluetoothpermissionresult::BluetoothPermissionResult;
 use dom::globalscope::GlobalScope;
 use dom::permissionstatus::PermissionStatus;
 use dom::promise::Promise;
+use dom_struct::dom_struct;
 use js::conversions::ConversionResult;
 use js::jsapi::{JSContext, JSObject};
 use js::jsval::{ObjectValue, UndefinedValue};
 use servo_config::prefs::PREFS;
 use std::rc::Rc;
 #[cfg(target_os = "linux")]
 use tinyfiledialogs::{self, MessageBoxIcon, YesNo};
 
--- a/servo/components/script/dom/permissionstatus.rs
+++ b/servo/components/script/dom/permissionstatus.rs
@@ -5,16 +5,17 @@
 use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull;
 use dom::bindings::codegen::Bindings::PermissionStatusBinding::{self, PermissionDescriptor, PermissionName};
 use dom::bindings::codegen::Bindings::PermissionStatusBinding::PermissionState;
 use dom::bindings::codegen::Bindings::PermissionStatusBinding::PermissionStatusMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use std::cell::Cell;
 use std::fmt::{self, Display, Formatter};
 
 // https://w3c.github.io/permissions/#permissionstatus
 #[dom_struct]
 pub struct PermissionStatus {
     eventtarget: EventTarget,
     state: Cell<PermissionState>,
--- a/servo/components/script/dom/plugin.rs
+++ b/servo/components/script/dom/plugin.rs
@@ -2,16 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::PluginBinding::PluginMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::Reflector;
 use dom::bindings::str::DOMString;
 use dom::mimetype::MimeType;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct Plugin {
     reflector_: Reflector,
 }
 
 impl PluginMethods for Plugin {
     // https://html.spec.whatwg.org/multipage/#dom-plugin-name
--- a/servo/components/script/dom/pluginarray.rs
+++ b/servo/components/script/dom/pluginarray.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::PluginArrayBinding;
 use dom::bindings::codegen::Bindings::PluginArrayBinding::PluginArrayMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::globalscope::GlobalScope;
 use dom::plugin::Plugin;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct PluginArray {
     reflector_: Reflector,
 }
 
 impl PluginArray {
     pub fn new_inherited() -> PluginArray {
--- a/servo/components/script/dom/popstateevent.rs
+++ b/servo/components/script/dom/popstateevent.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::Po
 use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{MutHeapJSVal, Root};
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::bindings::trace::RootedTraceableBox;
 use dom::event::Event;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use js::jsapi::{HandleValue, JSContext};
 use js::jsval::JSVal;
 use servo_atoms::Atom;
 
 // https://html.spec.whatwg.org/multipage/#the-popstateevent-interface
 #[dom_struct]
 pub struct PopStateEvent {
     event: Event,
--- a/servo/components/script/dom/processinginstruction.rs
+++ b/servo/components/script/dom/processinginstruction.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::ProcessingInstructionBinding;
 use dom::bindings::codegen::Bindings::ProcessingInstructionBinding::ProcessingInstructionMethods;
 use dom::bindings::js::Root;
 use dom::bindings::str::DOMString;
 use dom::characterdata::CharacterData;
 use dom::document::Document;
 use dom::node::Node;
+use dom_struct::dom_struct;
 
 /// An HTML processing instruction node.
 #[dom_struct]
 pub struct ProcessingInstruction {
     characterdata: CharacterData,
     target: DOMString,
 }
 
--- a/servo/components/script/dom/progressevent.rs
+++ b/servo/components/script/dom/progressevent.rs
@@ -7,16 +7,17 @@ use dom::bindings::codegen::Bindings::Pr
 use dom::bindings::codegen::Bindings::ProgressEventBinding::ProgressEventMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::event::{Event, EventBubbles, EventCancelable};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use servo_atoms::Atom;
 
 #[dom_struct]
 pub struct ProgressEvent {
     event: Event,
     length_computable: bool,
     loaded: u64,
     total: u64
--- a/servo/components/script/dom/promise.rs
+++ b/servo/components/script/dom/promise.rs
@@ -14,16 +14,17 @@
 use dom::bindings::callback::CallbackContainer;
 use dom::bindings::codegen::Bindings::PromiseBinding::AnyCallback;
 use dom::bindings::conversions::root_from_object;
 use dom::bindings::error::{Error, Fallible};
 use dom::bindings::js::MutHeapJSVal;
 use dom::bindings::reflector::{DomObject, MutDomObject, Reflector};
 use dom::globalscope::GlobalScope;
 use dom::promisenativehandler::PromiseNativeHandler;
+use dom_struct::dom_struct;
 use js::conversions::ToJSValConvertible;
 use js::jsapi::{CallOriginalPromiseResolve, CallOriginalPromiseReject, CallOriginalPromiseThen};
 use js::jsapi::{JSAutoCompartment, CallArgs, JS_GetFunctionObject, JS_NewFunction};
 use js::jsapi::{JSContext, HandleValue, HandleObject, IsPromiseObject, GetFunctionNativeReserved};
 use js::jsapi::{JS_ClearPendingException, JSObject, AddRawValueRoot, RemoveRawValueRoot, PromiseState};
 use js::jsapi::{MutableHandleObject, NewPromiseObject, ResolvePromise, RejectPromise, GetPromiseState};
 use js::jsapi::{SetFunctionNativeReserved, NewFunctionWithReserved, AddPromiseReactions};
 use js::jsval::{JSVal, UndefinedValue, ObjectValue, Int32Value};
--- a/servo/components/script/dom/promisenativehandler.rs
+++ b/servo/components/script/dom/promisenativehandler.rs
@@ -2,16 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::PromiseNativeHandlerBinding;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::trace::JSTraceable;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use heapsize::HeapSizeOf;
 use js::jsapi::{JSContext, HandleValue};
 
 pub trait Callback: JSTraceable + HeapSizeOf {
     fn callback(&self, cx: *mut JSContext, v: HandleValue);
 }
 
 #[dom_struct]
--- a/servo/components/script/dom/radionodelist.rs
+++ b/servo/components/script/dom/radionodelist.rs
@@ -9,16 +9,17 @@ use dom::bindings::codegen::Bindings::Ra
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::htmlinputelement::HTMLInputElement;
 use dom::node::Node;
 use dom::nodelist::{NodeList, NodeListType};
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct RadioNodeList {
     node_list: NodeList,
 }
 
 impl RadioNodeList {
     #[allow(unrooted_must_root)]
--- a/servo/components/script/dom/range.rs
+++ b/servo/components/script/dom/range.rs
@@ -21,16 +21,17 @@ use dom::bindings::weakref::{WeakRef, We
 use dom::characterdata::CharacterData;
 use dom::document::Document;
 use dom::documentfragment::DocumentFragment;
 use dom::element::Element;
 use dom::htmlscriptelement::HTMLScriptElement;
 use dom::node::{Node, UnbindContext};
 use dom::text::Text;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use heapsize::HeapSizeOf;
 use js::jsapi::JSTracer;
 use std::cell::{Cell, UnsafeCell};
 use std::cmp::{Ord, Ordering, PartialEq, PartialOrd};
 
 #[dom_struct]
 pub struct Range {
     reflector_: Reflector,
--- a/servo/components/script/dom/request.rs
+++ b/servo/components/script/dom/request.rs
@@ -20,16 +20,17 @@ use dom::bindings::error::{Error, Fallib
 use dom::bindings::js::{MutNullableJS, Root};
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bindings::str::{ByteString, DOMString, USVString};
 use dom::bindings::trace::RootedTraceableBox;
 use dom::globalscope::GlobalScope;
 use dom::headers::{Guard, Headers};
 use dom::promise::Promise;
 use dom::xmlhttprequest::Extractable;
+use dom_struct::dom_struct;
 use hyper::method::Method as HttpMethod;
 use net_traits::ReferrerPolicy as MsgReferrerPolicy;
 use net_traits::request::{Origin, Window};
 use net_traits::request::CacheMode as NetTraitsRequestCache;
 use net_traits::request::CredentialsMode as NetTraitsRequestCredentials;
 use net_traits::request::Destination as NetTraitsRequestDestination;
 use net_traits::request::RedirectMode as NetTraitsRequestRedirect;
 use net_traits::request::Referrer as NetTraitsRequestReferrer;
--- a/servo/components/script/dom/response.rs
+++ b/servo/components/script/dom/response.rs
@@ -13,16 +13,17 @@ use dom::bindings::error::{Error, Fallib
 use dom::bindings::js::{MutNullableJS, Root};
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bindings::str::{ByteString, USVString};
 use dom::globalscope::GlobalScope;
 use dom::headers::{Headers, Guard};
 use dom::headers::{is_vchar, is_obs_text};
 use dom::promise::Promise;
 use dom::xmlhttprequest::Extractable;
+use dom_struct::dom_struct;
 use hyper::header::Headers as HyperHeaders;
 use hyper::status::StatusCode;
 use hyper_serde::Serde;
 use net_traits::response::{ResponseBody as NetTraitsResponseBody};
 use servo_url::ServoUrl;
 use std::cell::Ref;
 use std::mem;
 use std::rc::Rc;
--- a/servo/components/script/dom/screen.rs
+++ b/servo/components/script/dom/screen.rs
@@ -2,16 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::ScreenBinding;
 use dom::bindings::codegen::Bindings::ScreenBinding::ScreenMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct Screen {
     reflector_: Reflector,
 }
 
 impl Screen {
     fn new_inherited() -> Screen {
--- a/servo/components/script/dom/serviceworker.rs
+++ b/servo/components/script/dom/serviceworker.rs
@@ -10,16 +10,17 @@ use dom::bindings::error::{ErrorResult, 
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::refcounted::Trusted;
 use dom::bindings::reflector::{DomObject, reflect_dom_object};
 use dom::bindings::str::USVString;
 use dom::bindings::structuredclone::StructuredCloneData;
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use js::jsapi::{HandleValue, JSContext};
 use script_thread::Runnable;
 use script_traits::{ScriptMsg, DOMMessage};
 use servo_url::ServoUrl;
 use std::cell::Cell;
 
 pub type TrustedServiceWorkerAddress = Trusted<ServiceWorker>;
 
--- a/servo/components/script/dom/serviceworkercontainer.rs
+++ b/servo/components/script/dom/serviceworkercontainer.rs
@@ -8,16 +8,17 @@ use dom::bindings::error::Error;
 use dom::bindings::js::{JS, MutNullableJS, Root};
 use dom::bindings::reflector::{DomObject, reflect_dom_object};
 use dom::bindings::str::USVString;
 use dom::client::Client;
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
 use dom::promise::Promise;
 use dom::serviceworker::ServiceWorker;
+use dom_struct::dom_struct;
 use script_thread::ScriptThread;
 use serviceworkerjob::{Job, JobType};
 use std::ascii::AsciiExt;
 use std::default::Default;
 use std::rc::Rc;
 
 #[dom_struct]
 pub struct ServiceWorkerContainer {
--- a/servo/components/script/dom/serviceworkerglobalscope.rs
+++ b/servo/components/script/dom/serviceworkerglobalscope.rs
@@ -13,16 +13,17 @@ use dom::bindings::js::{Root, RootCollec
 use dom::bindings::reflector::DomObject;
 use dom::bindings::str::DOMString;
 use dom::event::Event;
 use dom::eventtarget::EventTarget;
 use dom::extendableevent::ExtendableEvent;
 use dom::extendablemessageevent::ExtendableMessageEvent;
 use dom::globalscope::GlobalScope;
 use dom::workerglobalscope::WorkerGlobalScope;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::{self, IpcSender, IpcReceiver};
 use ipc_channel::router::ROUTER;
 use js::jsapi::{JS_SetInterruptCallback, JSAutoCompartment, JSContext};
 use js::jsval::UndefinedValue;
 use js::rust::Runtime;
 use net_traits::{load_whole_resource, IpcSend, CustomResponseMediator};
 use net_traits::request::{CredentialsMode, Destination, RequestInit, Type as RequestType};
 use script_runtime::{CommonScriptMsg, StackRootTLS, get_reports, new_rt_and_cx, ScriptChan};
--- a/servo/components/script/dom/serviceworkerregistration.rs
+++ b/servo/components/script/dom/serviceworkerregistration.rs
@@ -6,16 +6,17 @@ use dom::bindings::codegen::Bindings::Se
 use dom::bindings::codegen::Bindings::ServiceWorkerRegistrationBinding::{ServiceWorkerRegistrationMethods, Wrap};
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::USVString;
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
 use dom::serviceworker::ServiceWorker;
 use dom::workerglobalscope::prepare_workerscope_init;
+use dom_struct::dom_struct;
 use script_traits::{WorkerScriptLoadOrigin, ScopeThings};
 use servo_url::ServoUrl;
 use std::cell::Cell;
 
 
 #[dom_struct]
 pub struct ServiceWorkerRegistration {
     eventtarget: EventTarget,
--- a/servo/components/script/dom/servoparser/mod.rs
+++ b/servo/components/script/dom/servoparser/mod.rs
@@ -17,16 +17,17 @@ use dom::characterdata::CharacterData;
 use dom::document::{Document, DocumentSource, HasBrowsingContext, IsHTMLDocument};
 use dom::element::Element;
 use dom::globalscope::GlobalScope;
 use dom::htmlformelement::HTMLFormElement;
 use dom::htmlimageelement::HTMLImageElement;
 use dom::htmlscriptelement::{HTMLScriptElement, ScriptResult};
 use dom::node::{Node, NodeSiblingIterator};
 use dom::text::Text;
+use dom_struct::dom_struct;
 use encoding::all::UTF_8;
 use encoding::types::{DecoderTrap, Encoding};
 use html5ever::tokenizer::buffer_queue::BufferQueue;
 use html5ever::tree_builder::NodeOrText;
 use hyper::header::ContentType;
 use hyper::mime::{Mime, SubLevel, TopLevel};
 use hyper_serde::Serde;
 use msg::constellation_msg::PipelineId;
--- a/servo/components/script/dom/storage.rs
+++ b/servo/components/script/dom/storage.rs
@@ -8,16 +8,17 @@ use dom::bindings::error::{Error, ErrorR
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::refcounted::Trusted;
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::event::{Event, EventBubbles, EventCancelable};
 use dom::storageevent::StorageEvent;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::{self, IpcSender};
 use net_traits::IpcSend;
 use net_traits::storage_thread::{StorageThreadMsg, StorageType};
 use script_thread::{Runnable, ScriptThread};
 use script_traits::ScriptMsg;
 use servo_url::ServoUrl;
 use task_source::TaskSource;
 
--- a/servo/components/script/dom/storageevent.rs
+++ b/servo/components/script/dom/storageevent.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::St
 use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{MutNullableJS, Root, RootedReference};
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::event::{Event, EventBubbles, EventCancelable};
 use dom::storage::Storage;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use servo_atoms::Atom;
 
 #[dom_struct]
 pub struct StorageEvent {
     event: Event,
     key: Option<DOMString>,
     old_value: Option<DOMString>,
     new_value: Option<DOMString>,
--- a/servo/components/script/dom/stylesheet.rs
+++ b/servo/components/script/dom/stylesheet.rs
@@ -5,16 +5,17 @@
 use dom::bindings::codegen::Bindings::StyleSheetBinding;
 use dom::bindings::codegen::Bindings::StyleSheetBinding::StyleSheetMethods;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::cssstylesheet::CSSStyleSheet;
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct StyleSheet {
     reflector_: Reflector,
     type_: DOMString,
     href: Option<DOMString>,
     title: Option<DOMString>,
 }
--- a/servo/components/script/dom/stylesheetlist.rs
+++ b/servo/components/script/dom/stylesheetlist.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::StyleSheetListBinding;
 use dom::bindings::codegen::Bindings::StyleSheetListBinding::StyleSheetListMethods;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::document::Document;
 use dom::stylesheet::StyleSheet;
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct StyleSheetList {
     reflector_: Reflector,
     document: JS<Document>,
 }
 
 impl StyleSheetList {
--- a/servo/components/script/dom/svgelement.rs
+++ b/servo/components/script/dom/svgelement.rs
@@ -2,16 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::inheritance::Castable;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::Element;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use style::element_state::ElementState;
 
 #[dom_struct]
 pub struct SVGElement {
     element: Element,
 }
 
--- a/servo/components/script/dom/svggraphicselement.rs
+++ b/servo/components/script/dom/svggraphicselement.rs
@@ -2,16 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::inheritance::Castable;
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::svgelement::SVGElement;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use style::element_state::ElementState;
 
 #[dom_struct]
 pub struct SVGGraphicsElement {
     svgelement: SVGElement,
 }
 
--- a/servo/components/script/dom/svgsvgelement.rs
+++ b/servo/components/script/dom/svgsvgelement.rs
@@ -7,16 +7,17 @@ use dom::bindings::codegen::Bindings::SV
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{LayoutJS, Root};
 use dom::bindings::str::DOMString;
 use dom::document::Document;
 use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
 use dom::node::Node;
 use dom::svggraphicselement::SVGGraphicsElement;
 use dom::virtualmethods::VirtualMethods;
+use dom_struct::dom_struct;
 use html5ever_atoms::LocalName;
 use script_layout_interface::SVGSVGData;
 use style::attr::AttrValue;
 
 const DEFAULT_WIDTH: u32 = 300;
 const DEFAULT_HEIGHT: u32 = 150;
 
 #[dom_struct]
--- a/servo/components/script/dom/testbinding.rs
+++ b/servo/components/script/dom/testbinding.rs
@@ -29,16 +29,17 @@ use dom::bindings::reflector::{DomObject
 use dom::bindings::str::{ByteString, DOMString, USVString};
 use dom::bindings::trace::RootedTraceableBox;
 use dom::bindings::weakref::MutableWeakRef;
 use dom::blob::{Blob, BlobImpl};
 use dom::globalscope::GlobalScope;
 use dom::promise::Promise;
 use dom::promisenativehandler::{PromiseNativeHandler, Callback};
 use dom::url::URL;
+use dom_struct::dom_struct;
 use js::jsapi::{HandleObject, HandleValue, Heap, JSContext, JSObject, JSAutoCompartment};
 use js::jsapi::{JS_NewPlainObject, JS_NewUint8ClampedArray};
 use js::jsval::{JSVal, NullValue};
 use script_traits::MsDuration;
 use servo_config::prefs::PREFS;
 use std::borrow::ToOwned;
 use std::ptr;
 use std::rc::Rc;
--- a/servo/components/script/dom/testbindingiterable.rs
+++ b/servo/components/script/dom/testbindingiterable.rs
@@ -6,16 +6,17 @@
 
 use dom::bindings::cell::DOMRefCell;
 use dom::bindings::codegen::Bindings::TestBindingIterableBinding::{self, TestBindingIterableMethods};
 use dom::bindings::error::Fallible;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct TestBindingIterable {
     reflector: Reflector,
     vals: DOMRefCell<Vec<DOMString>>,
 }
 
 impl TestBindingIterable {
--- a/servo/components/script/dom/testbindingpairiterable.rs
+++ b/servo/components/script/dom/testbindingpairiterable.rs
@@ -8,16 +8,17 @@ use dom::bindings::cell::DOMRefCell;
 use dom::bindings::codegen::Bindings::TestBindingPairIterableBinding;
 use dom::bindings::codegen::Bindings::TestBindingPairIterableBinding::TestBindingPairIterableMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::iterable::Iterable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct TestBindingPairIterable {
     reflector: Reflector,
     map: DOMRefCell<Vec<(DOMString, u32)>>,
 }
 
 impl Iterable for TestBindingPairIterable {
--- a/servo/components/script/dom/testbindingproxy.rs
+++ b/servo/components/script/dom/testbindingproxy.rs
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // check-tidy: no specs after this line
 
 use dom::bindings::codegen::Bindings::TestBindingProxyBinding::TestBindingProxyMethods;
 use dom::bindings::reflector::Reflector;
 use dom::bindings::str::DOMString;
-
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct TestBindingProxy {
     reflector_: Reflector
 }
 
 impl TestBindingProxyMethods for TestBindingProxy {
     fn Length(&self) -> u32 { 0 }
--- a/servo/components/script/dom/testrunner.rs
+++ b/servo/components/script/dom/testrunner.rs
@@ -5,16 +5,17 @@
 use bluetooth_traits::BluetoothRequest;
 use dom::bindings::codegen::Bindings::TestRunnerBinding;
 use dom::bindings::codegen::Bindings::TestRunnerBinding::TestRunnerMethods;
 use dom::bindings::error::{Error, ErrorResult};
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::{self, IpcSender};
 
 // https://webbluetoothcg.github.io/web-bluetooth/tests#test-runner
  #[dom_struct]
 pub struct TestRunner {
     reflector_: Reflector,
 }
 
--- a/servo/components/script/dom/text.rs
+++ b/servo/components/script/dom/text.rs
@@ -11,16 +11,17 @@ use dom::bindings::error::{Error, Fallib
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::js::RootedReference;
 use dom::bindings::str::DOMString;
 use dom::characterdata::CharacterData;
 use dom::document::Document;
 use dom::node::Node;
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 /// An HTML text node.
 #[dom_struct]
 pub struct Text {
     characterdata: CharacterData,
 }
 
 impl Text {
--- a/servo/components/script/dom/textdecoder.rs
+++ b/servo/components/script/dom/textdecoder.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::TextDecoderBinding;
 use dom::bindings::codegen::Bindings::TextDecoderBinding::TextDecoderMethods;
 use dom::bindings::error::{Error, Fallible};
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::{DOMString, USVString};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use encoding::label::encoding_from_whatwg_label;
 use encoding::types::{DecoderTrap, EncodingRef};
 use js::jsapi::{JSContext, JSObject};
 use std::borrow::ToOwned;
 
 #[dom_struct]
 pub struct TextDecoder {
     reflector_: Reflector,
--- a/servo/components/script/dom/textencoder.rs
+++ b/servo/components/script/dom/textencoder.rs
@@ -5,16 +5,17 @@
 use core::nonzero::NonZero;
 use dom::bindings::codegen::Bindings::TextEncoderBinding;
 use dom::bindings::codegen::Bindings::TextEncoderBinding::TextEncoderMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::{DOMString, USVString};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use encoding::EncoderTrap;
 use encoding::Encoding;
 use encoding::all::UTF_8;
 use js::jsapi::{JSContext, JSObject};
 use js::typedarray::{Uint8Array, CreateWith};
 use std::ptr;
 
 #[dom_struct]
--- a/servo/components/script/dom/touch.rs
+++ b/servo/components/script/dom/touch.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::TouchBinding;
 use dom::bindings::codegen::Bindings::TouchBinding::TouchMethods;
 use dom::bindings::js::{MutJS, Root};
 use dom::bindings::num::Finite;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::eventtarget::EventTarget;
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct Touch {
     reflector_: Reflector,
     identifier: i32,
     target: MutJS<EventTarget>,
     screen_x: f64,
     screen_y: f64,
--- a/servo/components/script/dom/touchevent.rs
+++ b/servo/components/script/dom/touchevent.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::UI
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{MutJS, Root};
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::event::{EventBubbles, EventCancelable};
 use dom::touchlist::TouchList;
 use dom::uievent::UIEvent;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use std::cell::Cell;
 
 #[dom_struct]
 pub struct TouchEvent {
     uievent: UIEvent,
     touches: MutJS<TouchList>,
     target_touches: MutJS<TouchList>,
     changed_touches: MutJS<TouchList>,
--- a/servo/components/script/dom/touchlist.rs
+++ b/servo/components/script/dom/touchlist.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::TouchListBinding;
 use dom::bindings::codegen::Bindings::TouchListBinding::TouchListMethods;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::touch::Touch;
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct TouchList {
     reflector_: Reflector,
     touches: Vec<JS<Touch>>,
 }
 
 impl TouchList {
--- a/servo/components/script/dom/transitionevent.rs
+++ b/servo/components/script/dom/transitionevent.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::Tr
 use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::num::Finite;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::event::Event;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use servo_atoms::Atom;
 
 #[dom_struct]
 pub struct TransitionEvent {
     event: Event,
     property_name: Atom,
     elapsed_time: Finite<f32>,
     pseudo_element: DOMString,
--- a/servo/components/script/dom/treewalker.rs
+++ b/servo/components/script/dom/treewalker.rs
@@ -9,16 +9,17 @@ use dom::bindings::codegen::Bindings::No
 use dom::bindings::codegen::Bindings::TreeWalkerBinding;
 use dom::bindings::codegen::Bindings::TreeWalkerBinding::TreeWalkerMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::js::{JS, MutJS};
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::document::Document;
 use dom::node::Node;
+use dom_struct::dom_struct;
 use std::rc::Rc;
 
 // https://dom.spec.whatwg.org/#interface-treewalker
 #[dom_struct]
 pub struct TreeWalker {
     reflector_: Reflector,
     root_node: JS<Node>,
     current_node: MutJS<Node>,
--- a/servo/components/script/dom/uievent.rs
+++ b/servo/components/script/dom/uievent.rs
@@ -7,16 +7,17 @@ use dom::bindings::codegen::Bindings::UI
 use dom::bindings::codegen::Bindings::UIEventBinding::UIEventMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{MutNullableJS, Root, RootedReference};
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::event::{Event, EventBubbles, EventCancelable};
 use dom::window::Window;
+use dom_struct::dom_struct;
 use servo_atoms::Atom;
 use std::cell::Cell;
 use std::default::Default;
 
 // https://w3c.github.io/uievents/#interface-uievent
 #[dom_struct]
 pub struct UIEvent {
     event: Event,
--- a/servo/components/script/dom/url.rs
+++ b/servo/components/script/dom/url.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::UR
 use dom::bindings::error::{Error, ErrorResult, Fallible};
 use dom::bindings::js::{MutNullableJS, Root};
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bindings::str::{DOMString, USVString};
 use dom::blob::Blob;
 use dom::globalscope::GlobalScope;
 use dom::urlhelper::UrlHelper;
 use dom::urlsearchparams::URLSearchParams;
+use dom_struct::dom_struct;
 use ipc_channel::ipc;
 use net_traits::{CoreResourceMsg, IpcSend};
 use net_traits::blob_url_store::{get_blob_origin, parse_blob_url};
 use net_traits::filemanager_thread::FileManagerThreadMsg;
 use servo_url::ServoUrl;
 use std::default::Default;
 use uuid::Uuid;
 
--- a/servo/components/script/dom/urlsearchparams.rs
+++ b/servo/components/script/dom/urlsearchparams.rs
@@ -9,16 +9,17 @@ use dom::bindings::codegen::UnionTypes::
 use dom::bindings::error::Fallible;
 use dom::bindings::iterable::Iterable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::{DOMString, USVString};
 use dom::bindings::weakref::MutableWeakRef;
 use dom::globalscope::GlobalScope;
 use dom::url::URL;
+use dom_struct::dom_struct;
 use encoding::types::EncodingRef;
 use url::form_urlencoded;
 
 // https://url.spec.whatwg.org/#interface-urlsearchparams
 #[dom_struct]
 pub struct URLSearchParams {
     reflector_: Reflector,
     // https://url.spec.whatwg.org/#concept-urlsearchparams-list
--- a/servo/components/script/dom/validitystate.rs
+++ b/servo/components/script/dom/validitystate.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::ValidityStateBinding;
 use dom::bindings::codegen::Bindings::ValidityStateBinding::ValidityStateMethods;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::element::Element;
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 // https://html.spec.whatwg.org/multipage/#validity-states
 #[derive(JSTraceable, HeapSizeOf)]
 #[allow(dead_code)]
 pub enum ValidityStatus {
     ValueMissing,
     TypeMismatch,
     PatternMismatch,
--- a/servo/components/script/dom/vr.rs
+++ b/servo/components/script/dom/vr.rs
@@ -10,16 +10,17 @@ use dom::bindings::inheritance::Castable
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{DomObject, reflect_dom_object};
 use dom::event::Event;
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
 use dom::promise::Promise;
 use dom::vrdisplay::VRDisplay;
 use dom::vrdisplayevent::VRDisplayEvent;
+use dom_struct::dom_struct;
 use ipc_channel::ipc;
 use ipc_channel::ipc::IpcSender;
 use script_traits::WebVREventMsg;
 use std::rc::Rc;
 use webvr_traits::WebVRMsg;
 use webvr_traits::webvr;
 
 #[dom_struct]
--- a/servo/components/script/dom/vrdisplay.rs
+++ b/servo/components/script/dom/vrdisplay.rs
@@ -25,16 +25,17 @@ use dom::globalscope::GlobalScope;
 use dom::promise::Promise;
 use dom::vrdisplaycapabilities::VRDisplayCapabilities;
 use dom::vrdisplayevent::VRDisplayEvent;
 use dom::vreyeparameters::VREyeParameters;
 use dom::vrframedata::VRFrameData;
 use dom::vrpose::VRPose;
 use dom::vrstageparameters::VRStageParameters;
 use dom::webglrenderingcontext::WebGLRenderingContext;
+use dom_struct::dom_struct;
 use ipc_channel::ipc;
 use ipc_channel::ipc::{IpcSender, IpcReceiver};
 use js::jsapi::JSContext;
 use script_runtime::CommonScriptMsg;
 use script_runtime::ScriptThreadEventCategory::WebVREvent;
 use script_thread::Runnable;
 use std::cell::Cell;
 use std::mem;
--- a/servo/components/script/dom/vrdisplaycapabilities.rs
+++ b/servo/components/script/dom/vrdisplaycapabilities.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::cell::DOMRefCell;
 use dom::bindings::codegen::Bindings::VRDisplayCapabilitiesBinding;
 use dom::bindings::codegen::Bindings::VRDisplayCapabilitiesBinding::VRDisplayCapabilitiesMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use webvr_traits::WebVRDisplayCapabilities;
 
 #[dom_struct]
 pub struct VRDisplayCapabilities {
     reflector_: Reflector,
     #[ignore_heap_size_of = "Defined in rust-webvr"]
     capabilities: DOMRefCell<WebVRDisplayCapabilities>
 }
--- a/servo/components/script/dom/vrdisplayevent.rs
+++ b/servo/components/script/dom/vrdisplayevent.rs
@@ -10,16 +10,17 @@ use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{DomObject, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::event::Event;
 use dom::globalscope::GlobalScope;
 use dom::vrdisplay::VRDisplay;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use servo_atoms::Atom;
 use webvr_traits::{WebVRDisplayEvent, WebVRDisplayEventReason};
 
 #[dom_struct]
 pub struct VRDisplayEvent {
     event: Event,
     display: JS<VRDisplay>,
     reason: Option<VRDisplayEventReason>
--- a/servo/components/script/dom/vreyeparameters.rs
+++ b/servo/components/script/dom/vreyeparameters.rs
@@ -5,16 +5,17 @@
 use core::nonzero::NonZero;
 use dom::bindings::cell::DOMRefCell;
 use dom::bindings::codegen::Bindings::VREyeParametersBinding;
 use dom::bindings::codegen::Bindings::VREyeParametersBinding::VREyeParametersMethods;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::globalscope::GlobalScope;
 use dom::vrfieldofview::VRFieldOfView;
+use dom_struct::dom_struct;
 use js::jsapi::{Heap, JSContext, JSObject};
 use js::typedarray::{Float32Array, CreateWith};
 use std::default::Default;
 use webvr_traits::WebVREyeParameters;
 
 #[dom_struct]
 pub struct VREyeParameters {
     reflector_: Reflector,
--- a/servo/components/script/dom/vrfieldofview.rs
+++ b/servo/components/script/dom/vrfieldofview.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::cell::DOMRefCell;
 use dom::bindings::codegen::Bindings::VRFieldOfViewBinding;
 use dom::bindings::codegen::Bindings::VRFieldOfViewBinding::VRFieldOfViewMethods;
 use dom::bindings::js::Root;
 use dom::bindings::num::Finite;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use webvr_traits::WebVRFieldOfView;
 
 #[dom_struct]
 pub struct VRFieldOfView {
     reflector_: Reflector,
     #[ignore_heap_size_of = "Defined in rust-webvr"]
     fov: DOMRefCell<WebVRFieldOfView>
 }
--- a/servo/components/script/dom/vrframedata.rs
+++ b/servo/components/script/dom/vrframedata.rs
@@ -7,16 +7,17 @@ use dom::bindings::codegen::Bindings::VR
 use dom::bindings::codegen::Bindings::VRFrameDataBinding::VRFrameDataMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::num::Finite;
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::globalscope::GlobalScope;
 use dom::vrpose::VRPose;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use js::jsapi::{Heap, JSContext, JSObject};
 use js::typedarray::{Float32Array, CreateWith};
 use std::cell::Cell;
 use webvr_traits::WebVRFrameData;
 
 #[dom_struct]
 pub struct VRFrameData {
     reflector_: Reflector,
--- a/servo/components/script/dom/vrpose.rs
+++ b/servo/components/script/dom/vrpose.rs
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use core::nonzero::NonZero;
 use dom::bindings::codegen::Bindings::VRPoseBinding;
 use dom::bindings::codegen::Bindings::VRPoseBinding::VRPoseMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use js::jsapi::{Heap, JSContext, JSObject};
 use js::typedarray::{Float32Array, CreateWith};
 use std::ptr;
 use webvr_traits::webvr;
 
 #[dom_struct]
 pub struct VRPose {
     reflector_: Reflector,
--- a/servo/components/script/dom/vrstageparameters.rs
+++ b/servo/components/script/dom/vrstageparameters.rs
@@ -5,16 +5,17 @@
 use core::nonzero::NonZero;
 use dom::bindings::cell::DOMRefCell;
 use dom::bindings::codegen::Bindings::VRStageParametersBinding;
 use dom::bindings::codegen::Bindings::VRStageParametersBinding::VRStageParametersMethods;
 use dom::bindings::js::Root;
 use dom::bindings::num::Finite;
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::globalscope::GlobalScope;
+use dom_struct::dom_struct;
 use js::jsapi::{Heap, JSContext, JSObject};
 use js::typedarray::{Float32Array, CreateWith};
 use webvr_traits::WebVRStageParameters;
 
 #[dom_struct]
 pub struct VRStageParameters {
     reflector_: Reflector,
     #[ignore_heap_size_of = "Defined in rust-webvr"]
--- a/servo/components/script/dom/webglactiveinfo.rs
+++ b/servo/components/script/dom/webglactiveinfo.rs
@@ -4,16 +4,17 @@
 
 // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
 use dom::bindings::codegen::Bindings::WebGLActiveInfoBinding;
 use dom::bindings::codegen::Bindings::WebGLActiveInfoBinding::WebGLActiveInfoMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct WebGLActiveInfo {
     reflector_: Reflector,
     size: i32,
     // NOTE: `ty` stands for `type`, which is a reserved keyword
     ty: u32,
     name: DOMString,
--- a/servo/components/script/dom/webglbuffer.rs
+++ b/servo/components/script/dom/webglbuffer.rs
@@ -4,16 +4,17 @@
 
 // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
 use canvas_traits::CanvasMsg;
 use dom::bindings::codegen::Bindings::WebGLBufferBinding;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::webglobject::WebGLObject;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::IpcSender;
 use std::cell::Cell;
 use webrender_traits;
 use webrender_traits::{WebGLBufferId, WebGLCommand, WebGLError, WebGLResult};
 
 #[dom_struct]
 pub struct WebGLBuffer {
     webgl_object: WebGLObject,
--- a/servo/components/script/dom/webglcontextevent.rs
+++ b/servo/components/script/dom/webglcontextevent.rs
@@ -8,16 +8,17 @@ use dom::bindings::codegen::Bindings::We
 use dom::bindings::codegen::Bindings::WebGLContextEventBinding::WebGLContextEventMethods;
 use dom::bindings::error::Fallible;
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::event::{Event, EventBubbles, EventCancelable};
 use dom::window::Window;
+use dom_struct::dom_struct;
 use servo_atoms::Atom;
 
 #[dom_struct]
 pub struct WebGLContextEvent {
     event: Event,
     status_message: DOMString,
 }
 
--- a/servo/components/script/dom/webglframebuffer.rs
+++ b/servo/components/script/dom/webglframebuffer.rs
@@ -8,16 +8,17 @@ use dom::bindings::cell::DOMRefCell;
 use dom::bindings::codegen::Bindings::WebGLFramebufferBinding;
 use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::reflect_dom_object;
 use dom::webglobject::WebGLObject;
 use dom::webglrenderbuffer::WebGLRenderbuffer;
 use dom::webgltexture::WebGLTexture;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::IpcSender;
 use std::cell::Cell;
 use webrender_traits;
 use webrender_traits::{WebGLCommand, WebGLFramebufferBindingRequest, WebGLFramebufferId, WebGLResult, WebGLError};
 
 #[must_root]
 #[derive(JSTraceable, Clone, HeapSizeOf)]
 enum WebGLFramebufferAttachment {
--- a/servo/components/script/dom/webglobject.rs
+++ b/servo/components/script/dom/webglobject.rs
@@ -1,14 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
 use dom::bindings::reflector::Reflector;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct WebGLObject {
     reflector_: Reflector,
 }
 
 impl WebGLObject {
     pub fn new_inherited() -> WebGLObject {
--- a/servo/components/script/dom/webglprogram.rs
+++ b/servo/components/script/dom/webglprogram.rs
@@ -9,16 +9,17 @@ use dom::bindings::codegen::Bindings::We
 use dom::bindings::js::{MutNullableJS, Root};
 use dom::bindings::reflector::{DomObject, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::webglactiveinfo::WebGLActiveInfo;
 use dom::webglobject::WebGLObject;
 use dom::webglrenderingcontext::MAX_UNIFORM_AND_ATTRIBUTE_LEN;
 use dom::webglshader::WebGLShader;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::IpcSender;
 use std::cell::Cell;
 use webrender_traits;
 use webrender_traits::{WebGLCommand, WebGLError, WebGLParameter};
 use webrender_traits::{WebGLProgramId, WebGLResult};
 
 #[dom_struct]
 pub struct WebGLProgram {
--- a/servo/components/script/dom/webglrenderbuffer.rs
+++ b/servo/components/script/dom/webglrenderbuffer.rs
@@ -5,16 +5,17 @@
 // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
 use canvas_traits::CanvasMsg;
 use dom::bindings::codegen::Bindings::WebGLRenderbufferBinding;
 use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::webglobject::WebGLObject;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::IpcSender;
 use std::cell::Cell;
 use webrender_traits;
 use webrender_traits::{WebGLCommand, WebGLRenderbufferId, WebGLResult, WebGLError};
 
 #[dom_struct]
 pub struct WebGLRenderbuffer {
     webgl_object: WebGLObject,
--- a/servo/components/script/dom/webglrenderingcontext.rs
+++ b/servo/components/script/dom/webglrenderingcontext.rs
@@ -29,16 +29,17 @@ use dom::webglbuffer::WebGLBuffer;
 use dom::webglcontextevent::WebGLContextEvent;
 use dom::webglframebuffer::WebGLFramebuffer;
 use dom::webglprogram::WebGLProgram;
 use dom::webglrenderbuffer::WebGLRenderbuffer;
 use dom::webglshader::WebGLShader;
 use dom::webgltexture::{TexParameterValue, WebGLTexture};
 use dom::webgluniformlocation::WebGLUniformLocation;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use euclid::size::Size2D;
 use ipc_channel::ipc::{self, IpcSender};
 use js::conversions::ConversionBehavior;
 use js::jsapi::{JSContext, JSObject, Type, Rooted};
 use js::jsval::{BooleanValue, DoubleValue, Int32Value, JSVal, NullValue, UndefinedValue};
 use js::typedarray::{TypedArray, TypedArrayElement, Float32, Int32};
 use net_traits::image::base::PixelFormat;
 use net_traits::image_cache_thread::ImageResponse;
--- a/servo/components/script/dom/webglshader.rs
+++ b/servo/components/script/dom/webglshader.rs
@@ -7,16 +7,17 @@ use angle::hl::{BuiltInResources, Output
 use canvas_traits::CanvasMsg;
 use dom::bindings::cell::DOMRefCell;
 use dom::bindings::codegen::Bindings::WebGLShaderBinding;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::webglobject::WebGLObject;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::IpcSender;
 use std::cell::Cell;
 use std::sync::{ONCE_INIT, Once};
 use webrender_traits;
 use webrender_traits::{WebGLCommand, WebGLParameter, WebGLResult, WebGLShaderId};
 
 #[derive(Clone, Copy, PartialEq, Debug, JSTraceable, HeapSizeOf)]
 pub enum ShaderCompilationStatus {
--- a/servo/components/script/dom/webglshaderprecisionformat.rs
+++ b/servo/components/script/dom/webglshaderprecisionformat.rs
@@ -5,16 +5,17 @@
 #![allow(dead_code)]
 
 // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
 use dom::bindings::codegen::Bindings::WebGLShaderPrecisionFormatBinding;
 use dom::bindings::codegen::Bindings::WebGLShaderPrecisionFormatBinding::WebGLShaderPrecisionFormatMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::window::Window;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct WebGLShaderPrecisionFormat {
     reflector_: Reflector,
     range_min: i32,
     range_max: i32,
     precision: i32,
 }
--- a/servo/components/script/dom/webgltexture.rs
+++ b/servo/components/script/dom/webgltexture.rs
@@ -7,16 +7,17 @@ use canvas_traits::CanvasMsg;
 use dom::bindings::cell::DOMRefCell;
 use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
 use dom::bindings::codegen::Bindings::WebGLTextureBinding;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::webgl_validations::types::{TexImageTarget, TexFormat, TexDataType};
 use dom::webglobject::WebGLObject;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use ipc_channel::ipc::IpcSender;
 use std::cell::Cell;
 use std::cmp;
 use webrender_traits;
 use webrender_traits::{WebGLCommand, WebGLError, WebGLResult, WebGLTextureId};
 
 pub enum TexParameterValue {
     Float(f32),
--- a/servo/components/script/dom/webgluniformlocation.rs
+++ b/servo/components/script/dom/webgluniformlocation.rs
@@ -2,16 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
 use dom::bindings::codegen::Bindings::WebGLUniformLocationBinding;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::window::Window;
+use dom_struct::dom_struct;
 use webrender_traits::WebGLProgramId;
 
 #[dom_struct]
 pub struct WebGLUniformLocation {
     reflector_: Reflector,
     id: i32,
     program_id: WebGLProgramId,
 }
--- a/servo/components/script/dom/websocket.rs
+++ b/servo/components/script/dom/websocket.rs
@@ -17,16 +17,17 @@ use dom::bindings::reflector::{DomObject
 use dom::bindings::str::{DOMString, USVString, is_token};
 use dom::blob::{Blob, BlobImpl};
 use dom::closeevent::CloseEvent;
 use dom::event::{Event, EventBubbles, EventCancelable};
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
 use dom::messageevent::MessageEvent;
 use dom::urlhelper::UrlHelper;
+use dom_struct::dom_struct;
 use hyper;
 use hyper_serde::Serde;
 use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
 use js::jsapi::JSAutoCompartment;
 use js::jsval::UndefinedValue;
 use js::typedarray::{ArrayBuffer, CreateWith};
 use net_traits::{WebSocketCommunicate, WebSocketConnectData, WebSocketDomAction, WebSocketNetworkEvent};
 use net_traits::CookieSource::HTTP;
--- a/servo/components/script/dom/window.rs
+++ b/servo/components/script/dom/window.rs
@@ -43,16 +43,17 @@ use dom::mediaquerylist::{MediaQueryList
 use dom::messageevent::MessageEvent;
 use dom::navigator::Navigator;
 use dom::node::{Node, from_untrusted_node_address, window_from_node, NodeDamage};
 use dom::performance::Performance;
 use dom::promise::Promise;
 use dom::screen::Screen;
 use dom::storage::Storage;
 use dom::testrunner::TestRunner;
+use dom_struct::dom_struct;
 use euclid::{Point2D, Rect, Size2D};
 use fetch;
 use gfx_traits::ScrollRootId;
 use ipc_channel::ipc::{self, IpcSender};
 use ipc_channel::router::ROUTER;
 use js::jsapi::{HandleObject, HandleValue, JSAutoCompartment, JSContext};
 use js::jsapi::{JS_GC, JS_GetRuntime};
 use js::jsval::UndefinedValue;
--- a/servo/components/script/dom/worker.rs
+++ b/servo/components/script/dom/worker.rs
@@ -17,16 +17,17 @@ use dom::bindings::str::DOMString;
 use dom::bindings::structuredclone::StructuredCloneData;
 use dom::dedicatedworkerglobalscope::DedicatedWorkerGlobalScope;
 use dom::errorevent::ErrorEvent;
 use dom::event::{Event, EventBubbles, EventCancelable, EventStatus};
 use dom::eventtarget::EventTarget;
 use dom::globalscope::GlobalScope;
 use dom::messageevent::MessageEvent;
 use dom::workerglobalscope::prepare_workerscope_init;
+use dom_struct::dom_struct;
 use ipc_channel::ipc;
 use js::jsapi::{HandleValue, JSAutoCompartment, JSContext, NullHandleValue};
 use js::jsval::UndefinedValue;
 use script_thread::Runnable;
 use script_traits::WorkerScriptLoadOrigin;
 use std::cell::Cell;
 use std::sync::{Arc, Mutex};
 use std::sync::atomic::{AtomicBool, Ordering};
--- a/servo/components/script/dom/workerglobalscope.rs
+++ b/servo/components/script/dom/workerglobalscope.rs
@@ -18,16 +18,17 @@ use dom::bindings::trace::RootedTraceabl
 use dom::crypto::Crypto;
 use dom::dedicatedworkerglobalscope::DedicatedWorkerGlobalScope;
 use dom::globalscope::GlobalScope;
 use dom::promise::Promise;
 use dom::serviceworkerglobalscope::ServiceWorkerGlobalScope;
 use dom::window::{base64_atob, base64_btoa};
 use dom::workerlocation::WorkerLocation;
 use dom::workernavigator::WorkerNavigator;
+use dom_struct::dom_struct;
 use fetch;
 use ipc_channel::ipc::IpcSender;
 use js::jsapi::{HandleValue, JSAutoCompartment, JSContext, JSRuntime};
 use js::jsval::UndefinedValue;
 use js::panic::maybe_resume_unwind;
 use js::rust::Runtime;
 use microtask::{MicrotaskQueue, Microtask};
 use net_traits::{IpcSend, load_whole_resource};
--- a/servo/components/script/dom/workerlocation.rs
+++ b/servo/components/script/dom/workerlocation.rs
@@ -4,16 +4,17 @@
 
 use dom::bindings::codegen::Bindings::WorkerLocationBinding;
 use dom::bindings::codegen::Bindings::WorkerLocationBinding::WorkerLocationMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::{DOMString, USVString};
 use dom::urlhelper::UrlHelper;
 use dom::workerglobalscope::WorkerGlobalScope;
+use dom_struct::dom_struct;
 use servo_url::ServoUrl;
 
 // https://html.spec.whatwg.org/multipage/#worker-locations
 #[dom_struct]
 pub struct WorkerLocation {
     reflector_: Reflector,
     url: ServoUrl,
 }
--- a/servo/components/script/dom/workernavigator.rs
+++ b/servo/components/script/dom/workernavigator.rs
@@ -5,16 +5,17 @@
 use dom::bindings::codegen::Bindings::WorkerNavigatorBinding;
 use dom::bindings::codegen::Bindings::WorkerNavigatorBinding::WorkerNavigatorMethods;
 use dom::bindings::js::{MutNullableJS, Root};
 use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::navigatorinfo;
 use dom::permissions::Permissions;
 use dom::workerglobalscope::WorkerGlobalScope;
+use dom_struct::dom_struct;
 
 // https://html.spec.whatwg.org/multipage/#workernavigator
 #[dom_struct]
 pub struct WorkerNavigator {
     reflector_: Reflector,
     permissions: MutNullableJS<Permissions>,
 }
 
--- a/servo/components/script/dom/xmldocument.rs
+++ b/servo/components/script/dom/xmldocument.rs
@@ -9,16 +9,17 @@ use dom::bindings::codegen::Bindings::XM
 use dom::bindings::inheritance::Castable;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::bindings::str::DOMString;
 use dom::document::{Document, DocumentSource, HasBrowsingContext, IsHTMLDocument};
 use dom::location::Location;
 use dom::node::Node;
 use dom::window::Window;
+use dom_struct::dom_struct;
 use js::jsapi::{JSContext, JSObject};
 use script_traits::DocumentActivity;
 use servo_url::{MutableOrigin, ServoUrl};
 
 // https://dom.spec.whatwg.org/#xmldocument
 #[dom_struct]
 pub struct XMLDocument {
     document: Document,
--- a/servo/components/script/dom/xmlhttprequest.rs
+++ b/servo/components/script/dom/xmlhttprequest.rs
@@ -31,16 +31,17 @@ use dom::htmlformelement::{encode_multip
 use dom::node::Node;
 use dom::progressevent::ProgressEvent;
 use dom::servoparser::ServoParser;
 use dom::urlsearchparams::URLSearchParams;
 use dom::window::Window;
 use dom::workerglobalscope::WorkerGlobalScope;
 use dom::xmlhttprequesteventtarget::XMLHttpRequestEventTarget;
 use dom::xmlhttprequestupload::XMLHttpRequestUpload;
+use dom_struct::dom_struct;
 use encoding::all::UTF_8;
 use encoding::label::encoding_from_whatwg_label;
 use encoding::types::{DecoderTrap, EncoderTrap, Encoding, EncodingRef};
 use euclid::length::Length;
 use html5ever::serialize;
 use html5ever::serialize::SerializeOpts;
 use hyper::header::{ContentLength, ContentType};
 use hyper::header::Headers;
--- a/servo/components/script/dom/xmlhttprequesteventtarget.rs
+++ b/servo/components/script/dom/xmlhttprequesteventtarget.rs
@@ -1,15 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull;
 use dom::bindings::codegen::Bindings::XMLHttpRequestEventTargetBinding::XMLHttpRequestEventTargetMethods;
 use dom::eventtarget::EventTarget;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct XMLHttpRequestEventTarget {
     eventtarget: EventTarget,
 }
 
 impl XMLHttpRequestEventTarget {
     pub fn new_inherited() -> XMLHttpRequestEventTarget {
--- a/servo/components/script/dom/xmlhttprequestupload.rs
+++ b/servo/components/script/dom/xmlhttprequestupload.rs
@@ -2,16 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use dom::bindings::codegen::Bindings::XMLHttpRequestUploadBinding;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::reflect_dom_object;
 use dom::globalscope::GlobalScope;
 use dom::xmlhttprequesteventtarget::XMLHttpRequestEventTarget;
+use dom_struct::dom_struct;
 
 #[dom_struct]
 pub struct XMLHttpRequestUpload {
     eventtarget: XMLHttpRequestEventTarget
 }
 
 impl XMLHttpRequestUpload {
     fn new_inherited() -> XMLHttpRequestUpload {
--- a/servo/components/script/lib.rs
+++ b/servo/components/script/lib.rs
@@ -1,22 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #![feature(box_syntax)]
 #![feature(conservative_impl_trait)]
 #![feature(const_fn)]
 #![feature(core_intrinsics)]
-#![feature(field_init_shorthand)]
 #![feature(mpsc_select)]
 #![feature(nonzero)]
 #![feature(on_unimplemented)]
 #![feature(optin_builtin_traits)]
 #![feature(plugin)]
+#![feature(proc_macro)]
 #![feature(slice_patterns)]
 #![feature(stmt_expr_attributes)]
 #![feature(try_from)]
 #![feature(untagged_unions)]
 
 #![deny(unsafe_code)]
 #![allow(non_snake_case)]
 
@@ -36,16 +36,17 @@ extern crate canvas_traits;
 extern crate caseless;
 extern crate cookie as cookie_rs;
 extern crate core;
 #[macro_use]
 extern crate cssparser;
 #[macro_use]
 extern crate deny_public_fields;
 extern crate devtools_traits;
+extern crate dom_struct;
 #[macro_use]
 extern crate domobject_derive;
 extern crate encoding;
 extern crate euclid;
 extern crate fnv;
 extern crate gfx_traits;
 extern crate heapsize;
 #[macro_use] extern crate heapsize_derive;
deleted file mode 100644
--- a/servo/components/script_plugins/jstraceable.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-use syntax::ast::MetaItem;
-use syntax::codemap::Span;
-use syntax::ext::base::{Annotatable, ExtCtxt};
-use syntax::ptr::P;
-
-pub fn expand_dom_struct(cx: &mut ExtCtxt, sp: Span, _: &MetaItem, anno: Annotatable) -> Annotatable {
-    if let Annotatable::Item(item) = anno {
-        let mut item2 = (*item).clone();
-        item2.attrs.push(quote_attr!(cx, #[must_root]));
-        item2.attrs.push(quote_attr!(cx, #[repr(C)]));
-        item2.attrs.push(quote_attr!(cx, #[derive(JSTraceable)]));
-        item2.attrs.push(quote_attr!(cx, #[derive(HeapSizeOf)]));
-        item2.attrs.push(quote_attr!(cx, #[derive(DenyPublicFields)]));
-        item2.attrs.push(quote_attr!(cx, #[derive(DomObject)]));
-        Annotatable::Item(P(item2))
-    } else {
-        cx.span_err(sp, "#[dom_struct] applied to something other than a struct");
-        anno
-    }
-}
--- a/servo/components/script_plugins/lib.rs
+++ b/servo/components/script_plugins/lib.rs
@@ -10,39 +10,30 @@
 //!  - `#[derive(JSTraceable)]` : Auto-derives an implementation of `JSTraceable` for a struct in the script crate
 //!  - `#[must_root]` : Prevents data of the marked type from being used on the stack.
 //!                     See the lints module for more details
 //!  - `#[dom_struct]` : Implies #[derive(JSTraceable, DenyPublicFields)]`, and `#[must_root]`.
 //!                       Use this for structs that correspond to a DOM type
 
 
 #![deny(unsafe_code)]
-#![feature(box_syntax, plugin, plugin_registrar, quote, rustc_private, slice_patterns)]
+#![feature(box_syntax, plugin, plugin_registrar, rustc_private, slice_patterns)]
 
 #[macro_use]
 extern crate rustc;
 extern crate rustc_plugin;
 extern crate syntax;
 
 use rustc_plugin::Registry;
-use syntax::ext::base::*;
 use syntax::feature_gate::AttributeType::Whitelisted;
-use syntax::symbol::Symbol;
 
 mod ban;
-// Public for documentation to show up
-/// Handles the auto-deriving for `#[derive(JSTraceable)]`
-pub mod jstraceable;
 mod unrooted_must_root;
 /// Utilities for writing plugins
 mod utils;
 
 #[plugin_registrar]
 pub fn plugin_registrar(reg: &mut Registry) {
-    reg.register_syntax_extension(
-        Symbol::intern("dom_struct"),
-        MultiModifier(box jstraceable::expand_dom_struct));
-
     reg.register_late_lint_pass(box unrooted_must_root::UnrootedPass::new());
     reg.register_early_lint_pass(box ban::BanPass);
     reg.register_attribute("allow_unrooted_interior".to_string(), Whitelisted);
     reg.register_attribute("must_root".to_string(), Whitelisted);
 }
--- a/servo/rust-commit-hash
+++ b/servo/rust-commit-hash
@@ -1,1 +1,1 @@
-025c328bf5ab336ff708e62a59292298dc1bc089
+413a975e31584d1e22d158a70c6d3073b991a618
--- a/servo/tests/unit/script/size_of.rs
+++ b/servo/tests/unit/script/size_of.rs
@@ -24,21 +24,21 @@ macro_rules! sizeof_checker (
                         avoids this increase. If you feel that the increase is necessary, \
                         update to the new size in tests/unit/script/size_of.rs.",
                         stringify!($t), old, new)
         }
     });
 );
 
 // Update the sizes here
-sizeof_checker!(size_event_target, EventTarget, 40);
-sizeof_checker!(size_node, Node, 152);
-sizeof_checker!(size_element, Element, 312);
-sizeof_checker!(size_htmlelement, HTMLElement, 328);
-sizeof_checker!(size_div, HTMLDivElement, 328);
-sizeof_checker!(size_span, HTMLSpanElement, 328);
-sizeof_checker!(size_text, Text, 184);
-sizeof_checker!(size_characterdata, CharacterData, 184);
+sizeof_checker!(size_event_target, EventTarget, 48);
+sizeof_checker!(size_node, Node, 160);
+sizeof_checker!(size_element, Element, 320);
+sizeof_checker!(size_htmlelement, HTMLElement, 336);
+sizeof_checker!(size_div, HTMLDivElement, 336);
+sizeof_checker!(size_span, HTMLSpanElement, 336);
+sizeof_checker!(size_text, Text, 192);
+sizeof_checker!(size_characterdata, CharacterData, 192);
 sizeof_checker!(size_servothreadsafelayoutnode, ServoThreadSafeLayoutNode, 16);
 
 // We use these types in the parallel traversal. They should stay pointer-sized.
 sizeof_checker!(size_sendelement, SendElement, 8);
 sizeof_checker!(size_sendnode, SendNode, 8);