[Forms] label.form attribute doesn't work
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 13:05:35 +0000 (13:05 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 13:05:35 +0000 (13:05 +0000)
commitff7c9b2b930f601671f7078bcb84e0736413c0ff
treef6f18a8bb9a7c36a28e3a627b7df6602d28fc72a
parent70283c941d901b4a9323ab69704f4f1be8796ba8
[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
LayoutTests/ChangeLog
LayoutTests/fast/forms/form-attribute-expected.txt
LayoutTests/fast/forms/form-attribute-nonexistence-form-id-expected.txt
LayoutTests/fast/forms/form-attribute-nonexistence-form-id.html
LayoutTests/fast/forms/form-attribute.html
Source/WebCore/ChangeLog
Source/WebCore/html/FormAssociatedElement.cpp
Source/WebCore/html/FormAssociatedElement.h
Source/WebCore/html/HTMLLabelElement.cpp
Source/WebCore/html/HTMLLabelElement.h