RESOLVED FIXED 213205
[WPT] form.action does not return document.url when unset (part of https://wpt.live/html/dom/reflection-forms.html)
https://bugs.webkit.org/show_bug.cgi?id=213205
Summary [WPT] form.action does not return document.url when unset (part of https://wp...
Sam Weinig
Reported 2020-06-15 12:32:25 PDT
Created attachment 401922 [details] Test case WPT: form.action does not return document.url when unset (part of https://wpt.live/html/dom/reflection-forms.html) Test: https://wpt.live/html/dom/reflection-forms.html Spec: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-fs-action From 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".
Attachments
Test case (1.29 KB, text/html)
2020-06-15 12:32 PDT, Sam Weinig
no flags
WIP (2.38 KB, patch)
2020-06-15 12:37 PDT, Sam Weinig
no flags
WIP (3.19 KB, patch)
2020-06-15 13:25 PDT, Sam Weinig
no flags
Patch (15.04 KB, patch)
2020-06-15 18:22 PDT, Sam Weinig
no flags
Patch (15.05 KB, patch)
2020-06-15 20:44 PDT, Sam Weinig
no flags
Sam Weinig
Comment 1 2020-06-15 12:37:27 PDT Comment hidden (obsolete)
Sam Weinig
Comment 2 2020-06-15 13:25:44 PDT Comment hidden (obsolete)
Sam Weinig
Comment 3 2020-06-15 18:22:57 PDT Comment hidden (obsolete)
Sam Weinig
Comment 4 2020-06-15 20:44:07 PDT
David Kilzer (:ddkilzer)
Comment 5 2020-06-16 13:32:05 PDT
Comment on attachment 401972 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401972&action=review r=me > Source/WebCore/html/HTMLFormElement.cpp:641 > String HTMLFormElement::action() const > { > - return attributeWithoutSynchronization(actionAttr); > + auto& value = attributeWithoutSynchronization(actionAttr); > + if (value.isEmpty()) > + return document().url().string(); > + return document().completeURL(stripLeadingAndTrailingHTMLSpaces(value)).string(); > } HTMLFormElement::action() and HTMLFormControlElement::formAction() are now identical, except for the attribute retrieved. Is there a good place to share the code? Not necessary to land the patch; just noticed white reviewing.
Sam Weinig
Comment 6 2020-06-16 13:57:28 PDT
(In reply to David Kilzer (:ddkilzer) from comment #5) > Comment on attachment 401972 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=401972&action=review > > r=me > > > Source/WebCore/html/HTMLFormElement.cpp:641 > > String HTMLFormElement::action() const > > { > > - return attributeWithoutSynchronization(actionAttr); > > + auto& value = attributeWithoutSynchronization(actionAttr); > > + if (value.isEmpty()) > > + return document().url().string(); > > + return document().completeURL(stripLeadingAndTrailingHTMLSpaces(value)).string(); > > } > > HTMLFormElement::action() and HTMLFormControlElement::formAction() are now > identical, except for the attribute retrieved. > > Is there a good place to share the code? Not necessary to land the patch; > just noticed white reviewing. Not at the minute. Darin and I are discussing how to potentially cover more Reflection cases in https://bugs.webkit.org/show_bug.cgi?id=213227, which, depending on what we do, could cover this as well.
EWS
Comment 7 2020-06-16 14:03:54 PDT
Committed r263113: <https://trac.webkit.org/changeset/263113> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401972 [details].
Radar WebKit Bug Importer
Comment 8 2020-06-16 14:04:23 PDT
Note You need to log in before you can comment on or make changes to this bug.