aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlformelement.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2014-10-13 22:00:37 -0600
committerbors-servo <metajack+bors@gmail.com>2014-10-13 22:00:37 -0600
commitf350879574194bb612eac88e21d0920e9827afa7 (patch)
tree7b6bd300a6338550f74d4bfc0d1f1808c6f4734c /components/script/dom/htmlformelement.rs
parentd04733cf595edf8ed5f0eaa414355f9cdc3d9c10 (diff)
parentcbe50f1f149943212aa722b411d275614fbe9a5d (diff)
downloadservo-f350879574194bb612eac88e21d0920e9827afa7.tar.gz
servo-f350879574194bb612eac88e21d0920e9827afa7.zip
auto merge of #3666 : ttaubert/servo/issue/3644-privatize-dom, r=Manishearth
This PR removes public fields from all (hope I didn't miss any) DOM structs. Should |Page| be privatized as well? This PR additionally introduces a #[privatize] lint to ensure nobody accidentally re-introduces a public field. All changesets compile separately if applied in the same order. Hope that helps reviewing but I can of course squash them before merging.
Diffstat (limited to 'components/script/dom/htmlformelement.rs')
-rw-r--r--components/script/dom/htmlformelement.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs
index 75ce3119648..639d2296608 100644
--- a/components/script/dom/htmlformelement.rs
+++ b/components/script/dom/htmlformelement.rs
@@ -31,13 +31,14 @@ use url::form_urlencoded::serialize;
#[jstraceable]
#[must_root]
+#[privatize]
pub struct HTMLFormElement {
- pub htmlelement: HTMLElement,
+ htmlelement: HTMLElement,
}
impl HTMLFormElementDerived for EventTarget {
fn is_htmlformelement(&self) -> bool {
- self.type_id == NodeTargetTypeId(ElementNodeTypeId(HTMLFormElementTypeId))
+ *self.type_id() == NodeTargetTypeId(ElementNodeTypeId(HTMLFormElementTypeId))
}
}
@@ -217,8 +218,8 @@ impl<'a> HTMLFormElementHelpers for JSRef<'a, HTMLFormElement> {
}
// This is wrong. https://html.spec.whatwg.org/multipage/forms.html#planned-navigation
- let ScriptChan(ref script_chan) = win.script_chan;
- script_chan.send(TriggerLoadMsg(win.page.id, load_data));
+ let ScriptChan(ref script_chan) = *win.script_chan();
+ script_chan.send(TriggerLoadMsg(win.page().id, load_data));
}
fn get_form_dataset(self, _submitter: Option<FormSubmitter>) -> Vec<FormDatum> {