Changeset 167745 in webkit
- Timestamp:
- Apr 23, 2014 9:42:32 PM (10 years ago)
- Location:
- trunk/Source/WebKit/mac
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/mac/ChangeLog
r167730 r167745 1 2014-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 1 17 2014-04-23 Anders Carlsson <andersca@apple.com> 2 18 -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r167207 r167745 99 99 #import <WebCore/HTMLFrameElement.h> 100 100 #import <WebCore/HTMLFrameOwnerElement.h> 101 #import <WebCore/HTMLHeadElement.h>102 101 #import <WebCore/HTMLNames.h> 103 102 #import <WebCore/HTMLParserIdioms.h> … … 189 188 } 190 189 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 script196 // has a bug in it where it sets the scrolling attribute on frames, and that erroneous scrolling197 // 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 #endif225 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 in230 // 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 #endif235 }236 237 190 WebFrameLoaderClient::WebFrameLoaderClient(WebFrame *webFrame) 238 191 : m_webFrame(webFrame) … … 347 300 bool WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader* loader, const ResourceRequest& request, const ResourceResponse& response, int length) 348 301 { 349 applyAppleDictionaryApplicationQuirk(this, request);350 351 302 WebView *webView = getWebView(m_webFrame.get()); 352 303 WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); … … 391 342 void WebFrameLoaderClient::dispatchWillSendRequest(DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse) 392 343 { 393 applyAppleDictionaryApplicationQuirk(this, request);394 395 344 WebView *webView = getWebView(m_webFrame.get()); 396 345 WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView);
Note: See TracChangeset
for help on using the changeset viewer.