Changeset 167745 in webkit


Ignore:
Timestamp:
Apr 23, 2014 9:42:32 PM (10 years ago)
Author:
akling@apple.com
Message:

Remove Apple Dictionary workaround in WebFrameLoaderClient.
<https://webkit.org/b/132095>

Kill a hack to work around a WK1 client bug that got fixed years ago.
See <rdar://problem/6471058> for backstory.

Reviewed by Darin Adler.

  • WebCoreSupport/WebFrameLoaderClient.mm:

(WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache):
(WebFrameLoaderClient::dispatchWillSendRequest):
(applyAppleDictionaryApplicationQuirkNonInlinePart): Deleted.
(applyAppleDictionaryApplicationQuirk): Deleted.

Location:
trunk/Source/WebKit/mac
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/mac/ChangeLog

    r167730 r167745  
     12014-04-23  Andreas Kling  <akling@apple.com>
     2
     3        Remove Apple Dictionary workaround in WebFrameLoaderClient.
     4        <https://webkit.org/b/132095>
     5
     6        Kill a hack to work around a WK1 client bug that got fixed years ago.
     7        See <rdar://problem/6471058> for backstory.
     8
     9        Reviewed by Darin Adler.
     10
     11        * WebCoreSupport/WebFrameLoaderClient.mm:
     12        (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache):
     13        (WebFrameLoaderClient::dispatchWillSendRequest):
     14        (applyAppleDictionaryApplicationQuirkNonInlinePart): Deleted.
     15        (applyAppleDictionaryApplicationQuirk): Deleted.
     16
    1172014-04-23  Anders Carlsson  <andersca@apple.com>
    218
  • trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

    r167207 r167745  
    9999#import <WebCore/HTMLFrameElement.h>
    100100#import <WebCore/HTMLFrameOwnerElement.h>
    101 #import <WebCore/HTMLHeadElement.h>
    102101#import <WebCore/HTMLNames.h>
    103102#import <WebCore/HTMLParserIdioms.h>
     
    189188}
    190189
    191 #if !PLATFORM(IOS)
    192 // Quirk for the Apple Dictionary application.
    193 //
    194 // If a top level frame has a <script> element in its <head> for a script named MainPageJavaScript.js,
    195 // then for that frame's document, ignore changes to the scrolling attribute of frames. That script
    196 // has a bug in it where it sets the scrolling attribute on frames, and that erroneous scrolling
    197 // attribute needs to be ignored to avoid showing extra scroll bars in the window.
    198 // This quirk can be removed when Apple Dictionary is fixed (see <rdar://problem/6471058>).
    199 
    200 static void applyAppleDictionaryApplicationQuirkNonInlinePart(WebFrameLoaderClient* client, const ResourceRequest& request)
    201 {
    202     if (!request.url().isLocalFile())
    203         return;
    204     if (!request.url().string().endsWith("MainPageJavaScript.js"))
    205         return;
    206     Frame* frame = core(client->webFrame());
    207     if (!frame)
    208         return;
    209     if (frame->tree().parent())
    210         return;
    211     Document* document = frame->document();
    212     if (!document)
    213         return;
    214     HTMLHeadElement* head = document->head();
    215     if (!head)
    216         return;
    217     for (Node* c = head->firstChild(); c; c = c->nextSibling()) {
    218         if (c->hasTagName(scriptTag) && toElement(c)->getAttribute(srcAttr) == "MainPageJavaScript.js") {
    219             document->setFrameElementsShouldIgnoreScrolling(true);
    220             return;
    221         }
    222     }
    223 }
    224 #endif
    225 
    226 static inline void applyAppleDictionaryApplicationQuirk(WebFrameLoaderClient* client, const ResourceRequest& request)
    227 {
    228 #if !PLATFORM(IOS)
    229     // Use a one-time-initialized global variable so we can quickly determine there's nothing to do in
    230     // all applications other than Apple Dictionary.
    231     static bool isAppleDictionary = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.Dictionary"];
    232     if (isAppleDictionary)
    233         applyAppleDictionaryApplicationQuirkNonInlinePart(client, request);
    234 #endif
    235 }
    236 
    237190WebFrameLoaderClient::WebFrameLoaderClient(WebFrame *webFrame)
    238191    : m_webFrame(webFrame)
     
    347300bool WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader* loader, const ResourceRequest& request, const ResourceResponse& response, int length)
    348301{
    349     applyAppleDictionaryApplicationQuirk(this, request);
    350 
    351302    WebView *webView = getWebView(m_webFrame.get());
    352303    WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView);
     
    391342void WebFrameLoaderClient::dispatchWillSendRequest(DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse)
    392343{
    393     applyAppleDictionaryApplicationQuirk(this, request);
    394 
    395344    WebView *webView = getWebView(m_webFrame.get());
    396345    WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView);
Note: See TracChangeset for help on using the changeset viewer.