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".
Created attachment 401923 [details] WIP
Created attachment 401930 [details] WIP
Created attachment 401964 [details] Patch
Created attachment 401972 [details] Patch
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.
(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.
Committed r263113: <https://trac.webkit.org/changeset/263113> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401972 [details].
<rdar://problem/64420918>