Title: [97760] trunk/Source/WebKit2
Revision
97760
Author
[email protected]
Date
2011-10-18 08:51:32 -0700 (Tue, 18 Oct 2011)

Log Message

[Qt][WK2] ASSERT when displaying context menu in input field
https://bugs.webkit.org/show_bug.cgi?id=69859

Patch by Dinu Jacob <[email protected]> on 2011-10-18
Reviewed by Simon Hausmann.

When creating a submenu in the context menu, the submenu of type
QWidget is statically cast to QObject before calling setParent on
it. QObject::setParent asserts if the object is a QWidget. So, call
setParent of QWidget itself.

* UIProcess/qt/WebContextMenuProxyQt.cpp:
(WebKit::WebContextMenuProxyQt::createContextMenu):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (97759 => 97760)


--- trunk/Source/WebKit2/ChangeLog	2011-10-18 15:50:25 UTC (rev 97759)
+++ trunk/Source/WebKit2/ChangeLog	2011-10-18 15:51:32 UTC (rev 97760)
@@ -1,3 +1,18 @@
+2011-10-18  Dinu Jacob  <[email protected]>
+
+        [Qt][WK2] ASSERT when displaying context menu in input field
+        https://bugs.webkit.org/show_bug.cgi?id=69859
+
+        Reviewed by Simon Hausmann.
+
+        When creating a submenu in the context menu, the submenu of type
+        QWidget is statically cast to QObject before calling setParent on
+        it. QObject::setParent asserts if the object is a QWidget. So, call
+        setParent of QWidget itself.
+
+        * UIProcess/qt/WebContextMenuProxyQt.cpp:
+        (WebKit::WebContextMenuProxyQt::createContextMenu):
+
 2011-10-18  Caio Marcelo de Oliveira Filho  <[email protected]>
 
         [Qt] Fix linkHoveredDoesntEmitRepeated test in the bot

Modified: trunk/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp (97759 => 97760)


--- trunk/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp	2011-10-18 15:50:25 UTC (rev 97759)
+++ trunk/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp	2011-10-18 15:51:32 UTC (rev 97760)
@@ -112,7 +112,7 @@
             break;
         case WebCore::SubmenuType:
             if (OwnPtr<QMenu> subMenu = createContextMenu(item.submenu())) {
-                static_cast<QObject*>(subMenu.get())->setParent(menu.get());
+                subMenu->setParent(menu.get());
                 subMenu->setTitle(item.title());
                 QMenu* const subMenuPtr = subMenu.leakPtr();
                 menu->addMenu(subMenuPtr);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to