Diff
Modified: trunk/Source/WebCore/ChangeLog (96678 => 96679)
--- trunk/Source/WebCore/ChangeLog 2011-10-05 06:06:43 UTC (rev 96678)
+++ trunk/Source/WebCore/ChangeLog 2011-10-05 06:07:51 UTC (rev 96679)
@@ -1,5 +1,30 @@
2011-10-04 Kent Tamura <[email protected]>
+ Remove Node::willBlur()
+ https://bugs.webkit.org/show_bug.cgi?id=69395
+
+ Reviewed by Ryosuke Niwa.
+
+ Revert the WebCore part of r87371 because
+ FrameSelection::textWillBeReplaced() doesn't set focus anymore.
+ No new tests. Covered by fast/forms/input-number-blur-twice.html.
+
+ * dom/Document.cpp:
+ (WebCore::Document::setFocusedNode): Revert r87371.
+ * dom/Node.cpp: ditto.
+ * dom/Node.h: ditto.
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::handleBlurEvent): ditto.
+ * html/HTMLInputElement.h: ditto.
+ * html/InputType.cpp:
+ (WebCore::InputType::handleBlurEvent): ditto.
+ * html/InputType.h: ditto.
+ * html/NumberInputType.cpp:
+ (WebCore::NumberInputType::handleBlurEvent): ditto.
+ * html/NumberInputType.h: ditto.
+
+2011-10-04 Kent Tamura <[email protected]>
+
Introduce feature flags for incomplete input types
https://bugs.webkit.org/show_bug.cgi?id=68971
Modified: trunk/Source/WebCore/dom/Document.cpp (96678 => 96679)
--- trunk/Source/WebCore/dom/Document.cpp 2011-10-05 06:06:43 UTC (rev 96678)
+++ trunk/Source/WebCore/dom/Document.cpp 2011-10-05 06:07:51 UTC (rev 96679)
@@ -3168,12 +3168,10 @@
bool focusChangeBlocked = false;
RefPtr<Node> oldFocusedNode = m_focusedNode;
+ m_focusedNode = 0;
// Remove focus from the existing focus node (if any)
if (oldFocusedNode && !oldFocusedNode->inDetach()) {
- // willBlur() should be called before any status changes.
- oldFocusedNode->willBlur();
- m_focusedNode = 0;
if (oldFocusedNode->active())
oldFocusedNode->setActive(false);
@@ -3218,8 +3216,7 @@
else
view()->setFocus(false);
}
- } else
- m_focusedNode = 0;
+ }
if (newFocusedNode) {
if (newFocusedNode == newFocusedNode->rootEditableElement() && !acceptsEditingFocus(newFocusedNode.get())) {
Modified: trunk/Source/WebCore/dom/Node.cpp (96678 => 96679)
--- trunk/Source/WebCore/dom/Node.cpp 2011-10-05 06:06:43 UTC (rev 96678)
+++ trunk/Source/WebCore/dom/Node.cpp 2011-10-05 06:07:51 UTC (rev 96679)
@@ -2742,10 +2742,6 @@
EventDispatcher::dispatchEvent(this, FocusEventDispatchMediator::create(oldFocusedNode));
}
-void Node::willBlur()
-{
-}
-
void Node::dispatchBlurEvent(PassRefPtr<Node> newFocusedNode)
{
if (document()->page())
Modified: trunk/Source/WebCore/dom/Node.h (96678 => 96679)
--- trunk/Source/WebCore/dom/Node.h 2011-10-05 06:06:43 UTC (rev 96678)
+++ trunk/Source/WebCore/dom/Node.h 2011-10-05 06:07:51 UTC (rev 96679)
@@ -563,7 +563,6 @@
void dispatchSimulatedClick(PassRefPtr<Event> underlyingEvent, bool sendMouseEvents = false, bool showPressedLook = true);
virtual void dispatchFocusEvent(PassRefPtr<Node> oldFocusedNode);
- virtual void willBlur();
virtual void dispatchBlurEvent(PassRefPtr<Node> newFocusedNode);
virtual void dispatchChangeEvent();
virtual void dispatchInputEvent();
Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (96678 => 96679)
--- trunk/Source/WebCore/html/HTMLInputElement.cpp 2011-10-05 06:06:43 UTC (rev 96678)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp 2011-10-05 06:07:51 UTC (rev 96679)
@@ -513,14 +513,9 @@
document()->setUseSecureKeyboardEntryWhenActive(true);
}
-void HTMLInputElement::willBlur()
-{
- m_inputType->willBlur();
- HTMLTextFormControlElement::willBlur();
-}
-
void HTMLInputElement::handleBlurEvent()
{
+ m_inputType->handleBlurEvent();
if (!isTextField())
return;
Frame* frame = document()->frame();
Modified: trunk/Source/WebCore/html/HTMLInputElement.h (96678 => 96679)
--- trunk/Source/WebCore/html/HTMLInputElement.h 2011-10-05 06:06:43 UTC (rev 96678)
+++ trunk/Source/WebCore/html/HTMLInputElement.h 2011-10-05 06:07:51 UTC (rev 96679)
@@ -307,7 +307,6 @@
virtual bool isEmptyValue() const { return value().isEmpty(); }
virtual bool isEmptySuggestedValue() const { return suggestedValue().isEmpty(); }
virtual void handleFocusEvent();
- virtual void willBlur();
virtual void handleBlurEvent();
virtual bool isOptionalFormControl() const { return !isRequiredFormControl(); }
Modified: trunk/Source/WebCore/html/InputType.cpp (96678 => 96679)
--- trunk/Source/WebCore/html/InputType.cpp 2011-10-05 06:06:43 UTC (rev 96678)
+++ trunk/Source/WebCore/html/InputType.cpp 2011-10-05 06:07:51 UTC (rev 96679)
@@ -436,7 +436,7 @@
return false;
}
-void InputType::willBlur()
+void InputType::handleBlurEvent()
{
}
Modified: trunk/Source/WebCore/html/InputType.h (96678 => 96679)
--- trunk/Source/WebCore/html/InputType.h 2011-10-05 06:06:43 UTC (rev 96678)
+++ trunk/Source/WebCore/html/InputType.h 2011-10-05 06:07:51 UTC (rev 96679)
@@ -182,7 +182,7 @@
virtual PassRefPtr<HTMLFormElement> formForSubmission() const;
virtual bool isKeyboardFocusable() const;
virtual bool shouldUseInputMethod() const;
- virtual void willBlur();
+ virtual void handleBlurEvent();
virtual void accessKeyAction(bool sendToAnyElement);
virtual bool canBeSuccessfulSubmitButton();
Modified: trunk/Source/WebCore/html/NumberInputType.cpp (96678 => 96679)
--- trunk/Source/WebCore/html/NumberInputType.cpp 2011-10-05 06:06:43 UTC (rev 96678)
+++ trunk/Source/WebCore/html/NumberInputType.cpp 2011-10-05 06:07:51 UTC (rev 96679)
@@ -273,7 +273,7 @@
return step / pow(2.0, FLT_MANT_DIG);
}
-void NumberInputType::willBlur()
+void NumberInputType::handleBlurEvent()
{
// Reset the renderer value, which might be unmatched with the element value.
element()->setFormControlValueMatchesRenderer(false);
Modified: trunk/Source/WebCore/html/NumberInputType.h (96678 => 96679)
--- trunk/Source/WebCore/html/NumberInputType.h 2011-10-05 06:06:43 UTC (rev 96678)
+++ trunk/Source/WebCore/html/NumberInputType.h 2011-10-05 06:07:51 UTC (rev 96679)
@@ -64,7 +64,7 @@
virtual double parseToDoubleWithDecimalPlaces(const String&, double, unsigned*) const;
virtual String serialize(double) const;
virtual double acceptableError(double) const;
- virtual void willBlur();
+ virtual void handleBlurEvent() OVERRIDE;
virtual String visibleValue() const;
virtual String convertFromVisibleValue(const String&) const;
virtual bool isAcceptableValue(const String&);