Reviewed by Adam.
authorbdakin <bdakin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Dec 2006 21:54:47 +0000 (21:54 +0000)
committerbdakin <bdakin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Dec 2006 21:54:47 +0000 (21:54 +0000)
commit7ed4ab8a459ba848fae25625f5b282622d1a6e29
treedba3b77618780db99bd39b0c3deba2c237a218fc
parent6e49ed8070a19965c9500e61eb94cc075fff683b
    Reviewed by Adam.

        There are two bugs with WebCore ContextMenus due to the static
        ContextMenuItems. One bug is that we often crashed in
        NSAutoreleasePool upon quitting the browser. The other bug is that
        we were adding static NSMenuItems to multiple NSMenus, which is
        disallowed. To fix these bugs, the MenuItems are no longer static.
        This is in line with the current design in WebKit anyway. I made
        some re-arrangements in the code because I also removed the macro
        that was used to create the menu items since it was a bit
        confusing.

        * platform/ContextMenu.cpp:
        (WebCore::createFontSubMenu):
        (WebCore::createSpellingAndGrammarSubMenu):
        (WebCore::createSpellingSubMenu):
        (WebCore::createSpeechSubMenu):
        (WebCore::createWritingDirectionSubMenu):
        (WebCore::ContextMenu::populate):
        * platform/ContextMenuItem.h:
        * platform/mac/ContextMenuItemMac.mm:
        (WebCore::ContextMenuItem::ContextMenuItem): Use the NSMenuItem
        global separator item if we have SeparatorType.
        * platform/mac/ContextMenuMac.mm:
        (WebCore::setMenuItemTarget):  Change name of getNSMenuItem since
        that is no longer accurate.
        (WebCore::ContextMenu::appendItem): Above name change.
        (WebCore::ContextMenu::insertItem): Same.

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