[Forms] label.form attribute doesn't work
https://bugs.webkit.org/show_bug.cgi?id=80499
Patch by Yoshifumi Inoue <yosin@chromium.org> on 2012-03-16
Reviewed by Kent Tamura.
Source/WebCore:
This patch changes implementation of label.form of IDL attribute to
compute it to the form element specified by the "form" HTML attribute
or form ancestor when the "form" HTML attribute isn't in HTML.
This patch introduces new function FormAssociatedElement::findAssociatedForm
for sharing code among FormAssociateElement::insertedIntoTree, resetFormOwner
and HTMLLabelElement::form.
No new tests. Update existing tests.
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::findAssociatedForm): Added.
(WebCore):
(WebCore::FormAssociatedElement::insertedIntoTree):
(WebCore::FormAssociatedElement::resetFormOwner):
* html/FormAssociatedElement.h:
(FormAssociatedElement):
* html/HTMLLabelElement.cpp: Remove unused include files
(WebCore::HTMLLabelElement::form): Added.
LayoutTests:
This patch updates test cases and expectation for functional
"form" attribute of the "label" element.
* fast/forms/form-attribute-expected.txt:
* fast/forms/form-attribute-nonexistence-form-id-expected.txt:
* fast/forms/form-attribute-nonexistence-form-id.html:
* fast/forms/form-attribute.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110996
268f45cc-cd09-0410-ab3c-
d52691b4dbfc