adding macro to return string or url,

using that macro with the form action,
making the form submit process use base url,
adding tests.
This commit is contained in:
Jake Goldsborough 2016-09-20 21:16:51 -07:00
parent 1ed3521dcf
commit ce249d9384
6 changed files with 52 additions and 2 deletions

View file

@ -98,7 +98,7 @@ impl HTMLFormElementMethods for HTMLFormElement {
make_setter!(SetAcceptCharset, "accept-charset");
// https://html.spec.whatwg.org/multipage/#dom-fs-action
make_url_or_base_getter!(Action, "action");
make_string_or_document_url_getter!(Action, "action");
// https://html.spec.whatwg.org/multipage/#dom-fs-action
make_setter!(SetAction, "action");
@ -295,7 +295,7 @@ impl HTMLFormElement {
pub fn submit(&self, submit_method_flag: SubmittedFrom, submitter: FormSubmitter) {
// Step 1
let doc = document_from_node(self);
let base = doc.url();
let base = doc.base_url();
// TODO: Handle browsing contexts (Step 2, 3)
// Step 4
if submit_method_flag == SubmittedFrom::NotFromForm &&