Changeset 122520 in webkit
- Timestamp:
- Jul 12, 2012 3:58:08 PM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r122512 r122520 1 2012-07-12 Timothy Hatcher <timothy@apple.com> 2 3 Make the "Inspect Element" context menu item appear in nightly builds again. 4 5 https://webkit.org/b/89323 6 7 Reviewed by Anders Carlsson. 8 9 * Shared/API/c/WKContextMenuItem.cpp: 10 (compatibleContextMenuItemTag): Added. Checks for the specific version of Safari 6 that needs the 11 tag fixed up to match values it expects. 12 (WKContextMenuItemGetTag): On Mac platforms call compatibleContextMenuItemTag to fix up the tag 13 before returning it. 14 * Shared/API/c/WKContextMenuItemTypes.h: Fix the order of the WKContextMenuItemTag enum 15 to be binary compatible with older versions of WebKit2. 16 1 17 2012-07-12 Thiago Marcos P. Santos <thiago.santos@intel.com> 2 18 -
trunk/Source/WebKit2/Shared/API/c/WKContextMenuItem.cpp
r114367 r122520 32 32 #include "WKAPICast.h" 33 33 #include "WKContextMenuItemTypes.h" 34 35 #if PLATFORM(MAC) 36 #import <mach-o/dyld.h> 37 #endif 34 38 35 39 using namespace WebCore; … … 81 85 } 82 86 87 #if PLATFORM(MAC) 88 static WKContextMenuItemTag compatibleContextMenuItemTag(WKContextMenuItemTag tag) 89 { 90 static bool needsWorkaround = ^bool { 91 const int32_t safariFrameworkVersionWithIncompatibleContextMenuItemTags = 0x02181900; // 536.25.0 (Safari 6.0) 92 return NSVersionOfRunTimeLibrary("Safari") == safariFrameworkVersionWithIncompatibleContextMenuItemTags; 93 }(); 94 95 if (!needsWorkaround) 96 return tag; 97 98 // kWKContextMenuItemTagDictationAlternative was inserted before kWKContextMenuItemTagInspectElement. 99 // DictationAlternative is now at the end like it should have been. To be compatible we need to return 100 // InspectElement for DictationAlternative and shift InspectElement and after by one. 101 if (tag == kWKContextMenuItemTagDictationAlternative) 102 return kWKContextMenuItemTagInspectElement; 103 if (tag >= kWKContextMenuItemTagInspectElement && tag < kWKContextMenuItemBaseApplicationTag) 104 return tag + 1; 105 return tag; 106 } 107 #endif 108 83 109 WKContextMenuItemTag WKContextMenuItemGetTag(WKContextMenuItemRef itemRef) 84 110 { 85 111 #if ENABLE(CONTEXT_MENUS) 112 #if PLATFORM(MAC) 113 return compatibleContextMenuItemTag(toAPI(toImpl(itemRef)->data()->action())); 114 #else 86 115 return toAPI(toImpl(itemRef)->data()->action()); 116 #endif 87 117 #else 88 118 return toAPI(ContextMenuItemTagNoAction); -
trunk/Source/WebKit2/Shared/API/c/WKContextMenuItemTypes.h
r120357 r122520 89 89 kWKContextMenuItemTagPDFSinglePageScrolling, 90 90 kWKContextMenuItemTagPDFFacingPagesScrolling, 91 kWKContextMenuItemTagDictationAlternative,92 91 kWKContextMenuItemTagInspectElement, 93 92 kWKContextMenuItemTagTextDirectionMenu, … … 115 114 kWKContextMenuItemTagMediaPlayPause, 116 115 kWKContextMenuItemTagMediaMute, 116 kWKContextMenuItemTagDictationAlternative, 117 117 kWKContextMenuItemBaseApplicationTag = 10000 118 118 };
Note: See TracChangeset
for help on using the changeset viewer.