-
justing authored
Reviewed by oliver <rdar://problem/5213963> REGRESSION(r21467): Active selection remains in text field after clicking on a button Demonstrates bug: * editing/selection/5213963-expected.checksum: Added. * editing/selection/5213963-expected.png: Added. * editing/selection/5213963-expected.txt: Added. * editing/selection/5213963.html: Added. We now clear the selection on mouse down (but not before the mousedown event is fired): * fast/forms/focus-selection-input-expected.txt: * fast/forms/focus-selection-textarea-expected.txt: WebCore: Reviewed by oliver <rdar://problem/5213963> REGRESSION(r21467): Active selection remains in text field after clicking on a button * page/EventHandler.cpp: (WebCore::EventHandler::dispatchMouseEvent): Call FocusController::setFocusedNode, because Document::setFocusedNode no longer clears the selection. Begin passing the new focused frame to FocusController::setFocusedNode, because when the new focus node is null, the selection should only be cleared if the focused frame isn't changing. (WebCore::Element::focus): Begin passing the new focused frame. (WebCore::Element::blur): Ditto. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::focus): Ditto. * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::focus): Ditto. * page/Frame.cpp: (WebCore::Frame::setFocusedNodeIfNeeded): Ditto. * page/FocusController.cpp: (WebCore::clearSelectionIfNeeded): Take in the new focused frame. If it's not changing, don't clear the selection. (WebCore::FocusController::setFocusedNode): Take in the new focused frame. * page/FocusController.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
00b7e557