Modified: trunk/LayoutTests/ChangeLog (87209 => 87210)
--- trunk/LayoutTests/ChangeLog 2011-05-24 21:56:45 UTC (rev 87209)
+++ trunk/LayoutTests/ChangeLog 2011-05-24 21:59:54 UTC (rev 87210)
@@ -1,3 +1,12 @@
+2011-05-24 Robert Hogan <[email protected]>
+
+ Reviewed by Ryosuke Niwa.
+
+ [Qt] Fix fast/events/selectstart-by-single-click-with-shift.html
+ https://bugs.webkit.org/show_bug.cgi?id=61393
+
+ * platform/qt/Skipped: Unskip fast/events/selectstart-by-single-click-with-shift.html
+
2011-05-24 Ryosuke Niwa <[email protected]>
Skip fast/events/selectstart-by-double-triple-clicks.html and selectstart-by-drag.html
Modified: trunk/LayoutTests/platform/qt/Skipped (87209 => 87210)
--- trunk/LayoutTests/platform/qt/Skipped 2011-05-24 21:56:45 UTC (rev 87209)
+++ trunk/LayoutTests/platform/qt/Skipped 2011-05-24 21:59:54 UTC (rev 87210)
@@ -2521,4 +2521,3 @@
# https://bugs.webkit.org/show_bug.cgi?id=61322
fast/events/selectstart-by-double-triple-clicks.html
fast/events/selectstart-by-drag.html
-fast/events/selectstart-by-single-click-with-shift.html
Modified: trunk/Tools/ChangeLog (87209 => 87210)
--- trunk/Tools/ChangeLog 2011-05-24 21:56:45 UTC (rev 87209)
+++ trunk/Tools/ChangeLog 2011-05-24 21:59:54 UTC (rev 87210)
@@ -1,3 +1,17 @@
+2011-05-24 Robert Hogan <[email protected]>
+
+ Reviewed by Ryosuke Niwa.
+
+ [Qt] Fix fast/events/selectstart-by-single-click-with-shift.html
+ https://bugs.webkit.org/show_bug.cgi?id=61393
+
+ * DumpRenderTree/qt/EventSenderQt.h:
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (getModifiers): static function for interpreting modifiers
+ (EventSender::mouseDown): Respect keyboard modifiers
+ (EventSender::keyDown): use new static function
+ (EventSender::sendOrQueueEvent): whitespace fix
+
2011-05-24 Jay Civelli <[email protected]>
Reviewed by Adam Barth.
Modified: trunk/Tools/DumpRenderTree/qt/EventSenderQt.cpp (87209 => 87210)
--- trunk/Tools/DumpRenderTree/qt/EventSenderQt.cpp 2011-05-24 21:56:45 UTC (rev 87209)
+++ trunk/Tools/DumpRenderTree/qt/EventSenderQt.cpp 2011-05-24 21:59:54 UTC (rev 87210)
@@ -74,8 +74,26 @@
QApplication::setWheelScrollLines(2);
}
-void EventSender::mouseDown(int button)
+static Qt::KeyboardModifiers getModifiers(const QStringList& modifiers)
{
+ Qt::KeyboardModifiers modifs = 0;
+ for (int i = 0; i < modifiers.size(); ++i) {
+ const QString& m = modifiers.at(i);
+ if (m == "ctrlKey")
+ modifs |= Qt::ControlModifier;
+ else if (m == "shiftKey")
+ modifs |= Qt::ShiftModifier;
+ else if (m == "altKey")
+ modifs |= Qt::AltModifier;
+ else if (m == "metaKey")
+ modifs |= Qt::MetaModifier;
+ }
+ return modifs;
+}
+
+void EventSender::mouseDown(int button, const QStringList& modifiers)
+{
+ Qt::KeyboardModifiers modifs = getModifiers(modifiers);
Qt::MouseButton mouseButton;
switch (button) {
case 0:
@@ -114,11 +132,11 @@
if (isGraphicsBased()) {
event = createGraphicsSceneMouseEvent((m_clickCount == 2) ?
QEvent::GraphicsSceneMouseDoubleClick : QEvent::GraphicsSceneMousePress,
- m_mousePos, m_mousePos, mouseButton, m_mouseButtons, Qt::NoModifier);
+ m_mousePos, m_mousePos, mouseButton, m_mouseButtons, modifs);
} else {
event = new QMouseEvent((m_clickCount == 2) ? QEvent::MouseButtonDblClick :
QEvent::MouseButtonPress, m_mousePos, m_mousePos,
- mouseButton, m_mouseButtons, Qt::NoModifier);
+ mouseButton, m_mouseButtons, modifs);
}
sendOrQueueEvent(event);
@@ -222,18 +240,7 @@
void EventSender::keyDown(const QString& string, const QStringList& modifiers, unsigned int location)
{
QString s = string;
- Qt::KeyboardModifiers modifs = 0;
- for (int i = 0; i < modifiers.size(); ++i) {
- const QString& m = modifiers.at(i);
- if (m == "ctrlKey")
- modifs |= Qt::ControlModifier;
- else if (m == "shiftKey")
- modifs |= Qt::ShiftModifier;
- else if (m == "altKey")
- modifs |= Qt::AltModifier;
- else if (m == "metaKey")
- modifs |= Qt::MetaModifier;
- }
+ Qt::KeyboardModifiers modifs = getModifiers(modifiers);
if (location == 3)
modifs |= Qt::KeypadModifier;
int code = 0;
@@ -536,10 +543,10 @@
void EventSender::sendOrQueueEvent(QEvent* event)
{
- // Mouse move events are queued if
+ // Mouse move events are queued if
// 1. A previous event was queued.
// 2. A delay was set-up by leapForward().
- // 3. A call to mouseMoveTo while the mouse button is pressed could initiate a drag operation, and that does not return until mouseUp is processed.
+ // 3. A call to mouseMoveTo while the mouse button is pressed could initiate a drag operation, and that does not return until mouseUp is processed.
// To be safe and avoid a deadlock, this event is queued.
if (endOfQueue == startOfQueue && !eventQueue[endOfQueue].m_delay && (!(m_mouseButtonPressed && (m_eventLoop && event->type() == QEvent::MouseButtonRelease)))) {
sendEvent(m_page->view(), event);
Modified: trunk/Tools/DumpRenderTree/qt/EventSenderQt.h (87209 => 87210)
--- trunk/Tools/DumpRenderTree/qt/EventSenderQt.h 2011-05-24 21:56:45 UTC (rev 87209)
+++ trunk/Tools/DumpRenderTree/qt/EventSenderQt.h 2011-05-24 21:59:54 UTC (rev 87210)
@@ -55,7 +55,7 @@
void resetClickCount() { m_clickCount = 0; }
public slots:
- void mouseDown(int button = 0);
+ void mouseDown(int button = 0, const QStringList& modifiers = QStringList());
void mouseUp(int button = 0);
void mouseMoveTo(int x, int y);
#ifndef QT_NO_WHEELEVENT