Changeset 19494 in webkit


Ignore:
Timestamp:
Feb 7, 2007 9:41:39 PM (17 years ago)
Author:
aroben
Message:

2007-02-07 Charles Ying <charles_ying@yahoo.com>

Reviewed by Adam.

Code suggestion by aroben


Fix http://bugs.webkit.org/show_bug.cgi?id=12688

REGRESSION (r19469): ASSERT when right clicking on hyperlinks! in TOT webkit


  • WebCoreSupport/WebContextMenuClient.mm: (fixMenusReceivedFromOldClients):
  • fixMenusReceivedFromOldClients was hitting an ASSERT incorrectly because it could not match [item title] to any of the contentMenuItemTags using pointer comparison ==. Instead, it needs to do a string comparison between [item title] and the various contentMenuItemTags using isEqualToString instead of ==. You would encounter this whenever the context menu was activated, e.g., from a hyperlink right click (or control click).
Location:
trunk/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/ChangeLog

    r19487 r19494  
     12007-02-07  Charles Ying  <charles_ying@yahoo.com>
     2
     3        Reviewed by Adam.
     4
     5        Code suggestion by aroben
     6       
     7        Fix http://bugs.webkit.org/show_bug.cgi?id=12688
     8
     9        REGRESSION (r19469): ASSERT when right clicking on hyperlinks! in TOT webkit
     10       
     11        * WebCoreSupport/WebContextMenuClient.mm:
     12        (fixMenusReceivedFromOldClients):
     13
     14        - fixMenusReceivedFromOldClients was hitting an ASSERT incorrectly
     15        because it could not match [item title] to any of the contentMenuItemTags
     16        using pointer comparison ==. Instead, it needs to do a string comparison
     17        between [item title] and the various contentMenuItemTags using
     18        isEqualToString instead of ==. You would encounter this whenever the
     19        context menu was activated, e.g., from a hyperlink right click (or
     20        control click).
     21
     22
    1232007-02-07  Anders Carlsson  <acarlsson@apple.com>
    224
  • trunk/WebKit/WebCoreSupport/WebContextMenuClient.mm

    r19469 r19494  
    133133       
    134134        NSString *title = [item title];
    135         if (title == [[WebViewFactory sharedFactory] contextMenuItemTagOpenLink])
     135        if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagOpenLink]])
    136136            [item setTag:WebMenuItemTagOpenLink];
    137         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagIgnoreGrammar])
     137        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagIgnoreGrammar]])
    138138            [item setTag:WebMenuItemTagIgnoreGrammar];
    139         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagSpellingMenu])
     139        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSpellingMenu]])
    140140            [item setTag:WebMenuItemTagSpellingMenu];
    141         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagShowSpellingPanel:true]
    142             || title == [[WebViewFactory sharedFactory] contextMenuItemTagShowSpellingPanel:false])
     141        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSpellingPanel:true]]
     142            || [title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSpellingPanel:false]])
    143143            [item setTag:WebMenuItemTagShowSpellingPanel];
    144         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagCheckSpelling])
     144        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCheckSpelling]])
    145145            [item setTag:WebMenuItemTagCheckSpelling];
    146         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagCheckSpellingWhileTyping])
     146        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCheckSpellingWhileTyping]])
    147147            [item setTag:WebMenuItemTagCheckSpellingWhileTyping];
    148         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagCheckGrammarWithSpelling])
     148        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCheckGrammarWithSpelling]])
    149149            [item setTag:WebMenuItemTagCheckGrammarWithSpelling];
    150         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagFontMenu])
     150        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagFontMenu]])
    151151            [item setTag:WebMenuItemTagFontMenu];
    152         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagShowFonts])
     152        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowFonts]])
    153153            [item setTag:WebMenuItemTagShowFonts];
    154         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagBold])
     154        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagBold]])
    155155            [item setTag:WebMenuItemTagBold];
    156         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagItalic])
     156        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagItalic]])
    157157            [item setTag:WebMenuItemTagItalic];
    158         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagUnderline])
     158        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagUnderline]])
    159159            [item setTag:WebMenuItemTagUnderline];
    160         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagOutline])
     160        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagOutline]])
    161161            [item setTag:WebMenuItemTagOutline];
    162         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagStyles])
     162        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagStyles]])
    163163            [item setTag:WebMenuItemTagStyles];
    164         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagShowColors])
     164        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowColors]])
    165165            [item setTag:WebMenuItemTagShowColors];
    166         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagSpeechMenu])
     166        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSpeechMenu]])
    167167            [item setTag:WebMenuItemTagSpeechMenu];
    168         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagStartSpeaking])
     168        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagStartSpeaking]])
    169169            [item setTag:WebMenuItemTagStartSpeaking];
    170         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagStopSpeaking])
     170        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagStopSpeaking]])
    171171            [item setTag:WebMenuItemTagStopSpeaking];
    172         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagWritingDirectionMenu])
     172        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagWritingDirectionMenu]])
    173173            [item setTag:WebMenuItemTagWritingDirectionMenu];
    174         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagDefaultDirection])
     174        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagDefaultDirection]])
    175175            [item setTag:WebMenuItemTagDefaultDirection];
    176         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagLeftToRight])
     176        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagLeftToRight]])
    177177            [item setTag:WebMenuItemTagLeftToRight];
    178         else if (title == [[WebViewFactory sharedFactory] contextMenuItemTagRightToLeft])
     178        else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagRightToLeft]])
    179179            [item setTag:WebMenuItemTagRightToLeft];
    180180        else {
Note: See TracChangeset for help on using the changeset viewer.