Title: [129107] trunk/Source/WebCore
- Revision
- 129107
- Author
- [email protected]
- Date
- 2012-09-20 01:41:27 -0700 (Thu, 20 Sep 2012)
Log Message
[Forms] HTMLSelectElement should call formStateDidChange on both menulist and lisbox mode
https://bugs.webkit.org/show_bug.cgi?id=97177
Reviewed by Kent Tamura.
This patch makes listbox mode select element to call formStateDidChange()
when selected options are changed.
For this change, this patch moves notifyFormStateChanged() to
HTMLFormControlElementWithState class from HTMLTextFormControlElement
for sharing code HTMLSelectElement class and HTMLInputElement/HTMLTextAreaElement
derived from HTMLTextFormControlElement.
No new tests. We can't test this change in WebKit test tools. Test script
will be implemented in Chromium side.
* html/HTMLFormControlElementWithState.cpp:
(WebCore::HTMLFormControlElementWithState::notifyFormStateChanged):
(WebCore):
* html/HTMLFormControlElementWithState.h: Moved a declaration of notifyFormStateChanged() from HTMLTextFormControlElement.
(HTMLFormControlElementWithState): Moved an implemented of notifyFormStateChanged() from HTMLTextFormControlElement.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::selectOption): Changed to call notifyFormStateChanged() instead of formStateDidChange().
(WebCore::HTMLSelectElement::updateListBoxSelection): Changed to call notifyFormStateChanged().
* html/HTMLTextFormControlElement.cpp: Moved an implemented of notifyFormStateChanged() to HTMLFormControlElementWithState class.
* html/HTMLTextFormControlElement.h: Moved a declaration of notifyFormStateChanged() to HTMLFormControlElementWithState class.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (129106 => 129107)
--- trunk/Source/WebCore/ChangeLog 2012-09-20 08:35:20 UTC (rev 129106)
+++ trunk/Source/WebCore/ChangeLog 2012-09-20 08:41:27 UTC (rev 129107)
@@ -1,3 +1,32 @@
+2012-09-20 Yoshifumi Inoue <[email protected]>
+
+ [Forms] HTMLSelectElement should call formStateDidChange on both menulist and lisbox mode
+ https://bugs.webkit.org/show_bug.cgi?id=97177
+
+ Reviewed by Kent Tamura.
+
+ This patch makes listbox mode select element to call formStateDidChange()
+ when selected options are changed.
+
+ For this change, this patch moves notifyFormStateChanged() to
+ HTMLFormControlElementWithState class from HTMLTextFormControlElement
+ for sharing code HTMLSelectElement class and HTMLInputElement/HTMLTextAreaElement
+ derived from HTMLTextFormControlElement.
+
+ No new tests. We can't test this change in WebKit test tools. Test script
+ will be implemented in Chromium side.
+
+ * html/HTMLFormControlElementWithState.cpp:
+ (WebCore::HTMLFormControlElementWithState::notifyFormStateChanged):
+ (WebCore):
+ * html/HTMLFormControlElementWithState.h: Moved a declaration of notifyFormStateChanged() from HTMLTextFormControlElement.
+ (HTMLFormControlElementWithState): Moved an implemented of notifyFormStateChanged() from HTMLTextFormControlElement.
+ * html/HTMLSelectElement.cpp:
+ (WebCore::HTMLSelectElement::selectOption): Changed to call notifyFormStateChanged() instead of formStateDidChange().
+ (WebCore::HTMLSelectElement::updateListBoxSelection): Changed to call notifyFormStateChanged().
+ * html/HTMLTextFormControlElement.cpp: Moved an implemented of notifyFormStateChanged() to HTMLFormControlElementWithState class.
+ * html/HTMLTextFormControlElement.h: Moved a declaration of notifyFormStateChanged() to HTMLFormControlElementWithState class.
+
2012-09-20 Keishi Hattori <[email protected]>
REGRESSION(r127727): Can't navigate between months with arrow keys in calendar picker
Modified: trunk/Source/WebCore/html/HTMLFormControlElementWithState.cpp (129106 => 129107)
--- trunk/Source/WebCore/html/HTMLFormControlElementWithState.cpp 2012-09-20 08:35:20 UTC (rev 129106)
+++ trunk/Source/WebCore/html/HTMLFormControlElementWithState.cpp 2012-09-20 08:41:27 UTC (rev 129107)
@@ -25,8 +25,12 @@
#include "config.h"
#include "HTMLFormControlElementWithState.h"
+#include "Chrome.h"
+#include "ChromeClient.h"
#include "FormController.h"
+#include "Frame.h"
#include "HTMLFormElement.h"
+#include "Page.h"
namespace WebCore {
@@ -56,6 +60,16 @@
return form()->shouldAutocomplete();
}
+void HTMLFormControlElementWithState::notifyFormStateChanged()
+{
+ Frame* frame = document()->frame();
+ if (!frame)
+ return;
+
+ if (Page* page = frame->page())
+ page->chrome()->client()->formStateDidChange(this);
+}
+
bool HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState() const
{
// We don't save/restore control state in a form with autocomplete=off.
Modified: trunk/Source/WebCore/html/HTMLFormControlElementWithState.h (129106 => 129107)
--- trunk/Source/WebCore/html/HTMLFormControlElementWithState.h 2012-09-20 08:35:20 UTC (rev 129106)
+++ trunk/Source/WebCore/html/HTMLFormControlElementWithState.h 2012-09-20 08:41:27 UTC (rev 129107)
@@ -40,6 +40,7 @@
virtual FormControlState saveFormControlState() const;
// The specified FormControlState must have at least one string value.
virtual void restoreFormControlState(const FormControlState&) { }
+ void notifyFormStateChanged();
protected:
HTMLFormControlElementWithState(const QualifiedName& tagName, Document*, HTMLFormElement*);
Modified: trunk/Source/WebCore/html/HTMLSelectElement.cpp (129106 => 129107)
--- trunk/Source/WebCore/html/HTMLSelectElement.cpp 2012-09-20 08:35:20 UTC (rev 129106)
+++ trunk/Source/WebCore/html/HTMLSelectElement.cpp 2012-09-20 08:41:27 UTC (rev 129107)
@@ -632,6 +632,7 @@
scrollToSelection();
setNeedsValidityCheck();
+ notifyFormStateChanged();
}
void HTMLSelectElement::listBoxOnChange()
@@ -864,8 +865,7 @@
}
setNeedsValidityCheck();
- if (Frame* frame = document()->frame())
- frame->page()->chrome()->client()->formStateDidChange(this);
+ notifyFormStateChanged();
}
int HTMLSelectElement::optionToListIndex(int optionIndex) const
Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (129106 => 129107)
--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp 2012-09-20 08:35:20 UTC (rev 129106)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp 2012-09-20 08:41:27 UTC (rev 129107)
@@ -27,7 +27,6 @@
#include "AXObjectCache.h"
#include "Attribute.h"
-#include "Chrome.h"
#include "ChromeClient.h"
#include "Document.h"
#include "Event.h"
@@ -38,7 +37,6 @@
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "NodeRenderingContext.h"
-#include "Page.h"
#include "RenderBox.h"
#include "RenderTextControl.h"
#include "RenderTheme.h"
@@ -459,16 +457,6 @@
HTMLFormControlElementWithState::parseAttribute(attribute);
}
-void HTMLTextFormControlElement::notifyFormStateChanged()
-{
- Frame* frame = document()->frame();
- if (!frame)
- return;
-
- if (Page* page = frame->page())
- page->chrome()->client()->formStateDidChange(this);
-}
-
bool HTMLTextFormControlElement::lastChangeWasUserEdit() const
{
if (!isTextFormControl())
Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.h (129106 => 129107)
--- trunk/Source/WebCore/html/HTMLTextFormControlElement.h 2012-09-20 08:35:20 UTC (rev 129106)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.h 2012-09-20 08:41:27 UTC (rev 129107)
@@ -77,7 +77,6 @@
virtual HTMLElement* innerTextElement() const = 0;
void selectionChanged(bool userTriggered);
- void notifyFormStateChanged();
bool lastChangeWasUserEdit() const;
void setInnerTextValue(const String&);
String innerTextValue() const;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes