Handle "form" attribute updates in parseMappedAttribute() instead of attributeChanged...
authoradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Aug 2011 10:22:01 +0000 (10:22 +0000)
committeradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Aug 2011 10:22:01 +0000 (10:22 +0000)
commitbea196eab3a516dba4bd9b1e86d10581502e159a
tree19e059561761d252a52dab89d1ef3804129e9935
parentfaa4f1169b4145694ff8c68b94699964c257fe85
Handle "form" attribute updates in parseMappedAttribute() instead of attributeChanged() to better match HTMLElement practices
https://bugs.webkit.org/show_bug.cgi?id=66321

Reviewed by Darin Adler.

Source/WebCore:

This is simply a cleanup change: there's no need that I can see for
HTMLFormControlElement and HTMLObjectElement to override
Element::attributeChanged since they can properly handle form
attribute changes in parseMappedAttribute, which they also override.

Though no change in behavior, I've added test coverage of the moved
code to an existing test (fast/forms/form-attribute.html) and added
a new test.

Test: fast/forms/radio-remove-form-attr.html

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::parseMappedAttribute):
* html/HTMLFormControlElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parseMappedAttribute):
* html/HTMLObjectElement.h:

LayoutTests:

Added new coverage to ensure that adding a radio button to a radio
group in the document by removing a form attribute leaves the group in
a valid state (no more than one button checked).

Beefed up coverage of form associated elements to better cover
HTMLObjectElement.

* fast/forms/form-attribute-expected.txt:
* fast/forms/radio-remove-form-attr-expected.txt: Added.
* fast/forms/radio-remove-form-attr.html: Added.
* fast/forms/script-tests/form-attribute.js:
Added coverage of <object form=""> behavior.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/form-attribute-expected.txt
LayoutTests/fast/forms/radio-remove-form-attr-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/radio-remove-form-attr.html [new file with mode: 0644]
LayoutTests/fast/forms/script-tests/form-attribute.js
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormControlElement.h
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/HTMLObjectElement.h