some smaller fixes to the editing support in DRT. Makes another few tests pass.
authorlars <lars@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Oct 2007 12:32:31 +0000 (12:32 +0000)
committerlars <lars@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Oct 2007 12:32:31 +0000 (12:32 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@26970 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/EditorClientQt.cpp
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp
WebKitTools/DumpRenderTree/qt/jsobjects.cpp

index ec27032d44f98137f373dbba9063ff7832185860..90e5f3376042eec93df7116c6e3284b7a4094266 100644 (file)
@@ -1,3 +1,13 @@
+2007-10-24  Lars Knoll  <lars@trolltech.com>
+
+        Reviewed by Simon.
+
+        some smaller fixes to the editing support in DRT. Makes another few tests pass.
+
+        * WebCoreSupport/EditorClientQt.cpp:
+        (qt_dump_editing_callbacks):
+        (qt_drt_run):
+
 2007-10-24  Lars Knoll  <lars@trolltech.com>
 
         Reviewed by Simon.
index c24cc9f7cd491a9fafe30a4626ae743b42e95494..2977d16c50612756c2500718ae841e60e87e46eb 100644 (file)
 #define methodDebug() qDebug("EditorClientQt: %s", __FUNCTION__);
 
 static bool dumpEditingCallbacks = false;
+static bool drt_run = false;
 static bool acceptsEditing = true;
 void QWEBKIT_EXPORT qt_dump_editing_callbacks(bool b)
 {
     dumpEditingCallbacks = b;
 }
+void QWEBKIT_EXPORT qt_drt_run(bool b)
+{
+    drt_run = b;
+}
 
 void QWEBKIT_EXPORT qt_dump_set_accepts_editing(bool b)
 {
@@ -103,7 +108,7 @@ bool EditorClientQt::shouldDeleteRange(Range* range)
 
 bool EditorClientQt::shouldShowDeleteInterface(HTMLElement* element)
 {
-    if (dumpEditingCallbacks
+    if (drt_run
         return element->className() == "needsDeletionUI";
     return false;
 }
index 1014a5578e16f086454091bdeb96ca78f5af1b52..3fb9d54712f065c047b3858126b6dba36c4031b9 100644 (file)
@@ -1,3 +1,15 @@
+2007-10-24  Lars Knoll  <lars@trolltech.com>
+
+        Reviewed by Simon.
+
+        some smaller fixes to the editing support in DRT. Makes another few tests pass.
+
+        * DumpRenderTree/qt/DumpRenderTree.cpp:
+        (WebCore::DumpRenderTree::DumpRenderTree):
+        (WebCore::DumpRenderTree::initJSObjects):
+        * DumpRenderTree/qt/jsobjects.cpp:
+        (TextInputController::doCommand):
+
 2007-10-24  Lars Knoll  <lars@trolltech.com>
 
         Reviewed by Simon.
index b665f8da3657d1cd4b7723d1f0c0c0cf1f1f0f00..b7bdb0163a7999ea4c3dd0cecb6c1b8bb50ba13d 100644 (file)
@@ -45,7 +45,7 @@
 
 #include <unistd.h>
 #include <qdebug.h>
-extern void qt_dump_editing_callbacks(bool b);
+extern void qt_drt_run(bool b);
 extern void qt_dump_set_accepts_editing(bool b);
 
 
@@ -138,6 +138,7 @@ DumpRenderTree::DumpRenderTree()
     m_textInputController = new TextInputController(m_page);
 
     QObject::connect(this, SIGNAL(quit()), qApp, SLOT(quit()), Qt::QueuedConnection);
+    qt_drt_run(true);
     QFocusEvent event(QEvent::FocusIn, Qt::ActiveWindowFocusReason);
     QApplication::sendEvent(m_page, &event);
 }
@@ -197,6 +198,7 @@ void DumpRenderTree::initJSObjects()
     Q_ASSERT(frame);
     frame->addToJSWindowObject("layoutTestController", m_controller);
     frame->addToJSWindowObject("eventSender", m_eventSender);
+    frame->addToJSWindowObject("textInputController", m_textInputController);
 }
 
 
index 568816d895ff1444798ce74d12e7762610f24104..46d1424c9e47fa5771583cde4c6e4554f1ae0dbd 100644 (file)
@@ -225,6 +225,7 @@ redo:
 
 
 TextInputController::TextInputController(QWebPage *parent)
+    : QObject(parent)
 {
 }
 
@@ -304,6 +305,11 @@ void TextInputController::doCommand(const QString &command)
         keycode = Qt::Key_PageDown;        
     } else if(command =="pageUp:") {
         keycode = Qt::Key_PageUp;        
+    } else if(command == "deleteWordBackward:") {
+        modifiers |= Qt::ControlModifier;
+        keycode = Qt::Key_Backspace;
+    } else if(command == "deleteBackward:") {
+        keycode = Qt::Key_Backspace;
     }
     QKeyEvent event(QEvent::KeyPress, keycode, modifiers);
     QApplication::sendEvent(parent(), &event);