From 77170a14bc05fdf2ee420fd94fd661f19318ee64 Mon Sep 17 00:00:00 2001 From: Arthur Marble Date: Sat, 17 Sep 2016 01:10:12 -0500 Subject: [PATCH 01/13] This commit refactors ctrlKey to ctrl_key wherever possible. --- components/script/dom/activation.rs | 4 ++-- components/script/dom/htmlanchorelement.rs | 2 +- components/script/dom/htmlbuttonelement.rs | 4 ++-- components/script/dom/htmlinputelement.rs | 4 ++-- components/script/dom/htmllabelelement.rs | 2 +- components/script/dom/touchevent.rs | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/script/dom/activation.rs b/components/script/dom/activation.rs index 5c59393f766..221aa8657eb 100644 --- a/components/script/dom/activation.rs +++ b/components/script/dom/activation.rs @@ -62,7 +62,7 @@ pub enum ActivationSource { // https://html.spec.whatwg.org/multipage/#run-synthetic-click-activation-steps pub fn synthetic_click_activation(element: &Element, - ctrlKey: bool, + ctrl_key: bool, shiftKey: bool, altKey: bool, metaKey: bool, @@ -93,7 +93,7 @@ pub fn synthetic_click_activation(element: &Element, 0, 0, 0, - ctrlKey, + ctrl_key, shiftKey, altKey, metaKey, diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index e9df2b6c999..2743258cc98 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -540,7 +540,7 @@ impl Activatable for HTMLAnchorElement { } //TODO:https://html.spec.whatwg.org/multipage/#the-a-element - fn implicit_submission(&self, _ctrlKey: bool, _shiftKey: bool, _altKey: bool, _metaKey: bool) { + fn implicit_submission(&self, _ctrl_key: bool, _shiftKey: bool, _altKey: bool, _metaKey: bool) { } } diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs index af95ec404b9..e5f86d585ab 100644 --- a/components/script/dom/htmlbuttonelement.rs +++ b/components/script/dom/htmlbuttonelement.rs @@ -283,7 +283,7 @@ impl Activatable for HTMLButtonElement { // https://html.spec.whatwg.org/multipage/#implicit-submission #[allow(unsafe_code)] - fn implicit_submission(&self, ctrlKey: bool, shiftKey: bool, altKey: bool, metaKey: bool) { + fn implicit_submission(&self, ctrl_key: bool, shiftKey: bool, altKey: bool, metaKey: bool) { let doc = document_from_node(self); let node = doc.upcast::(); let owner = self.form_owner(); @@ -294,7 +294,7 @@ impl Activatable for HTMLButtonElement { .filter_map(Root::downcast::) .find(|r| r.form_owner() == owner) .map(|s| synthetic_click_activation(s.r().as_element(), - ctrlKey, + ctrl_key, shiftKey, altKey, metaKey, diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 978d93f6138..46fc0724b31 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -1275,7 +1275,7 @@ impl Activatable for HTMLInputElement { // https://html.spec.whatwg.org/multipage/#implicit-submission #[allow(unsafe_code)] - fn implicit_submission(&self, ctrlKey: bool, shiftKey: bool, altKey: bool, metaKey: bool) { + fn implicit_submission(&self, ctrl_key: bool, shiftKey: bool, altKey: bool, metaKey: bool) { let doc = document_from_node(self); let node = doc.upcast::(); let owner = self.form_owner(); @@ -1295,7 +1295,7 @@ impl Activatable for HTMLInputElement { Some(ref button) => { if button.is_instance_activatable() { synthetic_click_activation(button.as_element(), - ctrlKey, + ctrl_key, shiftKey, altKey, metaKey, diff --git a/components/script/dom/htmllabelelement.rs b/components/script/dom/htmllabelelement.rs index af3b51609a3..8accafc2da1 100644 --- a/components/script/dom/htmllabelelement.rs +++ b/components/script/dom/htmllabelelement.rs @@ -76,7 +76,7 @@ impl Activatable for HTMLLabelElement { } // https://html.spec.whatwg.org/multipage/#implicit-submission - fn implicit_submission(&self, _ctrlKey: bool, _shiftKey: bool, _altKey: bool, _metaKey: bool) { + fn implicit_submission(&self, _ctrl_key: bool, _shiftKey: bool, _altKey: bool, _metaKey: bool) { //FIXME: Investigate and implement implicit submission for label elements // Issue filed at https://github.com/servo/servo/issues/8263 } diff --git a/components/script/dom/touchevent.rs b/components/script/dom/touchevent.rs index 4f0822fddaf..5623a8bf572 100644 --- a/components/script/dom/touchevent.rs +++ b/components/script/dom/touchevent.rs @@ -62,7 +62,7 @@ impl TouchEvent { touches: &TouchList, changed_touches: &TouchList, target_touches: &TouchList, - ctrlKey: bool, + ctrl_key: bool, altKey: bool, shiftKey: bool, metaKey: bool) -> Root { @@ -71,7 +71,7 @@ impl TouchEvent { bool::from(canBubble), bool::from(cancelable), view, detail); - ev.ctrl_key.set(ctrlKey); + ev.ctrl_key.set(ctrl_key); ev.alt_key.set(altKey); ev.shift_key.set(shiftKey); ev.meta_key.set(metaKey); From fd0622a74195092b8873f497727bc654c40729be Mon Sep 17 00:00:00 2001 From: Arthur Marble Date: Sat, 17 Sep 2016 01:20:51 -0500 Subject: [PATCH 02/13] This commit refactors shiftKey to shift_key where possible. --- components/script/dom/activation.rs | 4 ++-- components/script/dom/htmlanchorelement.rs | 2 +- components/script/dom/htmlbuttonelement.rs | 4 ++-- components/script/dom/htmlinputelement.rs | 4 ++-- components/script/dom/htmllabelelement.rs | 2 +- components/script/dom/touchevent.rs | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/script/dom/activation.rs b/components/script/dom/activation.rs index 221aa8657eb..3f6b9890e4b 100644 --- a/components/script/dom/activation.rs +++ b/components/script/dom/activation.rs @@ -63,7 +63,7 @@ pub enum ActivationSource { // https://html.spec.whatwg.org/multipage/#run-synthetic-click-activation-steps pub fn synthetic_click_activation(element: &Element, ctrl_key: bool, - shiftKey: bool, + shift_key: bool, altKey: bool, metaKey: bool, source: ActivationSource) { @@ -94,7 +94,7 @@ pub fn synthetic_click_activation(element: &Element, 0, 0, ctrl_key, - shiftKey, + shift_key, altKey, metaKey, 0, diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index 2743258cc98..9321764fece 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -540,7 +540,7 @@ impl Activatable for HTMLAnchorElement { } //TODO:https://html.spec.whatwg.org/multipage/#the-a-element - fn implicit_submission(&self, _ctrl_key: bool, _shiftKey: bool, _altKey: bool, _metaKey: bool) { + fn implicit_submission(&self, _ctrl_key: bool, _shift_key: bool, _altKey: bool, _metaKey: bool) { } } diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs index e5f86d585ab..4bf1b9a16b5 100644 --- a/components/script/dom/htmlbuttonelement.rs +++ b/components/script/dom/htmlbuttonelement.rs @@ -283,7 +283,7 @@ impl Activatable for HTMLButtonElement { // https://html.spec.whatwg.org/multipage/#implicit-submission #[allow(unsafe_code)] - fn implicit_submission(&self, ctrl_key: bool, shiftKey: bool, altKey: bool, metaKey: bool) { + fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, altKey: bool, metaKey: bool) { let doc = document_from_node(self); let node = doc.upcast::(); let owner = self.form_owner(); @@ -295,7 +295,7 @@ impl Activatable for HTMLButtonElement { .find(|r| r.form_owner() == owner) .map(|s| synthetic_click_activation(s.r().as_element(), ctrl_key, - shiftKey, + shift_key, altKey, metaKey, ActivationSource::NotFromClick)); diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 46fc0724b31..a9f99ec20e1 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -1275,7 +1275,7 @@ impl Activatable for HTMLInputElement { // https://html.spec.whatwg.org/multipage/#implicit-submission #[allow(unsafe_code)] - fn implicit_submission(&self, ctrl_key: bool, shiftKey: bool, altKey: bool, metaKey: bool) { + fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, altKey: bool, metaKey: bool) { let doc = document_from_node(self); let node = doc.upcast::(); let owner = self.form_owner(); @@ -1296,7 +1296,7 @@ impl Activatable for HTMLInputElement { if button.is_instance_activatable() { synthetic_click_activation(button.as_element(), ctrl_key, - shiftKey, + shift_key, altKey, metaKey, ActivationSource::NotFromClick) diff --git a/components/script/dom/htmllabelelement.rs b/components/script/dom/htmllabelelement.rs index 8accafc2da1..b1a4e1dfe5b 100644 --- a/components/script/dom/htmllabelelement.rs +++ b/components/script/dom/htmllabelelement.rs @@ -76,7 +76,7 @@ impl Activatable for HTMLLabelElement { } // https://html.spec.whatwg.org/multipage/#implicit-submission - fn implicit_submission(&self, _ctrl_key: bool, _shiftKey: bool, _altKey: bool, _metaKey: bool) { + fn implicit_submission(&self, _ctrl_key: bool, _shift_key: bool, _altKey: bool, _metaKey: bool) { //FIXME: Investigate and implement implicit submission for label elements // Issue filed at https://github.com/servo/servo/issues/8263 } diff --git a/components/script/dom/touchevent.rs b/components/script/dom/touchevent.rs index 5623a8bf572..0a1aac87ecf 100644 --- a/components/script/dom/touchevent.rs +++ b/components/script/dom/touchevent.rs @@ -64,7 +64,7 @@ impl TouchEvent { target_touches: &TouchList, ctrl_key: bool, altKey: bool, - shiftKey: bool, + shift_key: bool, metaKey: bool) -> Root { let ev = TouchEvent::new_uninitialized(window, touches, changed_touches, target_touches); ev.upcast::().InitUIEvent(type_, @@ -73,7 +73,7 @@ impl TouchEvent { view, detail); ev.ctrl_key.set(ctrl_key); ev.alt_key.set(altKey); - ev.shift_key.set(shiftKey); + ev.shift_key.set(shift_key); ev.meta_key.set(metaKey); ev } From bdbc04409d25770b40c0f806bfa815e5a2313d21 Mon Sep 17 00:00:00 2001 From: Arthur Marble Date: Sat, 17 Sep 2016 01:26:55 -0500 Subject: [PATCH 03/13] This commit refactors altKey to alt_key when possible. --- components/script/dom/activation.rs | 4 ++-- components/script/dom/htmlanchorelement.rs | 2 +- components/script/dom/htmlbuttonelement.rs | 4 ++-- components/script/dom/htmlinputelement.rs | 4 ++-- components/script/dom/htmllabelelement.rs | 2 +- components/script/dom/touchevent.rs | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/script/dom/activation.rs b/components/script/dom/activation.rs index 3f6b9890e4b..d0623740a63 100644 --- a/components/script/dom/activation.rs +++ b/components/script/dom/activation.rs @@ -64,7 +64,7 @@ pub enum ActivationSource { pub fn synthetic_click_activation(element: &Element, ctrl_key: bool, shift_key: bool, - altKey: bool, + alt_key: bool, metaKey: bool, source: ActivationSource) { // Step 1 @@ -95,7 +95,7 @@ pub fn synthetic_click_activation(element: &Element, 0, ctrl_key, shift_key, - altKey, + alt_key, metaKey, 0, None); diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index 9321764fece..e019d8ce285 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -540,7 +540,7 @@ impl Activatable for HTMLAnchorElement { } //TODO:https://html.spec.whatwg.org/multipage/#the-a-element - fn implicit_submission(&self, _ctrl_key: bool, _shift_key: bool, _altKey: bool, _metaKey: bool) { + fn implicit_submission(&self, _ctrl_key: bool, _shift_key: bool, _alt_key: bool, _metaKey: bool) { } } diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs index 4bf1b9a16b5..e1e2a0ccd41 100644 --- a/components/script/dom/htmlbuttonelement.rs +++ b/components/script/dom/htmlbuttonelement.rs @@ -283,7 +283,7 @@ impl Activatable for HTMLButtonElement { // https://html.spec.whatwg.org/multipage/#implicit-submission #[allow(unsafe_code)] - fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, altKey: bool, metaKey: bool) { + fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, alt_key: bool, metaKey: bool) { let doc = document_from_node(self); let node = doc.upcast::(); let owner = self.form_owner(); @@ -296,7 +296,7 @@ impl Activatable for HTMLButtonElement { .map(|s| synthetic_click_activation(s.r().as_element(), ctrl_key, shift_key, - altKey, + alt_key, metaKey, ActivationSource::NotFromClick)); } diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index a9f99ec20e1..8495481d108 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -1275,7 +1275,7 @@ impl Activatable for HTMLInputElement { // https://html.spec.whatwg.org/multipage/#implicit-submission #[allow(unsafe_code)] - fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, altKey: bool, metaKey: bool) { + fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, alt_key: bool, metaKey: bool) { let doc = document_from_node(self); let node = doc.upcast::(); let owner = self.form_owner(); @@ -1297,7 +1297,7 @@ impl Activatable for HTMLInputElement { synthetic_click_activation(button.as_element(), ctrl_key, shift_key, - altKey, + alt_key, metaKey, ActivationSource::NotFromClick) } diff --git a/components/script/dom/htmllabelelement.rs b/components/script/dom/htmllabelelement.rs index b1a4e1dfe5b..894a5bd1c24 100644 --- a/components/script/dom/htmllabelelement.rs +++ b/components/script/dom/htmllabelelement.rs @@ -76,7 +76,7 @@ impl Activatable for HTMLLabelElement { } // https://html.spec.whatwg.org/multipage/#implicit-submission - fn implicit_submission(&self, _ctrl_key: bool, _shift_key: bool, _altKey: bool, _metaKey: bool) { + fn implicit_submission(&self, _ctrl_key: bool, _shift_key: bool, _alt_key: bool, _metaKey: bool) { //FIXME: Investigate and implement implicit submission for label elements // Issue filed at https://github.com/servo/servo/issues/8263 } diff --git a/components/script/dom/touchevent.rs b/components/script/dom/touchevent.rs index 0a1aac87ecf..24fae301ac2 100644 --- a/components/script/dom/touchevent.rs +++ b/components/script/dom/touchevent.rs @@ -63,7 +63,7 @@ impl TouchEvent { changed_touches: &TouchList, target_touches: &TouchList, ctrl_key: bool, - altKey: bool, + alt_key: bool, shift_key: bool, metaKey: bool) -> Root { let ev = TouchEvent::new_uninitialized(window, touches, changed_touches, target_touches); @@ -72,7 +72,7 @@ impl TouchEvent { bool::from(cancelable), view, detail); ev.ctrl_key.set(ctrl_key); - ev.alt_key.set(altKey); + ev.alt_key.set(alt_key); ev.shift_key.set(shift_key); ev.meta_key.set(metaKey); ev From 5ce3510a50cd908708efdce9e18749f1596d197f Mon Sep 17 00:00:00 2001 From: Arthur Marble Date: Sat, 17 Sep 2016 02:11:19 -0500 Subject: [PATCH 04/13] Refactored metaKey to meta_key where possible --- components/script/dom/activation.rs | 4 ++-- components/script/dom/htmlanchorelement.rs | 2 +- components/script/dom/htmlbuttonelement.rs | 4 ++-- components/script/dom/htmlinputelement.rs | 4 ++-- components/script/dom/htmllabelelement.rs | 2 +- components/script/dom/touchevent.rs | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/script/dom/activation.rs b/components/script/dom/activation.rs index d0623740a63..fc43efee367 100644 --- a/components/script/dom/activation.rs +++ b/components/script/dom/activation.rs @@ -65,7 +65,7 @@ pub fn synthetic_click_activation(element: &Element, ctrl_key: bool, shift_key: bool, alt_key: bool, - metaKey: bool, + meta_key: bool, source: ActivationSource) { // Step 1 if element.click_in_progress() { @@ -96,7 +96,7 @@ pub fn synthetic_click_activation(element: &Element, ctrl_key, shift_key, alt_key, - metaKey, + meta_key, 0, None); let event = mouse.upcast::(); diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index e019d8ce285..d7f8b554f0d 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -540,7 +540,7 @@ impl Activatable for HTMLAnchorElement { } //TODO:https://html.spec.whatwg.org/multipage/#the-a-element - fn implicit_submission(&self, _ctrl_key: bool, _shift_key: bool, _alt_key: bool, _metaKey: bool) { + fn implicit_submission(&self, _ctrl_key: bool, _shift_key: bool, _alt_key: bool, _meta_key: bool) { } } diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs index e1e2a0ccd41..258d535f527 100644 --- a/components/script/dom/htmlbuttonelement.rs +++ b/components/script/dom/htmlbuttonelement.rs @@ -283,7 +283,7 @@ impl Activatable for HTMLButtonElement { // https://html.spec.whatwg.org/multipage/#implicit-submission #[allow(unsafe_code)] - fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, alt_key: bool, metaKey: bool) { + fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, alt_key: bool, meta_key: bool) { let doc = document_from_node(self); let node = doc.upcast::(); let owner = self.form_owner(); @@ -297,7 +297,7 @@ impl Activatable for HTMLButtonElement { ctrl_key, shift_key, alt_key, - metaKey, + meta_key, ActivationSource::NotFromClick)); } } diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 8495481d108..51f9c4fb080 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -1275,7 +1275,7 @@ impl Activatable for HTMLInputElement { // https://html.spec.whatwg.org/multipage/#implicit-submission #[allow(unsafe_code)] - fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, alt_key: bool, metaKey: bool) { + fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, alt_key: bool, meta_key: bool) { let doc = document_from_node(self); let node = doc.upcast::(); let owner = self.form_owner(); @@ -1298,7 +1298,7 @@ impl Activatable for HTMLInputElement { ctrl_key, shift_key, alt_key, - metaKey, + meta_key, ActivationSource::NotFromClick) } } diff --git a/components/script/dom/htmllabelelement.rs b/components/script/dom/htmllabelelement.rs index 894a5bd1c24..f71e243c168 100644 --- a/components/script/dom/htmllabelelement.rs +++ b/components/script/dom/htmllabelelement.rs @@ -76,7 +76,7 @@ impl Activatable for HTMLLabelElement { } // https://html.spec.whatwg.org/multipage/#implicit-submission - fn implicit_submission(&self, _ctrl_key: bool, _shift_key: bool, _alt_key: bool, _metaKey: bool) { + fn implicit_submission(&self, _ctrl_key: bool, _shift_key: bool, _alt_key: bool, _meta_key: bool) { //FIXME: Investigate and implement implicit submission for label elements // Issue filed at https://github.com/servo/servo/issues/8263 } diff --git a/components/script/dom/touchevent.rs b/components/script/dom/touchevent.rs index 24fae301ac2..3b2a25a3e21 100644 --- a/components/script/dom/touchevent.rs +++ b/components/script/dom/touchevent.rs @@ -65,7 +65,7 @@ impl TouchEvent { ctrl_key: bool, alt_key: bool, shift_key: bool, - metaKey: bool) -> Root { + meta_key: bool) -> Root { let ev = TouchEvent::new_uninitialized(window, touches, changed_touches, target_touches); ev.upcast::().InitUIEvent(type_, bool::from(canBubble), @@ -74,7 +74,7 @@ impl TouchEvent { ev.ctrl_key.set(ctrl_key); ev.alt_key.set(alt_key); ev.shift_key.set(shift_key); - ev.meta_key.set(metaKey); + ev.meta_key.set(meta_key); ev } } From e7ffbf819af2162336c0b1f6f8f467bfc19e4590 Mon Sep 17 00:00:00 2001 From: Arthur Marble Date: Sat, 17 Sep 2016 18:28:28 -0500 Subject: [PATCH 05/13] Replace typeString with type_string. --- components/script/dom/blob.rs | 10 +++++----- components/script/dom/file.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index 78990f40564..75433a64de9 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -73,7 +73,7 @@ pub struct Blob { #[ignore_heap_size_of = "No clear owner"] blob_impl: DOMRefCell, /// content-type string - typeString: String, + type_string: String, isClosed_: Cell, } @@ -85,13 +85,13 @@ impl Blob { } #[allow(unrooted_must_root)] - pub fn new_inherited(blob_impl: BlobImpl, typeString: String) -> Blob { + pub fn new_inherited(blob_impl: BlobImpl, type_string: String) -> Blob { Blob { reflector_: Reflector::new(), blob_impl: DOMRefCell::new(blob_impl), // NOTE: Guarding the format correctness here, // https://w3c.github.io/FileAPI/#dfn-type - typeString: normalize_type_string(&typeString), + type_string: normalize_type_string(&type_string), isClosed_: Cell::new(false), } } @@ -222,7 +222,7 @@ impl Blob { let blob_buf = BlobBuf { filename: None, - type_string: self.typeString.clone(), + type_string: self.type_string.clone(), size: bytes.len() as u64, bytes: bytes.to_vec(), }; @@ -366,7 +366,7 @@ impl BlobMethods for Blob { // https://w3c.github.io/FileAPI/#dfn-type fn Type(&self) -> DOMString { - DOMString::from(self.typeString.clone()) + DOMString::from(self.type_string.clone()) } // https://w3c.github.io/FileAPI/#slice-method-algo diff --git a/components/script/dom/file.rs b/components/script/dom/file.rs index f9b181dbf1a..8b4abaaed80 100644 --- a/components/script/dom/file.rs +++ b/components/script/dom/file.rs @@ -25,9 +25,9 @@ pub struct File { impl File { #[allow(unrooted_must_root)] fn new_inherited(blob_impl: BlobImpl, name: DOMString, - modified: Option, typeString: &str) -> File { + modified: Option, type_string: &str) -> File { File { - blob: Blob::new_inherited(blob_impl, typeString.to_owned()), + blob: Blob::new_inherited(blob_impl, type_string.to_owned()), name: name, // https://w3c.github.io/FileAPI/#dfn-lastModified modified: match modified { From dd4907c985a3f38d5e8e5808cbbbef60cbb47620 Mon Sep 17 00:00:00 2001 From: Arthur Marble Date: Sat, 17 Sep 2016 19:25:40 -0500 Subject: [PATCH 06/13] Refactor isClosed_ to is_closed and relativeContentType to relative_content_type. --- components/script/dom/blob.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index 75433a64de9..d9a45d35665 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -74,7 +74,7 @@ pub struct Blob { blob_impl: DOMRefCell, /// content-type string type_string: String, - isClosed_: Cell, + is_closed: Cell, } impl Blob { @@ -92,13 +92,13 @@ impl Blob { // NOTE: Guarding the format correctness here, // https://w3c.github.io/FileAPI/#dfn-type type_string: normalize_type_string(&type_string), - isClosed_: Cell::new(false), + is_closed: Cell::new(false), } } #[allow(unrooted_must_root)] fn new_sliced(parent: &Blob, rel_pos: RelativePos, - relativeContentType: DOMString) -> Root { + relative_content_type: DOMString) -> Root { let global = parent.global(); let blob_impl = match *parent.blob_impl.borrow() { BlobImpl::File(_) => { @@ -115,7 +115,7 @@ impl Blob { } }; - Blob::new(global.r(), blob_impl, relativeContentType.into()) + Blob::new(global.r(), blob_impl, relative_content_type.into()) } // https://w3c.github.io/FileAPI/#constructorBlob @@ -381,18 +381,18 @@ impl BlobMethods for Blob { // https://w3c.github.io/FileAPI/#dfn-isClosed fn IsClosed(&self) -> bool { - self.isClosed_.get() + self.is_closed.get() } // https://w3c.github.io/FileAPI/#dfn-close fn Close(&self) { // Step 1 - if self.isClosed_.get() { + if self.is_closed.get() { return; } // Step 2 - self.isClosed_.set(true); + self.is_closed.set(true); // Step 3 self.clean_up_file_resource(); From 55ff161ed5e57322dcd4ed984c13f3ae3512a01a Mon Sep 17 00:00:00 2001 From: Arthur Marble Date: Sat, 17 Sep 2016 20:24:33 -0500 Subject: [PATCH 07/13] Refactored a couple of files from codeStyle to code_style. --- components/script/dom/blob.rs | 4 ++-- components/script/dom/bluetoothadvertisingdata.rs | 8 ++++---- .../script/dom/bluetoothcharacteristicproperties.rs | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index d9a45d35665..aef31efd687 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -373,10 +373,10 @@ impl BlobMethods for Blob { fn Slice(&self, start: Option, end: Option, - contentType: Option) + content_type: Option) -> Root { let rel_pos = RelativePos::from_opts(start, end); - Blob::new_sliced(self, rel_pos, contentType.unwrap_or(DOMString::from(""))) + Blob::new_sliced(self, rel_pos, content_type.unwrap_or(DOMString::from(""))) } // https://w3c.github.io/FileAPI/#dfn-isClosed diff --git a/components/script/dom/bluetoothadvertisingdata.rs b/components/script/dom/bluetoothadvertisingdata.rs index f6a7805acbf..6cd77385a26 100644 --- a/components/script/dom/bluetoothadvertisingdata.rs +++ b/components/script/dom/bluetoothadvertisingdata.rs @@ -13,19 +13,19 @@ use dom::bindings::reflector::{Reflector, reflect_dom_object}; pub struct BluetoothAdvertisingData { reflector_: Reflector, appearance: Option, - txPower: Option, + tx_power: Option, rssi: Option, } impl BluetoothAdvertisingData { pub fn new_inherited(appearance: Option, - txPower: Option, + tx_power: Option, rssi: Option) -> BluetoothAdvertisingData { BluetoothAdvertisingData { reflector_: Reflector::new(), appearance: appearance, - txPower: txPower, + tx_power: tx_power, rssi: rssi, } } @@ -51,7 +51,7 @@ impl BluetoothAdvertisingDataMethods for BluetoothAdvertisingData { // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothadvertisingdata-txpower fn GetTxPower(&self) -> Option { - self.txPower + self.tx_power } // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothadvertisingdata-rssi diff --git a/components/script/dom/bluetoothcharacteristicproperties.rs b/components/script/dom/bluetoothcharacteristicproperties.rs index 9abb5e5cd5b..6a0fb26c0b3 100644 --- a/components/script/dom/bluetoothcharacteristicproperties.rs +++ b/components/script/dom/bluetoothcharacteristicproperties.rs @@ -15,7 +15,7 @@ pub struct BluetoothCharacteristicProperties { reflector_: Reflector, broadcast: bool, read: bool, - writeWithoutResponse: bool, + write_without_response: bool, write: bool, notify: bool, indicate: bool, @@ -27,7 +27,7 @@ pub struct BluetoothCharacteristicProperties { impl BluetoothCharacteristicProperties { pub fn new_inherited(broadcast: bool, read: bool, - writeWithoutResponse: bool, + write_without_response: bool, write: bool, notify: bool, indicate: bool, @@ -39,7 +39,7 @@ impl BluetoothCharacteristicProperties { reflector_: Reflector::new(), broadcast: broadcast, read: read, - writeWithoutResponse: writeWithoutResponse, + write_without_response: write_without_response, write: write, notify: notify, indicate: indicate, @@ -87,7 +87,7 @@ impl BluetoothCharacteristicPropertiesMethods for BluetoothCharacteristicPropert // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-writewithoutresponse fn WriteWithoutResponse(&self) -> bool { - self.writeWithoutResponse + self.write_without_response } // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-write From 5fa54177cafdfd321972d3050f8979e6a4f81592 Mon Sep 17 00:00:00 2001 From: Arthur Marble Date: Sun, 18 Sep 2016 00:07:32 -0500 Subject: [PATCH 08/13] Refactored a bluetooth* related files from codeStyle to code_style. --- .../dom/bluetoothcharacteristicproperties.rs | 24 +++++++++---------- components/script/dom/bluetoothdevice.rs | 8 +++---- .../dom/bluetoothremotegattcharacteristic.rs | 8 +++---- .../dom/bluetoothremotegattdescriptor.rs | 8 +++---- .../script/dom/bluetoothremotegattservice.rs | 16 ++++++------- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/components/script/dom/bluetoothcharacteristicproperties.rs b/components/script/dom/bluetoothcharacteristicproperties.rs index 6a0fb26c0b3..fd716d72bb5 100644 --- a/components/script/dom/bluetoothcharacteristicproperties.rs +++ b/components/script/dom/bluetoothcharacteristicproperties.rs @@ -19,9 +19,9 @@ pub struct BluetoothCharacteristicProperties { write: bool, notify: bool, indicate: bool, - authenticatedSignedWrites: bool, - reliableWrite: bool, - writableAuxiliaries: bool, + authenticated_signed_writes: bool, + reliable_write: bool, + writable_auxiliaries: bool, } impl BluetoothCharacteristicProperties { @@ -31,9 +31,9 @@ impl BluetoothCharacteristicProperties { write: bool, notify: bool, indicate: bool, - authenticatedSignedWrites: bool, - reliableWrite: bool, - writableAuxiliaries: bool) + authenticated_signed_writes: bool, + reliable_write: bool, + writable_auxiliaries: bool) -> BluetoothCharacteristicProperties { BluetoothCharacteristicProperties { reflector_: Reflector::new(), @@ -43,9 +43,9 @@ impl BluetoothCharacteristicProperties { write: write, notify: notify, indicate: indicate, - authenticatedSignedWrites: authenticatedSignedWrites, - reliableWrite: reliableWrite, - writableAuxiliaries: writableAuxiliaries, + authenticated_signed_writes: authenticated_signed_writes, + reliable_write: reliable_write, + writable_auxiliaries: writable_auxiliaries, } } @@ -107,16 +107,16 @@ impl BluetoothCharacteristicPropertiesMethods for BluetoothCharacteristicPropert // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-authenticatedsignedwrites fn AuthenticatedSignedWrites(&self) -> bool { - self.authenticatedSignedWrites + self.authenticated_signed_writes } // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-reliablewrite fn ReliableWrite(&self) -> bool { - self.reliableWrite + self.reliable_write } // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-writableauxiliaries fn WritableAuxiliaries(&self) -> bool { - self.writableAuxiliaries + self.writable_auxiliaries } } diff --git a/components/script/dom/bluetoothdevice.rs b/components/script/dom/bluetoothdevice.rs index d82901b03de..1508c0382c8 100644 --- a/components/script/dom/bluetoothdevice.rs +++ b/components/script/dom/bluetoothdevice.rs @@ -17,20 +17,20 @@ pub struct BluetoothDevice { reflector_: Reflector, id: DOMString, name: Option, - adData: MutHeap>, + ad_data: MutHeap>, gatt: MutNullableHeap>, } impl BluetoothDevice { pub fn new_inherited(id: DOMString, name: Option, - adData: &BluetoothAdvertisingData) + ad_data: &BluetoothAdvertisingData) -> BluetoothDevice { BluetoothDevice { reflector_: Reflector::new(), id: id, name: name, - adData: MutHeap::new(adData), + ad_data: MutHeap::new(ad_data), gatt: Default::default(), } } @@ -61,7 +61,7 @@ impl BluetoothDeviceMethods for BluetoothDevice { // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-addata fn AdData(&self) -> Root { - self.adData.get() + self.ad_data.get() } // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-gatt diff --git a/components/script/dom/bluetoothremotegattcharacteristic.rs b/components/script/dom/bluetoothremotegattcharacteristic.rs index c88463920e6..15ca7af2235 100644 --- a/components/script/dom/bluetoothremotegattcharacteristic.rs +++ b/components/script/dom/bluetoothremotegattcharacteristic.rs @@ -37,14 +37,14 @@ pub struct BluetoothRemoteGATTCharacteristic { uuid: DOMString, properties: MutHeap>, value: DOMRefCell>, - instanceID: String, + instance_id: String, } impl BluetoothRemoteGATTCharacteristic { pub fn new_inherited(service: &BluetoothRemoteGATTService, uuid: DOMString, properties: &BluetoothCharacteristicProperties, - instanceID: String) + instance_id: String) -> BluetoothRemoteGATTCharacteristic { BluetoothRemoteGATTCharacteristic { reflector_: Reflector::new(), @@ -52,7 +52,7 @@ impl BluetoothRemoteGATTCharacteristic { uuid: uuid, properties: MutHeap::new(properties), value: DOMRefCell::new(None), - instanceID: instanceID, + instance_id: instance_id, } } @@ -77,7 +77,7 @@ impl BluetoothRemoteGATTCharacteristic { } fn get_instance_id(&self) -> String { - self.instanceID.clone() + self.instance_id.clone() } } diff --git a/components/script/dom/bluetoothremotegattdescriptor.rs b/components/script/dom/bluetoothremotegattdescriptor.rs index a726de42974..99065a9aec0 100644 --- a/components/script/dom/bluetoothremotegattdescriptor.rs +++ b/components/script/dom/bluetoothremotegattdescriptor.rs @@ -28,20 +28,20 @@ pub struct BluetoothRemoteGATTDescriptor { characteristic: MutHeap>, uuid: DOMString, value: DOMRefCell>, - instanceID: String, + instance_id: String, } impl BluetoothRemoteGATTDescriptor { pub fn new_inherited(characteristic: &BluetoothRemoteGATTCharacteristic, uuid: DOMString, - instanceID: String) + instance_id: String) -> BluetoothRemoteGATTDescriptor { BluetoothRemoteGATTDescriptor { reflector_: Reflector::new(), characteristic: MutHeap::new(characteristic), uuid: uuid, value: DOMRefCell::new(None), - instanceID: instanceID, + instance_id: instance_id, } } @@ -64,7 +64,7 @@ impl BluetoothRemoteGATTDescriptor { } fn get_instance_id(&self) -> String { - self.instanceID.clone() + self.instance_id.clone() } } diff --git a/components/script/dom/bluetoothremotegattservice.rs b/components/script/dom/bluetoothremotegattservice.rs index 5b80bc6afc0..a39bb4fdfd5 100644 --- a/components/script/dom/bluetoothremotegattservice.rs +++ b/components/script/dom/bluetoothremotegattservice.rs @@ -24,22 +24,22 @@ pub struct BluetoothRemoteGATTService { reflector_: Reflector, device: MutHeap>, uuid: DOMString, - isPrimary: bool, - instanceID: String, + is_primary: bool, + instance_id: String, } impl BluetoothRemoteGATTService { pub fn new_inherited(device: &BluetoothDevice, uuid: DOMString, - isPrimary: bool, - instanceID: String) + is_primary: bool, + instance_id: String) -> BluetoothRemoteGATTService { BluetoothRemoteGATTService { reflector_: Reflector::new(), device: MutHeap::new(device), uuid: uuid, - isPrimary: isPrimary, - instanceID: instanceID, + is_primary: is_primary, + instance_id: instance_id, } } @@ -64,7 +64,7 @@ impl BluetoothRemoteGATTService { } fn get_instance_id(&self) -> String { - self.instanceID.clone() + self.instance_id.clone() } } @@ -76,7 +76,7 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService { // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-isprimary fn IsPrimary(&self) -> bool { - self.isPrimary + self.is_primary } // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-uuid From dbec9d845472251b73e444d80a493173f11a0482 Mon Sep 17 00:00:00 2001 From: Arthur Marble Date: Sun, 18 Sep 2016 01:02:57 -0500 Subject: [PATCH 09/13] More code refactoring (exampleVar to example_var) --- components/script/dom/browsingcontext.rs | 8 ++-- .../script/dom/canvasrenderingcontext2d.rs | 12 ++--- components/script/dom/closeevent.rs | 8 ++-- components/script/dom/console.rs | 4 +- components/script/dom/document.rs | 44 +++++++++---------- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/components/script/dom/browsingcontext.rs b/components/script/dom/browsingcontext.rs index 02d153296ae..21693f781ca 100644 --- a/components/script/dom/browsingcontext.rs +++ b/components/script/dom/browsingcontext.rs @@ -230,7 +230,7 @@ impl SessionHistoryEntry { } #[allow(unsafe_code)] -unsafe fn GetSubframeWindow(cx: *mut JSContext, +unsafe fn get_subframe_window(cx: *mut JSContext, proxy: HandleObject, id: HandleId) -> Option> { @@ -251,7 +251,7 @@ unsafe extern "C" fn getOwnPropertyDescriptor(cx: *mut JSContext, id: HandleId, mut desc: MutableHandle) -> bool { - let window = GetSubframeWindow(cx, proxy, id); + let window = get_subframe_window(cx, proxy, id); if let Some(window) = window { rooted!(in(cx) let mut val = UndefinedValue()); window.to_jsval(cx, val.handle_mut()); @@ -300,7 +300,7 @@ unsafe extern "C" fn has(cx: *mut JSContext, id: HandleId, bp: *mut bool) -> bool { - let window = GetSubframeWindow(cx, proxy, id); + let window = get_subframe_window(cx, proxy, id); if window.is_some() { *bp = true; return true; @@ -323,7 +323,7 @@ unsafe extern "C" fn get(cx: *mut JSContext, id: HandleId, vp: MutableHandleValue) -> bool { - let window = GetSubframeWindow(cx, proxy, id); + let window = get_subframe_window(cx, proxy, id); if let Some(window) = window { window.to_jsval(cx, vp); return true; diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs index 13610c53487..4b598407829 100644 --- a/components/script/dom/canvasrenderingcontext2d.rs +++ b/components/script/dom/canvasrenderingcontext2d.rs @@ -1096,16 +1096,16 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D { imagedata: &ImageData, dx: Finite, dy: Finite, - dirtyX: Finite, - dirtyY: Finite, - dirtyWidth: Finite, - dirtyHeight: Finite) { + dirty_x: Finite, + dirty_y: Finite, + dirty_width: Finite, + dirty_height: Finite) { let data = imagedata.get_data_array(); let offset = Point2D::new(*dx, *dy); let image_data_size = Size2D::new(imagedata.Width() as f64, imagedata.Height() as f64); - let dirty_rect = Rect::new(Point2D::new(*dirtyX, *dirtyY), - Size2D::new(*dirtyWidth, *dirtyHeight)); + let dirty_rect = Rect::new(Point2D::new(*dirty_x, *dirty_y), + Size2D::new(*dirty_width, *dirty_height)); let msg = CanvasMsg::Canvas2d(Canvas2dMsg::PutImageData(data, offset, image_data_size, diff --git a/components/script/dom/closeevent.rs b/components/script/dom/closeevent.rs index b8fe636af60..07e2fbaa943 100644 --- a/components/script/dom/closeevent.rs +++ b/components/script/dom/closeevent.rs @@ -17,16 +17,16 @@ use string_cache::Atom; #[dom_struct] pub struct CloseEvent { event: Event, - wasClean: bool, + was_clean: bool, code: u16, reason: DOMString, } impl CloseEvent { - pub fn new_inherited(wasClean: bool, code: u16, reason: DOMString) -> CloseEvent { + pub fn new_inherited(was_clean: bool, code: u16, reason: DOMString) -> CloseEvent { CloseEvent { event: Event::new_inherited(), - wasClean: wasClean, + was_clean: was_clean, code: code, reason: reason, } @@ -77,7 +77,7 @@ impl CloseEvent { impl CloseEventMethods for CloseEvent { // https://html.spec.whatwg.org/multipage/#dom-closeevent-wasclean fn WasClean(&self) -> bool { - self.wasClean + self.was_clean } // https://html.spec.whatwg.org/multipage/#dom-closeevent-code diff --git a/components/script/dom/console.rs b/components/script/dom/console.rs index f167e8b28fe..05bd5e558b8 100644 --- a/components/script/dom/console.rs +++ b/components/script/dom/console.rs @@ -101,11 +101,11 @@ fn timestamp_in_ms(time: Timespec) -> u64 { (time.sec * 1000 + (time.nsec / 1000000) as i64) as u64 } -fn prepare_message(logLevel: LogLevel, message: DOMString) -> ConsoleMessage { +fn prepare_message(log_level: LogLevel, message: DOMString) -> ConsoleMessage { // TODO: Sending fake values for filename, lineNumber and columnNumber in LogMessage; adjust later ConsoleMessage { message: String::from(message), - logLevel: logLevel, + logLevel: log_level, filename: "test".to_owned(), lineNumber: 1, columnNumber: 1, diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 3436a4aaa0b..b50b5ec87e1 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -733,13 +733,13 @@ impl Document { // https://w3c.github.io/uievents/#event-type-click let client_x = client_point.x as i32; let client_y = client_point.y as i32; - let clickCount = 1; + let click_count = 1; let event = MouseEvent::new(&self.window, DOMString::from(mouse_event_type_string), EventBubbles::Bubbles, EventCancelable::Cancelable, Some(&self.window), - clickCount, + click_count, client_x, client_y, client_x, @@ -804,7 +804,7 @@ impl Document { if now.duration_since(last_time) < DBL_CLICK_TIMEOUT && dist < DBL_CLICK_DIST_THRESHOLD as f64 { // A double click has occurred if this click is within a certain time and dist. of previous click. - let clickCount = 2; + let click_count = 2; let client_x = click_pos.x as i32; let client_y = click_pos.y as i32; @@ -813,7 +813,7 @@ impl Document { EventBubbles::Bubbles, EventCancelable::Cancelable, Some(&self.window), - clickCount, + click_count, client_x, client_y, client_x, @@ -1617,7 +1617,7 @@ impl Document { } // https://html.spec.whatwg.org/multipage/#fire-a-focus-event - fn fire_focus_event(&self, focus_event_type: FocusEventType, node: &Node, relatedTarget: Option<&EventTarget>) { + fn fire_focus_event(&self, focus_event_type: FocusEventType, node: &Node, related_target: Option<&EventTarget>) { let (event_name, does_bubble) = match focus_event_type { FocusEventType::Focus => (DOMString::from("focus"), EventBubbles::DoesNotBubble), FocusEventType::Blur => (DOMString::from("blur"), EventBubbles::DoesNotBubble), @@ -1628,7 +1628,7 @@ impl Document { EventCancelable::NotCancelable, Some(&self.window), 0i32, - relatedTarget); + related_target); let event = event.upcast::(); event.set_trusted(true); let target = node.upcast(); @@ -2380,10 +2380,10 @@ impl DocumentMethods for Document { // https://dom.spec.whatwg.org/#dom-document-createnodeiteratorroot-whattoshow-filter fn CreateNodeIterator(&self, root: &Node, - whatToShow: u32, + what_to_show: u32, filter: Option>) -> Root { - NodeIterator::new(self, root, whatToShow, filter) + NodeIterator::new(self, root, what_to_show, filter) } // https://w3c.github.io/touch-events/#idl-def-Document @@ -2391,22 +2391,22 @@ impl DocumentMethods for Document { window: &Window, target: &EventTarget, identifier: i32, - pageX: Finite, - pageY: Finite, - screenX: Finite, - screenY: Finite) + page_x: Finite, + page_y: Finite, + screen_x: Finite, + screen_y: Finite) -> Root { - let clientX = Finite::wrap(*pageX - window.PageXOffset() as f64); - let clientY = Finite::wrap(*pageY - window.PageYOffset() as f64); + let client_x = Finite::wrap(*page_x - window.PageXOffset() as f64); + let client_y = Finite::wrap(*page_y - window.PageYOffset() as f64); Touch::new(window, identifier, target, - screenX, - screenY, - clientX, - clientY, - pageX, - pageY) + screen_x, + screen_y, + client_x, + client_y, + page_x, + page_y) } // https://w3c.github.io/touch-events/#idl-def-document-createtouchlist(touch...) @@ -2417,10 +2417,10 @@ impl DocumentMethods for Document { // https://dom.spec.whatwg.org/#dom-document-createtreewalker fn CreateTreeWalker(&self, root: &Node, - whatToShow: u32, + what_to_show: u32, filter: Option>) -> Root { - TreeWalker::new(self, root, whatToShow, filter) + TreeWalker::new(self, root, what_to_show, filter) } // https://html.spec.whatwg.org/multipage/#document.title From 883902bd972c9ea91cf6b6be74908e87c517b72e Mon Sep 17 00:00:00 2001 From: Arthur Marble Date: Sun, 18 Sep 2016 03:41:16 -0500 Subject: [PATCH 10/13] Most of the code refactoring needed to be done is done with this commit. --- components/script/dom/browsingcontext.rs | 2 +- components/script/dom/dompoint.rs | 8 +- components/script/dom/dompointreadonly.rs | 16 ++-- components/script/dom/htmlanchorelement.rs | 44 +++++----- components/script/dom/htmlappletelement.rs | 8 +- components/script/dom/htmlareaelement.rs | 8 +- components/script/dom/htmlaudioelement.rs | 8 +- components/script/dom/htmlbaseelement.rs | 8 +- components/script/dom/htmlbodyelement.rs | 8 +- components/script/dom/htmlbrelement.rs | 8 +- components/script/dom/htmlbuttonelement.rs | 8 +- components/script/dom/htmlcanvaselement.rs | 8 +- components/script/dom/htmldataelement.rs | 8 +- components/script/dom/htmldatalistelement.rs | 8 +- components/script/dom/htmldetailselement.rs | 8 +- components/script/dom/htmldialogelement.rs | 8 +- components/script/dom/htmldirectoryelement.rs | 8 +- components/script/dom/htmldivelement.rs | 8 +- components/script/dom/htmldlistelement.rs | 8 +- components/script/dom/htmlelement.rs | 4 +- components/script/dom/htmlembedelement.rs | 8 +- components/script/dom/htmlfieldsetelement.rs | 8 +- components/script/dom/htmlfontelement.rs | 8 +- components/script/dom/htmlformelement.rs | 8 +- components/script/dom/htmlframeelement.rs | 8 +- components/script/dom/htmlframesetelement.rs | 8 +- components/script/dom/htmlheadelement.rs | 8 +- components/script/dom/htmlheadingelement.rs | 8 +- components/script/dom/htmlhrelement.rs | 8 +- components/script/dom/htmliframeelement.rs | 20 ++--- components/script/dom/htmlimageelement.rs | 8 +- components/script/dom/htmlinputelement.rs | 8 +- components/script/dom/htmllabelelement.rs | 8 +- components/script/dom/htmllegendelement.rs | 8 +- components/script/dom/htmllielement.rs | 8 +- components/script/dom/htmllinkelement.rs | 8 +- components/script/dom/htmlmapelement.rs | 8 +- components/script/dom/htmlmetaelement.rs | 8 +- components/script/dom/htmlmeterelement.rs | 8 +- components/script/dom/htmlmodelement.rs | 8 +- components/script/dom/htmlobjectelement.rs | 8 +- components/script/dom/htmlolistelement.rs | 8 +- components/script/dom/htmloptgroupelement.rs | 8 +- components/script/dom/htmloptionelement.rs | 8 +- components/script/dom/htmloutputelement.rs | 8 +- components/script/dom/htmlparagraphelement.rs | 8 +- components/script/dom/htmlparamelement.rs | 8 +- components/script/dom/htmlpreelement.rs | 8 +- components/script/dom/htmlprogresselement.rs | 8 +- components/script/dom/htmlquoteelement.rs | 8 +- components/script/dom/htmlscriptelement.rs | 8 +- components/script/dom/htmlselectelement.rs | 8 +- components/script/dom/htmlsourceelement.rs | 8 +- components/script/dom/htmlspanelement.rs | 8 +- components/script/dom/htmlstyleelement.rs | 8 +- .../script/dom/htmltablecaptionelement.rs | 8 +- components/script/dom/htmltablecolelement.rs | 8 +- .../script/dom/htmltabledatacellelement.rs | 8 +- components/script/dom/htmltableelement.rs | 8 +- .../script/dom/htmltableheadercellelement.rs | 8 +- components/script/dom/htmltablerowelement.rs | 8 +- .../script/dom/htmltablesectionelement.rs | 8 +- components/script/dom/htmltemplateelement.rs | 8 +- components/script/dom/htmltextareaelement.rs | 8 +- components/script/dom/htmltimeelement.rs | 8 +- components/script/dom/htmltitleelement.rs | 8 +- components/script/dom/htmltrackelement.rs | 8 +- components/script/dom/htmlulistelement.rs | 8 +- components/script/dom/htmlunknownelement.rs | 8 +- components/script/dom/htmlvideoelement.rs | 8 +- components/script/dom/keyboardevent.rs | 48 +++++------ components/script/dom/location.rs | 32 ++++---- components/script/dom/mouseevent.rs | 80 +++++++++---------- components/script/dom/navigator.rs | 6 +- components/script/dom/node.rs | 8 +- components/script/dom/performance.rs | 4 +- components/script/dom/performancetiming.rs | 18 ++--- components/script/dom/storage.rs | 2 +- components/script/dom/storageevent.rs | 24 +++--- components/script/dom/touchevent.rs | 4 +- components/script/dom/url.rs | 40 +++++----- components/script/dom/urlhelper.rs | 42 +++++----- components/script/dom/websocket.rs | 2 +- components/script/dom/window.rs | 2 +- components/script/dom/workerlocation.rs | 16 ++-- components/script/script_runtime.rs | 4 +- 86 files changed, 469 insertions(+), 469 deletions(-) diff --git a/components/script/dom/browsingcontext.rs b/components/script/dom/browsingcontext.rs index 21693f781ca..3ebd3333efa 100644 --- a/components/script/dom/browsingcontext.rs +++ b/components/script/dom/browsingcontext.rs @@ -239,7 +239,7 @@ unsafe fn get_subframe_window(cx: *mut JSContext, rooted!(in(cx) let target = GetProxyPrivate(*proxy.ptr).to_object()); let win = root_from_handleobject::(target.handle()).unwrap(); let mut found = false; - return win.IndexedGetter(index, &mut found); + return win.indexed_getter(index, &mut found); } None diff --git a/components/script/dom/dompoint.rs b/components/script/dom/dompoint.rs index 906a30ea617..0e476bd2bde 100644 --- a/components/script/dom/dompoint.rs +++ b/components/script/dom/dompoint.rs @@ -49,7 +49,7 @@ impl DOMPointMethods for DOMPoint { // https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-x 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 @@ -59,7 +59,7 @@ impl DOMPointMethods for DOMPoint { // https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-y 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 @@ -69,7 +69,7 @@ impl DOMPointMethods for DOMPoint { // https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-z 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 @@ -79,6 +79,6 @@ impl DOMPointMethods for DOMPoint { // https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-w fn SetW(&self, value: f64) { - self.point.SetW(value); + self.point.set_w(value); } } diff --git a/components/script/dom/dompointreadonly.rs b/components/script/dom/dompointreadonly.rs index aa7efa76267..bc0ef8d346e 100644 --- a/components/script/dom/dompointreadonly.rs +++ b/components/script/dom/dompointreadonly.rs @@ -69,26 +69,26 @@ impl DOMPointReadOnlyMethods for DOMPointReadOnly { } pub trait DOMPointWriteMethods { - fn SetX(&self, value: f64); - fn SetY(&self, value: f64); - fn SetZ(&self, value: f64); - fn SetW(&self, value: f64); + fn set_x(&self, value: f64); + fn set_y(&self, value: f64); + fn set_z(&self, value: f64); + fn set_w(&self, value: f64); } impl DOMPointWriteMethods for DOMPointReadOnly { - fn SetX(&self, value: f64) { + fn set_x(&self, value: f64) { self.x.set(value); } - fn SetY(&self, value: f64) { + fn set_y(&self, value: f64) { self.y.set(value); } - fn SetZ(&self, value: f64) { + fn set_z(&self, value: f64) { self.z.set(value); } - fn SetW(&self, value: f64) { + fn set_w(&self, value: f64) { self.w.set(value); } } diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index d7f8b554f0d..5c8866ecef2 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -39,22 +39,22 @@ pub struct HTMLAnchorElement { } impl HTMLAnchorElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLAnchorElement { HTMLAnchorElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document), + HTMLElement::new_inherited(local_name, prefix, document), rel_list: Default::default(), url: DOMRefCell::new(None), } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLAnchorElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLAnchorElement::new_inherited(local_name, prefix, document), document, HTMLAnchorElementBinding::Wrap) } @@ -157,7 +157,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => USVString(String::new()), Some(ref url) => { // Steps 3-4. - UrlHelper::Hash(url) + UrlHelper::hash(url) } } } @@ -174,7 +174,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => return, // Steps 4-5. Some(url) => { - UrlHelper::SetHash(url, value); + UrlHelper::set_hash(url, value); DOMString::from(url.as_str()) } }; @@ -195,7 +195,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { USVString(String::new()) } else { // Steps 4-5. - UrlHelper::Host(url) + UrlHelper::host(url) } } } @@ -213,7 +213,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => return, // Step 4. Some(url) => { - UrlHelper::SetHost(url, value); + UrlHelper::set_host(url, value); DOMString::from(url.as_str()) } }; @@ -231,7 +231,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => USVString(String::new()), Some(ref url) => { // Step 4. - UrlHelper::Hostname(url) + UrlHelper::hostname(url) } } } @@ -248,7 +248,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => return, // Step 4. Some(url) => { - UrlHelper::SetHostname(url, value); + UrlHelper::set_hostname(url, value); DOMString::from(url.as_str()) } }; @@ -291,7 +291,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { // Step 3. None => USVString(String::new()), // 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, // Step 4. Some(url) => { - UrlHelper::SetPassword(url, value); + UrlHelper::set_password(url, value); DOMString::from(url.as_str()) } }; @@ -324,7 +324,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { // Step 3. None => USVString(String::new()), // 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, // Step 5. Some(url) => { - UrlHelper::SetPathname(url, value); + UrlHelper::set_pathname(url, value); DOMString::from(url.as_str()) } }; @@ -357,7 +357,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { // Step 3. None => USVString(String::new()), // Step 4. - Some(ref url) => UrlHelper::Port(url) + Some(ref url) => UrlHelper::port(url) } } @@ -374,7 +374,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => return, // Step 4. Some(url) => { - UrlHelper::SetPort(url, value); + UrlHelper::set_port(url, value); DOMString::from(url.as_str()) } }; @@ -391,7 +391,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { // Step 2. None => USVString(":".to_owned()), // Step 3. - Some(ref url) => UrlHelper::Protocol(url) + Some(ref url) => UrlHelper::protocol(url) } } @@ -405,7 +405,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => return, // Step 3. Some(url) => { - UrlHelper::SetProtocol(url, value); + UrlHelper::set_protocol(url, value); DOMString::from(url.as_str()) } }; @@ -422,7 +422,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { // Step 2. None => USVString(String::new()), // 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 // encoding override (as described in the spec) Some(url) => { - UrlHelper::SetSearch(url, value); + UrlHelper::set_search(url, value); DOMString::from(url.as_str()) } }; @@ -456,7 +456,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { // Step 2. None => USVString(String::new()), // Step 3. - Some(ref url) => UrlHelper::Username(url) + Some(ref url) => UrlHelper::username(url) } } @@ -472,7 +472,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => return, // Step 4. Some(url) => { - UrlHelper::SetUsername(url, value); + UrlHelper::set_username(url, value); DOMString::from(url.as_str()) } }; diff --git a/components/script/dom/htmlappletelement.rs b/components/script/dom/htmlappletelement.rs index f61a6499ea1..dfc43386492 100644 --- a/components/script/dom/htmlappletelement.rs +++ b/components/script/dom/htmlappletelement.rs @@ -20,20 +20,20 @@ pub struct HTMLAppletElement { } impl HTMLAppletElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLAppletElement { HTMLAppletElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLAppletElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLAppletElement::new_inherited(local_name, prefix, document), document, HTMLAppletElementBinding::Wrap) } diff --git a/components/script/dom/htmlareaelement.rs b/components/script/dom/htmlareaelement.rs index 511308dd8fc..6ba229640fd 100644 --- a/components/script/dom/htmlareaelement.rs +++ b/components/script/dom/htmlareaelement.rs @@ -23,18 +23,18 @@ pub struct HTMLAreaElement { } impl HTMLAreaElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLAreaElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLAreaElement { HTMLAreaElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document), + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), rel_list: Default::default(), } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLAreaElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLAreaElement::new_inherited(local_name, prefix, document), document, HTMLAreaElementBinding::Wrap) } diff --git a/components/script/dom/htmlaudioelement.rs b/components/script/dom/htmlaudioelement.rs index ad3062a1077..95342e2087d 100644 --- a/components/script/dom/htmlaudioelement.rs +++ b/components/script/dom/htmlaudioelement.rs @@ -16,20 +16,20 @@ pub struct HTMLAudioElement { } impl HTMLAudioElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLAudioElement { HTMLAudioElement { htmlmediaelement: - HTMLMediaElement::new_inherited(localName, prefix, document) + HTMLMediaElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLAudioElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLAudioElement::new_inherited(local_name, prefix, document), document, HTMLAudioElementBinding::Wrap) } diff --git a/components/script/dom/htmlbaseelement.rs b/components/script/dom/htmlbaseelement.rs index 9175cc77872..1a70759de44 100644 --- a/components/script/dom/htmlbaseelement.rs +++ b/components/script/dom/htmlbaseelement.rs @@ -23,17 +23,17 @@ pub struct HTMLBaseElement { } impl HTMLBaseElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLBaseElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLBaseElement { HTMLBaseElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLBaseElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLBaseElement::new_inherited(local_name, prefix, document), document, HTMLBaseElementBinding::Wrap) } diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs index c8007c39ea8..993d50a2a76 100644 --- a/components/script/dom/htmlbodyelement.rs +++ b/components/script/dom/htmlbodyelement.rs @@ -32,17 +32,17 @@ pub struct HTMLBodyElement { } impl HTMLBodyElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLBodyElement { HTMLBodyElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document), + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, prefix: Option, document: &Document) + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLBodyElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLBodyElement::new_inherited(local_name, prefix, document), document, HTMLBodyElementBinding::Wrap) } diff --git a/components/script/dom/htmlbrelement.rs b/components/script/dom/htmlbrelement.rs index b2d0067c3f6..09c92ccf45d 100644 --- a/components/script/dom/htmlbrelement.rs +++ b/components/script/dom/htmlbrelement.rs @@ -16,17 +16,17 @@ pub struct HTMLBRElement { } impl HTMLBRElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLBRElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLBRElement { HTMLBRElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLBRElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLBRElement::new_inherited(local_name, prefix, document), document, HTMLBRElementBinding::Wrap) } diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs index 258d535f527..ebb41e01deb 100644 --- a/components/script/dom/htmlbuttonelement.rs +++ b/components/script/dom/htmlbuttonelement.rs @@ -43,22 +43,22 @@ pub struct HTMLButtonElement { } impl HTMLButtonElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLButtonElement { HTMLButtonElement { htmlelement: HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, - localName, prefix, document), + local_name, prefix, document), button_type: Cell::new(ButtonType::Submit) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLButtonElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLButtonElement::new_inherited(local_name, prefix, document), document, HTMLButtonElementBinding::Wrap) } diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index 73b51962fe4..f4a13836eb1 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -56,20 +56,20 @@ pub struct HTMLCanvasElement { } impl HTMLCanvasElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLCanvasElement { HTMLCanvasElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document), + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), context: DOMRefCell::new(None), } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLCanvasElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLCanvasElement::new_inherited(local_name, prefix, document), document, HTMLCanvasElementBinding::Wrap) } diff --git a/components/script/dom/htmldataelement.rs b/components/script/dom/htmldataelement.rs index c4bd0bfd173..2ef14159f10 100644 --- a/components/script/dom/htmldataelement.rs +++ b/components/script/dom/htmldataelement.rs @@ -17,19 +17,19 @@ pub struct HTMLDataElement { } impl HTMLDataElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLDataElement { HTMLDataElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLDataElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLDataElement::new_inherited(local_name, prefix, document), document, HTMLDataElementBinding::Wrap) } diff --git a/components/script/dom/htmldatalistelement.rs b/components/script/dom/htmldatalistelement.rs index b592457fea2..18d2b1e7616 100644 --- a/components/script/dom/htmldatalistelement.rs +++ b/components/script/dom/htmldatalistelement.rs @@ -21,20 +21,20 @@ pub struct HTMLDataListElement { } impl HTMLDataListElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLDataListElement { HTMLDataListElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLDataListElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLDataListElement::new_inherited(local_name, prefix, document), document, HTMLDataListElementBinding::Wrap) } diff --git a/components/script/dom/htmldetailselement.rs b/components/script/dom/htmldetailselement.rs index 3c86a9fd0d9..61f02d0899f 100644 --- a/components/script/dom/htmldetailselement.rs +++ b/components/script/dom/htmldetailselement.rs @@ -28,21 +28,21 @@ pub struct HTMLDetailsElement { } impl HTMLDetailsElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLDetailsElement { HTMLDetailsElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document), + HTMLElement::new_inherited(local_name, prefix, document), toggle_counter: Cell::new(0) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLDetailsElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLDetailsElement::new_inherited(local_name, prefix, document), document, HTMLDetailsElementBinding::Wrap) } diff --git a/components/script/dom/htmldialogelement.rs b/components/script/dom/htmldialogelement.rs index 1afd7f0d76f..567d3a89946 100644 --- a/components/script/dom/htmldialogelement.rs +++ b/components/script/dom/htmldialogelement.rs @@ -22,21 +22,21 @@ pub struct HTMLDialogElement { } impl HTMLDialogElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLDialogElement { HTMLDialogElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document), + HTMLElement::new_inherited(local_name, prefix, document), return_value: DOMRefCell::new(DOMString::new()), } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLDialogElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLDialogElement::new_inherited(local_name, prefix, document), document, HTMLDialogElementBinding::Wrap) } diff --git a/components/script/dom/htmldirectoryelement.rs b/components/script/dom/htmldirectoryelement.rs index 82253004650..63677ce4140 100644 --- a/components/script/dom/htmldirectoryelement.rs +++ b/components/script/dom/htmldirectoryelement.rs @@ -16,20 +16,20 @@ pub struct HTMLDirectoryElement { } impl HTMLDirectoryElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLDirectoryElement { HTMLDirectoryElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLDirectoryElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLDirectoryElement::new_inherited(local_name, prefix, document), document, HTMLDirectoryElementBinding::Wrap) } diff --git a/components/script/dom/htmldivelement.rs b/components/script/dom/htmldivelement.rs index f3fcd6d8a3c..943dd8302ee 100644 --- a/components/script/dom/htmldivelement.rs +++ b/components/script/dom/htmldivelement.rs @@ -16,19 +16,19 @@ pub struct HTMLDivElement { } impl HTMLDivElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLDivElement { HTMLDivElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLDivElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLDivElement::new_inherited(local_name, prefix, document), document, HTMLDivElementBinding::Wrap) } diff --git a/components/script/dom/htmldlistelement.rs b/components/script/dom/htmldlistelement.rs index dbd67a87398..589eb7bc890 100644 --- a/components/script/dom/htmldlistelement.rs +++ b/components/script/dom/htmldlistelement.rs @@ -16,18 +16,18 @@ pub struct HTMLDListElement { } impl HTMLDListElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLDListElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLDListElement { HTMLDListElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLDListElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLDListElement::new_inherited(local_name, prefix, document), document, HTMLDListElementBinding::Wrap) } diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs index 4ec42ced6d6..9fd0faf383d 100644 --- a/components/script/dom/htmlelement.rs +++ b/components/script/dom/htmlelement.rs @@ -62,8 +62,8 @@ impl HTMLElement { } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLElement::new_inherited(localName, prefix, document), + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { + Node::reflect_node(box HTMLElement::new_inherited(local_name, prefix, document), document, HTMLElementBinding::Wrap) } diff --git a/components/script/dom/htmlembedelement.rs b/components/script/dom/htmlembedelement.rs index 195a82958fb..c527ee2cce7 100644 --- a/components/script/dom/htmlembedelement.rs +++ b/components/script/dom/htmlembedelement.rs @@ -16,17 +16,17 @@ pub struct HTMLEmbedElement { } impl HTMLEmbedElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLEmbedElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLEmbedElement { HTMLEmbedElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLEmbedElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLEmbedElement::new_inherited(local_name, prefix, document), document, HTMLEmbedElementBinding::Wrap) } diff --git a/components/script/dom/htmlfieldsetelement.rs b/components/script/dom/htmlfieldsetelement.rs index 86561581bd7..2fde1700088 100644 --- a/components/script/dom/htmlfieldsetelement.rs +++ b/components/script/dom/htmlfieldsetelement.rs @@ -26,21 +26,21 @@ pub struct HTMLFieldSetElement { } impl HTMLFieldSetElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLFieldSetElement { HTMLFieldSetElement { htmlelement: HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, - localName, prefix, document) + local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLFieldSetElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLFieldSetElement::new_inherited(local_name, prefix, document), document, HTMLFieldSetElementBinding::Wrap) } diff --git a/components/script/dom/htmlfontelement.rs b/components/script/dom/htmlfontelement.rs index 7dacde26cf9..ee7c67e45e5 100644 --- a/components/script/dom/htmlfontelement.rs +++ b/components/script/dom/htmlfontelement.rs @@ -25,17 +25,17 @@ pub struct HTMLFontElement { impl HTMLFontElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLFontElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLFontElement { HTMLFontElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document), + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLFontElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLFontElement::new_inherited(local_name, prefix, document), document, HTMLFontElementBinding::Wrap) } diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index ff0f6e53b92..d6a794621e5 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -65,11 +65,11 @@ pub struct HTMLFormElement { } impl HTMLFormElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLFormElement { HTMLFormElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document), + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), marked_for_reset: Cell::new(false), elements: Default::default(), generation_id: Cell::new(GenerationId(0)) @@ -77,10 +77,10 @@ impl HTMLFormElement { } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLFormElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLFormElement::new_inherited(local_name, prefix, document), document, HTMLFormElementBinding::Wrap) } diff --git a/components/script/dom/htmlframeelement.rs b/components/script/dom/htmlframeelement.rs index b2b46777843..b8ba42bec63 100644 --- a/components/script/dom/htmlframeelement.rs +++ b/components/script/dom/htmlframeelement.rs @@ -16,17 +16,17 @@ pub struct HTMLFrameElement { } impl HTMLFrameElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLFrameElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLFrameElement { HTMLFrameElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLFrameElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLFrameElement::new_inherited(local_name, prefix, document), document, HTMLFrameElementBinding::Wrap) } diff --git a/components/script/dom/htmlframesetelement.rs b/components/script/dom/htmlframesetelement.rs index 08f23eb1b26..bac782288b3 100644 --- a/components/script/dom/htmlframesetelement.rs +++ b/components/script/dom/htmlframesetelement.rs @@ -19,20 +19,20 @@ pub struct HTMLFrameSetElement { } impl HTMLFrameSetElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLFrameSetElement { HTMLFrameSetElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLFrameSetElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLFrameSetElement::new_inherited(local_name, prefix, document), document, HTMLFrameSetElementBinding::Wrap) } diff --git a/components/script/dom/htmlheadelement.rs b/components/script/dom/htmlheadelement.rs index cc88a4e4c87..26d966a05d1 100644 --- a/components/script/dom/htmlheadelement.rs +++ b/components/script/dom/htmlheadelement.rs @@ -22,19 +22,19 @@ pub struct HTMLHeadElement { } impl HTMLHeadElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLHeadElement { HTMLHeadElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLHeadElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLHeadElement::new_inherited(local_name, prefix, document), document, HTMLHeadElementBinding::Wrap) } diff --git a/components/script/dom/htmlheadingelement.rs b/components/script/dom/htmlheadingelement.rs index 94710294570..90fbd259818 100644 --- a/components/script/dom/htmlheadingelement.rs +++ b/components/script/dom/htmlheadingelement.rs @@ -27,23 +27,23 @@ pub struct HTMLHeadingElement { } impl HTMLHeadingElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document, level: HeadingLevel) -> HTMLHeadingElement { HTMLHeadingElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document), + HTMLElement::new_inherited(local_name, prefix, document), level: level, } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document, level: HeadingLevel) -> Root { - Node::reflect_node(box HTMLHeadingElement::new_inherited(localName, prefix, document, level), + Node::reflect_node(box HTMLHeadingElement::new_inherited(local_name, prefix, document, level), document, HTMLHeadingElementBinding::Wrap) } diff --git a/components/script/dom/htmlhrelement.rs b/components/script/dom/htmlhrelement.rs index 432b56eb345..ee2e9f4f12e 100644 --- a/components/script/dom/htmlhrelement.rs +++ b/components/script/dom/htmlhrelement.rs @@ -21,17 +21,17 @@ pub struct HTMLHRElement { } impl HTMLHRElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLHRElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLHRElement { HTMLHRElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLHRElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLHRElement::new_inherited(local_name, prefix, document), document, HTMLHRElementBinding::Wrap) } diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 220eb7d1c7c..1671c933074 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -173,11 +173,11 @@ impl HTMLIFrameElement { self.upcast::().dirty(NodeDamage::OtherNodeDamage); } - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLIFrameElement { HTMLIFrameElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document), + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), pipeline_id: Cell::new(None), sandbox: Default::default(), sandbox_allowance: Cell::new(None), @@ -187,10 +187,10 @@ impl HTMLIFrameElement { } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLIFrameElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLIFrameElement::new_inherited(local_name, prefix, document), document, 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.upcast::().is_in_doc() { let window = window_from_node(iframe); @@ -450,7 +450,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement { let self_url = 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()) } else { None @@ -479,16 +479,16 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement { // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/goBack 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 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 - fn Reload(&self, _hardReload: bool) -> ErrorResult { + fn Reload(&self, _hard_reload: bool) -> ErrorResult { if self.Mozbrowser() { if self.upcast::().is_in_doc() { self.navigate_or_reload_child_browsing_context(None); @@ -632,7 +632,7 @@ impl VirtualMethods for HTMLIFrameElement { // HTMLIFrameElement::contentDocument. let self_url = 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 { (None, None) diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index f03e43d9f2e..9236c75c699 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -194,9 +194,9 @@ impl HTMLImageElement { } } } - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLImageElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLImageElement { HTMLImageElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document), + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), current_request: DOMRefCell::new(ImageRequest { state: State::Unavailable, parsed_url: None, @@ -215,10 +215,10 @@ impl HTMLImageElement { } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLImageElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLImageElement::new_inherited(local_name, prefix, document), document, HTMLImageElementBinding::Wrap) } diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 51f9c4fb080..aded18162ba 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -125,12 +125,12 @@ static DEFAULT_INPUT_SIZE: u32 = 20; static DEFAULT_MAX_LENGTH: i32 = -1; impl HTMLInputElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLInputElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLInputElement { let chan = document.window().constellation_chan().clone(); HTMLInputElement { htmlelement: 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), placeholder: DOMRefCell::new(DOMString::new()), checked_changed: Cell::new(false), @@ -145,10 +145,10 @@ impl HTMLInputElement { } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLInputElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLInputElement::new_inherited(local_name, prefix, document), document, HTMLInputElementBinding::Wrap) } diff --git a/components/script/dom/htmllabelelement.rs b/components/script/dom/htmllabelelement.rs index f71e243c168..39869a50f49 100644 --- a/components/script/dom/htmllabelelement.rs +++ b/components/script/dom/htmllabelelement.rs @@ -25,20 +25,20 @@ pub struct HTMLLabelElement { } impl HTMLLabelElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLLabelElement { HTMLLabelElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLLabelElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLLabelElement::new_inherited(local_name, prefix, document), document, HTMLLabelElementBinding::Wrap) } diff --git a/components/script/dom/htmllegendelement.rs b/components/script/dom/htmllegendelement.rs index 91bc29b4099..e5c5e29aae2 100644 --- a/components/script/dom/htmllegendelement.rs +++ b/components/script/dom/htmllegendelement.rs @@ -23,19 +23,19 @@ pub struct HTMLLegendElement { } impl HTMLLegendElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLLegendElement { - HTMLLegendElement { htmlelement: HTMLElement::new_inherited(localName, prefix, document) } + HTMLLegendElement { htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLLegendElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLLegendElement::new_inherited(local_name, prefix, document), document, HTMLLegendElementBinding::Wrap) } diff --git a/components/script/dom/htmllielement.rs b/components/script/dom/htmllielement.rs index 32915a5c351..d08b677a947 100644 --- a/components/script/dom/htmllielement.rs +++ b/components/script/dom/htmllielement.rs @@ -20,17 +20,17 @@ pub struct HTMLLIElement { } impl HTMLLIElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLLIElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLLIElement { HTMLLIElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLLIElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLLIElement::new_inherited(local_name, prefix, document), document, HTMLLIElementBinding::Wrap) } diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs index 07cd47cbcec..c2a2b3e9040 100644 --- a/components/script/dom/htmllinkelement.rs +++ b/components/script/dom/htmllinkelement.rs @@ -57,10 +57,10 @@ pub struct HTMLLinkElement { } impl HTMLLinkElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document, creator: ElementCreator) -> HTMLLinkElement { HTMLLinkElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document), + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), rel_list: Default::default(), parser_inserted: Cell::new(creator == ElementCreator::ParserCreated), stylesheet: DOMRefCell::new(None), @@ -68,11 +68,11 @@ impl HTMLLinkElement { } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document, creator: ElementCreator) -> Root { - Node::reflect_node(box HTMLLinkElement::new_inherited(localName, prefix, document, creator), + Node::reflect_node(box HTMLLinkElement::new_inherited(local_name, prefix, document, creator), document, HTMLLinkElementBinding::Wrap) } diff --git a/components/script/dom/htmlmapelement.rs b/components/script/dom/htmlmapelement.rs index ac4b4970bb3..5bf05ef7747 100644 --- a/components/script/dom/htmlmapelement.rs +++ b/components/script/dom/htmlmapelement.rs @@ -16,19 +16,19 @@ pub struct HTMLMapElement { } impl HTMLMapElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLMapElement { HTMLMapElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLMapElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLMapElement::new_inherited(local_name, prefix, document), document, HTMLMapElementBinding::Wrap) } diff --git a/components/script/dom/htmlmetaelement.rs b/components/script/dom/htmlmetaelement.rs index e6f86f41d86..34e4dbdfefe 100644 --- a/components/script/dom/htmlmetaelement.rs +++ b/components/script/dom/htmlmetaelement.rs @@ -31,20 +31,20 @@ pub struct HTMLMetaElement { } impl HTMLMetaElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLMetaElement { HTMLMetaElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document), + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), stylesheet: DOMRefCell::new(None), } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLMetaElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLMetaElement::new_inherited(local_name, prefix, document), document, HTMLMetaElementBinding::Wrap) } diff --git a/components/script/dom/htmlmeterelement.rs b/components/script/dom/htmlmeterelement.rs index e0844d0dd55..151ea555c1b 100644 --- a/components/script/dom/htmlmeterelement.rs +++ b/components/script/dom/htmlmeterelement.rs @@ -18,19 +18,19 @@ pub struct HTMLMeterElement { } impl HTMLMeterElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLMeterElement { HTMLMeterElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLMeterElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLMeterElement::new_inherited(local_name, prefix, document), document, HTMLMeterElementBinding::Wrap) } diff --git a/components/script/dom/htmlmodelement.rs b/components/script/dom/htmlmodelement.rs index c34b27762ca..86357e820f4 100644 --- a/components/script/dom/htmlmodelement.rs +++ b/components/script/dom/htmlmodelement.rs @@ -16,20 +16,20 @@ pub struct HTMLModElement { } impl HTMLModElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLModElement { HTMLModElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLModElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLModElement::new_inherited(local_name, prefix, document), document, HTMLModElementBinding::Wrap) } diff --git a/components/script/dom/htmlobjectelement.rs b/components/script/dom/htmlobjectelement.rs index 593895461b5..a54cd5c1eb9 100644 --- a/components/script/dom/htmlobjectelement.rs +++ b/components/script/dom/htmlobjectelement.rs @@ -28,21 +28,21 @@ pub struct HTMLObjectElement { } impl HTMLObjectElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLObjectElement { HTMLObjectElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document), + HTMLElement::new_inherited(local_name, prefix, document), image: DOMRefCell::new(None), } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLObjectElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLObjectElement::new_inherited(local_name, prefix, document), document, HTMLObjectElementBinding::Wrap) } diff --git a/components/script/dom/htmlolistelement.rs b/components/script/dom/htmlolistelement.rs index fe65339bc80..9447053e5e8 100644 --- a/components/script/dom/htmlolistelement.rs +++ b/components/script/dom/htmlolistelement.rs @@ -16,19 +16,19 @@ pub struct HTMLOListElement { } impl HTMLOListElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLOListElement { HTMLOListElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLOListElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLOListElement::new_inherited(local_name, prefix, document), document, HTMLOListElementBinding::Wrap) } diff --git a/components/script/dom/htmloptgroupelement.rs b/components/script/dom/htmloptgroupelement.rs index 9a725975d0a..3d6f020e6f1 100644 --- a/components/script/dom/htmloptgroupelement.rs +++ b/components/script/dom/htmloptgroupelement.rs @@ -23,21 +23,21 @@ pub struct HTMLOptGroupElement { } impl HTMLOptGroupElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLOptGroupElement { HTMLOptGroupElement { htmlelement: HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, - localName, prefix, document) + local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLOptGroupElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLOptGroupElement::new_inherited(local_name, prefix, document), document, HTMLOptGroupElementBinding::Wrap) } diff --git a/components/script/dom/htmloptionelement.rs b/components/script/dom/htmloptionelement.rs index 9183a78de0c..5cb0ae0fc51 100644 --- a/components/script/dom/htmloptionelement.rs +++ b/components/script/dom/htmloptionelement.rs @@ -39,23 +39,23 @@ pub struct HTMLOptionElement { } impl HTMLOptionElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLOptionElement { HTMLOptionElement { htmlelement: HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, - localName, prefix, document), + local_name, prefix, document), selectedness: Cell::new(false), dirtiness: Cell::new(false), } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLOptionElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLOptionElement::new_inherited(local_name, prefix, document), document, HTMLOptionElementBinding::Wrap) } diff --git a/components/script/dom/htmloutputelement.rs b/components/script/dom/htmloutputelement.rs index 32e123a4700..07b415770db 100644 --- a/components/script/dom/htmloutputelement.rs +++ b/components/script/dom/htmloutputelement.rs @@ -21,20 +21,20 @@ pub struct HTMLOutputElement { } impl HTMLOutputElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLOutputElement { HTMLOutputElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLOutputElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLOutputElement::new_inherited(local_name, prefix, document), document, HTMLOutputElementBinding::Wrap) } diff --git a/components/script/dom/htmlparagraphelement.rs b/components/script/dom/htmlparagraphelement.rs index 5b913da8801..f437b429b9c 100644 --- a/components/script/dom/htmlparagraphelement.rs +++ b/components/script/dom/htmlparagraphelement.rs @@ -16,20 +16,20 @@ pub struct HTMLParagraphElement { } impl HTMLParagraphElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLParagraphElement { HTMLParagraphElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLParagraphElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLParagraphElement::new_inherited(local_name, prefix, document), document, HTMLParagraphElementBinding::Wrap) } diff --git a/components/script/dom/htmlparamelement.rs b/components/script/dom/htmlparamelement.rs index b2296f7750b..8a335a90bec 100644 --- a/components/script/dom/htmlparamelement.rs +++ b/components/script/dom/htmlparamelement.rs @@ -16,20 +16,20 @@ pub struct HTMLParamElement { } impl HTMLParamElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLParamElement { HTMLParamElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLParamElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLParamElement::new_inherited(local_name, prefix, document), document, HTMLParamElementBinding::Wrap) } diff --git a/components/script/dom/htmlpreelement.rs b/components/script/dom/htmlpreelement.rs index d39bb44f21f..599d9731e2e 100644 --- a/components/script/dom/htmlpreelement.rs +++ b/components/script/dom/htmlpreelement.rs @@ -16,20 +16,20 @@ pub struct HTMLPreElement { } impl HTMLPreElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLPreElement { HTMLPreElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLPreElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLPreElement::new_inherited(local_name, prefix, document), document, HTMLPreElementBinding::Wrap) } diff --git a/components/script/dom/htmlprogresselement.rs b/components/script/dom/htmlprogresselement.rs index b2f7d818210..81275b9fe72 100644 --- a/components/script/dom/htmlprogresselement.rs +++ b/components/script/dom/htmlprogresselement.rs @@ -18,20 +18,20 @@ pub struct HTMLProgressElement { } impl HTMLProgressElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLProgressElement { HTMLProgressElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLProgressElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLProgressElement::new_inherited(local_name, prefix, document), document, HTMLProgressElementBinding::Wrap) } diff --git a/components/script/dom/htmlquoteelement.rs b/components/script/dom/htmlquoteelement.rs index 81eb0d37864..d72f8dc67bd 100644 --- a/components/script/dom/htmlquoteelement.rs +++ b/components/script/dom/htmlquoteelement.rs @@ -16,20 +16,20 @@ pub struct HTMLQuoteElement { } impl HTMLQuoteElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLQuoteElement { HTMLQuoteElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLQuoteElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLQuoteElement::new_inherited(local_name, prefix, document), document, HTMLQuoteElementBinding::Wrap) } diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index 6484de1e029..19de9debcd4 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -64,11 +64,11 @@ pub struct HTMLScriptElement { } impl HTMLScriptElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document, creator: ElementCreator) -> HTMLScriptElement { HTMLScriptElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document), + HTMLElement::new_inherited(local_name, prefix, document), already_started: Cell::new(false), parser_inserted: Cell::new(creator == ElementCreator::ParserCreated), non_blocking: Cell::new(creator != ElementCreator::ParserCreated), @@ -79,9 +79,9 @@ impl HTMLScriptElement { } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, prefix: Option, document: &Document, + pub fn new(local_name: Atom, prefix: Option, document: &Document, creator: ElementCreator) -> Root { - Node::reflect_node(box HTMLScriptElement::new_inherited(localName, prefix, document, creator), + Node::reflect_node(box HTMLScriptElement::new_inherited(local_name, prefix, document, creator), document, HTMLScriptElementBinding::Wrap) } diff --git a/components/script/dom/htmlselectelement.rs b/components/script/dom/htmlselectelement.rs index cb42ca2521b..222dff3e52c 100644 --- a/components/script/dom/htmlselectelement.rs +++ b/components/script/dom/htmlselectelement.rs @@ -34,21 +34,21 @@ pub struct HTMLSelectElement { static DEFAULT_SELECT_SIZE: u32 = 0; impl HTMLSelectElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLSelectElement { HTMLSelectElement { htmlelement: HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, - localName, prefix, document) + local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLSelectElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLSelectElement::new_inherited(local_name, prefix, document), document, HTMLSelectElementBinding::Wrap) } diff --git a/components/script/dom/htmlsourceelement.rs b/components/script/dom/htmlsourceelement.rs index c369ab86aaf..3e1b878b802 100644 --- a/components/script/dom/htmlsourceelement.rs +++ b/components/script/dom/htmlsourceelement.rs @@ -16,20 +16,20 @@ pub struct HTMLSourceElement { } impl HTMLSourceElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLSourceElement { HTMLSourceElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLSourceElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLSourceElement::new_inherited(local_name, prefix, document), document, HTMLSourceElementBinding::Wrap) } diff --git a/components/script/dom/htmlspanelement.rs b/components/script/dom/htmlspanelement.rs index d95975c135c..d8fb4554b49 100644 --- a/components/script/dom/htmlspanelement.rs +++ b/components/script/dom/htmlspanelement.rs @@ -16,17 +16,17 @@ pub struct HTMLSpanElement { } impl HTMLSpanElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLSpanElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLSpanElement { HTMLSpanElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLSpanElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLSpanElement::new_inherited(local_name, prefix, document), document, HTMLSpanElementBinding::Wrap) } diff --git a/components/script/dom/htmlstyleelement.rs b/components/script/dom/htmlstyleelement.rs index c7cc4cc44a3..5e0706e5d65 100644 --- a/components/script/dom/htmlstyleelement.rs +++ b/components/script/dom/htmlstyleelement.rs @@ -28,20 +28,20 @@ pub struct HTMLStyleElement { } impl HTMLStyleElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLStyleElement { HTMLStyleElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document), + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), stylesheet: DOMRefCell::new(None), } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLStyleElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLStyleElement::new_inherited(local_name, prefix, document), document, HTMLStyleElementBinding::Wrap) } diff --git a/components/script/dom/htmltablecaptionelement.rs b/components/script/dom/htmltablecaptionelement.rs index fd01e2ee3fa..89c5f8307c9 100644 --- a/components/script/dom/htmltablecaptionelement.rs +++ b/components/script/dom/htmltablecaptionelement.rs @@ -16,20 +16,20 @@ pub struct HTMLTableCaptionElement { } impl HTMLTableCaptionElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLTableCaptionElement { HTMLTableCaptionElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLTableCaptionElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLTableCaptionElement::new_inherited(local_name, prefix, document), document, HTMLTableCaptionElementBinding::Wrap) } diff --git a/components/script/dom/htmltablecolelement.rs b/components/script/dom/htmltablecolelement.rs index b5e69aaadc1..38f839a811e 100644 --- a/components/script/dom/htmltablecolelement.rs +++ b/components/script/dom/htmltablecolelement.rs @@ -16,20 +16,20 @@ pub struct HTMLTableColElement { } impl HTMLTableColElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLTableColElement { HTMLTableColElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLTableColElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLTableColElement::new_inherited(local_name, prefix, document), document, HTMLTableColElementBinding::Wrap) } diff --git a/components/script/dom/htmltabledatacellelement.rs b/components/script/dom/htmltabledatacellelement.rs index 4d35fe699e7..989aa0e12fe 100644 --- a/components/script/dom/htmltabledatacellelement.rs +++ b/components/script/dom/htmltabledatacellelement.rs @@ -16,19 +16,19 @@ pub struct HTMLTableDataCellElement { } impl HTMLTableDataCellElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLTableDataCellElement { HTMLTableDataCellElement { htmltablecellelement: - HTMLTableCellElement::new_inherited(localName, prefix, document) + HTMLTableCellElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, prefix: Option, document: &Document) + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLTableDataCellElement::new_inherited(localName, + Node::reflect_node(box HTMLTableDataCellElement::new_inherited(local_name, prefix, document), document, diff --git a/components/script/dom/htmltableelement.rs b/components/script/dom/htmltableelement.rs index 1d189f4a21f..8eb6e697564 100644 --- a/components/script/dom/htmltableelement.rs +++ b/components/script/dom/htmltableelement.rs @@ -49,10 +49,10 @@ impl CollectionFilter for TableRowFilter { } impl HTMLTableElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLTableElement { HTMLTableElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document), + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), border: Cell::new(None), cellspacing: Cell::new(None), tbodies: Default::default(), @@ -60,9 +60,9 @@ impl HTMLTableElement { } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, prefix: Option, document: &Document) + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLTableElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLTableElement::new_inherited(local_name, prefix, document), document, HTMLTableElementBinding::Wrap) } diff --git a/components/script/dom/htmltableheadercellelement.rs b/components/script/dom/htmltableheadercellelement.rs index da980e7d840..9e0247f0f1b 100644 --- a/components/script/dom/htmltableheadercellelement.rs +++ b/components/script/dom/htmltableheadercellelement.rs @@ -16,20 +16,20 @@ pub struct HTMLTableHeaderCellElement { } impl HTMLTableHeaderCellElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLTableHeaderCellElement { HTMLTableHeaderCellElement { htmltablecellelement: - HTMLTableCellElement::new_inherited(localName, prefix, document) + HTMLTableCellElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLTableHeaderCellElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLTableHeaderCellElement::new_inherited(local_name, prefix, document), document, HTMLTableHeaderCellElementBinding::Wrap) } diff --git a/components/script/dom/htmltablerowelement.rs b/components/script/dom/htmltablerowelement.rs index 92c62115bd4..495c2e11e18 100644 --- a/components/script/dom/htmltablerowelement.rs +++ b/components/script/dom/htmltablerowelement.rs @@ -40,18 +40,18 @@ pub struct HTMLTableRowElement { } impl HTMLTableRowElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLTableRowElement { HTMLTableRowElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document), + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), cells: Default::default(), } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, prefix: Option, document: &Document) + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLTableRowElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLTableRowElement::new_inherited(local_name, prefix, document), document, HTMLTableRowElementBinding::Wrap) } diff --git a/components/script/dom/htmltablesectionelement.rs b/components/script/dom/htmltablesectionelement.rs index 3279e03ff0c..6d5648b7c9d 100644 --- a/components/script/dom/htmltablesectionelement.rs +++ b/components/script/dom/htmltablesectionelement.rs @@ -25,17 +25,17 @@ pub struct HTMLTableSectionElement { } impl HTMLTableSectionElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLTableSectionElement { HTMLTableSectionElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document), + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, prefix: Option, document: &Document) + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLTableSectionElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLTableSectionElement::new_inherited(local_name, prefix, document), document, HTMLTableSectionElementBinding::Wrap) } diff --git a/components/script/dom/htmltemplateelement.rs b/components/script/dom/htmltemplateelement.rs index aa98d849c85..bf659987620 100644 --- a/components/script/dom/htmltemplateelement.rs +++ b/components/script/dom/htmltemplateelement.rs @@ -25,21 +25,21 @@ pub struct HTMLTemplateElement { } impl HTMLTemplateElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLTemplateElement { HTMLTemplateElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document), + HTMLElement::new_inherited(local_name, prefix, document), contents: MutNullableHeap::new(None), } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLTemplateElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLTemplateElement::new_inherited(local_name, prefix, document), document, HTMLTemplateElementBinding::Wrap) } diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs index 5df0778fa2b..b43f4f75d5c 100644 --- a/components/script/dom/htmltextareaelement.rs +++ b/components/script/dom/htmltextareaelement.rs @@ -96,14 +96,14 @@ static DEFAULT_COLS: u32 = 20; static DEFAULT_ROWS: u32 = 2; impl HTMLTextAreaElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLTextAreaElement { let chan = document.window().constellation_chan().clone(); HTMLTextAreaElement { htmlelement: HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE, - localName, prefix, document), + local_name, prefix, document), textinput: DOMRefCell::new(TextInput::new( Lines::Multiple, DOMString::new(), chan, None, SelectionDirection::None)), value_changed: Cell::new(false), @@ -111,10 +111,10 @@ impl HTMLTextAreaElement { } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLTextAreaElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLTextAreaElement::new_inherited(local_name, prefix, document), document, HTMLTextAreaElementBinding::Wrap) } diff --git a/components/script/dom/htmltimeelement.rs b/components/script/dom/htmltimeelement.rs index bcf214cf5f6..8ba41e25a2b 100644 --- a/components/script/dom/htmltimeelement.rs +++ b/components/script/dom/htmltimeelement.rs @@ -16,17 +16,17 @@ pub struct HTMLTimeElement { } impl HTMLTimeElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLTimeElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLTimeElement { HTMLTimeElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLTimeElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLTimeElement::new_inherited(local_name, prefix, document), document, HTMLTimeElementBinding::Wrap) } diff --git a/components/script/dom/htmltitleelement.rs b/components/script/dom/htmltitleelement.rs index 077b6d6afdc..49994c4bcb8 100644 --- a/components/script/dom/htmltitleelement.rs +++ b/components/script/dom/htmltitleelement.rs @@ -22,17 +22,17 @@ pub struct HTMLTitleElement { } impl HTMLTitleElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLTitleElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLTitleElement { HTMLTitleElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLTitleElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLTitleElement::new_inherited(local_name, prefix, document), document, HTMLTitleElementBinding::Wrap) } diff --git a/components/script/dom/htmltrackelement.rs b/components/script/dom/htmltrackelement.rs index 979cbe17079..ae96aae3306 100644 --- a/components/script/dom/htmltrackelement.rs +++ b/components/script/dom/htmltrackelement.rs @@ -16,17 +16,17 @@ pub struct HTMLTrackElement { } impl HTMLTrackElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLTrackElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLTrackElement { HTMLTrackElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLTrackElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLTrackElement::new_inherited(local_name, prefix, document), document, HTMLTrackElementBinding::Wrap) } diff --git a/components/script/dom/htmlulistelement.rs b/components/script/dom/htmlulistelement.rs index 2b38b49f1db..b5da24728fc 100644 --- a/components/script/dom/htmlulistelement.rs +++ b/components/script/dom/htmlulistelement.rs @@ -16,17 +16,17 @@ pub struct HTMLUListElement { } impl HTMLUListElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLUListElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLUListElement { HTMLUListElement { - htmlelement: HTMLElement::new_inherited(localName, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLUListElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLUListElement::new_inherited(local_name, prefix, document), document, HTMLUListElementBinding::Wrap) } diff --git a/components/script/dom/htmlunknownelement.rs b/components/script/dom/htmlunknownelement.rs index 1bf321735fc..4ae99cfae58 100644 --- a/components/script/dom/htmlunknownelement.rs +++ b/components/script/dom/htmlunknownelement.rs @@ -16,20 +16,20 @@ pub struct HTMLUnknownElement { } impl HTMLUnknownElement { - fn new_inherited(localName: Atom, + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLUnknownElement { HTMLUnknownElement { htmlelement: - HTMLElement::new_inherited(localName, prefix, document) + HTMLElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLUnknownElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLUnknownElement::new_inherited(local_name, prefix, document), document, HTMLUnknownElementBinding::Wrap) } diff --git a/components/script/dom/htmlvideoelement.rs b/components/script/dom/htmlvideoelement.rs index 4c6f9663f97..d9635538e9b 100644 --- a/components/script/dom/htmlvideoelement.rs +++ b/components/script/dom/htmlvideoelement.rs @@ -16,18 +16,18 @@ pub struct HTMLVideoElement { } impl HTMLVideoElement { - fn new_inherited(localName: Atom, prefix: Option, document: &Document) -> HTMLVideoElement { + fn new_inherited(local_name: Atom, prefix: Option, document: &Document) -> HTMLVideoElement { HTMLVideoElement { htmlmediaelement: - HTMLMediaElement::new_inherited(localName, prefix, document) + HTMLMediaElement::new_inherited(local_name, prefix, document) } } #[allow(unrooted_must_root)] - pub fn new(localName: Atom, + pub fn new(local_name: Atom, prefix: Option, document: &Document) -> Root { - Node::reflect_node(box HTMLVideoElement::new_inherited(localName, prefix, document), + Node::reflect_node(box HTMLVideoElement::new_inherited(local_name, prefix, document), document, HTMLVideoElementBinding::Wrap) } diff --git a/components/script/dom/keyboardevent.rs b/components/script/dom/keyboardevent.rs index 71b00767a8e..d21f53eb609 100644 --- a/components/script/dom/keyboardevent.rs +++ b/components/script/dom/keyboardevent.rs @@ -68,7 +68,7 @@ impl KeyboardEvent { pub fn new(window: &Window, type_: DOMString, - canBubble: bool, + can_bubble: bool, cancelable: bool, view: Option<&Window>, _detail: i32, @@ -78,26 +78,26 @@ impl KeyboardEvent { code: DOMString, location: u32, repeat: bool, - isComposing: bool, - ctrlKey: bool, - altKey: bool, - shiftKey: bool, - metaKey: bool, + is_composing: bool, + ctrl_key: bool, + alt_key: bool, + shift_key: bool, + meta_key: bool, char_code: Option, key_code: u32) -> Root { 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()); ev.key.set(key); *ev.code.borrow_mut() = code; - ev.ctrl.set(ctrlKey); - ev.alt.set(altKey); - ev.shift.set(shiftKey); - ev.meta.set(metaKey); + ev.ctrl.set(ctrl_key); + ev.alt.set(alt_key); + ev.shift.set(shift_key); + ev.meta.set(meta_key); ev.char_code.set(char_code); ev.printable.set(ch); ev.key_code.set(key_code); - ev.is_composing.set(isComposing); + ev.is_composing.set(is_composing); ev } @@ -759,13 +759,13 @@ impl KeyEventProperties { impl KeyboardEventMethods for KeyboardEvent { // https://w3c.github.io/uievents/#widl-KeyboardEvent-initKeyboardEvent fn InitKeyboardEvent(&self, - typeArg: DOMString, - canBubbleArg: bool, - cancelableArg: bool, - viewArg: Option<&Window>, - keyArg: DOMString, - locationArg: u32, - _modifiersListArg: DOMString, + type_arg: DOMString, + can_bubble_arg: bool, + cancelable_arg: bool, + view_arg: Option<&Window>, + key_arg: DOMString, + location_arg: u32, + _modifiers_list_arg: DOMString, repeat: bool, _locale: DOMString) { if self.upcast::().dispatching() { @@ -773,9 +773,9 @@ impl KeyboardEventMethods for KeyboardEvent { } self.upcast::() - .InitUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, 0); - *self.key_string.borrow_mut() = keyArg; - self.location.set(locationArg); + .InitUIEvent(type_arg, can_bubble_arg, cancelable_arg, view_arg, 0); + *self.key_string.borrow_mut() = key_arg; + self.location.set(location_arg); self.repeat.set(repeat); } @@ -825,8 +825,8 @@ impl KeyboardEventMethods for KeyboardEvent { } // https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate - fn GetModifierState(&self, keyArg: DOMString) -> bool { - match &*keyArg { + fn GetModifierState(&self, key_arg: DOMString) -> bool { + match &*key_arg { "Ctrl" => self.CtrlKey(), "Alt" => self.AltKey(), "Shift" => self.ShiftKey(), diff --git a/components/script/dom/location.rs b/components/script/dom/location.rs index 72361193aa3..0c16c6a5f06 100644 --- a/components/script/dom/location.rs +++ b/components/script/dom/location.rs @@ -62,7 +62,7 @@ impl LocationMethods for Location { // https://html.spec.whatwg.org/multipage/#dom-location-hash fn Hash(&self) -> USVString { - UrlHelper::Hash(&self.get_url()) + UrlHelper::hash(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-hash @@ -70,37 +70,37 @@ impl LocationMethods for Location { if value.0.is_empty() { 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 fn Host(&self) -> USVString { - UrlHelper::Host(&self.get_url()) + UrlHelper::host(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-host 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 fn Origin(&self) -> USVString { - UrlHelper::Origin(&self.get_url()) + UrlHelper::origin(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-hostname fn Hostname(&self) -> USVString { - UrlHelper::Hostname(&self.get_url()) + UrlHelper::hostname(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-hostname 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 fn Href(&self) -> USVString { - UrlHelper::Href(&self.get_url()) + UrlHelper::href(&self.get_url()) } // 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 fn Pathname(&self) -> USVString { - UrlHelper::Pathname(&self.get_url()) + UrlHelper::pathname(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-pathname 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 fn Port(&self) -> USVString { - UrlHelper::Port(&self.get_url()) + UrlHelper::port(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-port 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 fn Protocol(&self) -> USVString { - UrlHelper::Protocol(&self.get_url()) + UrlHelper::protocol(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-protocol 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 @@ -147,11 +147,11 @@ impl LocationMethods for Location { // https://html.spec.whatwg.org/multipage/#dom-location-search fn Search(&self) -> USVString { - UrlHelper::Search(&self.get_url()) + UrlHelper::search(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-search fn SetSearch(&self, value: USVString) { - self.set_url_component(value, UrlHelper::SetSearch); + self.set_url_component(value, UrlHelper::set_search); } } diff --git a/components/script/dom/mouseevent.rs b/components/script/dom/mouseevent.rs index 78b1a33005f..659a28226b7 100644 --- a/components/script/dom/mouseevent.rs +++ b/components/script/dom/mouseevent.rs @@ -59,26 +59,26 @@ impl MouseEvent { pub fn new(window: &Window, type_: DOMString, - canBubble: EventBubbles, + can_bubble: EventBubbles, cancelable: EventCancelable, view: Option<&Window>, detail: i32, - screenX: i32, - screenY: i32, - clientX: i32, - clientY: i32, - ctrlKey: bool, - altKey: bool, - shiftKey: bool, - metaKey: bool, + screen_x: i32, + screen_y: i32, + client_x: i32, + client_y: i32, + ctrl_key: bool, + alt_key: bool, + shift_key: bool, + meta_key: bool, button: i16, - relatedTarget: Option<&EventTarget>) -> Root { + related_target: Option<&EventTarget>) -> Root { 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, - screenX, screenY, clientX, clientY, - ctrlKey, altKey, shiftKey, metaKey, - button, relatedTarget); + screen_x, screen_y, client_x, client_y, + ctrl_key, alt_key, shift_key, meta_key, + button, related_target); ev } @@ -166,37 +166,37 @@ impl MouseEventMethods for MouseEvent { // https://w3c.github.io/uievents/#widl-MouseEvent-initMouseEvent fn InitMouseEvent(&self, - typeArg: DOMString, - canBubbleArg: bool, - cancelableArg: bool, - viewArg: Option<&Window>, - detailArg: i32, - screenXArg: i32, - screenYArg: i32, - clientXArg: i32, - clientYArg: i32, - ctrlKeyArg: bool, - altKeyArg: bool, - shiftKeyArg: bool, - metaKeyArg: bool, - buttonArg: i16, - relatedTargetArg: Option<&EventTarget>) { + type_arg: DOMString, + can_bubble_arg: bool, + cancelable_arg: bool, + view_arg: Option<&Window>, + detail_arg: i32, + screen_x_arg: i32, + screen_y_arg: i32, + client_x_arg: i32, + client_y_arg: i32, + ctrl_key_arg: bool, + alt_key_arg: bool, + shift_key_arg: bool, + meta_key_arg: bool, + button_arg: i16, + related_target_arg: Option<&EventTarget>) { if self.upcast::().dispatching() { return; } self.upcast::() - .InitUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg); - self.screen_x.set(screenXArg); - self.screen_y.set(screenYArg); - self.client_x.set(clientXArg); - self.client_y.set(clientYArg); - self.ctrl_key.set(ctrlKeyArg); - self.alt_key.set(altKeyArg); - self.shift_key.set(shiftKeyArg); - self.meta_key.set(metaKeyArg); - self.button.set(buttonArg); - self.related_target.set(relatedTargetArg); + .InitUIEvent(type_arg, can_bubble_arg, cancelable_arg, view_arg, detail_arg); + self.screen_x.set(screen_x_arg); + self.screen_y.set(screen_y_arg); + self.client_x.set(client_x_arg); + self.client_y.set(client_y_arg); + self.ctrl_key.set(ctrl_key_arg); + self.alt_key.set(alt_key_arg); + self.shift_key.set(shift_key_arg); + self.meta_key.set(meta_key_arg); + self.button.set(button_arg); + self.related_target.set(related_target_arg); } // https://dom.spec.whatwg.org/#dom-event-istrusted diff --git a/components/script/dom/navigator.rs b/components/script/dom/navigator.rs index 61936c59e5f..b2a4fa81b3b 100644 --- a/components/script/dom/navigator.rs +++ b/components/script/dom/navigator.rs @@ -21,7 +21,7 @@ pub struct Navigator { bluetooth: MutNullableHeap>, plugins: MutNullableHeap>, mime_types: MutNullableHeap>, - serviceWorker: MutNullableHeap>, + service_worker: MutNullableHeap>, } impl Navigator { @@ -31,7 +31,7 @@ impl Navigator { bluetooth: Default::default(), plugins: 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 fn ServiceWorker(&self) -> Root { - 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 diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 5f1bee3a730..041d6407418 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -796,10 +796,10 @@ impl Node { } pub fn summarize(&self) -> NodeInfo { - let USVString(baseURI) = self.BaseURI(); + let USVString(base_uri) = self.BaseURI(); NodeInfo { uniqueId: self.unique_id(), - baseURI: baseURI, + baseURI: base_uri, parent: self.GetParentNode().map_or("".to_owned(), |node| node.unique_id()), nodeType: self.NodeType(), namespaceURI: String::new(), //FIXME @@ -2296,8 +2296,8 @@ impl NodeMethods for Node { } // https://dom.spec.whatwg.org/#dom-node-issamenode - fn IsSameNode(&self, otherNode: Option<&Node>) -> bool { - match otherNode { + fn IsSameNode(&self, other_node: Option<&Node>) -> bool { + match other_node { Some(node) => self == node, None => false, } diff --git a/components/script/dom/performance.rs b/components/script/dom/performance.rs index d641d355eb6..f6bc8d288f8 100644 --- a/components/script/dom/performance.rs +++ b/components/script/dom/performance.rs @@ -51,8 +51,8 @@ impl PerformanceMethods for Performance { // https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#dom-performance-now fn Now(&self) -> DOMHighResTimeStamp { - let navStart = self.timing.NavigationStartPrecise(); - let now = (time::precise_time_ns() as f64 - navStart) / 1000000 as f64; + let nav_start = self.timing.navigation_start_precise(); + let now = (time::precise_time_ns() as f64 - nav_start) / 1000000 as f64; Finite::wrap(now) } } diff --git a/components/script/dom/performancetiming.rs b/components/script/dom/performancetiming.rs index 9fe012fbc1c..6faa8246242 100644 --- a/components/script/dom/performancetiming.rs +++ b/components/script/dom/performancetiming.rs @@ -14,20 +14,20 @@ use dom::window::Window; #[dom_struct] pub struct PerformanceTiming { reflector_: Reflector, - navigationStart: u64, - navigationStartPrecise: f64, + navigation_start: u64, + navigation_start_precise: f64, document: JS, } impl PerformanceTiming { - fn new_inherited(navStart: u64, - navStartPrecise: f64, + fn new_inherited(nav_start: u64, + nav_start_precise: f64, document: &Document) -> PerformanceTiming { PerformanceTiming { reflector_: Reflector::new(), - navigationStart: navStart, - navigationStartPrecise: navStartPrecise, + navigation_start: nav_start, + navigation_start_precise: nav_start_precise, document: JS::from_ref(document), } } @@ -48,7 +48,7 @@ impl PerformanceTiming { impl PerformanceTimingMethods for PerformanceTiming { // https://w3c.github.io/navigation-timing/#widl-PerformanceTiming-navigationStart fn NavigationStart(&self) -> u64 { - self.navigationStart + self.navigation_start } // https://w3c.github.io/navigation-timing/#widl-PerformanceTiming-domLoading @@ -89,7 +89,7 @@ impl PerformanceTimingMethods for PerformanceTiming { impl PerformanceTiming { - pub fn NavigationStartPrecise(&self) -> f64 { - self.navigationStartPrecise + pub fn navigation_start_precise(&self) -> f64 { + self.navigation_start_precise } } diff --git a/components/script/dom/storage.rs b/components/script/dom/storage.rs index 411e304b2f5..bb81cdbb57e 100644 --- a/components/script/dom/storage.rs +++ b/components/script/dom/storage.rs @@ -203,7 +203,7 @@ impl Runnable for StorageEventRunnable { for it_context in root_context.iter() { let it_window_root = it_context.active_window(); 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 // objects are ignored by the event loop until the Document becomes fully active again. if ev_window.pipeline_id() != it_window.pipeline_id() { diff --git a/components/script/dom/storageevent.rs b/components/script/dom/storageevent.rs index 1c9b563b037..69fe7c257d5 100644 --- a/components/script/dom/storageevent.rs +++ b/components/script/dom/storageevent.rs @@ -20,26 +20,26 @@ use string_cache::Atom; pub struct StorageEvent { event: Event, key: Option, - oldValue: Option, - newValue: Option, + old_value: Option, + new_value: Option, url: DOMString, - storageArea: MutNullableHeap> + storage_area: MutNullableHeap> } impl StorageEvent { pub fn new_inherited(key: Option, - oldValue: Option, - newValue: Option, + old_value: Option, + new_value: Option, url: DOMString, - storageArea: Option<&Storage>) -> StorageEvent { + storage_area: Option<&Storage>) -> StorageEvent { StorageEvent { event: Event::new_inherited(), key: key, - oldValue: oldValue, - newValue: newValue, + old_value: old_value, + new_value: new_value, 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 fn GetOldValue(&self) -> Option { - self.oldValue.clone() + self.old_value.clone() } // https://html.spec.whatwg.org/multipage/#dom-storageevent-newvalue fn GetNewValue(&self) -> Option { - self.newValue.clone() + self.new_value.clone() } // 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 fn GetStorageArea(&self) -> Option> { - self.storageArea.get() + self.storage_area.get() } // https://dom.spec.whatwg.org/#dom-event-istrusted diff --git a/components/script/dom/touchevent.rs b/components/script/dom/touchevent.rs index 3b2a25a3e21..1a2f7334cdf 100644 --- a/components/script/dom/touchevent.rs +++ b/components/script/dom/touchevent.rs @@ -55,7 +55,7 @@ impl TouchEvent { pub fn new(window: &Window, type_: DOMString, - canBubble: EventBubbles, + can_bubble: EventBubbles, cancelable: EventCancelable, view: Option<&Window>, detail: i32, @@ -68,7 +68,7 @@ impl TouchEvent { meta_key: bool) -> Root { let ev = TouchEvent::new_uninitialized(window, touches, changed_touches, target_touches); ev.upcast::().InitUIEvent(type_, - bool::from(canBubble), + bool::from(can_bubble), bool::from(cancelable), view, detail); ev.ctrl_key.set(ctrl_key); diff --git a/components/script/dom/url.rs b/components/script/dom/url.rs index bc686d23cc4..12d4cdbea8a 100644 --- a/components/script/dom/url.rs +++ b/components/script/dom/url.rs @@ -176,37 +176,37 @@ impl URL { impl URLMethods for URL { // https://url.spec.whatwg.org/#dom-url-hash fn Hash(&self) -> USVString { - UrlHelper::Hash(&self.url.borrow()) + UrlHelper::hash(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-hash 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 fn Host(&self) -> USVString { - UrlHelper::Host(&self.url.borrow()) + UrlHelper::host(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-host 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 fn Hostname(&self) -> USVString { - UrlHelper::Hostname(&self.url.borrow()) + UrlHelper::hostname(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-hostname 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 fn Href(&self) -> USVString { - UrlHelper::Href(&self.url.borrow()) + UrlHelper::href(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-href @@ -225,57 +225,57 @@ impl URLMethods for URL { // https://url.spec.whatwg.org/#dom-url-password fn Password(&self) -> USVString { - UrlHelper::Password(&self.url.borrow()) + UrlHelper::password(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-password 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 fn Pathname(&self) -> USVString { - UrlHelper::Pathname(&self.url.borrow()) + UrlHelper::pathname(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-pathname 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 fn Port(&self) -> USVString { - UrlHelper::Port(&self.url.borrow()) + UrlHelper::port(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-port 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 fn Protocol(&self) -> USVString { - UrlHelper::Protocol(&self.url.borrow()) + UrlHelper::protocol(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-protocol 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 fn Origin(&self) -> USVString { - UrlHelper::Origin(&self.url.borrow()) + UrlHelper::origin(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-search fn Search(&self) -> USVString { - UrlHelper::Search(&self.url.borrow()) + UrlHelper::search(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-search 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() { 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 fn Username(&self) -> USVString { - UrlHelper::Username(&self.url.borrow()) + UrlHelper::username(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-username fn SetUsername(&self, value: USVString) { - UrlHelper::SetUsername(&mut self.url.borrow_mut(), value); + UrlHelper::set_username(&mut self.url.borrow_mut(), value); } } diff --git a/components/script/dom/urlhelper.rs b/components/script/dom/urlhelper.rs index 68e4219f996..498cfd71ef1 100644 --- a/components/script/dom/urlhelper.rs +++ b/components/script/dom/urlhelper.rs @@ -10,25 +10,25 @@ use url::{Url, quirks}; pub struct UrlHelper; impl UrlHelper { - pub fn SameOrigin(urlA: &Url, urlB: &Url) -> bool { urlA.origin() == urlB.origin() } - pub fn Origin(url: &Url) -> USVString { USVString(quirks::origin(url)) } - 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 Host(url: &Url) -> USVString { USVString(quirks::host(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 Hostname(url: &Url) -> USVString { USVString(quirks::hostname(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 Protocol(url: &Url) -> USVString { USVString(quirks::protocol(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 SetHost(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 SetSearch(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 SetHostname(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 SetProtocol(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 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 href(url: &Url) -> USVString { USVString(quirks::href(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 port(url: &Url) -> USVString { USVString(quirks::port(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 password(url: &Url) -> USVString { USVString(quirks::password(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 username(url: &Url) -> USVString { USVString(quirks::username(url).to_owned()) } + pub fn set_hash(url: &mut Url, value: USVString) { quirks::set_hash(url, &value.0) } + pub fn set_host(url: &mut Url, value: USVString) { let _ = quirks::set_host(url, &value.0); } + pub fn set_port(url: &mut Url, value: USVString) { let _ = quirks::set_port(url, &value.0); } + pub fn set_search(url: &mut Url, value: USVString) { quirks::set_search(url, &value.0) } + pub fn set_pathname(url: &mut Url, value: USVString) { quirks::set_pathname(url, &value.0) } + pub fn set_hostname(url: &mut Url, value: USVString) { let _ = quirks::set_hostname(url, &value.0); } + pub fn set_password(url: &mut Url, value: USVString) { let _ = quirks::set_password(url, &value.0); } + pub fn set_protocol(url: &mut Url, value: USVString) { let _ = quirks::set_protocol(url, &value.0); } + pub fn set_username(url: &mut Url, value: USVString) { let _ = quirks::set_username(url, &value.0); } } diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs index df9c2e5ed34..6d68e7e6b0b 100644 --- a/components/script/dom/websocket.rs +++ b/components/script/dom/websocket.rs @@ -238,7 +238,7 @@ impl WebSocket { } // Step 6: Origin. - let origin = UrlHelper::Origin(&global.get_url()).0; + let origin = UrlHelper::origin(&global.get_url()).0; // Step 7. let ws = WebSocket::new(global, resource_url.clone()); diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index f4efcd8dd76..34a809e1f86 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -1536,7 +1536,7 @@ impl Window { } // https://html.spec.whatwg.org/multipage/#accessing-other-browsing-contexts - pub fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Option> { + pub fn indexed_getter(&self, _index: u32, _found: &mut bool) -> Option> { None } diff --git a/components/script/dom/workerlocation.rs b/components/script/dom/workerlocation.rs index a037f7737a8..50d92521572 100644 --- a/components/script/dom/workerlocation.rs +++ b/components/script/dom/workerlocation.rs @@ -37,42 +37,42 @@ impl WorkerLocation { impl WorkerLocationMethods for WorkerLocation { // https://html.spec.whatwg.org/multipage/#dom-workerlocation-hash fn Hash(&self) -> USVString { - UrlHelper::Hash(&self.url) + UrlHelper::hash(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-host fn Host(&self) -> USVString { - UrlHelper::Host(&self.url) + UrlHelper::host(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-hostname fn Hostname(&self) -> USVString { - UrlHelper::Hostname(&self.url) + UrlHelper::hostname(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-href fn Href(&self) -> USVString { - UrlHelper::Href(&self.url) + UrlHelper::href(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-pathname fn Pathname(&self) -> USVString { - UrlHelper::Pathname(&self.url) + UrlHelper::pathname(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-port fn Port(&self) -> USVString { - UrlHelper::Port(&self.url) + UrlHelper::port(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-protocol fn Protocol(&self) -> USVString { - UrlHelper::Protocol(&self.url) + UrlHelper::protocol(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-search fn Search(&self) -> USVString { - UrlHelper::Search(&self.url) + UrlHelper::search(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-href diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs index 124bf8f2b84..0287d0e9c10 100644 --- a/components/script/script_runtime.rs +++ b/components/script/script_runtime.rs @@ -370,11 +370,11 @@ unsafe extern "C" fn gc_slice_callback(_rt: *mut JSRuntime, progress: GCProgress }; if !desc.is_null() { let desc: &GCDescription = &*desc; - let invocationKind = match desc.invocationKind_ { + let invocation_kind = match desc.invocationKind_ { JSGCInvocationKind::GC_NORMAL => "GC_NORMAL", JSGCInvocationKind::GC_SHRINK => "GC_SHRINK", }; - println!(" isCompartment={}, invocationKind={}", desc.isCompartment_, invocationKind); + println!(" isCompartment={}, invocation_kind={}", desc.isCompartment_, invocation_kind); } let _ = stdout().flush(); } From 7986423cd7235eeff6da2c2395c6ecdef4fb78df Mon Sep 17 00:00:00 2001 From: Arthur Marble Date: Sun, 18 Sep 2016 05:57:24 -0500 Subject: [PATCH 11/13] One last refactoring before fixing --- components/script/dom/activation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/script/dom/activation.rs b/components/script/dom/activation.rs index fc43efee367..58db9234170 100644 --- a/components/script/dom/activation.rs +++ b/components/script/dom/activation.rs @@ -31,7 +31,7 @@ pub trait Activatable { fn activation_behavior(&self, event: &Event, target: &EventTarget); // https://html.spec.whatwg.org/multipage/#implicit-submission - fn implicit_submission(&self, ctrlKey: bool, shiftKey: bool, altKey: bool, metaKey: bool); + fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, alt_key: bool, meta_key: bool); // https://html.spec.whatwg.org/multipage/#concept-selector-active fn enter_formal_activation_state(&self) { From b874e764553b928db06e580498516558ebeb5d72 Mon Sep 17 00:00:00 2001 From: Arthur Marble Date: Sun, 18 Sep 2016 07:12:39 -0500 Subject: [PATCH 12/13] Made fixes for PR. --- components/script/dom/browsingcontext.rs | 10 +++--- components/script/dom/dompoint.rs | 8 ++--- components/script/dom/dompointreadonly.rs | 16 ++++----- components/script/dom/htmlanchorelement.rs | 36 +++++++++---------- components/script/dom/htmliframeelement.rs | 10 +++--- components/script/dom/location.rs | 32 ++++++++--------- components/script/dom/storage.rs | 2 +- components/script/dom/url.rs | 40 ++++++++++----------- components/script/dom/urlhelper.rs | 42 +++++++++++----------- components/script/dom/websocket.rs | 2 +- components/script/dom/window.rs | 2 +- components/script/dom/workerlocation.rs | 16 ++++----- 12 files changed, 108 insertions(+), 108 deletions(-) diff --git a/components/script/dom/browsingcontext.rs b/components/script/dom/browsingcontext.rs index 3ebd3333efa..4659844af00 100644 --- a/components/script/dom/browsingcontext.rs +++ b/components/script/dom/browsingcontext.rs @@ -230,7 +230,7 @@ impl SessionHistoryEntry { } #[allow(unsafe_code)] -unsafe fn get_subframe_window(cx: *mut JSContext, +unsafe fn getSubframeWindow(cx: *mut JSContext, proxy: HandleObject, id: HandleId) -> Option> { @@ -239,7 +239,7 @@ unsafe fn get_subframe_window(cx: *mut JSContext, rooted!(in(cx) let target = GetProxyPrivate(*proxy.ptr).to_object()); let win = root_from_handleobject::(target.handle()).unwrap(); let mut found = false; - return win.indexed_getter(index, &mut found); + return win.IndexedGetter(index, &mut found); } None @@ -251,7 +251,7 @@ unsafe extern "C" fn getOwnPropertyDescriptor(cx: *mut JSContext, id: HandleId, mut desc: MutableHandle) -> bool { - let window = get_subframe_window(cx, proxy, id); + let window = getSubframeWindow(cx, proxy, id); if let Some(window) = window { rooted!(in(cx) let mut val = UndefinedValue()); window.to_jsval(cx, val.handle_mut()); @@ -300,7 +300,7 @@ unsafe extern "C" fn has(cx: *mut JSContext, id: HandleId, bp: *mut bool) -> bool { - let window = get_subframe_window(cx, proxy, id); + let window = getSubframeWindow(cx, proxy, id); if window.is_some() { *bp = true; return true; @@ -323,7 +323,7 @@ unsafe extern "C" fn get(cx: *mut JSContext, id: HandleId, vp: MutableHandleValue) -> bool { - let window = get_subframe_window(cx, proxy, id); + let window = getSubframeWindow(cx, proxy, id); if let Some(window) = window { window.to_jsval(cx, vp); return true; diff --git a/components/script/dom/dompoint.rs b/components/script/dom/dompoint.rs index 0e476bd2bde..906a30ea617 100644 --- a/components/script/dom/dompoint.rs +++ b/components/script/dom/dompoint.rs @@ -49,7 +49,7 @@ impl DOMPointMethods for DOMPoint { // https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-x fn SetX(&self, value: f64) { - self.point.set_x(value); + self.point.SetX(value); } // 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 fn SetY(&self, value: f64) { - self.point.set_y(value); + self.point.SetY(value); } // 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 fn SetZ(&self, value: f64) { - self.point.set_z(value); + self.point.SetZ(value); } // 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 fn SetW(&self, value: f64) { - self.point.set_w(value); + self.point.SetW(value); } } diff --git a/components/script/dom/dompointreadonly.rs b/components/script/dom/dompointreadonly.rs index bc0ef8d346e..aa7efa76267 100644 --- a/components/script/dom/dompointreadonly.rs +++ b/components/script/dom/dompointreadonly.rs @@ -69,26 +69,26 @@ impl DOMPointReadOnlyMethods for DOMPointReadOnly { } pub trait DOMPointWriteMethods { - fn set_x(&self, value: f64); - fn set_y(&self, value: f64); - fn set_z(&self, value: f64); - fn set_w(&self, value: f64); + fn SetX(&self, value: f64); + fn SetY(&self, value: f64); + fn SetZ(&self, value: f64); + fn SetW(&self, value: f64); } impl DOMPointWriteMethods for DOMPointReadOnly { - fn set_x(&self, value: f64) { + fn SetX(&self, value: f64) { self.x.set(value); } - fn set_y(&self, value: f64) { + fn SetY(&self, value: f64) { self.y.set(value); } - fn set_z(&self, value: f64) { + fn SetZ(&self, value: f64) { self.z.set(value); } - fn set_w(&self, value: f64) { + fn SetW(&self, value: f64) { self.w.set(value); } } diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index 5c8866ecef2..08e7e01b77a 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -157,7 +157,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => USVString(String::new()), Some(ref url) => { // Steps 3-4. - UrlHelper::hash(url) + UrlHelper::Hash(url) } } } @@ -174,7 +174,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => return, // Steps 4-5. Some(url) => { - UrlHelper::set_hash(url, value); + UrlHelper::SetHash(url, value); DOMString::from(url.as_str()) } }; @@ -195,7 +195,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { USVString(String::new()) } else { // Steps 4-5. - UrlHelper::host(url) + UrlHelper::Host(url) } } } @@ -213,7 +213,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => return, // Step 4. Some(url) => { - UrlHelper::set_host(url, value); + UrlHelper::SetHost(url, value); DOMString::from(url.as_str()) } }; @@ -231,7 +231,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => USVString(String::new()), Some(ref url) => { // Step 4. - UrlHelper::hostname(url) + UrlHelper::Hostname(url) } } } @@ -248,7 +248,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => return, // Step 4. Some(url) => { - UrlHelper::set_hostname(url, value); + UrlHelper::SetHostname(url, value); DOMString::from(url.as_str()) } }; @@ -291,7 +291,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { // Step 3. None => USVString(String::new()), // 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, // Step 4. Some(url) => { - UrlHelper::set_password(url, value); + UrlHelper::SetPassword(url, value); DOMString::from(url.as_str()) } }; @@ -324,7 +324,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { // Step 3. None => USVString(String::new()), // 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, // Step 5. Some(url) => { - UrlHelper::set_pathname(url, value); + UrlHelper::SetPathname(url, value); DOMString::from(url.as_str()) } }; @@ -357,7 +357,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { // Step 3. None => USVString(String::new()), // Step 4. - Some(ref url) => UrlHelper::port(url) + Some(ref url) => UrlHelper::Port(url) } } @@ -374,7 +374,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => return, // Step 4. Some(url) => { - UrlHelper::set_port(url, value); + UrlHelper::SetPort(url, value); DOMString::from(url.as_str()) } }; @@ -391,7 +391,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { // Step 2. None => USVString(":".to_owned()), // Step 3. - Some(ref url) => UrlHelper::protocol(url) + Some(ref url) => UrlHelper::Protocol(url) } } @@ -405,7 +405,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => return, // Step 3. Some(url) => { - UrlHelper::set_protocol(url, value); + UrlHelper::SetProtocol(url, value); DOMString::from(url.as_str()) } }; @@ -422,7 +422,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { // Step 2. None => USVString(String::new()), // 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 // encoding override (as described in the spec) Some(url) => { - UrlHelper::set_search(url, value); + UrlHelper::SetSearch(url, value); DOMString::from(url.as_str()) } }; @@ -456,7 +456,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { // Step 2. None => USVString(String::new()), // Step 3. - Some(ref url) => UrlHelper::username(url) + Some(ref url) => UrlHelper::Username(url) } } @@ -472,7 +472,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement { None => return, // Step 4. Some(url) => { - UrlHelper::set_username(url, value); + UrlHelper::SetUsername(url, value); DOMString::from(url.as_str()) } }; diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 1671c933074..3b74d3e6e05 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -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.upcast::().is_in_doc() { let window = window_from_node(iframe); @@ -450,7 +450,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement { let self_url = self.get_url(); let win_url = window_from_node(self).get_url(); - if UrlHelper::same_origin(&self_url, &win_url) { + if UrlHelper::SameOrigin(&self_url, &win_url) { Some(window.Document()) } else { None @@ -479,12 +479,12 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement { // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/goBack 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 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 @@ -632,7 +632,7 @@ impl VirtualMethods for HTMLIFrameElement { // HTMLIFrameElement::contentDocument. let self_url = self.get_url(); let win_url = window_from_node(self).get_url(); - UrlHelper::same_origin(&self_url, &win_url) + UrlHelper::SameOrigin(&self_url, &win_url) }; let (sender, receiver) = if same_origin { (None, None) diff --git a/components/script/dom/location.rs b/components/script/dom/location.rs index 0c16c6a5f06..72361193aa3 100644 --- a/components/script/dom/location.rs +++ b/components/script/dom/location.rs @@ -62,7 +62,7 @@ impl LocationMethods for Location { // https://html.spec.whatwg.org/multipage/#dom-location-hash fn Hash(&self) -> USVString { - UrlHelper::hash(&self.get_url()) + UrlHelper::Hash(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-hash @@ -70,37 +70,37 @@ impl LocationMethods for Location { if value.0.is_empty() { value = USVString("#".to_owned()); } - self.set_url_component(value, UrlHelper::set_hash); + self.set_url_component(value, UrlHelper::SetHash); } // https://html.spec.whatwg.org/multipage/#dom-location-host fn Host(&self) -> USVString { - UrlHelper::host(&self.get_url()) + UrlHelper::Host(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-host fn SetHost(&self, value: USVString) { - self.set_url_component(value, UrlHelper::set_host); + self.set_url_component(value, UrlHelper::SetHost); } // https://html.spec.whatwg.org/multipage/#dom-location-origin fn Origin(&self) -> USVString { - UrlHelper::origin(&self.get_url()) + UrlHelper::Origin(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-hostname fn Hostname(&self) -> USVString { - UrlHelper::hostname(&self.get_url()) + UrlHelper::Hostname(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-hostname fn SetHostname(&self, value: USVString) { - self.set_url_component(value, UrlHelper::set_hostname); + self.set_url_component(value, UrlHelper::SetHostname); } // https://html.spec.whatwg.org/multipage/#dom-location-href fn Href(&self) -> USVString { - UrlHelper::href(&self.get_url()) + UrlHelper::Href(&self.get_url()) } // 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 fn Pathname(&self) -> USVString { - UrlHelper::pathname(&self.get_url()) + UrlHelper::Pathname(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-pathname fn SetPathname(&self, value: USVString) { - self.set_url_component(value, UrlHelper::set_pathname); + self.set_url_component(value, UrlHelper::SetPathname); } // https://html.spec.whatwg.org/multipage/#dom-location-port fn Port(&self) -> USVString { - UrlHelper::port(&self.get_url()) + UrlHelper::Port(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-port fn SetPort(&self, value: USVString) { - self.set_url_component(value, UrlHelper::set_port); + self.set_url_component(value, UrlHelper::SetPort); } // https://html.spec.whatwg.org/multipage/#dom-location-protocol fn Protocol(&self) -> USVString { - UrlHelper::protocol(&self.get_url()) + UrlHelper::Protocol(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-protocol fn SetProtocol(&self, value: USVString) { - self.set_url_component(value, UrlHelper::set_protocol); + self.set_url_component(value, UrlHelper::SetProtocol); } // 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 fn Search(&self) -> USVString { - UrlHelper::search(&self.get_url()) + UrlHelper::Search(&self.get_url()) } // https://html.spec.whatwg.org/multipage/#dom-location-search fn SetSearch(&self, value: USVString) { - self.set_url_component(value, UrlHelper::set_search); + self.set_url_component(value, UrlHelper::SetSearch); } } diff --git a/components/script/dom/storage.rs b/components/script/dom/storage.rs index bb81cdbb57e..411e304b2f5 100644 --- a/components/script/dom/storage.rs +++ b/components/script/dom/storage.rs @@ -203,7 +203,7 @@ impl Runnable for StorageEventRunnable { for it_context in root_context.iter() { let it_window_root = it_context.active_window(); let it_window = it_window_root.r(); - assert!(UrlHelper::same_origin(&ev_url, &it_window.get_url())); + assert!(UrlHelper::SameOrigin(&ev_url, &it_window.get_url())); // 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. if ev_window.pipeline_id() != it_window.pipeline_id() { diff --git a/components/script/dom/url.rs b/components/script/dom/url.rs index 12d4cdbea8a..bc686d23cc4 100644 --- a/components/script/dom/url.rs +++ b/components/script/dom/url.rs @@ -176,37 +176,37 @@ impl URL { impl URLMethods for URL { // https://url.spec.whatwg.org/#dom-url-hash fn Hash(&self) -> USVString { - UrlHelper::hash(&self.url.borrow()) + UrlHelper::Hash(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-hash fn SetHash(&self, value: USVString) { - UrlHelper::set_hash(&mut self.url.borrow_mut(), value); + UrlHelper::SetHash(&mut self.url.borrow_mut(), value); } // https://url.spec.whatwg.org/#dom-url-host fn Host(&self) -> USVString { - UrlHelper::host(&self.url.borrow()) + UrlHelper::Host(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-host fn SetHost(&self, value: USVString) { - UrlHelper::set_host(&mut self.url.borrow_mut(), value); + UrlHelper::SetHost(&mut self.url.borrow_mut(), value); } // https://url.spec.whatwg.org/#dom-url-hostname fn Hostname(&self) -> USVString { - UrlHelper::hostname(&self.url.borrow()) + UrlHelper::Hostname(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-hostname fn SetHostname(&self, value: USVString) { - UrlHelper::set_hostname(&mut self.url.borrow_mut(), value); + UrlHelper::SetHostname(&mut self.url.borrow_mut(), value); } // https://url.spec.whatwg.org/#dom-url-href fn Href(&self) -> USVString { - UrlHelper::href(&self.url.borrow()) + UrlHelper::Href(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-href @@ -225,57 +225,57 @@ impl URLMethods for URL { // https://url.spec.whatwg.org/#dom-url-password fn Password(&self) -> USVString { - UrlHelper::password(&self.url.borrow()) + UrlHelper::Password(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-password fn SetPassword(&self, value: USVString) { - UrlHelper::set_password(&mut self.url.borrow_mut(), value); + UrlHelper::SetPassword(&mut self.url.borrow_mut(), value); } // https://url.spec.whatwg.org/#dom-url-pathname fn Pathname(&self) -> USVString { - UrlHelper::pathname(&self.url.borrow()) + UrlHelper::Pathname(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-pathname fn SetPathname(&self, value: USVString) { - UrlHelper::set_pathname(&mut self.url.borrow_mut(), value); + UrlHelper::SetPathname(&mut self.url.borrow_mut(), value); } // https://url.spec.whatwg.org/#dom-url-port fn Port(&self) -> USVString { - UrlHelper::port(&self.url.borrow()) + UrlHelper::Port(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-port fn SetPort(&self, value: USVString) { - UrlHelper::set_port(&mut self.url.borrow_mut(), value); + UrlHelper::SetPort(&mut self.url.borrow_mut(), value); } // https://url.spec.whatwg.org/#dom-url-protocol fn Protocol(&self) -> USVString { - UrlHelper::protocol(&self.url.borrow()) + UrlHelper::Protocol(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-protocol fn SetProtocol(&self, value: USVString) { - UrlHelper::set_protocol(&mut self.url.borrow_mut(), value); + UrlHelper::SetProtocol(&mut self.url.borrow_mut(), value); } // https://url.spec.whatwg.org/#dom-url-origin fn Origin(&self) -> USVString { - UrlHelper::origin(&self.url.borrow()) + UrlHelper::Origin(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-search fn Search(&self) -> USVString { - UrlHelper::search(&self.url.borrow()) + UrlHelper::Search(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-search fn SetSearch(&self, value: USVString) { - UrlHelper::set_search(&mut self.url.borrow_mut(), value); + UrlHelper::SetSearch(&mut self.url.borrow_mut(), value); if let Some(search_params) = self.search_params.get() { 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 fn Username(&self) -> USVString { - UrlHelper::username(&self.url.borrow()) + UrlHelper::Username(&self.url.borrow()) } // https://url.spec.whatwg.org/#dom-url-username fn SetUsername(&self, value: USVString) { - UrlHelper::set_username(&mut self.url.borrow_mut(), value); + UrlHelper::SetUsername(&mut self.url.borrow_mut(), value); } } diff --git a/components/script/dom/urlhelper.rs b/components/script/dom/urlhelper.rs index 498cfd71ef1..cd58612a6c1 100644 --- a/components/script/dom/urlhelper.rs +++ b/components/script/dom/urlhelper.rs @@ -10,25 +10,25 @@ use url::{Url, quirks}; pub struct UrlHelper; impl UrlHelper { - 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 href(url: &Url) -> USVString { USVString(quirks::href(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 port(url: &Url) -> USVString { USVString(quirks::port(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 password(url: &Url) -> USVString { USVString(quirks::password(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 username(url: &Url) -> USVString { USVString(quirks::username(url).to_owned()) } - pub fn set_hash(url: &mut Url, value: USVString) { quirks::set_hash(url, &value.0) } - pub fn set_host(url: &mut Url, value: USVString) { let _ = quirks::set_host(url, &value.0); } - pub fn set_port(url: &mut Url, value: USVString) { let _ = quirks::set_port(url, &value.0); } - pub fn set_search(url: &mut Url, value: USVString) { quirks::set_search(url, &value.0) } - pub fn set_pathname(url: &mut Url, value: USVString) { quirks::set_pathname(url, &value.0) } - pub fn set_hostname(url: &mut Url, value: USVString) { let _ = quirks::set_hostname(url, &value.0); } - pub fn set_password(url: &mut Url, value: USVString) { let _ = quirks::set_password(url, &value.0); } - pub fn set_protocol(url: &mut Url, value: USVString) { let _ = quirks::set_protocol(url, &value.0); } - pub fn set_username(url: &mut Url, value: USVString) { let _ = quirks::set_username(url, &value.0); } + pub fn SameOrigin(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 Href(url: &Url) -> USVString { USVString(quirks::href(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 Port(url: &Url) -> USVString { USVString(quirks::port(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 Password(url: &Url) -> USVString { USVString(quirks::password(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 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 SetHost(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 SetSearch(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 SetHostname(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 SetProtocol(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); } } diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs index 6d68e7e6b0b..df9c2e5ed34 100644 --- a/components/script/dom/websocket.rs +++ b/components/script/dom/websocket.rs @@ -238,7 +238,7 @@ impl WebSocket { } // Step 6: Origin. - let origin = UrlHelper::origin(&global.get_url()).0; + let origin = UrlHelper::Origin(&global.get_url()).0; // Step 7. let ws = WebSocket::new(global, resource_url.clone()); diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 34a809e1f86..f4efcd8dd76 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -1536,7 +1536,7 @@ impl Window { } // https://html.spec.whatwg.org/multipage/#accessing-other-browsing-contexts - pub fn indexed_getter(&self, _index: u32, _found: &mut bool) -> Option> { + pub fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Option> { None } diff --git a/components/script/dom/workerlocation.rs b/components/script/dom/workerlocation.rs index 50d92521572..a037f7737a8 100644 --- a/components/script/dom/workerlocation.rs +++ b/components/script/dom/workerlocation.rs @@ -37,42 +37,42 @@ impl WorkerLocation { impl WorkerLocationMethods for WorkerLocation { // https://html.spec.whatwg.org/multipage/#dom-workerlocation-hash fn Hash(&self) -> USVString { - UrlHelper::hash(&self.url) + UrlHelper::Hash(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-host fn Host(&self) -> USVString { - UrlHelper::host(&self.url) + UrlHelper::Host(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-hostname fn Hostname(&self) -> USVString { - UrlHelper::hostname(&self.url) + UrlHelper::Hostname(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-href fn Href(&self) -> USVString { - UrlHelper::href(&self.url) + UrlHelper::Href(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-pathname fn Pathname(&self) -> USVString { - UrlHelper::pathname(&self.url) + UrlHelper::Pathname(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-port fn Port(&self) -> USVString { - UrlHelper::port(&self.url) + UrlHelper::Port(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-protocol fn Protocol(&self) -> USVString { - UrlHelper::protocol(&self.url) + UrlHelper::Protocol(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-search fn Search(&self) -> USVString { - UrlHelper::search(&self.url) + UrlHelper::Search(&self.url) } // https://html.spec.whatwg.org/multipage/#dom-workerlocation-href From 5f961f9fd9aeb13ff6c5746a8d143a30a90b06c2 Mon Sep 17 00:00:00 2001 From: Arthur Marble Date: Sun, 18 Sep 2016 07:32:05 -0500 Subject: [PATCH 13/13] Fix my typo on commit. Rest of the fixes will be here soon. --- components/script/dom/browsingcontext.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/script/dom/browsingcontext.rs b/components/script/dom/browsingcontext.rs index 4659844af00..02d153296ae 100644 --- a/components/script/dom/browsingcontext.rs +++ b/components/script/dom/browsingcontext.rs @@ -230,7 +230,7 @@ impl SessionHistoryEntry { } #[allow(unsafe_code)] -unsafe fn getSubframeWindow(cx: *mut JSContext, +unsafe fn GetSubframeWindow(cx: *mut JSContext, proxy: HandleObject, id: HandleId) -> Option> { @@ -251,7 +251,7 @@ unsafe extern "C" fn getOwnPropertyDescriptor(cx: *mut JSContext, id: HandleId, mut desc: MutableHandle) -> bool { - let window = getSubframeWindow(cx, proxy, id); + let window = GetSubframeWindow(cx, proxy, id); if let Some(window) = window { rooted!(in(cx) let mut val = UndefinedValue()); window.to_jsval(cx, val.handle_mut()); @@ -300,7 +300,7 @@ unsafe extern "C" fn has(cx: *mut JSContext, id: HandleId, bp: *mut bool) -> bool { - let window = getSubframeWindow(cx, proxy, id); + let window = GetSubframeWindow(cx, proxy, id); if window.is_some() { *bp = true; return true; @@ -323,7 +323,7 @@ unsafe extern "C" fn get(cx: *mut JSContext, id: HandleId, vp: MutableHandleValue) -> bool { - let window = getSubframeWindow(cx, proxy, id); + let window = GetSubframeWindow(cx, proxy, id); if let Some(window) = window { window.to_jsval(cx, vp); return true;