form.action needs to return current document URL when content attribute is the empty string




DOM: Core & HTML
10 months ago
10 months ago


(Reporter: ayg, Assigned: ayg)


Firefox Tracking Flags

(Not tracked)


In Chrome, WebKit, and Edge, this outputs ",", which says that when you get the IDL .action property on <form action=""> it returns the page's current URL (which is where the form is actually going to submit, after all).  This matches the spec:

The action IDL attribute must reflect the content attribute of the same name, except that on getting, when the content attribute is missing or its value is the empty string, the element's node document's URL must be returned instead.

(The spec also currently mandates this behavior even when the content attribute is missing, but this does not match browsers, and I'm going to submit a spec fix.)
Fiddle including formAction as well:

This shows that for formAction, Chrome and WebKit match the spec and also output the document URL for a missing attribute, unlike with action.  Edge always just outputs an empty string, but we should align with Chrome/WebKit/spec.
Whoops, I was testing on an old Firefox.  This was mostly fixed by bug 1366361 part 1, but that seems to match the previous spec, not other browsers.

Spec PR to match browsers:
Upstream test submission:

Once one UA already matches the spec -- which makes more sense than what other UAs do anyway -- I'm not sure if we want to change the spec on this point.  Maybe the other engines should change.
Per the discussion on the PR, it seems we want the spec to stay as it is.
Last Resolved: 10 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.