formaction must return document's address when formaction is missing
[WebKit-https.git] / Source / WebCore / html / HTMLFormControlElement.cpp
index 88d8321..1855819 100644 (file)
@@ -104,6 +104,19 @@ bool HTMLFormControlElement::formNoValidate() const
     return fastHasAttribute(formnovalidateAttr);
 }
 
+String HTMLFormControlElement::formAction() const
+{
+    const AtomicString& value = fastGetAttribute(formactionAttr);
+    if (value.isEmpty())
+        return document().url();
+    return getURLAttribute(formactionAttr);
+}
+
+void HTMLFormControlElement::setFormAction(const AtomicString& value)
+{
+    setAttributeWithoutSynchronization(formactionAttr, value);
+}
+
 bool HTMLFormControlElement::computeIsDisabledByFieldsetAncestor() const
 {
     Element* previousAncestor = nullptr;