RESOLVED FIXED40017
[Qt] DRT EventSender support to graphics mouse events activation
https://bugs.webkit.org/show_bug.cgi?id=40017
Summary [Qt] DRT EventSender support to graphics mouse events activation
Diego Gonzalez
Reported 2010-06-01 12:00:10 PDT
Make Qt DRT send the correct QGraphicsSceneEvent's when it is in QGraphicsWebView mode.
Attachments
Patch (10.69 KB, patch)
2010-06-08 10:18 PDT, Diego Gonzalez
no flags
Patch (9.62 KB, patch)
2010-06-08 15:03 PDT, Diego Gonzalez
no flags
Patch (9.18 KB, patch)
2010-06-09 06:59 PDT, Diego Gonzalez
no flags
Patch (9.20 KB, patch)
2010-06-09 11:07 PDT, Diego Gonzalez
no flags
Patch (9.10 KB, patch)
2010-06-09 11:54 PDT, Diego Gonzalez
no flags
Patch (9.05 KB, patch)
2010-06-09 13:29 PDT, Diego Gonzalez
no flags
Patch (9.03 KB, patch)
2010-06-09 13:51 PDT, Diego Gonzalez
no flags
Diego Gonzalez
Comment 1 2010-06-08 10:18:39 PDT
Antonio Gomes
Comment 2 2010-06-08 10:42:44 PDT
lgtm. I'd rename hasGraphicsEvents , since it does not sound good to me. Maybe isGraphicsBasedView() ? or something ... or even better, just remove it, since you do not need this method. Inside EventSender class you can know if it is GraphicsBased or not, by checking page->view() - as you did in EventSender::sendEvent
Diego Gonzalez
Comment 3 2010-06-08 12:29:00 PDT
(In reply to comment #2) > lgtm. > > I'd rename hasGraphicsEvents , since it does not sound good to me. Maybe isGraphicsBasedView() ? or something ... > > or even better, just remove it, since you do not need this method. Inside EventSender class you can know if it is GraphicsBased or not, by checking page->view() - as you did in EventSender::sendEvent Make sense Antonio.
Diego Gonzalez
Comment 4 2010-06-08 15:03:01 PDT
Antonio Gomes
Comment 5 2010-06-08 16:08:35 PDT
comments: (In reply to comment #4) > Created an attachment (id=58189) [details] > Patch + event->setModifiers(Qt::NoModifier); + sendOrQueueEvent(event); + } else { + QMouseEvent* event = new QMouseEvent(QEvent::MouseButtonRelease, m_mousePos, m_mousePos, mouseButton, m_mouseButtons, Qt::NoModifier); + sendOrQueueEvent(event); I'd put "endOrQueueEvent(event);" out of the if-else block, since it will be executed in both cases. It happens twice in the code. if (WebCore::WebViewGraphicsBased* view ... do you need the WebCore namespace?
Diego Gonzalez
Comment 6 2010-06-09 05:17:19 PDT
(In reply to comment #5) > comments: > > (In reply to comment #4) > > Created an attachment (id=58189) [details] [details] > > Patch > > + event->setModifiers(Qt::NoModifier); > + sendOrQueueEvent(event); > + } else { > + QMouseEvent* event = new QMouseEvent(QEvent::MouseButtonRelease, m_mousePos, m_mousePos, mouseButton, m_mouseButtons, Qt::NoModifier); > + sendOrQueueEvent(event); > > I'd put "endOrQueueEvent(event);" out of the if-else block, since it will be executed in both cases. It happens twice in the code. > The events types are different in this case, so more casts will be necessary. > if (WebCore::WebViewGraphicsBased* view ... > > do you need the WebCore namespace? Unfortunately the namespace is necessary :(. A little refactory i, DumpRenderTreeQt will be necessary to remove it,
Diego Gonzalez
Comment 7 2010-06-09 05:49:54 PDT
The results with this patch running in graphics view mode: 13767 test cases (99%) succeeded 19 test cases (<1%) had incorrect layout 49 test cases (<1%) were new 1 test case (<1%) crashed 5 test cases (<1%) had stderr output Before this patch: 13502 test cases (97%) succeeded 270 test cases (1%) had incorrect layout 38 test cases (<1%) were new 2 test cases (<1%) crashed 162 test cases (1%) had stderr output Results with normal mode (QWebView): 13778 test cases (99%) succeeded 9 test cases (<1%) had incorrect layout 49 test cases (<1%) were new 5 test cases (<1%) had stderr output
Kenneth Rohde Christiansen
Comment 8 2010-06-09 06:06:07 PDT
Comment on attachment 58189 [details] Patch > + if (qobject_cast<WebCore::WebViewGraphicsBased*>(m_page->view())) > + m_graphicsBasedView = true; > + else > + m_graphicsBasedView = false; Make a method for that bool isGraphicsBased() { return qobject_cast<WebCore::WebViewGraphicsBased*>(m_page->view()); }
Diego Gonzalez
Comment 9 2010-06-09 06:59:44 PDT
Created attachment 58240 [details] Patch Make Kenneth's suggestion
Kenneth Rohde Christiansen
Comment 10 2010-06-09 07:04:26 PDT
Comment on attachment 58240 [details] Patch Wouldn't it be possible to make methods like QGraphicsSceneMouseEvent* createGraphicsSceneMouseEvent(... ) etc.
Diego Gonzalez
Comment 11 2010-06-09 08:53:59 PDT
(In reply to comment #10) > (From update of attachment 58240 [details]) > Wouldn't it be possible to make methods like QGraphicsSceneMouseEvent* createGraphicsSceneMouseEvent(... ) etc. You mean a method similar to QMouseEvent constructor? Like this: QGraphicsSceneMouseEvent* createGraphicsSceneMouseEvent(QEvent::Type type, const QPoint& pos, const QPoint& screenPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
Diego Gonzalez
Comment 12 2010-06-09 11:07:29 PDT
Kenneth Rohde Christiansen
Comment 13 2010-06-09 11:17:56 PDT
Comment on attachment 58263 [details] Patch > +void EventSender::sendEvent(QObject* receiver, QEvent* event, bool graphics) Couldn't it verify this "graphics" inside the method? This is never going to change through runs anyway. > +{ > + if (!graphics) > + QApplication::sendEvent(receiver, event); > + else { > + if (WebCore::WebViewGraphicsBased* view = qobject_cast<WebCore::WebViewGraphicsBased*>(receiver)) > + view->scene()->sendEvent(view->graphicsView(), event); > + } > +}
Diego Gonzalez
Comment 14 2010-06-09 11:54:41 PDT
Diego Gonzalez
Comment 15 2010-06-09 13:29:30 PDT
Diego Gonzalez
Comment 16 2010-06-09 13:51:21 PDT
WebKit Commit Bot
Comment 17 2010-06-10 08:45:58 PDT
Comment on attachment 58292 [details] Patch Clearing flags on attachment: 58292 Committed r60959: <http://trac.webkit.org/changeset/60959>
WebKit Commit Bot
Comment 18 2010-06-10 08:46:06 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.