diff options
author | Gilles Leblanc <gilles.leblanc@gmail.com> | 2014-10-16 20:57:55 -0400 |
---|---|---|
committer | Gilles Leblanc <gilles.leblanc@gmail.com> | 2014-10-16 20:57:55 -0400 |
commit | a31849df1142fd51f0fd48034bcf08f053b4a56f (patch) | |
tree | 09920056468ddac6df0b58bf009fd2589245a514 /components/script/dom/htmlformelement.rs | |
parent | 6ab8f4611f67883288f9bb6d03aa7dc1e06aea5f (diff) | |
download | servo-a31849df1142fd51f0fd48034bcf08f053b4a56f.tar.gz servo-a31849df1142fd51f0fd48034bcf08f053b4a56f.zip |
Make HTMLFormElementHelpers::submit take an enumerated argument instead of a boolean
Fixes #3677
Diffstat (limited to 'components/script/dom/htmlformelement.rs')
-rw-r--r-- | components/script/dom/htmlformelement.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index 49c3486a186..f19649427e4 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -116,19 +116,24 @@ impl<'a> HTMLFormElementMethods for JSRef<'a, HTMLFormElement> { // https://html.spec.whatwg.org/multipage/forms.html#the-form-element:concept-form-submit fn Submit(self) { - self.submit(true, FormElement(self)); + self.submit(FromFormSubmitMethod, FormElement(self)); } } +pub enum SubmittedFrom { + FromFormSubmitMethod, + NotFromFormSubmitMethod +} + pub trait HTMLFormElementHelpers { // https://html.spec.whatwg.org/multipage/forms.html#concept-form-submit - fn submit(self, from_submit_method: bool, submitter: FormSubmitter); + fn submit(self, submit_method_flag: SubmittedFrom, submitter: FormSubmitter); // https://html.spec.whatwg.org/multipage/forms.html#constructing-the-form-data-set fn get_form_dataset(self, submitter: Option<FormSubmitter>) -> Vec<FormDatum>; } impl<'a> HTMLFormElementHelpers for JSRef<'a, HTMLFormElement> { - fn submit(self, _from_submit_method: bool, submitter: FormSubmitter) { + fn submit(self, _submit_method_flag: SubmittedFrom, submitter: FormSubmitter) { // Step 1 let doc = document_from_node(self).root(); let win = window_from_node(self).root(); |