From cb86d451e663646c496e6bece8b456f5196afca7 Mon Sep 17 00:00:00 2001 From: CYBAI Date: Thu, 10 Jan 2019 18:58:07 +0800 Subject: Implement cannot navigate --- components/script/dom/htmlformelement.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'components/script/dom/htmlformelement.rs') diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index 6a4a4b97fe5..e81613d750d 100755 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -317,7 +317,11 @@ impl HTMLFormElement { /// [Form submission](https://html.spec.whatwg.org/multipage/#concept-form-submit) pub fn submit(&self, submit_method_flag: SubmittedFrom, submitter: FormSubmitter) { - // TODO: Step 1. If form cannot navigate , then return. + // Step 1 + if self.upcast::().cannot_navigate() { + return; + } + // Step 2 if self.constructing_entry_list.get() { return; @@ -342,6 +346,11 @@ impl HTMLFormElement { if event.DefaultPrevented() { return; } + + // Step 7-3 + if self.upcast::().cannot_navigate() { + return; + } } // Step 8 @@ -353,7 +362,10 @@ impl HTMLFormElement { None => return, }; - // TODO: Step 10. If form cannot navigate, then return. + // Step 10 + if self.upcast::().cannot_navigate() { + return; + } // Step 11 let mut action = submitter.action(); -- cgit v1.2.3