Implement cannot navigate

This commit is contained in:
CYBAI 2019-01-10 18:58:07 +08:00
parent 9d70f51356
commit cb86d451e6
4 changed files with 26 additions and 12 deletions

View file

@ -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::<Element>().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::<Element>().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::<Element>().cannot_navigate() {
return;
}
// Step 11
let mut action = submitter.action();