Changeset 39566 in webkit
- Timestamp:
- Jan 2, 2009 6:04:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r39564 r39566 1 2009-01-02 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Bug 23072: REGRESSION (r37371): In the Dictionary application, scroll bar appears 6 inside its web view when resizing its window 7 https://bugs.webkit.org/show_bug.cgi?id=23072 8 rdar://problem/6368028 9 10 The first attempt at fixing this did not work. 11 This time I was able to reproduce the bug and test the fix. 12 13 Bug 11212: REGRESSION: Activity window doesn't always list all files until refresh 14 https://bugs.webkit.org/show_bug.cgi?id=11212 15 rdar://problem/4959702 16 17 I had to fix this second bug because otherwise the WebKit code to trigger the first 18 fix didn't run. 19 20 Also fixes memory use that kept growing as we maintained a set of all URLs loaded in 21 a particular frame. Bad idea! It's bad enough that we do it for each document, but 22 the old version kept the set around forever as you moved from one document to the next. 23 24 * html/HTMLFrameElementBase.cpp: 25 (WebCore::HTMLFrameElementBase::parseMappedAttribute): Change this so that we allow 26 turning off scrolling when the quirk is enabled. We just don't allow turning it on. 27 This fixes one of the two problems with the initial patch; the other fix is in WebKit. 28 29 * loader/DocumentLoader.h: Moved didTellClientAboutLoad and haveToldClientAboutLoad 30 here from FrameLoader. The old way meant that a given frame would forever remember 31 the URL of any resources loaded in that frame and never send any "loaded from cache" 32 client calls about those URLs. 33 34 * loader/FrameLoader.cpp: 35 (WebCore::FrameLoader::loadResourceSynchronously): Removed call to didTellCientAboutLoad. 36 This is now handled by dispatchWillSendRequest, which is safer since that's the actual 37 function that tells the client about the load. 38 (WebCore::FrameLoader::loadedResourceFromMemoryCache): Changed calls to 39 haveToldClientAboutLoad and didTellClientAboutLoad to call the document loader. 40 Also removed the call in the case where we don't load from the cache, since 41 dispatchWillSendRequest now takes care of it. 42 (WebCore::FrameLoader::dispatchWillSendRequest): Put calls to didTellClientAboutLoad 43 here. Call it both on the URL we pass in and the URL the client returns; we won't 44 tell the client about either if it's loaded from the memory cache. 45 46 * loader/FrameLoader.h: Removed didTellClientAboutLoad, haveToldClientAboutLoad, and 47 m_urlsClientKnowsAbout. 48 49 * loader/SubresourceLoader.cpp: Removed unneeded load function that called 50 didTellClientAboutLoad. That's now taken care of in dispatchWillSendRequest. 51 52 * loader/SubresourceLoader.h: Removed load function. Also made all members private 53 except for create and clearClient. 54 1 55 2009-01-02 Simon Fraser <simon.fraser@apple.com> 2 56 -
trunk/WebCore/html/HTMLFrameElementBase.cpp
r39547 r39566 4 4 * (C) 2000 Simon Hausmann (hausmann@kde.org) 5 5 * (C) 2001 Dirk Mueller (mueller@kde.org) 6 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. 7 7 * 8 8 * This library is free software; you can redistribute it and/or … … 130 130 // FIXME: If we are already attached, this has no effect. 131 131 } else if (attr->name() == scrollingAttr) { 132 if (document()->frameElementsShouldIgnoreScrolling())133 return;134 132 // Auto and yes both simply mean "allow scrolling." No means "don't allow scrolling." 135 133 if (equalIgnoringCase(attr->value(), "auto") || equalIgnoringCase(attr->value(), "yes")) 136 m_scrolling = ScrollbarAuto;134 m_scrolling = document()->frameElementsShouldIgnoreScrolling() ? ScrollbarAlwaysOff : ScrollbarAuto; 137 135 else if (equalIgnoringCase(attr->value(), "no")) 138 136 m_scrolling = ScrollbarAlwaysOff; -
trunk/WebCore/loader/DocumentLoader.h
r39546 r39566 1 1 /* 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 #define DocumentLoader_h 31 31 32 #include "IconDatabase.h"33 32 #include "NavigationAction.h" 34 #include <wtf/RefCounted.h>35 #include "PlatformString.h"36 33 #include "ResourceError.h" 37 34 #include "ResourceRequest.h" 38 35 #include "ResourceResponse.h" 39 36 #include "SubstituteData.h" 40 #include <wtf/HashSet.h> 41 #include <wtf/RefPtr.h> 42 #include <wtf/Vector.h> 37 #include "Timer.h" 43 38 44 39 namespace WebCore { 45 40 46 #if ENABLE(OFFLINE_WEB_APPLICATIONS)47 41 class ApplicationCache; 48 42 class ApplicationCacheGroup; 49 43 class ApplicationCacheResource; 50 #endif51 44 class Archive; 52 45 class ArchiveResource; … … 55 48 class Frame; 56 49 class FrameLoader; 57 class HistoryItem;58 class KURL;59 50 class MainResourceLoader; 60 51 class ResourceLoader; 61 52 class SchedulePair; 62 53 class SharedBuffer; 63 class SubstituteData;64 54 class SubstituteResource; 65 55 … … 197 187 bool deferMainResourceDataLoad() const { return m_deferMainResourceDataLoad; } 198 188 189 void didTellClientAboutLoad(const String& url) { m_resourcesClientKnowsAbout.add(url); } 190 bool haveToldClientAboutLoad(const String& url) { return m_resourcesClientKnowsAbout.contains(url); } 191 199 192 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 200 193 bool scheduleApplicationCacheLoad(ResourceLoader*, const ResourceRequest&, const KURL& originalURL); … … 290 283 OwnPtr<ArchiveResourceCollection> m_archiveResourceCollection; 291 284 RefPtr<SharedBuffer> m_parsedArchiveData; 292 285 286 HashSet<String> m_resourcesClientKnowsAbout; 287 293 288 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 294 289 // The application cache that the document loader is associated with (if any). -
trunk/WebCore/loader/FrameLoader.cpp
r39546 r39566 1 1 /* 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) … … 805 805 void FrameLoader::clear(bool clearWindowProperties, bool clearScriptObjects) 806 806 { 807 // FIXME: Commenting out the below line causes <http://bugs.webkit.org/show_bug.cgi?id=11212>, but putting it808 // back causes a measurable performance regression which we will need to fix to restore the correct behavior809 // urlsBridgeKnowsAbout.clear();810 811 807 m_frame->editor()->clear(); 812 808 … … 3386 3382 } 3387 3383 3388 void FrameLoader::didTellClientAboutLoad(const String& url)3389 {3390 m_urlsClientKnowsAbout.add(url);3391 }3392 3393 bool FrameLoader::haveToldClientAboutLoad(const String& url)3394 {3395 return m_urlsClientKnowsAbout.contains(url);3396 }3397 3398 3384 void FrameLoader::handledOnloadEvents() 3399 3385 { … … 3586 3572 if (error.isNull()) { 3587 3573 ASSERT(!newRequest.isNull()); 3588 didTellClientAboutLoad(newRequest.url().string());3589 3574 3590 3575 #if ENABLE(OFFLINE_WEB_APPLICATIONS) … … 4038 4023 page->inspectorController()->didLoadResourceFromMemoryCache(m_documentLoader.get(), request, response, length); 4039 4024 4040 if (!resource->sendResourceLoadCallbacks() || haveToldClientAboutLoad(resource->url()))4025 if (!resource->sendResourceLoadCallbacks() || m_documentLoader->haveToldClientAboutLoad(request.url())) 4041 4026 return; 4042 4027 4043 4028 if (m_client->dispatchDidLoadResourceFromMemoryCache(m_documentLoader.get(), request, response, length)) { 4044 didTellClientAboutLoad(resource->url());4029 m_documentLoader->didTellClientAboutLoad(request.url()); 4045 4030 return; 4046 4031 } … … 4051 4036 requestFromDelegate(r, identifier, error); 4052 4037 sendRemainingDelegateMessages(identifier, response, length, error); 4053 4054 didTellClientAboutLoad(resource->url());4055 4038 } 4056 4039 … … 5126 5109 void FrameLoader::dispatchWillSendRequest(DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse) 5127 5110 { 5111 m_documentLoader->didTellClientAboutLoad(request.url()); 5128 5112 m_client->dispatchWillSendRequest(loader, identifier, request, redirectResponse); 5113 m_documentLoader->didTellClientAboutLoad(request.url()); 5129 5114 5130 5115 if (Page* page = m_frame->page()) -
trunk/WebCore/loader/FrameLoader.h
r39432 r39566 1 1 /* 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) 4 4 * … … 31 31 #define FrameLoader_h 32 32 33 #include "CachedResource.h"34 33 #include "CachePolicy.h" 35 #include "FormState.h"36 34 #include "FrameLoaderTypes.h" 37 #include "KURL.h" 38 #include "StringHash.h" 35 #include "ResourceRequest.h" 39 36 #include "Timer.h" 40 #include <wtf/Forward.h> 41 #include <wtf/HashSet.h> 42 #include <wtf/HashMap.h> 43 #include <wtf/Noncopyable.h> 44 #include <wtf/OwnPtr.h> 45 #include <wtf/RefPtr.h> 46 #include "ResourceRequest.h" 37 47 38 #if USE(LOW_BANDWIDTH_DISPLAY) 48 39 #include "CachedResourceClient.h" … … 52 43 53 44 class Archive; 54 class ArchiveResource;55 45 class AuthenticationChallenge; 56 46 class CachedPage; 47 class CachedResource; 57 48 class Document; 58 49 class DocumentLoader; … … 60 51 class Event; 61 52 class FormData; 53 class FormState; 62 54 class Frame; 63 55 class FrameLoaderClient; … … 68 60 class IntSize; 69 61 class NavigationAction; 70 class Node;71 class Page;72 62 class RenderPart; 73 63 class ResourceError; 74 64 class ResourceLoader; 75 class ResourceRequest;76 65 class ResourceResponse; 77 66 class ScriptSourceCode; … … 127 116 class FrameLoader : Noncopyable 128 117 #if USE(LOW_BANDWIDTH_DISPLAY) 129 , private CachedResourceClient118 , private CachedResourceClient 130 119 #endif 131 120 { … … 405 394 KURL completeURL(const String& url); 406 395 407 void didTellClientAboutLoad(const String& url);408 bool haveToldClientAboutLoad(const String& url);409 410 396 KURL originalRequestURL() const; 411 397 … … 619 605 String m_outgoingReferrer; 620 606 621 HashSet<String> m_urlsClientKnowsAbout;622 623 607 OwnPtr<FormSubmission> m_deferredFormSubmission; 624 608 -
trunk/WebCore/loader/SubresourceLoader.cpp
r39393 r39566 1 1 /* 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 #include "SubresourceLoader.h" 31 31 32 #include "Document.h"33 32 #include "DocumentLoader.h" 34 33 #include "Frame.h" 35 34 #include "FrameLoader.h" 36 #include "Logging.h"37 35 #include "ResourceHandle.h" 38 #include "ResourceRequest.h"39 36 #include "SubresourceLoaderClient.h" 40 #include "SharedBuffer.h"41 37 #include <wtf/RefCountedLeakCounter.h> 42 38 … … 63 59 subresourceLoaderCounter.decrement(); 64 60 #endif 65 }66 67 bool SubresourceLoader::load(const ResourceRequest& r)68 {69 m_frame->loader()->didTellClientAboutLoad(r.url().string());70 71 return ResourceLoader::load(r);72 61 } 73 62 -
trunk/WebCore/loader/SubresourceLoader.h
r39393 r39566 1 1 /* 2 * Copyright (C) 2005, 2006 Apple Computer, Inc.All rights reserved.2 * Copyright (C) 2005, 2006, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 31 31 32 32 #include "ResourceLoader.h" 33 #include <wtf/PassRefPtr.h>34 33 35 34 namespace WebCore { 36 35 37 class FormData;38 class String;39 class ResourceHandle;40 36 class ResourceRequest; 41 37 class SubresourceLoaderClient; … … 44 40 public: 45 41 static PassRefPtr<SubresourceLoader> create(Frame*, SubresourceLoaderClient*, const ResourceRequest&, bool skipCanLoadCheck = false, bool sendResourceLoadCallbacks = true, bool shouldContentSniff = true); 46 42 43 void clearClient() { m_client = 0; } 44 45 private: 46 SubresourceLoader(Frame*, SubresourceLoaderClient*, bool sendResourceLoadCallbacks, bool shouldContentSniff); 47 47 virtual ~SubresourceLoader(); 48 49 virtual bool load(const ResourceRequest&);50 48 51 49 virtual void willSendRequest(ResourceRequest&, const ResourceResponse& redirectResponse); … … 57 55 virtual bool shouldUseCredentialStorage(); 58 56 virtual void didReceiveAuthenticationChallenge(const AuthenticationChallenge&); 59 virtual void receivedCancellation(const AuthenticationChallenge&); 60 61 void clearClient() { m_client = 0; } 57 virtual void receivedCancellation(const AuthenticationChallenge&); 58 virtual void didCancel(const ResourceError&); 62 59 63 private:64 SubresourceLoader(Frame*, SubresourceLoaderClient*, bool sendResourceLoadCallbacks, bool shouldContentSniff);65 66 virtual void didCancel(const ResourceError&);67 60 SubresourceLoaderClient* m_client; 68 61 bool m_loadingMultipartContent; -
trunk/WebKit/mac/ChangeLog
r39549 r39566 1 2009-01-02 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Bug 23072: REGRESSION (r37371): In the Dictionary application, scroll bar appears 6 inside its web view when resizing its window 7 https://bugs.webkit.org/show_bug.cgi?id=23072 8 rdar://problem/6368028 9 10 The first attempt at fixing this did not work. 11 This time I was able to reproduce the bug and test the fix. 12 13 * WebCoreSupport/WebFrameLoaderClient.mm: 14 (applyAppleDictionaryApplicationQuirkNonInlinePart): Changed the arguments and 15 function names around a bit to make even less code at the call site. 16 (applyAppleDictionaryApplicationQuirk): Put the check for whether this is the 17 Dictionary application in here. 18 (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache): Put a call to 19 applyAppleDictionaryApplicationQuirk here. This was a case I had missed before, 20 when the script is cached. This fixes one of the two problems with the initial 21 patch; the other fix is in WebCore. 22 (WebFrameLoaderClient::dispatchWillSendRequest): Changed the 23 applyAppleDictionaryApplicationQuirk call here to work the new simpler way. 24 25 * WebView/WebView.mm: Had to add an include due to changes in WebCore header includes. 26 1 27 2009-01-02 Cameron Zwarich <cwzwarich@uwaterloo.ca> 2 28 -
trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r39547 r39566 1 1 /* 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 157 157 // This quirk can be removed when Apple Dictionary is fixed (see <rdar://problem/6471058>). 158 158 159 static bool isAppleDictionaryApplication() 160 { 161 return [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.Dictionary"]; 162 } 163 164 static void applyAppleDictionaryApplicationQuirk(WebFrame *webFrame, const ResourceRequest& request) 159 static void applyAppleDictionaryApplicationQuirkNonInlinePart(WebFrameLoaderClient* client, const ResourceRequest& request) 165 160 { 166 161 if (!request.url().isLocalFile()) … … 168 163 if (!request.url().string().endsWith("MainPageJavaScript.js")) 169 164 return; 170 Frame* frame = core( webFrame);165 Frame* frame = core(client->webFrame()); 171 166 if (!frame) 172 167 return; … … 185 180 } 186 181 } 182 } 183 184 static inline void applyAppleDictionaryApplicationQuirk(WebFrameLoaderClient* client, const ResourceRequest& request) 185 { 186 // Use a one-time-initialized global variable so we can quickly determine there's nothing to do in 187 // all applications other than Apple Dictionary. 188 static bool isAppleDictionary = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.Dictionary"]; 189 if (isAppleDictionary) 190 applyAppleDictionaryApplicationQuirkNonInlinePart(client, request); 187 191 } 188 192 … … 319 323 bool WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader* loader, const ResourceRequest& request, const ResourceResponse& response, int length) 320 324 { 325 applyAppleDictionaryApplicationQuirk(this, request); 326 321 327 WebView *webView = getWebView(m_webFrame.get()); 322 328 WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); … … 350 356 void WebFrameLoaderClient::dispatchWillSendRequest(DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse) 351 357 { 352 static bool isDictionary = isAppleDictionaryApplication(); 353 if (isDictionary) 354 applyAppleDictionaryApplicationQuirk(m_webFrame.get(), request); 358 applyAppleDictionaryApplicationQuirk(this, request); 355 359 356 360 WebView *webView = getWebView(m_webFrame.get()); -
trunk/WebKit/mac/WebView/WebView.mm
r39452 r39566 108 108 #import <WebCore/HTMLNames.h> 109 109 #import <WebCore/HistoryItem.h> 110 #import <WebCore/IconDatabase.h> 110 111 #import <WebCore/Logging.h> 111 112 #import <WebCore/MIMETypeRegistry.h>
Note: See TracChangeset
for help on using the changeset viewer.