Fix <rdar://5395835> REGRESSION (r24527): Context menu for edit fields is...
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 19 Aug 2007 22:07:28 +0000 (22:07 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 19 Aug 2007 22:07:28 +0000 (22:07 +0000)
commita99276afa4a1af52f1bf21c44f08b6bd1530e348
tree47ca1bb4d75ff0b74a58b7c14af76dee471877c3
parentfb00891ac590a84164a5380f51a4ee1d7075f52c
    Fix <rdar://5395835> REGRESSION (r24527): Context menu for edit fields is missing "Font & Writing Direction"

        The problem was that ContextMenuItem::setSubMenu was just copying the
        HMENU from the ContextMenu passed in on Windows, but that HMENU was
        later getting destroyed when the ContextMenu went out of scope.

        I added a new ContextMenu::releasePlatformDescription method that is
        used in setSubMenu instead. I think an ultimately better design would
        be for setSubMenu to take ownership of the ContextMenu that's passed in
        (as should insertItem and appendItem), but I decided to be conservative
        and just make the changes needed to fix the bug.

        Reviewed by Darin.

        No test possible.

        * platform/ContextMenu.h: Added releasePlatformDescription.
        * platform/gdk/TemporaryLinkStubs.cpp: Added stub implementation.
        * platform/mac/ContextMenuMac.mm:
        (WebCore::ContextMenu::releasePlatformDescription): Implemented, though
        it's never called on this platform.
        * platform/qt/ContextMenuQt.cpp:
        (WebCore::ContextMenu::releasePlatformDescription): Ditto.
        * platform/win/ContextMenuItemWin.cpp:
        (WebCore::ContextMenuItem::setSubMenu): Call releasePlatformDescription
        since we need to take ownership of the HMENU.
        * platform/win/ContextMenuWin.cpp:
        (WebCore::ContextMenu::releasePlatformDescription): Implemented.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/platform/ContextMenu.h
WebCore/platform/gdk/TemporaryLinkStubs.cpp
WebCore/platform/mac/ContextMenuMac.mm
WebCore/platform/qt/ContextMenuQt.cpp
WebCore/platform/win/ContextMenuItemWin.cpp
WebCore/platform/win/ContextMenuWin.cpp