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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:14:24 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a440d6296f54bbcc464149970ee7193d8c44ffda
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 12 20:48:09 2002 +0000

            Reviewed by Ken.
    
    	- fixed 3126042 -- Failure to send onkeypress event on key down causes forms to submit incorrectly
    
            * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::keyEvent): Fixed the code to send the second event with repeat
    	set equal to true. Before it was constructing the event but never sending it because result was true.
    	Also fixed a problem where it was considering sending a second mouse up event. What we're doing here
    	is a bit of a hack and probably should be fixed -- it seems that the behavior in dispatchKeyEvent where
    	it sends only a down and not a press for the a non-autorepeat event is a KHTML bug that we should fix
    	instead of work around eventually.
    
            - fix to something that made this harder to debug
    
            * khtml/xml/dom2_eventsimpl.cpp: (KeyEventImpl::KeyEventImpl): Logging the type was showing the wrong
    	type, and I narrowed it down to this code here. Changing m_id after the fact doesn't change the type
    	string, so you need to compute the correct ID and pass it to the constructor.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3024 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 4de27c0..11d84b7 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -2,6 +2,25 @@
 
         Reviewed by Ken.
 
+	- fixed 3126042 -- Failure to send onkeypress event on key down causes forms to submit incorrectly
+
+        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::keyEvent): Fixed the code to send the second event with repeat
+	set equal to true. Before it was constructing the event but never sending it because result was true.
+	Also fixed a problem where it was considering sending a second mouse up event. What we're doing here
+	is a bit of a hack and probably should be fixed -- it seems that the behavior in dispatchKeyEvent where
+	it sends only a down and not a press for the a non-autorepeat event is a KHTML bug that we should fix
+	instead of work around eventually.
+        
+        - fix to something that made this harder to debug
+
+        * khtml/xml/dom2_eventsimpl.cpp: (KeyEventImpl::KeyEventImpl): Logging the type was showing the wrong
+	type, and I narrowed it down to this code here. Changing m_id after the fact doesn't change the type
+	string, so you need to compute the correct ID and pass it to the constructor.
+
+2002-12-12  Darin Adler  <darin at apple.com>
+
+        Reviewed by Ken.
+
 	- fixed 3125886 -- Failure to set document onkeypress handler causes return key to submit forms incorrectly
 
 	The handler was getting ignored because the property setting code never got to the DOMNode level.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 4de27c0..11d84b7 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -2,6 +2,25 @@
 
         Reviewed by Ken.
 
+	- fixed 3126042 -- Failure to send onkeypress event on key down causes forms to submit incorrectly
+
+        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::keyEvent): Fixed the code to send the second event with repeat
+	set equal to true. Before it was constructing the event but never sending it because result was true.
+	Also fixed a problem where it was considering sending a second mouse up event. What we're doing here
+	is a bit of a hack and probably should be fixed -- it seems that the behavior in dispatchKeyEvent where
+	it sends only a down and not a press for the a non-autorepeat event is a KHTML bug that we should fix
+	instead of work around eventually.
+        
+        - fix to something that made this harder to debug
+
+        * khtml/xml/dom2_eventsimpl.cpp: (KeyEventImpl::KeyEventImpl): Logging the type was showing the wrong
+	type, and I narrowed it down to this code here. Changing m_id after the fact doesn't change the type
+	string, so you need to compute the correct ID and pass it to the constructor.
+
+2002-12-12  Darin Adler  <darin at apple.com>
+
+        Reviewed by Ken.
+
 	- fixed 3125886 -- Failure to set document onkeypress handler causes return key to submit forms incorrectly
 
 	The handler was getting ignored because the property setting code never got to the DOMNode level.
diff --git a/WebCore/khtml/xml/dom2_eventsimpl.cpp b/WebCore/khtml/xml/dom2_eventsimpl.cpp
index e34bdec..1226a42 100644
--- a/WebCore/khtml/xml/dom2_eventsimpl.cpp
+++ b/WebCore/khtml/xml/dom2_eventsimpl.cpp
@@ -506,7 +506,8 @@ KeyEventImpl::KeyEventImpl()
 }
 
 KeyEventImpl::KeyEventImpl(QKeyEvent *key, AbstractViewImpl *view)
-  : UIEventImpl(KHTML_KEYDOWN_EVENT,true,true,view,0)
+  : UIEventImpl(key->type() == QEvent::KeyRelease ? KHTML_KEYUP_EVENT : key->isAutoRepeat() ? KHTML_KEYPRESS_EVENT : KHTML_KEYDOWN_EVENT,
+                true,true,view,0)
 {
   qKeyEvent = new QKeyEvent(key->type(), key->key(), key->ascii(), key->state(), key->text(), key->isAutoRepeat(), key->count() );
   // Events are supposed to be accepted by default in Qt!
@@ -514,13 +515,6 @@ KeyEventImpl::KeyEventImpl(QKeyEvent *key, AbstractViewImpl *view)
   // (and e.g. space would make it scroll down)
   //qKeyEvent->ignore();
 
-  if (key->type() == QEvent::KeyRelease)
-      m_id = KHTML_KEYUP_EVENT;
-  else if (key->isAutoRepeat())
-      m_id = KHTML_KEYPRESS_EVENT;
-  else if (key->type() == QEvent::KeyPress)
-      m_id = KHTML_KEYDOWN_EVENT;
-
   m_detail = key->count();
 
   m_numPad = false;
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 5fda573..479e38f 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -678,19 +678,18 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
 		     stateForCurrentEvent(),
 		     QString::fromNSString([event characters]),
 		     [event isARepeat]);
-
     bool result = node->dispatchKeyEvent(&qEvent);
 
-    // We want to send both a down and a press for the initial key event
-    if (![event isARepeat]) {
-	QKeyEvent qEvent([event type] == NSKeyDown ? QEvent::KeyPress : QEvent::KeyRelease,
+    // We want to send both a down and a press for the initial key event.
+    // This is a temporary hack; we need to do this a better way.
+    if ([event type] == NSKeyDown && ![event isARepeat]) {
+	QKeyEvent qEvent(QEvent::KeyPress,
 			 [event keyCode],
 			 ascii,
 			 stateForCurrentEvent(),
 			 QString::fromNSString([event characters]),
 			 true);
-	
-	result = result && node->dispatchKeyEvent(&qEvent);
+        node->dispatchKeyEvent(&qEvent);
     }
 
     _currentEvent = oldCurrentEvent;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list