Reviewed by Geoff.
authorbdakin <bdakin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Dec 2006 06:33:03 +0000 (06:33 +0000)
committerbdakin <bdakin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Dec 2006 06:33:03 +0000 (06:33 +0000)
commit8e233d6c93e15b91a60feee01ca6f9db029c0274
tree92b89f3e84b58df746b60bcfc52481e20c067463
parentf4fd8b40becb3dcf5b6e0ad1bd071a6411c235fd
    Reviewed by Geoff.

        With the new changes to ContextMenuItems, WebCore context menus
        stopped appearing at all. And then when I got them to appear, they
        crashed. This fixes both of these problems.

        * platform/mac/ContextMenuItemMac.mm:
        (WebCore::ContextMenuItem::ContextMenuItem): keyEquivalent cannot
        be nil. This was causing Obj-C to throw an exception preventing the
        menus from popping up at all.
        * platform/mac/ContextMenuMac.mm:
        (+[WebCoreMenuTarget sharedMenuTarget]): Re-name our static
        MenuTarget so that it is more clear that it is a static and shared
        WebCoreMenuTarget.
        (WebCore::ContextMenu::ContextMenu): Initialize the
        WebCoreMenuTarget's controller in the ContextMenu constructor
        instead of in getNSMenuItem since the controller will only possibly
        change when a new ContextMenu has been created.
        (WebCore::ContextMenu::~ContextMenu): Set the target's controller
        to 0.
        (WebCore::getNSMenuItem): A lot of this work is being done other
        places now. Call new class method on WebCoreMenuTarget to get the
        shared target.
        (WebCore::ContextMenu::appendItem): We should not be releasing the
        menuItem here! This caused the crashes I saw.
        (WebCore::ContextMenu::insertItem): Same.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@18015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/platform/mac/ContextMenuItemMac.mm
WebCore/platform/mac/ContextMenuMac.mm