- Source/WebKit/mac/ChangeLog +21 lines
Lines 1-3 Source/WebKit/mac/ChangeLog_sec1
1
2013-05-16  Dan Bernstein  <mitz@apple.com>
2
3
        -webView:updateHistoryTitle:forURL: does not pass a frame to the delegate
4
        https://bugs.webkit.org/show_bug.cgi?id=116243
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Added a WebFrame parameter to the delegate method.
9
10
        * WebCoreSupport/WebFrameLoaderClient.mm:
11
        (WebFrameLoaderClient::setTitle): Pass the frame to the delegate. Maintain
12
        compatibility with clients that implement the old delegate method that
13
        doesn’t take a frame.
14
        * WebView/WebDelegateImplementationCaching.h:
15
        (WebHistoryDelegateImplementationCache): Added a field to cache the
16
        implementation of the old delegate method.
17
        * WebView/WebHistoryDelegate.h: Changed the signature of the delegate method.
18
        * WebView/WebView.mm:
19
        (-[WebView _cacheHistoryDelegateImplementations]): Cache the implementation
20
        of the new delegate method, but also check for the old one.
21
1
2013-05-16  Simon Fraser  <simon.fraser@apple.com>
22
2013-05-16  Simon Fraser  <simon.fraser@apple.com>
2
23
3
        Re-land r150168 with some OS version guards.
24
        Re-land r150168 with some OS version guards.
- Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm -4 / +5 lines
Lines 1173-1183 void WebFrameLoaderClient::setTitle(cons Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm_sec1
1173
    
1173
    
1174
    if ([view historyDelegate]) {
1174
    if ([view historyDelegate]) {
1175
        WebHistoryDelegateImplementationCache* implementations = WebViewGetHistoryDelegateImplementations(view);
1175
        WebHistoryDelegateImplementationCache* implementations = WebViewGetHistoryDelegateImplementations(view);
1176
        if (!implementations->setTitleFunc)
1177
            return;
1178
            
1179
        // FIXME: use direction of title.
1176
        // FIXME: use direction of title.
1180
        CallHistoryDelegate(implementations->setTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:), (NSString *)title.string(), (NSString *)url);
1177
        if (implementations->setTitleFunc)
1178
            CallHistoryDelegate(implementations->setTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:inFrame:), (NSString *)title.string(), (NSString *)url, m_webFrame.get());
1179
        else if (implementations->deprecatedSetTitleFunc)
1180
            CallHistoryDelegate(implementations->deprecatedSetTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:), (NSString *)title.string(), (NSString *)url);
1181
1181
        return;
1182
        return;
1182
    }
1183
    }
1183
    
1184
    
- Source/WebKit/mac/WebView/WebDelegateImplementationCaching.h +1 lines
Lines 101-106 struct WebHistoryDelegateImplementationC Source/WebKit/mac/WebView/WebDelegateImplementationCaching.h_sec1
101
    IMP navigatedFunc;
101
    IMP navigatedFunc;
102
    IMP clientRedirectFunc;
102
    IMP clientRedirectFunc;
103
    IMP serverRedirectFunc;
103
    IMP serverRedirectFunc;
104
    IMP deprecatedSetTitleFunc;
104
    IMP setTitleFunc;
105
    IMP setTitleFunc;
105
    IMP populateVisitedLinksFunc;
106
    IMP populateVisitedLinksFunc;
106
};
107
};
- Source/WebKit/mac/WebView/WebHistoryDelegate.h -1 / +1 lines
Lines 37-43 @interface NSObject (WebHistoryDelegate) Source/WebKit/mac/WebView/WebHistoryDelegate.h_sec1
37
37
38
- (void)webView:(WebView *)webView didPerformServerRedirectFromURL:(NSString *)sourceURL toURL:(NSString *)destinationURL inFrame:(WebFrame *)webFrame;
38
- (void)webView:(WebView *)webView didPerformServerRedirectFromURL:(NSString *)sourceURL toURL:(NSString *)destinationURL inFrame:(WebFrame *)webFrame;
39
39
40
- (void)webView:(WebView *)webView updateHistoryTitle:(NSString *)title forURL:(NSString *)url;
40
- (void)webView:(WebView *)webView updateHistoryTitle:(NSString *)title forURL:(NSString *)url inFrame:(WebFrame *)webFrame;
41
41
42
- (void)populateVisitedLinksForWebView:(WebView *)webView;
42
- (void)populateVisitedLinksForWebView:(WebView *)webView;
43
43
- Source/WebKit/mac/WebView/WebView.mm -1 / +2 lines
Lines 1720-1726 - (void)_cacheHistoryDelegateImplementat Source/WebKit/mac/WebView/WebView.mm_sec1
1720
    cache->navigatedFunc = getMethod(delegate, @selector(webView:didNavigateWithNavigationData:inFrame:));
1720
    cache->navigatedFunc = getMethod(delegate, @selector(webView:didNavigateWithNavigationData:inFrame:));
1721
    cache->clientRedirectFunc = getMethod(delegate, @selector(webView:didPerformClientRedirectFromURL:toURL:inFrame:));
1721
    cache->clientRedirectFunc = getMethod(delegate, @selector(webView:didPerformClientRedirectFromURL:toURL:inFrame:));
1722
    cache->serverRedirectFunc = getMethod(delegate, @selector(webView:didPerformServerRedirectFromURL:toURL:inFrame:));
1722
    cache->serverRedirectFunc = getMethod(delegate, @selector(webView:didPerformServerRedirectFromURL:toURL:inFrame:));
1723
    cache->setTitleFunc = getMethod(delegate, @selector(webView:updateHistoryTitle:forURL:));
1723
    cache->deprecatedSetTitleFunc = getMethod(delegate, @selector(webView:updateHistoryTitle:forURL:));
1724
    cache->setTitleFunc = getMethod(delegate, @selector(webView:updateHistoryTitle:forURL:inFrame:));
1724
    cache->populateVisitedLinksFunc = getMethod(delegate, @selector(populateVisitedLinksForWebView:));
1725
    cache->populateVisitedLinksFunc = getMethod(delegate, @selector(populateVisitedLinksForWebView:));
1725
}
1726
}
1726
1727

Return to Bug 116243