Bug 69859 - [Qt][WK2] ASSERT when displaying context menu in input field
Summary: [Qt][WK2] ASSERT when displaying context menu in input field
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dinu Jacob
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-11 11:44 PDT by Dinu Jacob
Modified: 2011-10-18 08:50 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.38 KB, patch)
2011-10-11 11:58 PDT, Dinu Jacob
hausmann: review-
Details | Formatted Diff | Diff
Patch with ChangeLog update (Can't think of why I didn't do it earlier :) ) (1.68 KB, patch)
2011-10-18 06:23 PDT, Dinu Jacob
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dinu Jacob 2011-10-11 11:44:16 PDT
Right clicking in an input field to display the context menu causes an ASSERT when creating the sub menu and setting the menu as the parent of the sub-menu in WebContextMenuProxyQt::createContextMenu.
Comment 1 Dinu Jacob 2011-10-11 11:47:53 PDT
QWidget is statically cast to QObject before calling setParent on it. QObject::setParent asserts if the object is a QWidget.
Comment 2 Dinu Jacob 2011-10-11 11:58:33 PDT
Created attachment 110554 [details]
Patch
Comment 3 Dinu Jacob 2011-10-11 12:00:05 PDT
Patch attached. Not sure why it was being explcitly cast to QObject. I see that the setParent of QWidget does additional things than QObject. Please review and provide your feedback.
Comment 4 Simon Hausmann 2011-10-14 01:48:33 PDT
Comment on attachment 110554 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=110554&action=review

> Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp:115
> -                static_cast<QObject*>(subMenu.get())->setParent(menu.get());
> +                subMenu->setParent(menu.get());

Could you explain (for example in the changelog or whereever appropriate) why your patch fixes the assert?

Please also mention what assert exactly :)
Comment 5 Simon Hausmann 2011-10-14 01:52:30 PDT
Argh, I should've read the bug report first, I see that the comments explain it :)
Comment 6 Dinu Jacob 2011-10-18 06:23:29 PDT
Created attachment 111429 [details]
Patch with  ChangeLog update (Can't think of why I didn't do it earlier :) )
Comment 7 WebKit Review Bot 2011-10-18 08:50:38 PDT
Comment on attachment 111429 [details]
Patch with  ChangeLog update (Can't think of why I didn't do it earlier :) )

Clearing flags on attachment: 111429

Committed r97760: <http://trac.webkit.org/changeset/97760>
Comment 8 WebKit Review Bot 2011-10-18 08:50:42 PDT
All reviewed patches have been landed.  Closing bug.