2011-03-05 Ilya Sherman <isherman@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Mar 2011 08:09:39 +0000 (08:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Mar 2011 08:09:39 +0000 (08:09 +0000)
commitff3b85f1498f6f31b6f6d1d5e14b56923e1571b7
tree79e0be04ff9daefc4e9739521b8e681f0b458673
parent9f96d45926f85c792be4130b827a4b418d961fb9
2011-03-05  Ilya Sherman  <isherman@chromium.org>

        Reviewed by Darin Adler.

        HTMLInputElement::setValue() should schedule change event when the element is focused
        In service of https://code.google.com/p/chromium/issues/detail?id=42716
        https://bugs.webkit.org/show_bug.cgi?id=53160

        * fast/forms/onchange-change-type-expected.txt: Added.
        * fast/forms/onchange-change-type.html: Added.
        * fast/forms/onchange-setvalueforuser-expected.txt: Added.
        * fast/forms/onchange-setvalueforuser.html: Added.
2011-03-05  Ilya Sherman  <isherman@chromium.org>

        Reviewed by Darin Adler.

        HTMLInputElement::setValue() should schedule change event when the element is focused.
        Refactored tracking of "changed since last change event" state from renderer to DOM.In service of https://code.google.com/p/chromium/issues
        In service of https://code.google.com/p/chromium/issues/detail?id=42716
        https://bugs.webkit.org/show_bug.cgi?id=53160

        Test: fast/forms/onchange-change-type.html
        Test: fast/forms/onchange-setvalueforuser.html

        * WebCore.exp.in:
        * dom/Document.cpp:
        (WebCore::Document::setFocusedNode):
        * dom/Element.h:
        (WebCore::Element::wasChangedSinceLastFormControlChangeEvent): Added.
        (WebCore::Element::setChangedSinceLastFormControlChangeEvent): Added.
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::HTMLFormControlElement):
        (WebCore::HTMLFormControlElement::wasChangedSinceLastFormControlChangeEvent): Added.
        (WebCore::HTMLFormControlElement::setChangedSinceLastFormControlChangeEvent): Added.
        (WebCore::HTMLFormControlElement::dispatchFormControlChangeEvent): Also clear the "changed since last change event" flag.
        (WebCore::HTMLFormControlElement::dispatchFormControlInputEvent): Also set the "changed since last change event" flag.
        * html/HTMLFormControlElement.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::updateType): Also clear the "changed since last change event" flag.
        (WebCore::HTMLInputElement::setValue):
            For a focused text field, dispatch an input event, but delay the change event until the field loses focus.
        (WebCore::HTMLInputElement::defaultEventHandler):
        (WebCore::HTMLInputElement::stepUpFromRenderer):
        * html/shadow/TextControlInnerElements.cpp:
        (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
        * rendering/RenderTextControl.cpp:
        (WebCore::RenderTextControl::RenderTextControl):
        (WebCore::RenderTextControl::subtreeHasChanged):
        * rendering/RenderTextControl.h:
        * rendering/RenderTextControlMultiLine.cpp:
        (WebCore::RenderTextControlMultiLine::subtreeHasChanged):
        * rendering/RenderTextControlSingleLine.cpp:
        (WebCore::RenderTextControlSingleLine::subtreeHasChanged):
        * wml/WMLInputElement.cpp:
        (WebCore::WMLInputElement::WMLInputElement):
        (WebCore::WMLInputElement::defaultEventHandler):
        * wml/WMLInputElement.h:
        (WebCore::WMLInputElement::wasChangedSinceLastFormControlChangeEvent): Added.
        (WebCore::WMLInputElement::setChangedSinceLastFormControlChangeEvent): Added.
2011-03-05  Ilya Sherman  <isherman@chromium.org>

        Reviewed by Darin Adler.

        HTMLInputElement::setValue() should schedule change event when the element is focused
        In service of https://code.google.com/p/chromium/issues/detail?id=42716
        https://bugs.webkit.org/show_bug.cgi?id=53160

        * DOM/WebDOMOperations.mm:
        (-[DOMHTMLInputElement _setValueForUser:]): Expose HTMLInputElement::setValueForUser() to tests
        * DOM/WebDOMOperationsPrivate.h:
        * WebView/WebViewInternal.h:
2011-03-05  Ilya Sherman  <isherman@chromium.org>

        Reviewed by Darin Adler.

        HTMLInputElement::setValue() should schedule change event when the element is focused
        In service of https://code.google.com/p/chromium/issues/detail?id=42716
        https://bugs.webkit.org/show_bug.cgi?id=53160

        * DumpRenderTree/LayoutTestController.cpp:
        (setValueForUserCallback):
        (LayoutTestController::staticFunctions):
        * DumpRenderTree/LayoutTestController.h:
        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
        (LayoutTestController::setValueForUser): Stubbed out; need real implementation.
        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
        (LayoutTestController::setValueForUser): Expose HTMLInputElement::setValueForUser() to tests
        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
        (LayoutTestController::setValueForUser): Stubbed out; need real implementation.
        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
        (LayoutTestController::setValueForUser): Stubbed out; need real implementation.
        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
        (LayoutTestController::setValueForUser): Stubbed out; need real implementation.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80412 268f45cc-cd09-0410-ab3c-d52691b4dbfc
31 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/onchange-change-type-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/onchange-change-type.html [new file with mode: 0644]
LayoutTests/fast/forms/onchange-setvalueforuser-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/onchange-setvalueforuser.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormControlElement.h
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/rendering/RenderTextControl.cpp
Source/WebCore/rendering/RenderTextControl.h
Source/WebCore/rendering/RenderTextControlMultiLine.cpp
Source/WebCore/rendering/RenderTextControlSingleLine.cpp
Source/WebCore/wml/WMLInputElement.cpp
Source/WebCore/wml/WMLInputElement.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/DOM/WebDOMOperations.mm
Source/WebKit/mac/DOM/WebDOMOperationsPrivate.h
Source/WebKit/mac/WebView/WebViewInternal.h
Tools/ChangeLog
Tools/DumpRenderTree/LayoutTestController.cpp
Tools/DumpRenderTree/LayoutTestController.h
Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm
Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp
Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp