Most of the code refactoring needed to be done is done with this commit.

This commit is contained in:
Arthur Marble 2016-09-18 03:41:16 -05:00
parent dbec9d8454
commit 883902bd97
86 changed files with 469 additions and 469 deletions

View file

@ -239,7 +239,7 @@ unsafe fn get_subframe_window(cx: *mut JSContext,
rooted!(in(cx) let target = GetProxyPrivate(*proxy.ptr).to_object()); rooted!(in(cx) let target = GetProxyPrivate(*proxy.ptr).to_object());
let win = root_from_handleobject::<Window>(target.handle()).unwrap(); let win = root_from_handleobject::<Window>(target.handle()).unwrap();
let mut found = false; let mut found = false;
return win.IndexedGetter(index, &mut found); return win.indexed_getter(index, &mut found);
} }
None None

View file

@ -49,7 +49,7 @@ impl DOMPointMethods for DOMPoint {
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-x // https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-x
fn SetX(&self, value: f64) { fn SetX(&self, value: f64) {
self.point.SetX(value); self.point.set_x(value);
} }
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-y // https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-y
@ -59,7 +59,7 @@ impl DOMPointMethods for DOMPoint {
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-y // https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-y
fn SetY(&self, value: f64) { fn SetY(&self, value: f64) {
self.point.SetY(value); self.point.set_y(value);
} }
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-z // https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-z
@ -69,7 +69,7 @@ impl DOMPointMethods for DOMPoint {
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-z // https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-z
fn SetZ(&self, value: f64) { fn SetZ(&self, value: f64) {
self.point.SetZ(value); self.point.set_z(value);
} }
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-w // https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-w
@ -79,6 +79,6 @@ impl DOMPointMethods for DOMPoint {
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-w // https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-w
fn SetW(&self, value: f64) { fn SetW(&self, value: f64) {
self.point.SetW(value); self.point.set_w(value);
} }
} }

View file

@ -69,26 +69,26 @@ impl DOMPointReadOnlyMethods for DOMPointReadOnly {
} }
pub trait DOMPointWriteMethods { pub trait DOMPointWriteMethods {
fn SetX(&self, value: f64); fn set_x(&self, value: f64);
fn SetY(&self, value: f64); fn set_y(&self, value: f64);
fn SetZ(&self, value: f64); fn set_z(&self, value: f64);
fn SetW(&self, value: f64); fn set_w(&self, value: f64);
} }
impl DOMPointWriteMethods for DOMPointReadOnly { impl DOMPointWriteMethods for DOMPointReadOnly {
fn SetX(&self, value: f64) { fn set_x(&self, value: f64) {
self.x.set(value); self.x.set(value);
} }
fn SetY(&self, value: f64) { fn set_y(&self, value: f64) {
self.y.set(value); self.y.set(value);
} }
fn SetZ(&self, value: f64) { fn set_z(&self, value: f64) {
self.z.set(value); self.z.set(value);
} }
fn SetW(&self, value: f64) { fn set_w(&self, value: f64) {
self.w.set(value); self.w.set(value);
} }
} }

View file

@ -39,22 +39,22 @@ pub struct HTMLAnchorElement {
} }
impl HTMLAnchorElement { impl HTMLAnchorElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLAnchorElement { document: &Document) -> HTMLAnchorElement {
HTMLAnchorElement { HTMLAnchorElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
rel_list: Default::default(), rel_list: Default::default(),
url: DOMRefCell::new(None), url: DOMRefCell::new(None),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLAnchorElement> { document: &Document) -> Root<HTMLAnchorElement> {
Node::reflect_node(box HTMLAnchorElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLAnchorElement::new_inherited(local_name, prefix, document),
document, document,
HTMLAnchorElementBinding::Wrap) HTMLAnchorElementBinding::Wrap)
} }
@ -157,7 +157,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
None => USVString(String::new()), None => USVString(String::new()),
Some(ref url) => { Some(ref url) => {
// Steps 3-4. // Steps 3-4.
UrlHelper::Hash(url) UrlHelper::hash(url)
} }
} }
} }
@ -174,7 +174,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
None => return, None => return,
// Steps 4-5. // Steps 4-5.
Some(url) => { Some(url) => {
UrlHelper::SetHash(url, value); UrlHelper::set_hash(url, value);
DOMString::from(url.as_str()) DOMString::from(url.as_str())
} }
}; };
@ -195,7 +195,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
USVString(String::new()) USVString(String::new())
} else { } else {
// Steps 4-5. // Steps 4-5.
UrlHelper::Host(url) UrlHelper::host(url)
} }
} }
} }
@ -213,7 +213,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
None => return, None => return,
// Step 4. // Step 4.
Some(url) => { Some(url) => {
UrlHelper::SetHost(url, value); UrlHelper::set_host(url, value);
DOMString::from(url.as_str()) DOMString::from(url.as_str())
} }
}; };
@ -231,7 +231,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
None => USVString(String::new()), None => USVString(String::new()),
Some(ref url) => { Some(ref url) => {
// Step 4. // Step 4.
UrlHelper::Hostname(url) UrlHelper::hostname(url)
} }
} }
} }
@ -248,7 +248,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
None => return, None => return,
// Step 4. // Step 4.
Some(url) => { Some(url) => {
UrlHelper::SetHostname(url, value); UrlHelper::set_hostname(url, value);
DOMString::from(url.as_str()) DOMString::from(url.as_str())
} }
}; };
@ -291,7 +291,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
// Step 3. // Step 3.
None => USVString(String::new()), None => USVString(String::new()),
// Steps 3-4. // Steps 3-4.
Some(ref url) => UrlHelper::Password(url) Some(ref url) => UrlHelper::password(url)
} }
} }
@ -307,7 +307,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
None => return, None => return,
// Step 4. // Step 4.
Some(url) => { Some(url) => {
UrlHelper::SetPassword(url, value); UrlHelper::set_password(url, value);
DOMString::from(url.as_str()) DOMString::from(url.as_str())
} }
}; };
@ -324,7 +324,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
// Step 3. // Step 3.
None => USVString(String::new()), None => USVString(String::new()),
// Steps 4-5. // Steps 4-5.
Some(ref url) => UrlHelper::Pathname(url) Some(ref url) => UrlHelper::pathname(url)
} }
} }
@ -340,7 +340,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
None => return, None => return,
// Step 5. // Step 5.
Some(url) => { Some(url) => {
UrlHelper::SetPathname(url, value); UrlHelper::set_pathname(url, value);
DOMString::from(url.as_str()) DOMString::from(url.as_str())
} }
}; };
@ -357,7 +357,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
// Step 3. // Step 3.
None => USVString(String::new()), None => USVString(String::new()),
// Step 4. // Step 4.
Some(ref url) => UrlHelper::Port(url) Some(ref url) => UrlHelper::port(url)
} }
} }
@ -374,7 +374,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
None => return, None => return,
// Step 4. // Step 4.
Some(url) => { Some(url) => {
UrlHelper::SetPort(url, value); UrlHelper::set_port(url, value);
DOMString::from(url.as_str()) DOMString::from(url.as_str())
} }
}; };
@ -391,7 +391,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
// Step 2. // Step 2.
None => USVString(":".to_owned()), None => USVString(":".to_owned()),
// Step 3. // Step 3.
Some(ref url) => UrlHelper::Protocol(url) Some(ref url) => UrlHelper::protocol(url)
} }
} }
@ -405,7 +405,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
None => return, None => return,
// Step 3. // Step 3.
Some(url) => { Some(url) => {
UrlHelper::SetProtocol(url, value); UrlHelper::set_protocol(url, value);
DOMString::from(url.as_str()) DOMString::from(url.as_str())
} }
}; };
@ -422,7 +422,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
// Step 2. // Step 2.
None => USVString(String::new()), None => USVString(String::new()),
// Step 3. // Step 3.
Some(ref url) => UrlHelper::Search(url) Some(ref url) => UrlHelper::search(url)
} }
} }
@ -439,7 +439,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
// TODO add this element's node document character encoding as // TODO add this element's node document character encoding as
// encoding override (as described in the spec) // encoding override (as described in the spec)
Some(url) => { Some(url) => {
UrlHelper::SetSearch(url, value); UrlHelper::set_search(url, value);
DOMString::from(url.as_str()) DOMString::from(url.as_str())
} }
}; };
@ -456,7 +456,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
// Step 2. // Step 2.
None => USVString(String::new()), None => USVString(String::new()),
// Step 3. // Step 3.
Some(ref url) => UrlHelper::Username(url) Some(ref url) => UrlHelper::username(url)
} }
} }
@ -472,7 +472,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
None => return, None => return,
// Step 4. // Step 4.
Some(url) => { Some(url) => {
UrlHelper::SetUsername(url, value); UrlHelper::set_username(url, value);
DOMString::from(url.as_str()) DOMString::from(url.as_str())
} }
}; };

View file

@ -20,20 +20,20 @@ pub struct HTMLAppletElement {
} }
impl HTMLAppletElement { impl HTMLAppletElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLAppletElement { document: &Document) -> HTMLAppletElement {
HTMLAppletElement { HTMLAppletElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLAppletElement> { document: &Document) -> Root<HTMLAppletElement> {
Node::reflect_node(box HTMLAppletElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLAppletElement::new_inherited(local_name, prefix, document),
document, document,
HTMLAppletElementBinding::Wrap) HTMLAppletElementBinding::Wrap)
} }

View file

@ -23,18 +23,18 @@ pub struct HTMLAreaElement {
} }
impl HTMLAreaElement { impl HTMLAreaElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLAreaElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLAreaElement {
HTMLAreaElement { HTMLAreaElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
rel_list: Default::default(), rel_list: Default::default(),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLAreaElement> { document: &Document) -> Root<HTMLAreaElement> {
Node::reflect_node(box HTMLAreaElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLAreaElement::new_inherited(local_name, prefix, document),
document, document,
HTMLAreaElementBinding::Wrap) HTMLAreaElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLAudioElement {
} }
impl HTMLAudioElement { impl HTMLAudioElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLAudioElement { document: &Document) -> HTMLAudioElement {
HTMLAudioElement { HTMLAudioElement {
htmlmediaelement: htmlmediaelement:
HTMLMediaElement::new_inherited(localName, prefix, document) HTMLMediaElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLAudioElement> { document: &Document) -> Root<HTMLAudioElement> {
Node::reflect_node(box HTMLAudioElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLAudioElement::new_inherited(local_name, prefix, document),
document, document,
HTMLAudioElementBinding::Wrap) HTMLAudioElementBinding::Wrap)
} }

View file

@ -23,17 +23,17 @@ pub struct HTMLBaseElement {
} }
impl HTMLBaseElement { impl HTMLBaseElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBaseElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBaseElement {
HTMLBaseElement { HTMLBaseElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLBaseElement> { document: &Document) -> Root<HTMLBaseElement> {
Node::reflect_node(box HTMLBaseElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLBaseElement::new_inherited(local_name, prefix, document),
document, document,
HTMLBaseElementBinding::Wrap) HTMLBaseElementBinding::Wrap)
} }

View file

@ -32,17 +32,17 @@ pub struct HTMLBodyElement {
} }
impl HTMLBodyElement { impl HTMLBodyElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> HTMLBodyElement { -> HTMLBodyElement {
HTMLBodyElement { HTMLBodyElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLBodyElement> { -> Root<HTMLBodyElement> {
Node::reflect_node(box HTMLBodyElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLBodyElement::new_inherited(local_name, prefix, document),
document, document,
HTMLBodyElementBinding::Wrap) HTMLBodyElementBinding::Wrap)
} }

View file

@ -16,17 +16,17 @@ pub struct HTMLBRElement {
} }
impl HTMLBRElement { impl HTMLBRElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBRElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBRElement {
HTMLBRElement { HTMLBRElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLBRElement> { document: &Document) -> Root<HTMLBRElement> {
Node::reflect_node(box HTMLBRElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLBRElement::new_inherited(local_name, prefix, document),
document, document,
HTMLBRElementBinding::Wrap) HTMLBRElementBinding::Wrap)
} }

View file

@ -43,22 +43,22 @@ pub struct HTMLButtonElement {
} }
impl HTMLButtonElement { impl HTMLButtonElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLButtonElement { document: &Document) -> HTMLButtonElement {
HTMLButtonElement { HTMLButtonElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
localName, prefix, document), local_name, prefix, document),
button_type: Cell::new(ButtonType::Submit) button_type: Cell::new(ButtonType::Submit)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLButtonElement> { document: &Document) -> Root<HTMLButtonElement> {
Node::reflect_node(box HTMLButtonElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLButtonElement::new_inherited(local_name, prefix, document),
document, document,
HTMLButtonElementBinding::Wrap) HTMLButtonElementBinding::Wrap)
} }

View file

@ -56,20 +56,20 @@ pub struct HTMLCanvasElement {
} }
impl HTMLCanvasElement { impl HTMLCanvasElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLCanvasElement { document: &Document) -> HTMLCanvasElement {
HTMLCanvasElement { HTMLCanvasElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
context: DOMRefCell::new(None), context: DOMRefCell::new(None),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLCanvasElement> { document: &Document) -> Root<HTMLCanvasElement> {
Node::reflect_node(box HTMLCanvasElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLCanvasElement::new_inherited(local_name, prefix, document),
document, document,
HTMLCanvasElementBinding::Wrap) HTMLCanvasElementBinding::Wrap)
} }

View file

@ -17,19 +17,19 @@ pub struct HTMLDataElement {
} }
impl HTMLDataElement { impl HTMLDataElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDataElement { document: &Document) -> HTMLDataElement {
HTMLDataElement { HTMLDataElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDataElement> { document: &Document) -> Root<HTMLDataElement> {
Node::reflect_node(box HTMLDataElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLDataElement::new_inherited(local_name, prefix, document),
document, document,
HTMLDataElementBinding::Wrap) HTMLDataElementBinding::Wrap)
} }

View file

@ -21,20 +21,20 @@ pub struct HTMLDataListElement {
} }
impl HTMLDataListElement { impl HTMLDataListElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDataListElement { document: &Document) -> HTMLDataListElement {
HTMLDataListElement { HTMLDataListElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDataListElement> { document: &Document) -> Root<HTMLDataListElement> {
Node::reflect_node(box HTMLDataListElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLDataListElement::new_inherited(local_name, prefix, document),
document, document,
HTMLDataListElementBinding::Wrap) HTMLDataListElementBinding::Wrap)
} }

View file

@ -28,21 +28,21 @@ pub struct HTMLDetailsElement {
} }
impl HTMLDetailsElement { impl HTMLDetailsElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDetailsElement { document: &Document) -> HTMLDetailsElement {
HTMLDetailsElement { HTMLDetailsElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
toggle_counter: Cell::new(0) toggle_counter: Cell::new(0)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDetailsElement> { document: &Document) -> Root<HTMLDetailsElement> {
Node::reflect_node(box HTMLDetailsElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLDetailsElement::new_inherited(local_name, prefix, document),
document, document,
HTMLDetailsElementBinding::Wrap) HTMLDetailsElementBinding::Wrap)
} }

View file

@ -22,21 +22,21 @@ pub struct HTMLDialogElement {
} }
impl HTMLDialogElement { impl HTMLDialogElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDialogElement { document: &Document) -> HTMLDialogElement {
HTMLDialogElement { HTMLDialogElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
return_value: DOMRefCell::new(DOMString::new()), return_value: DOMRefCell::new(DOMString::new()),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDialogElement> { document: &Document) -> Root<HTMLDialogElement> {
Node::reflect_node(box HTMLDialogElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLDialogElement::new_inherited(local_name, prefix, document),
document, document,
HTMLDialogElementBinding::Wrap) HTMLDialogElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLDirectoryElement {
} }
impl HTMLDirectoryElement { impl HTMLDirectoryElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDirectoryElement { document: &Document) -> HTMLDirectoryElement {
HTMLDirectoryElement { HTMLDirectoryElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDirectoryElement> { document: &Document) -> Root<HTMLDirectoryElement> {
Node::reflect_node(box HTMLDirectoryElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLDirectoryElement::new_inherited(local_name, prefix, document),
document, document,
HTMLDirectoryElementBinding::Wrap) HTMLDirectoryElementBinding::Wrap)
} }

View file

@ -16,19 +16,19 @@ pub struct HTMLDivElement {
} }
impl HTMLDivElement { impl HTMLDivElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDivElement { document: &Document) -> HTMLDivElement {
HTMLDivElement { HTMLDivElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDivElement> { document: &Document) -> Root<HTMLDivElement> {
Node::reflect_node(box HTMLDivElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLDivElement::new_inherited(local_name, prefix, document),
document, document,
HTMLDivElementBinding::Wrap) HTMLDivElementBinding::Wrap)
} }

View file

@ -16,18 +16,18 @@ pub struct HTMLDListElement {
} }
impl HTMLDListElement { impl HTMLDListElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLDListElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLDListElement {
HTMLDListElement { HTMLDListElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDListElement> { document: &Document) -> Root<HTMLDListElement> {
Node::reflect_node(box HTMLDListElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLDListElement::new_inherited(local_name, prefix, document),
document, document,
HTMLDListElementBinding::Wrap) HTMLDListElementBinding::Wrap)
} }

View file

@ -62,8 +62,8 @@ impl HTMLElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) -> Root<HTMLElement> { pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> Root<HTMLElement> {
Node::reflect_node(box HTMLElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLElement::new_inherited(local_name, prefix, document),
document, document,
HTMLElementBinding::Wrap) HTMLElementBinding::Wrap)
} }

View file

@ -16,17 +16,17 @@ pub struct HTMLEmbedElement {
} }
impl HTMLEmbedElement { impl HTMLEmbedElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLEmbedElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLEmbedElement {
HTMLEmbedElement { HTMLEmbedElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLEmbedElement> { document: &Document) -> Root<HTMLEmbedElement> {
Node::reflect_node(box HTMLEmbedElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLEmbedElement::new_inherited(local_name, prefix, document),
document, document,
HTMLEmbedElementBinding::Wrap) HTMLEmbedElementBinding::Wrap)
} }

View file

@ -26,21 +26,21 @@ pub struct HTMLFieldSetElement {
} }
impl HTMLFieldSetElement { impl HTMLFieldSetElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLFieldSetElement { document: &Document) -> HTMLFieldSetElement {
HTMLFieldSetElement { HTMLFieldSetElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
localName, prefix, document) local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFieldSetElement> { document: &Document) -> Root<HTMLFieldSetElement> {
Node::reflect_node(box HTMLFieldSetElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLFieldSetElement::new_inherited(local_name, prefix, document),
document, document,
HTMLFieldSetElementBinding::Wrap) HTMLFieldSetElementBinding::Wrap)
} }

View file

@ -25,17 +25,17 @@ pub struct HTMLFontElement {
impl HTMLFontElement { impl HTMLFontElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLFontElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLFontElement {
HTMLFontElement { HTMLFontElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFontElement> { document: &Document) -> Root<HTMLFontElement> {
Node::reflect_node(box HTMLFontElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLFontElement::new_inherited(local_name, prefix, document),
document, document,
HTMLFontElementBinding::Wrap) HTMLFontElementBinding::Wrap)
} }

View file

@ -65,11 +65,11 @@ pub struct HTMLFormElement {
} }
impl HTMLFormElement { impl HTMLFormElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLFormElement { document: &Document) -> HTMLFormElement {
HTMLFormElement { HTMLFormElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
marked_for_reset: Cell::new(false), marked_for_reset: Cell::new(false),
elements: Default::default(), elements: Default::default(),
generation_id: Cell::new(GenerationId(0)) generation_id: Cell::new(GenerationId(0))
@ -77,10 +77,10 @@ impl HTMLFormElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFormElement> { document: &Document) -> Root<HTMLFormElement> {
Node::reflect_node(box HTMLFormElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLFormElement::new_inherited(local_name, prefix, document),
document, document,
HTMLFormElementBinding::Wrap) HTMLFormElementBinding::Wrap)
} }

View file

@ -16,17 +16,17 @@ pub struct HTMLFrameElement {
} }
impl HTMLFrameElement { impl HTMLFrameElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLFrameElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLFrameElement {
HTMLFrameElement { HTMLFrameElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFrameElement> { document: &Document) -> Root<HTMLFrameElement> {
Node::reflect_node(box HTMLFrameElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLFrameElement::new_inherited(local_name, prefix, document),
document, document,
HTMLFrameElementBinding::Wrap) HTMLFrameElementBinding::Wrap)
} }

View file

@ -19,20 +19,20 @@ pub struct HTMLFrameSetElement {
} }
impl HTMLFrameSetElement { impl HTMLFrameSetElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLFrameSetElement { document: &Document) -> HTMLFrameSetElement {
HTMLFrameSetElement { HTMLFrameSetElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFrameSetElement> { document: &Document) -> Root<HTMLFrameSetElement> {
Node::reflect_node(box HTMLFrameSetElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLFrameSetElement::new_inherited(local_name, prefix, document),
document, document,
HTMLFrameSetElementBinding::Wrap) HTMLFrameSetElementBinding::Wrap)
} }

View file

@ -22,19 +22,19 @@ pub struct HTMLHeadElement {
} }
impl HTMLHeadElement { impl HTMLHeadElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLHeadElement { document: &Document) -> HTMLHeadElement {
HTMLHeadElement { HTMLHeadElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLHeadElement> { document: &Document) -> Root<HTMLHeadElement> {
Node::reflect_node(box HTMLHeadElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLHeadElement::new_inherited(local_name, prefix, document),
document, document,
HTMLHeadElementBinding::Wrap) HTMLHeadElementBinding::Wrap)
} }

View file

@ -27,23 +27,23 @@ pub struct HTMLHeadingElement {
} }
impl HTMLHeadingElement { impl HTMLHeadingElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document, document: &Document,
level: HeadingLevel) -> HTMLHeadingElement { level: HeadingLevel) -> HTMLHeadingElement {
HTMLHeadingElement { HTMLHeadingElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
level: level, level: level,
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document, document: &Document,
level: HeadingLevel) -> Root<HTMLHeadingElement> { level: HeadingLevel) -> Root<HTMLHeadingElement> {
Node::reflect_node(box HTMLHeadingElement::new_inherited(localName, prefix, document, level), Node::reflect_node(box HTMLHeadingElement::new_inherited(local_name, prefix, document, level),
document, document,
HTMLHeadingElementBinding::Wrap) HTMLHeadingElementBinding::Wrap)
} }

View file

@ -21,17 +21,17 @@ pub struct HTMLHRElement {
} }
impl HTMLHRElement { impl HTMLHRElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLHRElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLHRElement {
HTMLHRElement { HTMLHRElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLHRElement> { document: &Document) -> Root<HTMLHRElement> {
Node::reflect_node(box HTMLHRElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLHRElement::new_inherited(local_name, prefix, document),
document, document,
HTMLHRElementBinding::Wrap) HTMLHRElementBinding::Wrap)
} }

View file

@ -173,11 +173,11 @@ impl HTMLIFrameElement {
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage); self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
} }
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLIFrameElement { document: &Document) -> HTMLIFrameElement {
HTMLIFrameElement { HTMLIFrameElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
pipeline_id: Cell::new(None), pipeline_id: Cell::new(None),
sandbox: Default::default(), sandbox: Default::default(),
sandbox_allowance: Cell::new(None), sandbox_allowance: Cell::new(None),
@ -187,10 +187,10 @@ impl HTMLIFrameElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLIFrameElement> { document: &Document) -> Root<HTMLIFrameElement> {
Node::reflect_node(box HTMLIFrameElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLIFrameElement::new_inherited(local_name, prefix, document),
document, document,
HTMLIFrameElementBinding::Wrap) HTMLIFrameElementBinding::Wrap)
} }
@ -402,7 +402,7 @@ unsafe fn build_mozbrowser_event_detail(event: MozBrowserEvent,
} }
} }
pub fn Navigate(iframe: &HTMLIFrameElement, direction: TraversalDirection) -> ErrorResult { pub fn navigate(iframe: &HTMLIFrameElement, direction: TraversalDirection) -> ErrorResult {
if iframe.Mozbrowser() { if iframe.Mozbrowser() {
if iframe.upcast::<Node>().is_in_doc() { if iframe.upcast::<Node>().is_in_doc() {
let window = window_from_node(iframe); let window = window_from_node(iframe);
@ -450,7 +450,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
let self_url = self.get_url(); let self_url = self.get_url();
let win_url = window_from_node(self).get_url(); let win_url = window_from_node(self).get_url();
if UrlHelper::SameOrigin(&self_url, &win_url) { if UrlHelper::same_origin(&self_url, &win_url) {
Some(window.Document()) Some(window.Document())
} else { } else {
None None
@ -479,16 +479,16 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/goBack // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/goBack
fn GoBack(&self) -> ErrorResult { fn GoBack(&self) -> ErrorResult {
Navigate(self, TraversalDirection::Back(1)) navigate(self, TraversalDirection::Back(1))
} }
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/goForward // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/goForward
fn GoForward(&self) -> ErrorResult { fn GoForward(&self) -> ErrorResult {
Navigate(self, TraversalDirection::Forward(1)) navigate(self, TraversalDirection::Forward(1))
} }
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/reload // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/reload
fn Reload(&self, _hardReload: bool) -> ErrorResult { fn Reload(&self, _hard_reload: bool) -> ErrorResult {
if self.Mozbrowser() { if self.Mozbrowser() {
if self.upcast::<Node>().is_in_doc() { if self.upcast::<Node>().is_in_doc() {
self.navigate_or_reload_child_browsing_context(None); self.navigate_or_reload_child_browsing_context(None);
@ -632,7 +632,7 @@ impl VirtualMethods for HTMLIFrameElement {
// HTMLIFrameElement::contentDocument. // HTMLIFrameElement::contentDocument.
let self_url = self.get_url(); let self_url = self.get_url();
let win_url = window_from_node(self).get_url(); let win_url = window_from_node(self).get_url();
UrlHelper::SameOrigin(&self_url, &win_url) UrlHelper::same_origin(&self_url, &win_url)
}; };
let (sender, receiver) = if same_origin { let (sender, receiver) = if same_origin {
(None, None) (None, None)

View file

@ -194,9 +194,9 @@ impl HTMLImageElement {
} }
} }
} }
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLImageElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLImageElement {
HTMLImageElement { HTMLImageElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
current_request: DOMRefCell::new(ImageRequest { current_request: DOMRefCell::new(ImageRequest {
state: State::Unavailable, state: State::Unavailable,
parsed_url: None, parsed_url: None,
@ -215,10 +215,10 @@ impl HTMLImageElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLImageElement> { document: &Document) -> Root<HTMLImageElement> {
Node::reflect_node(box HTMLImageElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLImageElement::new_inherited(local_name, prefix, document),
document, document,
HTMLImageElementBinding::Wrap) HTMLImageElementBinding::Wrap)
} }

View file

@ -125,12 +125,12 @@ static DEFAULT_INPUT_SIZE: u32 = 20;
static DEFAULT_MAX_LENGTH: i32 = -1; static DEFAULT_MAX_LENGTH: i32 = -1;
impl HTMLInputElement { impl HTMLInputElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLInputElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLInputElement {
let chan = document.window().constellation_chan().clone(); let chan = document.window().constellation_chan().clone();
HTMLInputElement { HTMLInputElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE,
localName, prefix, document), local_name, prefix, document),
input_type: Cell::new(InputType::InputText), input_type: Cell::new(InputType::InputText),
placeholder: DOMRefCell::new(DOMString::new()), placeholder: DOMRefCell::new(DOMString::new()),
checked_changed: Cell::new(false), checked_changed: Cell::new(false),
@ -145,10 +145,10 @@ impl HTMLInputElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLInputElement> { document: &Document) -> Root<HTMLInputElement> {
Node::reflect_node(box HTMLInputElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLInputElement::new_inherited(local_name, prefix, document),
document, document,
HTMLInputElementBinding::Wrap) HTMLInputElementBinding::Wrap)
} }

View file

@ -25,20 +25,20 @@ pub struct HTMLLabelElement {
} }
impl HTMLLabelElement { impl HTMLLabelElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLLabelElement { document: &Document) -> HTMLLabelElement {
HTMLLabelElement { HTMLLabelElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLLabelElement> { document: &Document) -> Root<HTMLLabelElement> {
Node::reflect_node(box HTMLLabelElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLLabelElement::new_inherited(local_name, prefix, document),
document, document,
HTMLLabelElementBinding::Wrap) HTMLLabelElementBinding::Wrap)
} }

View file

@ -23,19 +23,19 @@ pub struct HTMLLegendElement {
} }
impl HTMLLegendElement { impl HTMLLegendElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) document: &Document)
-> HTMLLegendElement { -> HTMLLegendElement {
HTMLLegendElement { htmlelement: HTMLElement::new_inherited(localName, prefix, document) } HTMLLegendElement { htmlelement: HTMLElement::new_inherited(local_name, prefix, document) }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) document: &Document)
-> Root<HTMLLegendElement> { -> Root<HTMLLegendElement> {
Node::reflect_node(box HTMLLegendElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLLegendElement::new_inherited(local_name, prefix, document),
document, document,
HTMLLegendElementBinding::Wrap) HTMLLegendElementBinding::Wrap)
} }

View file

@ -20,17 +20,17 @@ pub struct HTMLLIElement {
} }
impl HTMLLIElement { impl HTMLLIElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLLIElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLLIElement {
HTMLLIElement { HTMLLIElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLLIElement> { document: &Document) -> Root<HTMLLIElement> {
Node::reflect_node(box HTMLLIElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLLIElement::new_inherited(local_name, prefix, document),
document, document,
HTMLLIElementBinding::Wrap) HTMLLIElementBinding::Wrap)
} }

View file

@ -57,10 +57,10 @@ pub struct HTMLLinkElement {
} }
impl HTMLLinkElement { impl HTMLLinkElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document, fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document,
creator: ElementCreator) -> HTMLLinkElement { creator: ElementCreator) -> HTMLLinkElement {
HTMLLinkElement { HTMLLinkElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
rel_list: Default::default(), rel_list: Default::default(),
parser_inserted: Cell::new(creator == ElementCreator::ParserCreated), parser_inserted: Cell::new(creator == ElementCreator::ParserCreated),
stylesheet: DOMRefCell::new(None), stylesheet: DOMRefCell::new(None),
@ -68,11 +68,11 @@ impl HTMLLinkElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document, document: &Document,
creator: ElementCreator) -> Root<HTMLLinkElement> { creator: ElementCreator) -> Root<HTMLLinkElement> {
Node::reflect_node(box HTMLLinkElement::new_inherited(localName, prefix, document, creator), Node::reflect_node(box HTMLLinkElement::new_inherited(local_name, prefix, document, creator),
document, document,
HTMLLinkElementBinding::Wrap) HTMLLinkElementBinding::Wrap)
} }

View file

@ -16,19 +16,19 @@ pub struct HTMLMapElement {
} }
impl HTMLMapElement { impl HTMLMapElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLMapElement { document: &Document) -> HTMLMapElement {
HTMLMapElement { HTMLMapElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLMapElement> { document: &Document) -> Root<HTMLMapElement> {
Node::reflect_node(box HTMLMapElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLMapElement::new_inherited(local_name, prefix, document),
document, document,
HTMLMapElementBinding::Wrap) HTMLMapElementBinding::Wrap)
} }

View file

@ -31,20 +31,20 @@ pub struct HTMLMetaElement {
} }
impl HTMLMetaElement { impl HTMLMetaElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLMetaElement { document: &Document) -> HTMLMetaElement {
HTMLMetaElement { HTMLMetaElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
stylesheet: DOMRefCell::new(None), stylesheet: DOMRefCell::new(None),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLMetaElement> { document: &Document) -> Root<HTMLMetaElement> {
Node::reflect_node(box HTMLMetaElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLMetaElement::new_inherited(local_name, prefix, document),
document, document,
HTMLMetaElementBinding::Wrap) HTMLMetaElementBinding::Wrap)
} }

View file

@ -18,19 +18,19 @@ pub struct HTMLMeterElement {
} }
impl HTMLMeterElement { impl HTMLMeterElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLMeterElement { document: &Document) -> HTMLMeterElement {
HTMLMeterElement { HTMLMeterElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLMeterElement> { document: &Document) -> Root<HTMLMeterElement> {
Node::reflect_node(box HTMLMeterElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLMeterElement::new_inherited(local_name, prefix, document),
document, document,
HTMLMeterElementBinding::Wrap) HTMLMeterElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLModElement {
} }
impl HTMLModElement { impl HTMLModElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLModElement { document: &Document) -> HTMLModElement {
HTMLModElement { HTMLModElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLModElement> { document: &Document) -> Root<HTMLModElement> {
Node::reflect_node(box HTMLModElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLModElement::new_inherited(local_name, prefix, document),
document, document,
HTMLModElementBinding::Wrap) HTMLModElementBinding::Wrap)
} }

View file

@ -28,21 +28,21 @@ pub struct HTMLObjectElement {
} }
impl HTMLObjectElement { impl HTMLObjectElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLObjectElement { document: &Document) -> HTMLObjectElement {
HTMLObjectElement { HTMLObjectElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
image: DOMRefCell::new(None), image: DOMRefCell::new(None),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLObjectElement> { document: &Document) -> Root<HTMLObjectElement> {
Node::reflect_node(box HTMLObjectElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLObjectElement::new_inherited(local_name, prefix, document),
document, document,
HTMLObjectElementBinding::Wrap) HTMLObjectElementBinding::Wrap)
} }

View file

@ -16,19 +16,19 @@ pub struct HTMLOListElement {
} }
impl HTMLOListElement { impl HTMLOListElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLOListElement { document: &Document) -> HTMLOListElement {
HTMLOListElement { HTMLOListElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLOListElement> { document: &Document) -> Root<HTMLOListElement> {
Node::reflect_node(box HTMLOListElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLOListElement::new_inherited(local_name, prefix, document),
document, document,
HTMLOListElementBinding::Wrap) HTMLOListElementBinding::Wrap)
} }

View file

@ -23,21 +23,21 @@ pub struct HTMLOptGroupElement {
} }
impl HTMLOptGroupElement { impl HTMLOptGroupElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLOptGroupElement { document: &Document) -> HTMLOptGroupElement {
HTMLOptGroupElement { HTMLOptGroupElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
localName, prefix, document) local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLOptGroupElement> { document: &Document) -> Root<HTMLOptGroupElement> {
Node::reflect_node(box HTMLOptGroupElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLOptGroupElement::new_inherited(local_name, prefix, document),
document, document,
HTMLOptGroupElementBinding::Wrap) HTMLOptGroupElementBinding::Wrap)
} }

View file

@ -39,23 +39,23 @@ pub struct HTMLOptionElement {
} }
impl HTMLOptionElement { impl HTMLOptionElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLOptionElement { document: &Document) -> HTMLOptionElement {
HTMLOptionElement { HTMLOptionElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
localName, prefix, document), local_name, prefix, document),
selectedness: Cell::new(false), selectedness: Cell::new(false),
dirtiness: Cell::new(false), dirtiness: Cell::new(false),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLOptionElement> { document: &Document) -> Root<HTMLOptionElement> {
Node::reflect_node(box HTMLOptionElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLOptionElement::new_inherited(local_name, prefix, document),
document, document,
HTMLOptionElementBinding::Wrap) HTMLOptionElementBinding::Wrap)
} }

View file

@ -21,20 +21,20 @@ pub struct HTMLOutputElement {
} }
impl HTMLOutputElement { impl HTMLOutputElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLOutputElement { document: &Document) -> HTMLOutputElement {
HTMLOutputElement { HTMLOutputElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLOutputElement> { document: &Document) -> Root<HTMLOutputElement> {
Node::reflect_node(box HTMLOutputElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLOutputElement::new_inherited(local_name, prefix, document),
document, document,
HTMLOutputElementBinding::Wrap) HTMLOutputElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLParagraphElement {
} }
impl HTMLParagraphElement { impl HTMLParagraphElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLParagraphElement { document: &Document) -> HTMLParagraphElement {
HTMLParagraphElement { HTMLParagraphElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLParagraphElement> { document: &Document) -> Root<HTMLParagraphElement> {
Node::reflect_node(box HTMLParagraphElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLParagraphElement::new_inherited(local_name, prefix, document),
document, document,
HTMLParagraphElementBinding::Wrap) HTMLParagraphElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLParamElement {
} }
impl HTMLParamElement { impl HTMLParamElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLParamElement { document: &Document) -> HTMLParamElement {
HTMLParamElement { HTMLParamElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLParamElement> { document: &Document) -> Root<HTMLParamElement> {
Node::reflect_node(box HTMLParamElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLParamElement::new_inherited(local_name, prefix, document),
document, document,
HTMLParamElementBinding::Wrap) HTMLParamElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLPreElement {
} }
impl HTMLPreElement { impl HTMLPreElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLPreElement { document: &Document) -> HTMLPreElement {
HTMLPreElement { HTMLPreElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLPreElement> { document: &Document) -> Root<HTMLPreElement> {
Node::reflect_node(box HTMLPreElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLPreElement::new_inherited(local_name, prefix, document),
document, document,
HTMLPreElementBinding::Wrap) HTMLPreElementBinding::Wrap)
} }

View file

@ -18,20 +18,20 @@ pub struct HTMLProgressElement {
} }
impl HTMLProgressElement { impl HTMLProgressElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLProgressElement { document: &Document) -> HTMLProgressElement {
HTMLProgressElement { HTMLProgressElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLProgressElement> { document: &Document) -> Root<HTMLProgressElement> {
Node::reflect_node(box HTMLProgressElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLProgressElement::new_inherited(local_name, prefix, document),
document, document,
HTMLProgressElementBinding::Wrap) HTMLProgressElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLQuoteElement {
} }
impl HTMLQuoteElement { impl HTMLQuoteElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLQuoteElement { document: &Document) -> HTMLQuoteElement {
HTMLQuoteElement { HTMLQuoteElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLQuoteElement> { document: &Document) -> Root<HTMLQuoteElement> {
Node::reflect_node(box HTMLQuoteElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLQuoteElement::new_inherited(local_name, prefix, document),
document, document,
HTMLQuoteElementBinding::Wrap) HTMLQuoteElementBinding::Wrap)
} }

View file

@ -64,11 +64,11 @@ pub struct HTMLScriptElement {
} }
impl HTMLScriptElement { impl HTMLScriptElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document, fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document,
creator: ElementCreator) -> HTMLScriptElement { creator: ElementCreator) -> HTMLScriptElement {
HTMLScriptElement { HTMLScriptElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
already_started: Cell::new(false), already_started: Cell::new(false),
parser_inserted: Cell::new(creator == ElementCreator::ParserCreated), parser_inserted: Cell::new(creator == ElementCreator::ParserCreated),
non_blocking: Cell::new(creator != ElementCreator::ParserCreated), non_blocking: Cell::new(creator != ElementCreator::ParserCreated),
@ -79,9 +79,9 @@ impl HTMLScriptElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document, pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document,
creator: ElementCreator) -> Root<HTMLScriptElement> { creator: ElementCreator) -> Root<HTMLScriptElement> {
Node::reflect_node(box HTMLScriptElement::new_inherited(localName, prefix, document, creator), Node::reflect_node(box HTMLScriptElement::new_inherited(local_name, prefix, document, creator),
document, document,
HTMLScriptElementBinding::Wrap) HTMLScriptElementBinding::Wrap)
} }

View file

@ -34,21 +34,21 @@ pub struct HTMLSelectElement {
static DEFAULT_SELECT_SIZE: u32 = 0; static DEFAULT_SELECT_SIZE: u32 = 0;
impl HTMLSelectElement { impl HTMLSelectElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLSelectElement { document: &Document) -> HTMLSelectElement {
HTMLSelectElement { HTMLSelectElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
localName, prefix, document) local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLSelectElement> { document: &Document) -> Root<HTMLSelectElement> {
Node::reflect_node(box HTMLSelectElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLSelectElement::new_inherited(local_name, prefix, document),
document, document,
HTMLSelectElementBinding::Wrap) HTMLSelectElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLSourceElement {
} }
impl HTMLSourceElement { impl HTMLSourceElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLSourceElement { document: &Document) -> HTMLSourceElement {
HTMLSourceElement { HTMLSourceElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLSourceElement> { document: &Document) -> Root<HTMLSourceElement> {
Node::reflect_node(box HTMLSourceElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLSourceElement::new_inherited(local_name, prefix, document),
document, document,
HTMLSourceElementBinding::Wrap) HTMLSourceElementBinding::Wrap)
} }

View file

@ -16,17 +16,17 @@ pub struct HTMLSpanElement {
} }
impl HTMLSpanElement { impl HTMLSpanElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLSpanElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLSpanElement {
HTMLSpanElement { HTMLSpanElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLSpanElement> { document: &Document) -> Root<HTMLSpanElement> {
Node::reflect_node(box HTMLSpanElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLSpanElement::new_inherited(local_name, prefix, document),
document, document,
HTMLSpanElementBinding::Wrap) HTMLSpanElementBinding::Wrap)
} }

View file

@ -28,20 +28,20 @@ pub struct HTMLStyleElement {
} }
impl HTMLStyleElement { impl HTMLStyleElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLStyleElement { document: &Document) -> HTMLStyleElement {
HTMLStyleElement { HTMLStyleElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
stylesheet: DOMRefCell::new(None), stylesheet: DOMRefCell::new(None),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLStyleElement> { document: &Document) -> Root<HTMLStyleElement> {
Node::reflect_node(box HTMLStyleElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLStyleElement::new_inherited(local_name, prefix, document),
document, document,
HTMLStyleElementBinding::Wrap) HTMLStyleElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLTableCaptionElement {
} }
impl HTMLTableCaptionElement { impl HTMLTableCaptionElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTableCaptionElement { document: &Document) -> HTMLTableCaptionElement {
HTMLTableCaptionElement { HTMLTableCaptionElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTableCaptionElement> { document: &Document) -> Root<HTMLTableCaptionElement> {
Node::reflect_node(box HTMLTableCaptionElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTableCaptionElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTableCaptionElementBinding::Wrap) HTMLTableCaptionElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLTableColElement {
} }
impl HTMLTableColElement { impl HTMLTableColElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTableColElement { document: &Document) -> HTMLTableColElement {
HTMLTableColElement { HTMLTableColElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTableColElement> { document: &Document) -> Root<HTMLTableColElement> {
Node::reflect_node(box HTMLTableColElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTableColElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTableColElementBinding::Wrap) HTMLTableColElementBinding::Wrap)
} }

View file

@ -16,19 +16,19 @@ pub struct HTMLTableDataCellElement {
} }
impl HTMLTableDataCellElement { impl HTMLTableDataCellElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTableDataCellElement { document: &Document) -> HTMLTableDataCellElement {
HTMLTableDataCellElement { HTMLTableDataCellElement {
htmltablecellelement: htmltablecellelement:
HTMLTableCellElement::new_inherited(localName, prefix, document) HTMLTableCellElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLTableDataCellElement> { -> Root<HTMLTableDataCellElement> {
Node::reflect_node(box HTMLTableDataCellElement::new_inherited(localName, Node::reflect_node(box HTMLTableDataCellElement::new_inherited(local_name,
prefix, prefix,
document), document),
document, document,

View file

@ -49,10 +49,10 @@ impl CollectionFilter for TableRowFilter {
} }
impl HTMLTableElement { impl HTMLTableElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> HTMLTableElement { -> HTMLTableElement {
HTMLTableElement { HTMLTableElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
border: Cell::new(None), border: Cell::new(None),
cellspacing: Cell::new(None), cellspacing: Cell::new(None),
tbodies: Default::default(), tbodies: Default::default(),
@ -60,9 +60,9 @@ impl HTMLTableElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLTableElement> { -> Root<HTMLTableElement> {
Node::reflect_node(box HTMLTableElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTableElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTableElementBinding::Wrap) HTMLTableElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLTableHeaderCellElement {
} }
impl HTMLTableHeaderCellElement { impl HTMLTableHeaderCellElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTableHeaderCellElement { document: &Document) -> HTMLTableHeaderCellElement {
HTMLTableHeaderCellElement { HTMLTableHeaderCellElement {
htmltablecellelement: htmltablecellelement:
HTMLTableCellElement::new_inherited(localName, prefix, document) HTMLTableCellElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTableHeaderCellElement> { document: &Document) -> Root<HTMLTableHeaderCellElement> {
Node::reflect_node(box HTMLTableHeaderCellElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTableHeaderCellElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTableHeaderCellElementBinding::Wrap) HTMLTableHeaderCellElementBinding::Wrap)
} }

View file

@ -40,18 +40,18 @@ pub struct HTMLTableRowElement {
} }
impl HTMLTableRowElement { impl HTMLTableRowElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> HTMLTableRowElement { -> HTMLTableRowElement {
HTMLTableRowElement { HTMLTableRowElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
cells: Default::default(), cells: Default::default(),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLTableRowElement> { -> Root<HTMLTableRowElement> {
Node::reflect_node(box HTMLTableRowElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTableRowElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTableRowElementBinding::Wrap) HTMLTableRowElementBinding::Wrap)
} }

View file

@ -25,17 +25,17 @@ pub struct HTMLTableSectionElement {
} }
impl HTMLTableSectionElement { impl HTMLTableSectionElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> HTMLTableSectionElement { -> HTMLTableSectionElement {
HTMLTableSectionElement { HTMLTableSectionElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLTableSectionElement> { -> Root<HTMLTableSectionElement> {
Node::reflect_node(box HTMLTableSectionElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTableSectionElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTableSectionElementBinding::Wrap) HTMLTableSectionElementBinding::Wrap)
} }

View file

@ -25,21 +25,21 @@ pub struct HTMLTemplateElement {
} }
impl HTMLTemplateElement { impl HTMLTemplateElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTemplateElement { document: &Document) -> HTMLTemplateElement {
HTMLTemplateElement { HTMLTemplateElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
contents: MutNullableHeap::new(None), contents: MutNullableHeap::new(None),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTemplateElement> { document: &Document) -> Root<HTMLTemplateElement> {
Node::reflect_node(box HTMLTemplateElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTemplateElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTemplateElementBinding::Wrap) HTMLTemplateElementBinding::Wrap)
} }

View file

@ -96,14 +96,14 @@ static DEFAULT_COLS: u32 = 20;
static DEFAULT_ROWS: u32 = 2; static DEFAULT_ROWS: u32 = 2;
impl HTMLTextAreaElement { impl HTMLTextAreaElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTextAreaElement { document: &Document) -> HTMLTextAreaElement {
let chan = document.window().constellation_chan().clone(); let chan = document.window().constellation_chan().clone();
HTMLTextAreaElement { HTMLTextAreaElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE,
localName, prefix, document), local_name, prefix, document),
textinput: DOMRefCell::new(TextInput::new( textinput: DOMRefCell::new(TextInput::new(
Lines::Multiple, DOMString::new(), chan, None, SelectionDirection::None)), Lines::Multiple, DOMString::new(), chan, None, SelectionDirection::None)),
value_changed: Cell::new(false), value_changed: Cell::new(false),
@ -111,10 +111,10 @@ impl HTMLTextAreaElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTextAreaElement> { document: &Document) -> Root<HTMLTextAreaElement> {
Node::reflect_node(box HTMLTextAreaElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTextAreaElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTextAreaElementBinding::Wrap) HTMLTextAreaElementBinding::Wrap)
} }

View file

@ -16,17 +16,17 @@ pub struct HTMLTimeElement {
} }
impl HTMLTimeElement { impl HTMLTimeElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTimeElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTimeElement {
HTMLTimeElement { HTMLTimeElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTimeElement> { document: &Document) -> Root<HTMLTimeElement> {
Node::reflect_node(box HTMLTimeElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTimeElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTimeElementBinding::Wrap) HTMLTimeElementBinding::Wrap)
} }

View file

@ -22,17 +22,17 @@ pub struct HTMLTitleElement {
} }
impl HTMLTitleElement { impl HTMLTitleElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTitleElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTitleElement {
HTMLTitleElement { HTMLTitleElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTitleElement> { document: &Document) -> Root<HTMLTitleElement> {
Node::reflect_node(box HTMLTitleElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTitleElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTitleElementBinding::Wrap) HTMLTitleElementBinding::Wrap)
} }

View file

@ -16,17 +16,17 @@ pub struct HTMLTrackElement {
} }
impl HTMLTrackElement { impl HTMLTrackElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTrackElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTrackElement {
HTMLTrackElement { HTMLTrackElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTrackElement> { document: &Document) -> Root<HTMLTrackElement> {
Node::reflect_node(box HTMLTrackElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTrackElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTrackElementBinding::Wrap) HTMLTrackElementBinding::Wrap)
} }

View file

@ -16,17 +16,17 @@ pub struct HTMLUListElement {
} }
impl HTMLUListElement { impl HTMLUListElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLUListElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLUListElement {
HTMLUListElement { HTMLUListElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLUListElement> { document: &Document) -> Root<HTMLUListElement> {
Node::reflect_node(box HTMLUListElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLUListElement::new_inherited(local_name, prefix, document),
document, document,
HTMLUListElementBinding::Wrap) HTMLUListElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLUnknownElement {
} }
impl HTMLUnknownElement { impl HTMLUnknownElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLUnknownElement { document: &Document) -> HTMLUnknownElement {
HTMLUnknownElement { HTMLUnknownElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLUnknownElement> { document: &Document) -> Root<HTMLUnknownElement> {
Node::reflect_node(box HTMLUnknownElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLUnknownElement::new_inherited(local_name, prefix, document),
document, document,
HTMLUnknownElementBinding::Wrap) HTMLUnknownElementBinding::Wrap)
} }

View file

@ -16,18 +16,18 @@ pub struct HTMLVideoElement {
} }
impl HTMLVideoElement { impl HTMLVideoElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLVideoElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLVideoElement {
HTMLVideoElement { HTMLVideoElement {
htmlmediaelement: htmlmediaelement:
HTMLMediaElement::new_inherited(localName, prefix, document) HTMLMediaElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLVideoElement> { document: &Document) -> Root<HTMLVideoElement> {
Node::reflect_node(box HTMLVideoElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLVideoElement::new_inherited(local_name, prefix, document),
document, document,
HTMLVideoElementBinding::Wrap) HTMLVideoElementBinding::Wrap)
} }

View file

@ -68,7 +68,7 @@ impl KeyboardEvent {
pub fn new(window: &Window, pub fn new(window: &Window,
type_: DOMString, type_: DOMString,
canBubble: bool, can_bubble: bool,
cancelable: bool, cancelable: bool,
view: Option<&Window>, view: Option<&Window>,
_detail: i32, _detail: i32,
@ -78,26 +78,26 @@ impl KeyboardEvent {
code: DOMString, code: DOMString,
location: u32, location: u32,
repeat: bool, repeat: bool,
isComposing: bool, is_composing: bool,
ctrlKey: bool, ctrl_key: bool,
altKey: bool, alt_key: bool,
shiftKey: bool, shift_key: bool,
metaKey: bool, meta_key: bool,
char_code: Option<u32>, char_code: Option<u32>,
key_code: u32) -> Root<KeyboardEvent> { key_code: u32) -> Root<KeyboardEvent> {
let ev = KeyboardEvent::new_uninitialized(window); let ev = KeyboardEvent::new_uninitialized(window);
ev.InitKeyboardEvent(type_, canBubble, cancelable, view, key_string, location, ev.InitKeyboardEvent(type_, can_bubble, cancelable, view, key_string, location,
DOMString::new(), repeat, DOMString::new()); DOMString::new(), repeat, DOMString::new());
ev.key.set(key); ev.key.set(key);
*ev.code.borrow_mut() = code; *ev.code.borrow_mut() = code;
ev.ctrl.set(ctrlKey); ev.ctrl.set(ctrl_key);
ev.alt.set(altKey); ev.alt.set(alt_key);
ev.shift.set(shiftKey); ev.shift.set(shift_key);
ev.meta.set(metaKey); ev.meta.set(meta_key);
ev.char_code.set(char_code); ev.char_code.set(char_code);
ev.printable.set(ch); ev.printable.set(ch);
ev.key_code.set(key_code); ev.key_code.set(key_code);
ev.is_composing.set(isComposing); ev.is_composing.set(is_composing);
ev ev
} }
@ -759,13 +759,13 @@ impl KeyEventProperties {
impl KeyboardEventMethods for KeyboardEvent { impl KeyboardEventMethods for KeyboardEvent {
// https://w3c.github.io/uievents/#widl-KeyboardEvent-initKeyboardEvent // https://w3c.github.io/uievents/#widl-KeyboardEvent-initKeyboardEvent
fn InitKeyboardEvent(&self, fn InitKeyboardEvent(&self,
typeArg: DOMString, type_arg: DOMString,
canBubbleArg: bool, can_bubble_arg: bool,
cancelableArg: bool, cancelable_arg: bool,
viewArg: Option<&Window>, view_arg: Option<&Window>,
keyArg: DOMString, key_arg: DOMString,
locationArg: u32, location_arg: u32,
_modifiersListArg: DOMString, _modifiers_list_arg: DOMString,
repeat: bool, repeat: bool,
_locale: DOMString) { _locale: DOMString) {
if self.upcast::<Event>().dispatching() { if self.upcast::<Event>().dispatching() {
@ -773,9 +773,9 @@ impl KeyboardEventMethods for KeyboardEvent {
} }
self.upcast::<UIEvent>() self.upcast::<UIEvent>()
.InitUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, 0); .InitUIEvent(type_arg, can_bubble_arg, cancelable_arg, view_arg, 0);
*self.key_string.borrow_mut() = keyArg; *self.key_string.borrow_mut() = key_arg;
self.location.set(locationArg); self.location.set(location_arg);
self.repeat.set(repeat); self.repeat.set(repeat);
} }
@ -825,8 +825,8 @@ impl KeyboardEventMethods for KeyboardEvent {
} }
// https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate // https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
fn GetModifierState(&self, keyArg: DOMString) -> bool { fn GetModifierState(&self, key_arg: DOMString) -> bool {
match &*keyArg { match &*key_arg {
"Ctrl" => self.CtrlKey(), "Ctrl" => self.CtrlKey(),
"Alt" => self.AltKey(), "Alt" => self.AltKey(),
"Shift" => self.ShiftKey(), "Shift" => self.ShiftKey(),

View file

@ -62,7 +62,7 @@ impl LocationMethods for Location {
// https://html.spec.whatwg.org/multipage/#dom-location-hash // https://html.spec.whatwg.org/multipage/#dom-location-hash
fn Hash(&self) -> USVString { fn Hash(&self) -> USVString {
UrlHelper::Hash(&self.get_url()) UrlHelper::hash(&self.get_url())
} }
// https://html.spec.whatwg.org/multipage/#dom-location-hash // https://html.spec.whatwg.org/multipage/#dom-location-hash
@ -70,37 +70,37 @@ impl LocationMethods for Location {
if value.0.is_empty() { if value.0.is_empty() {
value = USVString("#".to_owned()); value = USVString("#".to_owned());
} }
self.set_url_component(value, UrlHelper::SetHash); self.set_url_component(value, UrlHelper::set_hash);
} }
// https://html.spec.whatwg.org/multipage/#dom-location-host // https://html.spec.whatwg.org/multipage/#dom-location-host
fn Host(&self) -> USVString { fn Host(&self) -> USVString {
UrlHelper::Host(&self.get_url()) UrlHelper::host(&self.get_url())
} }
// https://html.spec.whatwg.org/multipage/#dom-location-host // https://html.spec.whatwg.org/multipage/#dom-location-host
fn SetHost(&self, value: USVString) { fn SetHost(&self, value: USVString) {
self.set_url_component(value, UrlHelper::SetHost); self.set_url_component(value, UrlHelper::set_host);
} }
// https://html.spec.whatwg.org/multipage/#dom-location-origin // https://html.spec.whatwg.org/multipage/#dom-location-origin
fn Origin(&self) -> USVString { fn Origin(&self) -> USVString {
UrlHelper::Origin(&self.get_url()) UrlHelper::origin(&self.get_url())
} }
// https://html.spec.whatwg.org/multipage/#dom-location-hostname // https://html.spec.whatwg.org/multipage/#dom-location-hostname
fn Hostname(&self) -> USVString { fn Hostname(&self) -> USVString {
UrlHelper::Hostname(&self.get_url()) UrlHelper::hostname(&self.get_url())
} }
// https://html.spec.whatwg.org/multipage/#dom-location-hostname // https://html.spec.whatwg.org/multipage/#dom-location-hostname
fn SetHostname(&self, value: USVString) { fn SetHostname(&self, value: USVString) {
self.set_url_component(value, UrlHelper::SetHostname); self.set_url_component(value, UrlHelper::set_hostname);
} }
// https://html.spec.whatwg.org/multipage/#dom-location-href // https://html.spec.whatwg.org/multipage/#dom-location-href
fn Href(&self) -> USVString { fn Href(&self) -> USVString {
UrlHelper::Href(&self.get_url()) UrlHelper::href(&self.get_url())
} }
// https://html.spec.whatwg.org/multipage/#dom-location-href // https://html.spec.whatwg.org/multipage/#dom-location-href
@ -112,32 +112,32 @@ impl LocationMethods for Location {
// https://html.spec.whatwg.org/multipage/#dom-location-pathname // https://html.spec.whatwg.org/multipage/#dom-location-pathname
fn Pathname(&self) -> USVString { fn Pathname(&self) -> USVString {
UrlHelper::Pathname(&self.get_url()) UrlHelper::pathname(&self.get_url())
} }
// https://html.spec.whatwg.org/multipage/#dom-location-pathname // https://html.spec.whatwg.org/multipage/#dom-location-pathname
fn SetPathname(&self, value: USVString) { fn SetPathname(&self, value: USVString) {
self.set_url_component(value, UrlHelper::SetPathname); self.set_url_component(value, UrlHelper::set_pathname);
} }
// https://html.spec.whatwg.org/multipage/#dom-location-port // https://html.spec.whatwg.org/multipage/#dom-location-port
fn Port(&self) -> USVString { fn Port(&self) -> USVString {
UrlHelper::Port(&self.get_url()) UrlHelper::port(&self.get_url())
} }
// https://html.spec.whatwg.org/multipage/#dom-location-port // https://html.spec.whatwg.org/multipage/#dom-location-port
fn SetPort(&self, value: USVString) { fn SetPort(&self, value: USVString) {
self.set_url_component(value, UrlHelper::SetPort); self.set_url_component(value, UrlHelper::set_port);
} }
// https://html.spec.whatwg.org/multipage/#dom-location-protocol // https://html.spec.whatwg.org/multipage/#dom-location-protocol
fn Protocol(&self) -> USVString { fn Protocol(&self) -> USVString {
UrlHelper::Protocol(&self.get_url()) UrlHelper::protocol(&self.get_url())
} }
// https://html.spec.whatwg.org/multipage/#dom-location-protocol // https://html.spec.whatwg.org/multipage/#dom-location-protocol
fn SetProtocol(&self, value: USVString) { fn SetProtocol(&self, value: USVString) {
self.set_url_component(value, UrlHelper::SetProtocol); self.set_url_component(value, UrlHelper::set_protocol);
} }
// https://html.spec.whatwg.org/multipage/#dom-location-href // https://html.spec.whatwg.org/multipage/#dom-location-href
@ -147,11 +147,11 @@ impl LocationMethods for Location {
// https://html.spec.whatwg.org/multipage/#dom-location-search // https://html.spec.whatwg.org/multipage/#dom-location-search
fn Search(&self) -> USVString { fn Search(&self) -> USVString {
UrlHelper::Search(&self.get_url()) UrlHelper::search(&self.get_url())
} }
// https://html.spec.whatwg.org/multipage/#dom-location-search // https://html.spec.whatwg.org/multipage/#dom-location-search
fn SetSearch(&self, value: USVString) { fn SetSearch(&self, value: USVString) {
self.set_url_component(value, UrlHelper::SetSearch); self.set_url_component(value, UrlHelper::set_search);
} }
} }

View file

@ -59,26 +59,26 @@ impl MouseEvent {
pub fn new(window: &Window, pub fn new(window: &Window,
type_: DOMString, type_: DOMString,
canBubble: EventBubbles, can_bubble: EventBubbles,
cancelable: EventCancelable, cancelable: EventCancelable,
view: Option<&Window>, view: Option<&Window>,
detail: i32, detail: i32,
screenX: i32, screen_x: i32,
screenY: i32, screen_y: i32,
clientX: i32, client_x: i32,
clientY: i32, client_y: i32,
ctrlKey: bool, ctrl_key: bool,
altKey: bool, alt_key: bool,
shiftKey: bool, shift_key: bool,
metaKey: bool, meta_key: bool,
button: i16, button: i16,
relatedTarget: Option<&EventTarget>) -> Root<MouseEvent> { related_target: Option<&EventTarget>) -> Root<MouseEvent> {
let ev = MouseEvent::new_uninitialized(window); let ev = MouseEvent::new_uninitialized(window);
ev.InitMouseEvent(type_, bool::from(canBubble), bool::from(cancelable), ev.InitMouseEvent(type_, bool::from(can_bubble), bool::from(cancelable),
view, detail, view, detail,
screenX, screenY, clientX, clientY, screen_x, screen_y, client_x, client_y,
ctrlKey, altKey, shiftKey, metaKey, ctrl_key, alt_key, shift_key, meta_key,
button, relatedTarget); button, related_target);
ev ev
} }
@ -166,37 +166,37 @@ impl MouseEventMethods for MouseEvent {
// https://w3c.github.io/uievents/#widl-MouseEvent-initMouseEvent // https://w3c.github.io/uievents/#widl-MouseEvent-initMouseEvent
fn InitMouseEvent(&self, fn InitMouseEvent(&self,
typeArg: DOMString, type_arg: DOMString,
canBubbleArg: bool, can_bubble_arg: bool,
cancelableArg: bool, cancelable_arg: bool,
viewArg: Option<&Window>, view_arg: Option<&Window>,
detailArg: i32, detail_arg: i32,
screenXArg: i32, screen_x_arg: i32,
screenYArg: i32, screen_y_arg: i32,
clientXArg: i32, client_x_arg: i32,
clientYArg: i32, client_y_arg: i32,
ctrlKeyArg: bool, ctrl_key_arg: bool,
altKeyArg: bool, alt_key_arg: bool,
shiftKeyArg: bool, shift_key_arg: bool,
metaKeyArg: bool, meta_key_arg: bool,
buttonArg: i16, button_arg: i16,
relatedTargetArg: Option<&EventTarget>) { related_target_arg: Option<&EventTarget>) {
if self.upcast::<Event>().dispatching() { if self.upcast::<Event>().dispatching() {
return; return;
} }
self.upcast::<UIEvent>() self.upcast::<UIEvent>()
.InitUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg); .InitUIEvent(type_arg, can_bubble_arg, cancelable_arg, view_arg, detail_arg);
self.screen_x.set(screenXArg); self.screen_x.set(screen_x_arg);
self.screen_y.set(screenYArg); self.screen_y.set(screen_y_arg);
self.client_x.set(clientXArg); self.client_x.set(client_x_arg);
self.client_y.set(clientYArg); self.client_y.set(client_y_arg);
self.ctrl_key.set(ctrlKeyArg); self.ctrl_key.set(ctrl_key_arg);
self.alt_key.set(altKeyArg); self.alt_key.set(alt_key_arg);
self.shift_key.set(shiftKeyArg); self.shift_key.set(shift_key_arg);
self.meta_key.set(metaKeyArg); self.meta_key.set(meta_key_arg);
self.button.set(buttonArg); self.button.set(button_arg);
self.related_target.set(relatedTargetArg); self.related_target.set(related_target_arg);
} }
// https://dom.spec.whatwg.org/#dom-event-istrusted // https://dom.spec.whatwg.org/#dom-event-istrusted

View file

@ -21,7 +21,7 @@ pub struct Navigator {
bluetooth: MutNullableHeap<JS<Bluetooth>>, bluetooth: MutNullableHeap<JS<Bluetooth>>,
plugins: MutNullableHeap<JS<PluginArray>>, plugins: MutNullableHeap<JS<PluginArray>>,
mime_types: MutNullableHeap<JS<MimeTypeArray>>, mime_types: MutNullableHeap<JS<MimeTypeArray>>,
serviceWorker: MutNullableHeap<JS<ServiceWorkerContainer>>, service_worker: MutNullableHeap<JS<ServiceWorkerContainer>>,
} }
impl Navigator { impl Navigator {
@ -31,7 +31,7 @@ impl Navigator {
bluetooth: Default::default(), bluetooth: Default::default(),
plugins: Default::default(), plugins: Default::default(),
mime_types: Default::default(), mime_types: Default::default(),
serviceWorker: Default::default(), service_worker: Default::default(),
} }
} }
@ -105,7 +105,7 @@ impl NavigatorMethods for Navigator {
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#navigator-service-worker-attribute // https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#navigator-service-worker-attribute
fn ServiceWorker(&self) -> Root<ServiceWorkerContainer> { fn ServiceWorker(&self) -> Root<ServiceWorkerContainer> {
self.serviceWorker.or_init(|| ServiceWorkerContainer::new(self.global().r())) self.service_worker.or_init(|| ServiceWorkerContainer::new(self.global().r()))
} }
// https://html.spec.whatwg.org/multipage/#dom-navigator-cookieenabled // https://html.spec.whatwg.org/multipage/#dom-navigator-cookieenabled

View file

@ -796,10 +796,10 @@ impl Node {
} }
pub fn summarize(&self) -> NodeInfo { pub fn summarize(&self) -> NodeInfo {
let USVString(baseURI) = self.BaseURI(); let USVString(base_uri) = self.BaseURI();
NodeInfo { NodeInfo {
uniqueId: self.unique_id(), uniqueId: self.unique_id(),
baseURI: baseURI, baseURI: base_uri,
parent: self.GetParentNode().map_or("".to_owned(), |node| node.unique_id()), parent: self.GetParentNode().map_or("".to_owned(), |node| node.unique_id()),
nodeType: self.NodeType(), nodeType: self.NodeType(),
namespaceURI: String::new(), //FIXME namespaceURI: String::new(), //FIXME
@ -2296,8 +2296,8 @@ impl NodeMethods for Node {
} }
// https://dom.spec.whatwg.org/#dom-node-issamenode // https://dom.spec.whatwg.org/#dom-node-issamenode
fn IsSameNode(&self, otherNode: Option<&Node>) -> bool { fn IsSameNode(&self, other_node: Option<&Node>) -> bool {
match otherNode { match other_node {
Some(node) => self == node, Some(node) => self == node,
None => false, None => false,
} }

View file

@ -51,8 +51,8 @@ impl PerformanceMethods for Performance {
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#dom-performance-now // https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#dom-performance-now
fn Now(&self) -> DOMHighResTimeStamp { fn Now(&self) -> DOMHighResTimeStamp {
let navStart = self.timing.NavigationStartPrecise(); let nav_start = self.timing.navigation_start_precise();
let now = (time::precise_time_ns() as f64 - navStart) / 1000000 as f64; let now = (time::precise_time_ns() as f64 - nav_start) / 1000000 as f64;
Finite::wrap(now) Finite::wrap(now)
} }
} }

View file

@ -14,20 +14,20 @@ use dom::window::Window;
#[dom_struct] #[dom_struct]
pub struct PerformanceTiming { pub struct PerformanceTiming {
reflector_: Reflector, reflector_: Reflector,
navigationStart: u64, navigation_start: u64,
navigationStartPrecise: f64, navigation_start_precise: f64,
document: JS<Document>, document: JS<Document>,
} }
impl PerformanceTiming { impl PerformanceTiming {
fn new_inherited(navStart: u64, fn new_inherited(nav_start: u64,
navStartPrecise: f64, nav_start_precise: f64,
document: &Document) document: &Document)
-> PerformanceTiming { -> PerformanceTiming {
PerformanceTiming { PerformanceTiming {
reflector_: Reflector::new(), reflector_: Reflector::new(),
navigationStart: navStart, navigation_start: nav_start,
navigationStartPrecise: navStartPrecise, navigation_start_precise: nav_start_precise,
document: JS::from_ref(document), document: JS::from_ref(document),
} }
} }
@ -48,7 +48,7 @@ impl PerformanceTiming {
impl PerformanceTimingMethods for PerformanceTiming { impl PerformanceTimingMethods for PerformanceTiming {
// https://w3c.github.io/navigation-timing/#widl-PerformanceTiming-navigationStart // https://w3c.github.io/navigation-timing/#widl-PerformanceTiming-navigationStart
fn NavigationStart(&self) -> u64 { fn NavigationStart(&self) -> u64 {
self.navigationStart self.navigation_start
} }
// https://w3c.github.io/navigation-timing/#widl-PerformanceTiming-domLoading // https://w3c.github.io/navigation-timing/#widl-PerformanceTiming-domLoading
@ -89,7 +89,7 @@ impl PerformanceTimingMethods for PerformanceTiming {
impl PerformanceTiming { impl PerformanceTiming {
pub fn NavigationStartPrecise(&self) -> f64 { pub fn navigation_start_precise(&self) -> f64 {
self.navigationStartPrecise self.navigation_start_precise
} }
} }

View file

@ -203,7 +203,7 @@ impl Runnable for StorageEventRunnable {
for it_context in root_context.iter() { for it_context in root_context.iter() {
let it_window_root = it_context.active_window(); let it_window_root = it_context.active_window();
let it_window = it_window_root.r(); let it_window = it_window_root.r();
assert!(UrlHelper::SameOrigin(&ev_url, &it_window.get_url())); assert!(UrlHelper::same_origin(&ev_url, &it_window.get_url()));
// TODO: Such a Document object is not necessarily fully active, but events fired on such // TODO: Such a Document object is not necessarily fully active, but events fired on such
// objects are ignored by the event loop until the Document becomes fully active again. // objects are ignored by the event loop until the Document becomes fully active again.
if ev_window.pipeline_id() != it_window.pipeline_id() { if ev_window.pipeline_id() != it_window.pipeline_id() {

View file

@ -20,26 +20,26 @@ use string_cache::Atom;
pub struct StorageEvent { pub struct StorageEvent {
event: Event, event: Event,
key: Option<DOMString>, key: Option<DOMString>,
oldValue: Option<DOMString>, old_value: Option<DOMString>,
newValue: Option<DOMString>, new_value: Option<DOMString>,
url: DOMString, url: DOMString,
storageArea: MutNullableHeap<JS<Storage>> storage_area: MutNullableHeap<JS<Storage>>
} }
impl StorageEvent { impl StorageEvent {
pub fn new_inherited(key: Option<DOMString>, pub fn new_inherited(key: Option<DOMString>,
oldValue: Option<DOMString>, old_value: Option<DOMString>,
newValue: Option<DOMString>, new_value: Option<DOMString>,
url: DOMString, url: DOMString,
storageArea: Option<&Storage>) -> StorageEvent { storage_area: Option<&Storage>) -> StorageEvent {
StorageEvent { StorageEvent {
event: Event::new_inherited(), event: Event::new_inherited(),
key: key, key: key,
oldValue: oldValue, old_value: old_value,
newValue: newValue, new_value: new_value,
url: url, url: url,
storageArea: MutNullableHeap::new(storageArea) storage_area: MutNullableHeap::new(storage_area)
} }
} }
@ -96,12 +96,12 @@ impl StorageEventMethods for StorageEvent {
// https://html.spec.whatwg.org/multipage/#dom-storageevent-oldvalue // https://html.spec.whatwg.org/multipage/#dom-storageevent-oldvalue
fn GetOldValue(&self) -> Option<DOMString> { fn GetOldValue(&self) -> Option<DOMString> {
self.oldValue.clone() self.old_value.clone()
} }
// https://html.spec.whatwg.org/multipage/#dom-storageevent-newvalue // https://html.spec.whatwg.org/multipage/#dom-storageevent-newvalue
fn GetNewValue(&self) -> Option<DOMString> { fn GetNewValue(&self) -> Option<DOMString> {
self.newValue.clone() self.new_value.clone()
} }
// https://html.spec.whatwg.org/multipage/#dom-storageevent-url // https://html.spec.whatwg.org/multipage/#dom-storageevent-url
@ -111,7 +111,7 @@ impl StorageEventMethods for StorageEvent {
// https://html.spec.whatwg.org/multipage/#dom-storageevent-storagearea // https://html.spec.whatwg.org/multipage/#dom-storageevent-storagearea
fn GetStorageArea(&self) -> Option<Root<Storage>> { fn GetStorageArea(&self) -> Option<Root<Storage>> {
self.storageArea.get() self.storage_area.get()
} }
// https://dom.spec.whatwg.org/#dom-event-istrusted // https://dom.spec.whatwg.org/#dom-event-istrusted

View file

@ -55,7 +55,7 @@ impl TouchEvent {
pub fn new(window: &Window, pub fn new(window: &Window,
type_: DOMString, type_: DOMString,
canBubble: EventBubbles, can_bubble: EventBubbles,
cancelable: EventCancelable, cancelable: EventCancelable,
view: Option<&Window>, view: Option<&Window>,
detail: i32, detail: i32,
@ -68,7 +68,7 @@ impl TouchEvent {
meta_key: bool) -> Root<TouchEvent> { meta_key: bool) -> Root<TouchEvent> {
let ev = TouchEvent::new_uninitialized(window, touches, changed_touches, target_touches); let ev = TouchEvent::new_uninitialized(window, touches, changed_touches, target_touches);
ev.upcast::<UIEvent>().InitUIEvent(type_, ev.upcast::<UIEvent>().InitUIEvent(type_,
bool::from(canBubble), bool::from(can_bubble),
bool::from(cancelable), bool::from(cancelable),
view, detail); view, detail);
ev.ctrl_key.set(ctrl_key); ev.ctrl_key.set(ctrl_key);

View file

@ -176,37 +176,37 @@ impl URL {
impl URLMethods for URL { impl URLMethods for URL {
// https://url.spec.whatwg.org/#dom-url-hash // https://url.spec.whatwg.org/#dom-url-hash
fn Hash(&self) -> USVString { fn Hash(&self) -> USVString {
UrlHelper::Hash(&self.url.borrow()) UrlHelper::hash(&self.url.borrow())
} }
// https://url.spec.whatwg.org/#dom-url-hash // https://url.spec.whatwg.org/#dom-url-hash
fn SetHash(&self, value: USVString) { fn SetHash(&self, value: USVString) {
UrlHelper::SetHash(&mut self.url.borrow_mut(), value); UrlHelper::set_hash(&mut self.url.borrow_mut(), value);
} }
// https://url.spec.whatwg.org/#dom-url-host // https://url.spec.whatwg.org/#dom-url-host
fn Host(&self) -> USVString { fn Host(&self) -> USVString {
UrlHelper::Host(&self.url.borrow()) UrlHelper::host(&self.url.borrow())
} }
// https://url.spec.whatwg.org/#dom-url-host // https://url.spec.whatwg.org/#dom-url-host
fn SetHost(&self, value: USVString) { fn SetHost(&self, value: USVString) {
UrlHelper::SetHost(&mut self.url.borrow_mut(), value); UrlHelper::set_host(&mut self.url.borrow_mut(), value);
} }
// https://url.spec.whatwg.org/#dom-url-hostname // https://url.spec.whatwg.org/#dom-url-hostname
fn Hostname(&self) -> USVString { fn Hostname(&self) -> USVString {
UrlHelper::Hostname(&self.url.borrow()) UrlHelper::hostname(&self.url.borrow())
} }
// https://url.spec.whatwg.org/#dom-url-hostname // https://url.spec.whatwg.org/#dom-url-hostname
fn SetHostname(&self, value: USVString) { fn SetHostname(&self, value: USVString) {
UrlHelper::SetHostname(&mut self.url.borrow_mut(), value); UrlHelper::set_hostname(&mut self.url.borrow_mut(), value);
} }
// https://url.spec.whatwg.org/#dom-url-href // https://url.spec.whatwg.org/#dom-url-href
fn Href(&self) -> USVString { fn Href(&self) -> USVString {
UrlHelper::Href(&self.url.borrow()) UrlHelper::href(&self.url.borrow())
} }
// https://url.spec.whatwg.org/#dom-url-href // https://url.spec.whatwg.org/#dom-url-href
@ -225,57 +225,57 @@ impl URLMethods for URL {
// https://url.spec.whatwg.org/#dom-url-password // https://url.spec.whatwg.org/#dom-url-password
fn Password(&self) -> USVString { fn Password(&self) -> USVString {
UrlHelper::Password(&self.url.borrow()) UrlHelper::password(&self.url.borrow())
} }
// https://url.spec.whatwg.org/#dom-url-password // https://url.spec.whatwg.org/#dom-url-password
fn SetPassword(&self, value: USVString) { fn SetPassword(&self, value: USVString) {
UrlHelper::SetPassword(&mut self.url.borrow_mut(), value); UrlHelper::set_password(&mut self.url.borrow_mut(), value);
} }
// https://url.spec.whatwg.org/#dom-url-pathname // https://url.spec.whatwg.org/#dom-url-pathname
fn Pathname(&self) -> USVString { fn Pathname(&self) -> USVString {
UrlHelper::Pathname(&self.url.borrow()) UrlHelper::pathname(&self.url.borrow())
} }
// https://url.spec.whatwg.org/#dom-url-pathname // https://url.spec.whatwg.org/#dom-url-pathname
fn SetPathname(&self, value: USVString) { fn SetPathname(&self, value: USVString) {
UrlHelper::SetPathname(&mut self.url.borrow_mut(), value); UrlHelper::set_pathname(&mut self.url.borrow_mut(), value);
} }
// https://url.spec.whatwg.org/#dom-url-port // https://url.spec.whatwg.org/#dom-url-port
fn Port(&self) -> USVString { fn Port(&self) -> USVString {
UrlHelper::Port(&self.url.borrow()) UrlHelper::port(&self.url.borrow())
} }
// https://url.spec.whatwg.org/#dom-url-port // https://url.spec.whatwg.org/#dom-url-port
fn SetPort(&self, value: USVString) { fn SetPort(&self, value: USVString) {
UrlHelper::SetPort(&mut self.url.borrow_mut(), value); UrlHelper::set_port(&mut self.url.borrow_mut(), value);
} }
// https://url.spec.whatwg.org/#dom-url-protocol // https://url.spec.whatwg.org/#dom-url-protocol
fn Protocol(&self) -> USVString { fn Protocol(&self) -> USVString {
UrlHelper::Protocol(&self.url.borrow()) UrlHelper::protocol(&self.url.borrow())
} }
// https://url.spec.whatwg.org/#dom-url-protocol // https://url.spec.whatwg.org/#dom-url-protocol
fn SetProtocol(&self, value: USVString) { fn SetProtocol(&self, value: USVString) {
UrlHelper::SetProtocol(&mut self.url.borrow_mut(), value); UrlHelper::set_protocol(&mut self.url.borrow_mut(), value);
} }
// https://url.spec.whatwg.org/#dom-url-origin // https://url.spec.whatwg.org/#dom-url-origin
fn Origin(&self) -> USVString { fn Origin(&self) -> USVString {
UrlHelper::Origin(&self.url.borrow()) UrlHelper::origin(&self.url.borrow())
} }
// https://url.spec.whatwg.org/#dom-url-search // https://url.spec.whatwg.org/#dom-url-search
fn Search(&self) -> USVString { fn Search(&self) -> USVString {
UrlHelper::Search(&self.url.borrow()) UrlHelper::search(&self.url.borrow())
} }
// https://url.spec.whatwg.org/#dom-url-search // https://url.spec.whatwg.org/#dom-url-search
fn SetSearch(&self, value: USVString) { fn SetSearch(&self, value: USVString) {
UrlHelper::SetSearch(&mut self.url.borrow_mut(), value); UrlHelper::set_search(&mut self.url.borrow_mut(), value);
if let Some(search_params) = self.search_params.get() { if let Some(search_params) = self.search_params.get() {
search_params.set_list(self.url.borrow().query_pairs().into_owned().collect()); search_params.set_list(self.url.borrow().query_pairs().into_owned().collect());
} }
@ -293,11 +293,11 @@ impl URLMethods for URL {
// https://url.spec.whatwg.org/#dom-url-username // https://url.spec.whatwg.org/#dom-url-username
fn Username(&self) -> USVString { fn Username(&self) -> USVString {
UrlHelper::Username(&self.url.borrow()) UrlHelper::username(&self.url.borrow())
} }
// https://url.spec.whatwg.org/#dom-url-username // https://url.spec.whatwg.org/#dom-url-username
fn SetUsername(&self, value: USVString) { fn SetUsername(&self, value: USVString) {
UrlHelper::SetUsername(&mut self.url.borrow_mut(), value); UrlHelper::set_username(&mut self.url.borrow_mut(), value);
} }
} }

View file

@ -10,25 +10,25 @@ use url::{Url, quirks};
pub struct UrlHelper; pub struct UrlHelper;
impl UrlHelper { impl UrlHelper {
pub fn SameOrigin(urlA: &Url, urlB: &Url) -> bool { urlA.origin() == urlB.origin() } pub fn same_origin(url_a: &Url, url_b: &Url) -> bool { url_a.origin() == url_b.origin() }
pub fn Origin(url: &Url) -> USVString { USVString(quirks::origin(url)) } pub fn origin(url: &Url) -> USVString { USVString(quirks::origin(url)) }
pub fn Href(url: &Url) -> USVString { USVString(quirks::href(url).to_owned()) } pub fn href(url: &Url) -> USVString { USVString(quirks::href(url).to_owned()) }
pub fn Hash(url: &Url) -> USVString { USVString(quirks::hash(url).to_owned()) } pub fn hash(url: &Url) -> USVString { USVString(quirks::hash(url).to_owned()) }
pub fn Host(url: &Url) -> USVString { USVString(quirks::host(url).to_owned()) } pub fn host(url: &Url) -> USVString { USVString(quirks::host(url).to_owned()) }
pub fn Port(url: &Url) -> USVString { USVString(quirks::port(url).to_owned()) } pub fn port(url: &Url) -> USVString { USVString(quirks::port(url).to_owned()) }
pub fn Search(url: &Url) -> USVString { USVString(quirks::search(url).to_owned()) } pub fn search(url: &Url) -> USVString { USVString(quirks::search(url).to_owned()) }
pub fn Hostname(url: &Url) -> USVString { USVString(quirks::hostname(url).to_owned()) } pub fn hostname(url: &Url) -> USVString { USVString(quirks::hostname(url).to_owned()) }
pub fn Password(url: &Url) -> USVString { USVString(quirks::password(url).to_owned()) } pub fn password(url: &Url) -> USVString { USVString(quirks::password(url).to_owned()) }
pub fn Pathname(url: &Url) -> USVString { USVString(quirks::pathname(url).to_owned()) } pub fn pathname(url: &Url) -> USVString { USVString(quirks::pathname(url).to_owned()) }
pub fn Protocol(url: &Url) -> USVString { USVString(quirks::protocol(url).to_owned()) } pub fn protocol(url: &Url) -> USVString { USVString(quirks::protocol(url).to_owned()) }
pub fn Username(url: &Url) -> USVString { USVString(quirks::username(url).to_owned()) } pub fn username(url: &Url) -> USVString { USVString(quirks::username(url).to_owned()) }
pub fn SetHash(url: &mut Url, value: USVString) { quirks::set_hash(url, &value.0) } pub fn set_hash(url: &mut Url, value: USVString) { quirks::set_hash(url, &value.0) }
pub fn SetHost(url: &mut Url, value: USVString) { let _ = quirks::set_host(url, &value.0); } pub fn set_host(url: &mut Url, value: USVString) { let _ = quirks::set_host(url, &value.0); }
pub fn SetPort(url: &mut Url, value: USVString) { let _ = quirks::set_port(url, &value.0); } pub fn set_port(url: &mut Url, value: USVString) { let _ = quirks::set_port(url, &value.0); }
pub fn SetSearch(url: &mut Url, value: USVString) { quirks::set_search(url, &value.0) } pub fn set_search(url: &mut Url, value: USVString) { quirks::set_search(url, &value.0) }
pub fn SetPathname(url: &mut Url, value: USVString) { quirks::set_pathname(url, &value.0) } pub fn set_pathname(url: &mut Url, value: USVString) { quirks::set_pathname(url, &value.0) }
pub fn SetHostname(url: &mut Url, value: USVString) { let _ = quirks::set_hostname(url, &value.0); } pub fn set_hostname(url: &mut Url, value: USVString) { let _ = quirks::set_hostname(url, &value.0); }
pub fn SetPassword(url: &mut Url, value: USVString) { let _ = quirks::set_password(url, &value.0); } pub fn set_password(url: &mut Url, value: USVString) { let _ = quirks::set_password(url, &value.0); }
pub fn SetProtocol(url: &mut Url, value: USVString) { let _ = quirks::set_protocol(url, &value.0); } pub fn set_protocol(url: &mut Url, value: USVString) { let _ = quirks::set_protocol(url, &value.0); }
pub fn SetUsername(url: &mut Url, value: USVString) { let _ = quirks::set_username(url, &value.0); } pub fn set_username(url: &mut Url, value: USVString) { let _ = quirks::set_username(url, &value.0); }
} }

View file

@ -238,7 +238,7 @@ impl WebSocket {
} }
// Step 6: Origin. // Step 6: Origin.
let origin = UrlHelper::Origin(&global.get_url()).0; let origin = UrlHelper::origin(&global.get_url()).0;
// Step 7. // Step 7.
let ws = WebSocket::new(global, resource_url.clone()); let ws = WebSocket::new(global, resource_url.clone());

View file

@ -1536,7 +1536,7 @@ impl Window {
} }
// https://html.spec.whatwg.org/multipage/#accessing-other-browsing-contexts // https://html.spec.whatwg.org/multipage/#accessing-other-browsing-contexts
pub fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Option<Root<Window>> { pub fn indexed_getter(&self, _index: u32, _found: &mut bool) -> Option<Root<Window>> {
None None
} }

View file

@ -37,42 +37,42 @@ impl WorkerLocation {
impl WorkerLocationMethods for WorkerLocation { impl WorkerLocationMethods for WorkerLocation {
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-hash // https://html.spec.whatwg.org/multipage/#dom-workerlocation-hash
fn Hash(&self) -> USVString { fn Hash(&self) -> USVString {
UrlHelper::Hash(&self.url) UrlHelper::hash(&self.url)
} }
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-host // https://html.spec.whatwg.org/multipage/#dom-workerlocation-host
fn Host(&self) -> USVString { fn Host(&self) -> USVString {
UrlHelper::Host(&self.url) UrlHelper::host(&self.url)
} }
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-hostname // https://html.spec.whatwg.org/multipage/#dom-workerlocation-hostname
fn Hostname(&self) -> USVString { fn Hostname(&self) -> USVString {
UrlHelper::Hostname(&self.url) UrlHelper::hostname(&self.url)
} }
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-href // https://html.spec.whatwg.org/multipage/#dom-workerlocation-href
fn Href(&self) -> USVString { fn Href(&self) -> USVString {
UrlHelper::Href(&self.url) UrlHelper::href(&self.url)
} }
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-pathname // https://html.spec.whatwg.org/multipage/#dom-workerlocation-pathname
fn Pathname(&self) -> USVString { fn Pathname(&self) -> USVString {
UrlHelper::Pathname(&self.url) UrlHelper::pathname(&self.url)
} }
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-port // https://html.spec.whatwg.org/multipage/#dom-workerlocation-port
fn Port(&self) -> USVString { fn Port(&self) -> USVString {
UrlHelper::Port(&self.url) UrlHelper::port(&self.url)
} }
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-protocol // https://html.spec.whatwg.org/multipage/#dom-workerlocation-protocol
fn Protocol(&self) -> USVString { fn Protocol(&self) -> USVString {
UrlHelper::Protocol(&self.url) UrlHelper::protocol(&self.url)
} }
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-search // https://html.spec.whatwg.org/multipage/#dom-workerlocation-search
fn Search(&self) -> USVString { fn Search(&self) -> USVString {
UrlHelper::Search(&self.url) UrlHelper::search(&self.url)
} }
// https://html.spec.whatwg.org/multipage/#dom-workerlocation-href // https://html.spec.whatwg.org/multipage/#dom-workerlocation-href

View file

@ -370,11 +370,11 @@ unsafe extern "C" fn gc_slice_callback(_rt: *mut JSRuntime, progress: GCProgress
}; };
if !desc.is_null() { if !desc.is_null() {
let desc: &GCDescription = &*desc; let desc: &GCDescription = &*desc;
let invocationKind = match desc.invocationKind_ { let invocation_kind = match desc.invocationKind_ {
JSGCInvocationKind::GC_NORMAL => "GC_NORMAL", JSGCInvocationKind::GC_NORMAL => "GC_NORMAL",
JSGCInvocationKind::GC_SHRINK => "GC_SHRINK", JSGCInvocationKind::GC_SHRINK => "GC_SHRINK",
}; };
println!(" isCompartment={}, invocationKind={}", desc.isCompartment_, invocationKind); println!(" isCompartment={}, invocation_kind={}", desc.isCompartment_, invocation_kind);
} }
let _ = stdout().flush(); let _ = stdout().flush();
} }