[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:09:04 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 04575d37e2ae3a2d69901674fa3d012560b622bb
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 4 00:42:44 2003 +0000

            Reviewed by Maciej
    
    	Fix for this bug:
    
    	<rdar://problem/3470338>: onclick is not executing when you hit enter on focused links
    
    	Now when we trap return or enter when a link is focused, we send
    	a click event to the node.
    
            * khtml/html/html_inlineimpl.cpp:
            (HTMLAnchorElementImpl::defaultEventHandler): Swallow key event when
    	return or enter and send a mouse event.
            (HTMLAnchorElementImpl::performClick): New function to send simulated
    	click.
            * khtml/html/html_inlineimpl.h: Declare performClick function.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5375 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 03e2469..8e9ce45 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,21 @@
+2003-11-03  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Maciej
+
+	Fix for this bug:
+
+	<rdar://problem/3470338>: onclick is not executing when you hit enter on focused links
+
+	Now when we trap return or enter when a link is focused, we send
+	a click event to the node.
+
+        * khtml/html/html_inlineimpl.cpp:
+        (HTMLAnchorElementImpl::defaultEventHandler): Swallow key event when 
+	return or enter and send a mouse event.
+        (HTMLAnchorElementImpl::performClick): New function to send simulated
+	click.
+        * khtml/html/html_inlineimpl.h: Declare performClick function.
+
 2003-11-03  Darin Adler  <darin at apple.com>
 
         Reviewed by John.
diff --git a/WebCore/khtml/html/html_inlineimpl.cpp b/WebCore/khtml/html/html_inlineimpl.cpp
index 8b01b33..2634edc 100644
--- a/WebCore/khtml/html/html_inlineimpl.cpp
+++ b/WebCore/khtml/html/html_inlineimpl.cpp
@@ -93,7 +93,12 @@ void HTMLAnchorElementImpl::defaultEventHandler(EventImpl *evt)
                 HTMLElementImpl::defaultEventHandler(evt);
                 return;
             }
-            if (k->qKeyEvent()) k->qKeyEvent()->accept();
+            if (k->qKeyEvent()) {
+                k->qKeyEvent()->accept();
+                evt->setDefaultHandled();
+                performClick();
+                return;
+            }
         }
 
         url = khtml::parseURL(getAttribute(ATTR_HREF)).string();
@@ -184,6 +189,19 @@ void HTMLAnchorElementImpl::parseAttribute(AttributeImpl *attr)
     }
 }
 
+void HTMLAnchorElementImpl::performClick()
+{
+    int x = 0;
+    int y = 0;
+    if (renderer()) {
+        renderer()->absolutePosition(x,y);
+        x += renderer()->width() / 2;
+        y += renderer()->height() / 2;
+    }
+    QMouseEvent event(QEvent::MouseButtonRelease, QPoint(x,y), Qt::LeftButton, 0);
+    dispatchMouseEvent(&event, EventImpl::KHTML_CLICK_EVENT);
+}
+
 // -------------------------------------------------------------------------
 
 HTMLBRElementImpl::HTMLBRElementImpl(DocumentPtr *doc) : HTMLElementImpl(doc)
diff --git a/WebCore/khtml/html/html_inlineimpl.h b/WebCore/khtml/html/html_inlineimpl.h
index 5acbda3..cece915 100644
--- a/WebCore/khtml/html/html_inlineimpl.h
+++ b/WebCore/khtml/html/html_inlineimpl.h
@@ -43,6 +43,7 @@ public:
     virtual Id id() const;
     virtual void parseAttribute(AttributeImpl *attr);
     virtual void defaultEventHandler(EventImpl *evt);
+    void performClick();
 protected:
     bool m_hasTarget : 1;
 };

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list