Skip to content

Commit

Permalink
Most of the code refactoring needed to be done is done with this commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
bubbles231 committed Sep 18, 2016
1 parent dbec9d8 commit 883902b
Show file tree
Hide file tree
Showing 86 changed files with 469 additions and 469 deletions.
2 changes: 1 addition & 1 deletion components/script/dom/browsingcontext.rs
Expand Up @@ -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::<Window>(target.handle()).unwrap();
let mut found = false;
return win.IndexedGetter(index, &mut found);
return win.indexed_getter(index, &mut found);
}

None
Expand Down
8 changes: 4 additions & 4 deletions components/script/dom/dompoint.rs
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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);
}
}
16 changes: 8 additions & 8 deletions components/script/dom/dompointreadonly.rs
Expand Up @@ -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);
}
}
44 changes: 22 additions & 22 deletions components/script/dom/htmlanchorelement.rs
Expand Up @@ -39,22 +39,22 @@ pub struct HTMLAnchorElement {
}

impl HTMLAnchorElement {
fn new_inherited(localName: Atom,
fn new_inherited(local_name: Atom,
prefix: Option<DOMString>,
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<DOMString>,
document: &Document) -> Root<HTMLAnchorElement> {
Node::reflect_node(box HTMLAnchorElement::new_inherited(localName, prefix, document),
Node::reflect_node(box HTMLAnchorElement::new_inherited(local_name, prefix, document),
document,
HTMLAnchorElementBinding::Wrap)
}
Expand Down Expand Up @@ -157,7 +157,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
None => USVString(String::new()),
Some(ref url) => {
// Steps 3-4.
UrlHelper::Hash(url)
UrlHelper::hash(url)
}
}
}
Expand All @@ -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())
}
};
Expand All @@ -195,7 +195,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
USVString(String::new())
} else {
// Steps 4-5.
UrlHelper::Host(url)
UrlHelper::host(url)
}
}
}
Expand All @@ -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())
}
};
Expand All @@ -231,7 +231,7 @@ impl HTMLAnchorElementMethods for HTMLAnchorElement {
None => USVString(String::new()),
Some(ref url) => {
// Step 4.
UrlHelper::Hostname(url)
UrlHelper::hostname(url)
}
}
}
Expand All @@ -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())
}
};
Expand Down Expand Up @@ -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)
}
}

Expand All @@ -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())
}
};
Expand All @@ -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)
}
}

Expand All @@ -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())
}
};
Expand All @@ -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)
}
}

Expand All @@ -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())
}
};
Expand All @@ -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)
}
}

Expand All @@ -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())
}
};
Expand All @@ -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)
}
}

Expand All @@ -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())
}
};
Expand All @@ -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)
}
}

Expand All @@ -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())
}
};
Expand Down
8 changes: 4 additions & 4 deletions components/script/dom/htmlappletelement.rs
Expand Up @@ -20,20 +20,20 @@ pub struct HTMLAppletElement {
}

impl HTMLAppletElement {
fn new_inherited(localName: Atom,
fn new_inherited(local_name: Atom,
prefix: Option<DOMString>,
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<DOMString>,
document: &Document) -> Root<HTMLAppletElement> {
Node::reflect_node(box HTMLAppletElement::new_inherited(localName, prefix, document),
Node::reflect_node(box HTMLAppletElement::new_inherited(local_name, prefix, document),
document,
HTMLAppletElementBinding::Wrap)
}
Expand Down
8 changes: 4 additions & 4 deletions components/script/dom/htmlareaelement.rs
Expand Up @@ -23,18 +23,18 @@ pub struct HTMLAreaElement {
}

impl HTMLAreaElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLAreaElement {
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLAreaElement {
HTMLAreaElement {
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<DOMString>,
document: &Document) -> Root<HTMLAreaElement> {
Node::reflect_node(box HTMLAreaElement::new_inherited(localName, prefix, document),
Node::reflect_node(box HTMLAreaElement::new_inherited(local_name, prefix, document),
document,
HTMLAreaElementBinding::Wrap)
}
Expand Down
8 changes: 4 additions & 4 deletions components/script/dom/htmlaudioelement.rs
Expand Up @@ -16,20 +16,20 @@ pub struct HTMLAudioElement {
}

impl HTMLAudioElement {
fn new_inherited(localName: Atom,
fn new_inherited(local_name: Atom,
prefix: Option<DOMString>,
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<DOMString>,
document: &Document) -> Root<HTMLAudioElement> {
Node::reflect_node(box HTMLAudioElement::new_inherited(localName, prefix, document),
Node::reflect_node(box HTMLAudioElement::new_inherited(local_name, prefix, document),
document,
HTMLAudioElementBinding::Wrap)
}
Expand Down
8 changes: 4 additions & 4 deletions components/script/dom/htmlbaseelement.rs
Expand Up @@ -23,17 +23,17 @@ pub struct HTMLBaseElement {
}

impl HTMLBaseElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBaseElement {
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBaseElement {
HTMLBaseElement {
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<DOMString>,
document: &Document) -> Root<HTMLBaseElement> {
Node::reflect_node(box HTMLBaseElement::new_inherited(localName, prefix, document),
Node::reflect_node(box HTMLBaseElement::new_inherited(local_name, prefix, document),
document,
HTMLBaseElementBinding::Wrap)
}
Expand Down
8 changes: 4 additions & 4 deletions components/script/dom/htmlbodyelement.rs
Expand Up @@ -32,17 +32,17 @@ pub struct HTMLBodyElement {
}

impl HTMLBodyElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document)
fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> HTMLBodyElement {
HTMLBodyElement {
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<DOMString>, document: &Document)
pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLBodyElement> {
Node::reflect_node(box HTMLBodyElement::new_inherited(localName, prefix, document),
Node::reflect_node(box HTMLBodyElement::new_inherited(local_name, prefix, document),
document,
HTMLBodyElementBinding::Wrap)
}
Expand Down

0 comments on commit 883902b

Please sign in to comment.