Refactor ValidationMessage class
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Sep 2012 01:42:19 +0000 (01:42 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Sep 2012 01:42:19 +0000 (01:42 +0000)
commit35129a42cb2d4a3cae93598ef74e522f3a074fa4
tree8a0f9297d3d85d4aa17e8f1e401f7e45148e9da5
parentd09f9daa9d5e9e38ff0acd6f622b5a48b081465d
Refactor ValidationMessage class
https://bugs.webkit.org/show_bug.cgi?id=96365

Reviewed by Hajime Morita.

- Move some code from HTMLFormControlElement to ValidationMessage
- ValidationMessage class holds an element pointer as
HTMLFormControlElement, not FormAssociatedElement.

No new tests because of no behavior changes.

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::updateVisibleValidationMessage):
Moved some code to ValidationMessage::updateValidationMessage().
(WebCore::HTMLFormControlElement::setNeedsValidityCheck):
Ask ValidationMessage whether it is visible or not.
* html/HTMLFormControlElement.h:
(HTMLFormControlElement): Removed visibleValidationMessage().

* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::ValidationMessage):
Change the argument type: FormAssociatedElement -> HTMLFormControlElement
(WebCore::ValidationMessage::create): ditto.
(WebCore::ValidationMessage::updateValidationMessage):
Added. Moved some code from
HTMLFormControlElement::updateVisibleValidationMessage().
(WebCore::ValidationMessage::buildBubbleTree): toHTMLElement() is not needed.
(WebCore::ValidationMessage::deleteBubbleTree): ditto.
(WebCore::ValidationMessage::isVisible): Added.
* html/ValidationMessage.h:
(ValidationMessage):
 - Change some instance of FormAssociatedElement to HTMLFormControlElement
 - Remove message().
 - Added updateValidationMessage() and isVisible()
 - Made setMessage() private.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@128254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormControlElement.h
Source/WebCore/html/ValidationMessage.cpp
Source/WebCore/html/ValidationMessage.h