2010-12-07 Kenichi Ishibashi <bashi@google.com>
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Dec 2010 09:40:23 +0000 (09:40 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Dec 2010 09:40:23 +0000 (09:40 +0000)
commita1245e933ecf1eddcf2c3f08c760f0330d5d198a
tree4f35be9a4a6b16d1cf0efa7e0ce7ec3d73de2426
parent350c026f3ae8fc36db92e33c022504f64f0c5c86
2010-12-07  Kenichi Ishibashi  <bashi@google.com>

        Reviewed by Kent Tamura.

        Let HTMLObjectElement be a form associated element
        https://bugs.webkit.org/show_bug.cgi?id=48821

        Introduces FormAssociatedElement class which would be a super class
        of form assocated elements. Some of member functions and variables of
        HTMLFormControlElement are migrated into this class.
        Following the HTML5 spec, HTMLFormControlElement class and
        HTMLObjectElement class are subclasses of it for now.

        Test: fast/forms/form-collection-elements-order.html

        * Android.mk: Added FormAssociatedElement.cpp
        * CMakeLists.txt: Ditto.
        * GNUmakefile.am: Added FormAssociatedElement.{cpp,h}
        * WebCore.exp.in: Added the symbol for toHTMLElement(FormAssociatedElement*)
        * WebCore.gypi: Added FormAssociatedElement.{cpp,h}
        * WebCore.pro: Ditto.
        * WebCore.vcproj/WebCore.vcproj: Ditto.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * dom/CheckedRadioButtons.h: Fixed class forward declaration order.
        * dom/Document.cpp:
        (WebCore::Document::registerFormElementWithFormAttribute): Modified to
        use FormAssociatedElement instead of HTMLFormControlElement
        (WebCore::Document::unregisterFormElementWithFormAttribute): Ditto.
        (WebCore::Document::resetFormElementsOwner):
        * dom/Document.h: Ditto.
        * html/DOMFormData.cpp: Ditto.
        (WebCore::DOMFormData::DOMFormData):
        * html/FormAssociatedElement.cpp: Copied and renamed from WebCore/html/HTMLFormControlElement.cpp.
        (WebCore::FormAssociatedElement::FormAssociatedElement):
        (WebCore::FormAssociatedElement::~FormAssociatedElement):
        (WebCore::FormAssociatedElement::validity):
        (WebCore::FormAssociatedElement::insertedIntoTree):
        (WebCore::FormAssociatedElement::removedFromTree):
        (WebCore::FormAssociatedElement::removeFromForm):
        (WebCore::FormAssociatedElement::resetFormOwner):
        (WebCore::FormAssociatedElement::formAttributeChanged):
        (WebCore::toHTMLElement):
        * html/FormAssociatedElement.h: Ditto.
        (WebCore::FormAssociatedElement::ref):
        (WebCore::FormAssociatedElement::deref):
        (WebCore::FormAssociatedElement::formDestroyed):
        (WebCore::FormAssociatedElement::setForm):
        * html/HTMLElement.h: Changed the access level of findFormAncestor().
        * html/HTMLFormCollection.cpp:
        (WebCore::HTMLFormCollection::item): Modified to use FormAssociatedElement
        instead of HTMLFormControlElement.
        (WebCore::HTMLFormCollection::getNamedFormItem): Ditto.
        (WebCore::HTMLFormCollection::updateNameCache): Ditto.
        * html/HTMLFormControlElement.cpp: Modified regarding with the change of class
        hierarchy.
        (WebCore::HTMLFormControlElement::HTMLFormControlElement):
        (WebCore::HTMLFormControlElement::~HTMLFormControlElement):
        (WebCore::HTMLFormControlElement::insertedIntoTree):
        (WebCore::HTMLFormControlElement::removedFromTree):
        (WebCore::HTMLFormControlElement::supportsFocus):
        (WebCore::HTMLFormControlElement::checkValidity):
        (WebCore::HTMLFormControlElement::virtualForm):
        (WebCore::HTMLFormControlElement::isDefaultButtonForForm):
        (WebCore::HTMLFormControlElement::attributeChanged):
        * html/HTMLFormControlElement.h: Ditto.
        (WebCore::HTMLFormControlElement::form):
        (WebCore::HTMLFormControlElement::disabled):
        (WebCore::HTMLFormControlElement::type):
        (WebCore::HTMLFormControlElement::refFormAssociatedElement):
        (WebCore::HTMLFormControlElement::derefFormAssociatedElement):
        * html/HTMLFormElement.cpp: Modified to use FormAssociatedElement
        instead of HTMLFormControlElement.
        (WebCore::HTMLFormElement::submitImplicitly):
        (WebCore::HTMLFormElement::validateInteractively):
        (WebCore::HTMLFormElement::submit):
        (WebCore::HTMLFormElement::reset):
        (WebCore::HTMLFormElement::formElementIndexWithFormAttribute):
        (WebCore::HTMLFormElement::formElementIndex):
        (WebCore::HTMLFormElement::registerFormElement):
        (WebCore::HTMLFormElement::removeFormElement):
        (WebCore::HTMLFormElement::defaultButton):
        (WebCore::HTMLFormElement::checkValidity):
        (WebCore::HTMLFormElement::collectUnhandledInvalidControls):
        (WebCore::HTMLFormElement::documentDidBecomeActive):
        * html/HTMLFormElement.h: Ditto.
        (WebCore::HTMLFormElement::associatedElements):
        * html/HTMLInputElement.cpp: Ditto.
        (WebCore::HTMLInputElement::updateCheckedRadioButtons):
        * html/HTMLObjectElement.cpp: Modified regarding with the change of class
        hierarchy.
        (WebCore::HTMLObjectElement::HTMLObjectElement):
        (WebCore::HTMLObjectElement::~HTMLObjectElement):
        (WebCore::HTMLObjectElement::create):
        (WebCore::HTMLObjectElement::attributeChanged):
        (WebCore::HTMLObjectElement::insertedIntoTree):
        (WebCore::HTMLObjectElement::removedFromTree):
        (WebCore::HTMLObjectElement::appendFormData):
        (WebCore::HTMLObjectElement::formControlName):
        * html/HTMLObjectElement.h: Ditto.
        (WebCore::HTMLObjectElement::form):
        (WebCore::HTMLObjectElement::isFormControlElement):
        (WebCore::HTMLObjectElement::isEnumeratable):
        (WebCore::HTMLObjectElement::refFormAssociatedElement):
        (WebCore::HTMLObjectElement::derefFormAssociatedElement):
        * html/HTMLTagNames.in: Added constructorNeedsFormElement to object tag.
        * html/ValidationMessage.cpp: Modified to use FormAssociatedElement
        instead of HTMLFormControlElement.
        (WebCore::ValidationMessage::ValidationMessage):
        (WebCore::ValidationMessage::create):
        * html/ValidationMessage.h: Ditto.
        * html/ValidityState.cpp: Ditto.
        (WebCore::ValidityState::validationMessage):
        (WebCore::ValidityState::setCustomErrorMessage):
        (WebCore::ValidityState::valueMissing):
        (WebCore::ValidityState::typeMismatch):
        (WebCore::ValidityState::patternMismatch):
        (WebCore::ValidityState::tooLong):
        (WebCore::ValidityState::rangeUnderflow):
        (WebCore::ValidityState::rangeOverflow):
        (WebCore::ValidityState::stepMismatch):
        * html/ValidityState.h: Ditto.
        (WebCore::ValidityState::create):
        (WebCore::ValidityState::ValidityState):
        * loader/FormSubmission.cpp: Ditto.
        (WebCore::FormSubmission::create):

2010-12-07  Kenichi Ishibashi  <bashi@google.com>

        Reviewed by Kent Tamura.

        Let HTMLObjectElement be a form associated element
        https://bugs.webkit.org/show_bug.cgi?id=48821

        Modified to use FormAssociatedElement instead of HTMLFormControlElement.

        * src/WebFormElement.cpp:
        (WebKit::WebFormElement::getFormControlElements): Modified to use
        FormAssociatedElement instead of HTMLFormControlElement.
        * src/WebPasswordFormUtils.cpp:
        (WebKit::findPasswordFormFields): Ditto.
        * src/WebSearchableFormData.cpp:
        (WebCore::GetButtonToActivate): Ditto.
        (WebCore::HasSuitableTextElement): Ditto.

2010-12-07  Kenichi Ishibashi  <bashi@google.com>

        Reviewed by Kent Tamura.

        Let HTMLObjectElement be a form associated element
        https://bugs.webkit.org/show_bug.cgi?id=48821

        Modified to use FormAssociatedElement instead of HTMLFormControlElement.

        * WebFrame.cpp:
        (WebFrame::elementWithName): Modified to use FormAssociatedElement
        instead of HTMLFormControlElement.
        (WebFrame::controlsInForm): Ditto.

2010-12-07  Kenichi Ishibashi  <bashi@google.com>

        Reviewed by Kent Tamura.

        Let HTMLObjectElement be a form associated element
        https://bugs.webkit.org/show_bug.cgi?id=48821

        Modified to use FormAssociatedElement instead of HTMLFormControlElement.

        * WebView/WebHTMLRepresentation.mm:
        (-[WebHTMLRepresentation elementWithName:inForm:]): Modified to use
        FormAssociatedElement instead of HTMLFormControlElement.
        (-[WebHTMLRepresentation controlsInForm:]): Ditto.

2010-12-07  Kenichi Ishibashi  <bashi@google.com>

        Reviewed by Kent Tamura.

        Let HTMLObjectElement be a form associated element
        https://bugs.webkit.org/show_bug.cgi?id=48821

        Adds a test to ensure the order of form.elements attribute.
        Updates two tests to check whether object elements are handled
        correctly in form.elements attribute.

        * fast/forms/form-attribute-expected.txt: Updated.
        * fast/forms/form-collection-elements-order-expected.txt: Added.
        * fast/forms/form-collection-elements-order.html: Added.
        * fast/forms/script-tests/form-attribute.js: Updated.
        * fast/forms/script-tests/form-collection-elements-order.js: Added.
        (checkOrder):
        * fast/forms/script-tests/form-collection-elements.js: Updated.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
46 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/form-attribute-expected.txt
LayoutTests/fast/forms/form-collection-elements-expected.txt
LayoutTests/fast/forms/form-collection-elements-order-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/form-collection-elements-order.html [new file with mode: 0644]
LayoutTests/fast/forms/script-tests/form-attribute.js
LayoutTests/fast/forms/script-tests/form-collection-elements-order.js [new file with mode: 0644]
LayoutTests/fast/forms/script-tests/form-collection-elements.js
WebCore/Android.mk
WebCore/CMakeLists.txt
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.exp.in
WebCore/WebCore.gypi
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/dom/CheckedRadioButtons.h
WebCore/dom/Document.cpp
WebCore/dom/Document.h
WebCore/html/DOMFormData.cpp
WebCore/html/FormAssociatedElement.cpp [new file with mode: 0644]
WebCore/html/FormAssociatedElement.h [new file with mode: 0644]
WebCore/html/HTMLElement.h
WebCore/html/HTMLFormCollection.cpp
WebCore/html/HTMLFormControlElement.cpp
WebCore/html/HTMLFormControlElement.h
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLFormElement.h
WebCore/html/HTMLInputElement.cpp
WebCore/html/HTMLObjectElement.cpp
WebCore/html/HTMLObjectElement.h
WebCore/html/HTMLTagNames.in
WebCore/html/ValidationMessage.cpp
WebCore/html/ValidationMessage.h
WebCore/html/ValidityState.cpp
WebCore/html/ValidityState.h
WebCore/loader/FormSubmission.cpp
WebKit/chromium/ChangeLog
WebKit/chromium/src/WebFormElement.cpp
WebKit/chromium/src/WebPasswordFormUtils.cpp
WebKit/chromium/src/WebSearchableFormData.cpp
WebKit/mac/ChangeLog
WebKit/mac/WebView/WebHTMLRepresentation.mm
WebKit/win/ChangeLog
WebKit/win/WebFrame.cpp