https://webkit.org/b/78447
rdar://problem/
10843542
Reviewed by Brian Weinstein.
Test: inspector/protocol/page-agent.html
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourcesForFrame): Skip CachedFonts and CachedImages that
return true for stillNeedsLoad.
* loader/cache/CachedFont.h:
(WebCore::CachedFont::stillNeedsLoad): Added.
LayoutTests: Updated test results to exclude CachedResources that haven't downloaded.
https://webkit.org/b/78447
rdar://problem/
10843542
Reviewed by Brian Weinstein.
* inspector/protocol/page-agent-expected.txt: Updated. There is now only one font list
in the resources, when there was incorrectly two being listed. Only the font being used
is the one that downloaded and is listed now.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107715
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2012-02-14 Timothy Hatcher <timothy@apple.com>
+ Updated test results to exclude CachedResources that haven't downloaded.
+
+ https://webkit.org/b/78447
+ rdar://problem/10843542
+
+ Reviewed by Brian Weinstein.
+
+ * inspector/protocol/page-agent-expected.txt: Updated. There is now only one font list
+ in the resources, when there was incorrectly two being listed. Only the font being used
+ is the one that downloaded and is listed now.
+
+2012-02-14 Timothy Hatcher <timothy@apple.com>
+
Test for Web Inspector: include failed and canceled in FrameResourceTree.
https://webkit.org/b/78445
}
{
url : <string>
- type : "Font"
- mimeType : ""
- }
- {
- url : <string>
type : "Script"
mimeType : "text/javascript"
}
2012-02-12 Timothy Hatcher <timothy@apple.com>
+ Don't include CachedResources that haven't downloaded when populating the Web Inspector on load.
+
+ https://webkit.org/b/78447
+ rdar://problem/10843542
+
+ Reviewed by Brian Weinstein.
+
+ Test: inspector/protocol/page-agent.html
+
+ * inspector/InspectorPageAgent.cpp:
+ (WebCore::InspectorPageAgent::cachedResourcesForFrame): Skip CachedFonts and CachedImages that
+ return true for stillNeedsLoad.
+ * loader/cache/CachedFont.h:
+ (WebCore::CachedFont::stillNeedsLoad): Added.
+
+2012-02-12 Timothy Hatcher <timothy@apple.com>
+
Web Inspector: include failed and canceled in FrameResourceTree.
https://webkit.org/b/78445
#include "Base64.h"
#include "CachedCSSStyleSheet.h"
+#include "CachedFont.h"
+#include "CachedImage.h"
#include "CachedResource.h"
#include "CachedResourceLoader.h"
#include "CachedScript.h"
const CachedResourceLoader::DocumentResourceMap& allResources = frame->document()->cachedResourceLoader()->allCachedResources();
CachedResourceLoader::DocumentResourceMap::const_iterator end = allResources.end();
- for (CachedResourceLoader::DocumentResourceMap::const_iterator it = allResources.begin(); it != end; ++it)
- result.append(it->second.get());
+ for (CachedResourceLoader::DocumentResourceMap::const_iterator it = allResources.begin(); it != end; ++it) {
+ CachedResource* cachedResource = it->second.get();
+
+ switch (cachedResource->type()) {
+ case CachedResource::ImageResource:
+ // Skip images that were not auto loaded (images disabled in the user agent).
+ if (static_cast<CachedImage*>(cachedResource)->stillNeedsLoad())
+ continue;
+ break;
+ case CachedResource::FontResource:
+ // Skip fonts that were referenced in CSS but never used/downloaded.
+ if (static_cast<CachedFont*>(cachedResource)->stillNeedsLoad())
+ continue;
+ break;
+ default:
+ // All other CachedResource types download immediately.
+ break;
+ }
+
+ result.append(cachedResource);
+ }
return result;
}
void checkNotify();
void beginLoadIfNeeded(CachedResourceLoader* dl);
+ bool stillNeedsLoad() const { return !m_loadInitiated; }
bool ensureCustomFontData();
FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);