- fixed <rdar://problem/3484465>: REGRESSION (118): button click does
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Jan 2004 23:39:26 +0000 (23:39 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Jan 2004 23:39:26 +0000 (23:39 +0000)
        not take focus away from <textarea>; breaks Outlook Web Access

        Reviewed by Dave.

        * khtml/khtmlview.cpp:
        (KHTMLView::dispatchMouseEvent):
        Removed nodeimpl == nil test that was preventing button/link clicks
        from blurring previously-focused text field.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@5862 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/khtml/khtmlview.cpp

index ad2a619edc5b61c1dc8507a9672b433bb8e896e8..20892991cb118c68f144c6d0e038cf2fed2bb653 100644 (file)
@@ -1,3 +1,15 @@
+2004-01-06  John Sullivan  <sullivan@apple.com>
+
+        - fixed <rdar://problem/3484465>: REGRESSION (118): button click does 
+        not take focus away from <textarea>; breaks Outlook Web Access
+
+        Reviewed by Dave.
+
+        * khtml/khtmlview.cpp:
+        (KHTMLView::dispatchMouseEvent):
+        Removed nodeimpl == nil test that was preventing button/link clicks
+        from blurring previously-focused text field.
+
 2004-01-06  David Hyatt  <hyatt@apple.com>
 
        Fix for 3520636, infinite loop in page breaking code when printing.
index 1a798ae96a557e941df7ae922cf53cc34011afa5..548b71ad163e63145160b90d14d5d720cf557200 100644 (file)
@@ -1675,11 +1675,14 @@ bool KHTMLView::dispatchMouseEvent(int eventId, DOM::NodeImpl *targetNode, bool
         }
         else if (eventId == EventImpl::MOUSEDOWN_EVENT) {
             // Focus should be shifted on mouse down, not on a click.  -dwh
+            // Blur current focus node when a link/button is clicked; this
+            // is expected by some sites that rely on onChange handlers running
+            // from form fields before the button click is processed.
            DOM::NodeImpl* nodeImpl = targetNode;
            for ( ; nodeImpl && !nodeImpl->isFocusable(); nodeImpl = nodeImpl->parentNode());
             if (nodeImpl && nodeImpl->isMouseFocusable())
                 m_part->xmlDocImpl()->setFocusNode(nodeImpl);
-            else if (!nodeImpl)
+            else
                 m_part->xmlDocImpl()->setFocusNode(0);
         }
     }