-
bdakin authored
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: http://svn.webkit.org/repository/webkit/trunk@18045 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1f36a953