Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
2011-05-21 Gavin Peters <gavinp@chromium.org>
Reviewed by Adam Barth. Add rel type prerender to distinguish prerender from prefetch https://bugs.webkit.org/show_bug.cgi?id=61079 Chrome right now uses <link rel=prefetch ...> for one of two things, to warm the cache in the same way as firefox, or to launch a speculative rendering of a web page, for faster "loading" when the user navigates to it. This new rel type will let us distinguish the two cases; the rel type prerender isn't used on the web today, but the Google Web Search example prerendering application is ready to experiment with it. * fast/dom/HTMLLinkElement/prerender-expected.txt: Added. * fast/dom/HTMLLinkElement/prerender.html: Added. * platform/gtk/Skipped: * platform/mac/Skipped: * platform/qt/Skipped: * platform/win/Skipped: 2011-05-21 Gavin Peters <gavinp@chromium.org> Reviewed by Adam Barth. Add rel type prerender to distinguish prerender from prefetch https://bugs.webkit.org/show_bug.cgi?id=61079 Chrome right now uses <link rel=prefetch ...> for one of two things, to warm the cache in the same way as firefox, or to launch a speculative rendering of a web page, for faster "loading" when the user navigates to it. This new rel type will let us distinguish the two cases; the rel type prerender isn't used on the web today, but the Google Web Search example prerendering application is ready to experiment with it. Test: fast/dom/HTMLLinkElement/prerender.html * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::tokenizeRelAttribute): (WebCore::HTMLLinkElement::process): * html/HTMLLinkElement.h: (WebCore::HTMLLinkElement::RelAttribute::RelAttribute): * loader/cache/CachedResource.cpp: (WebCore::defaultPriorityForResourceType): * loader/cache/CachedResource.h: (WebCore::CachedResource::isLinkResource): * loader/cache/CachedResourceLoader.cpp: (WebCore::createResource): (WebCore::CachedResourceLoader::requestLinkResource): (WebCore::CachedResourceLoader::canRequest): * loader/cache/CachedResourceLoader.h: * loader/cache/CachedResourceRequest.cpp: (WebCore::cachedResourceTypeToTargetType): (WebCore::CachedResourceRequest::load): * platform/network/ResourceRequestBase.h: Canonical link: https://commits.webkit.org/76619@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
137 additions
and 24 deletions.
- +22 −0 LayoutTests/ChangeLog
- +3 −0 LayoutTests/fast/dom/HTMLLinkElement/prerender-expected.txt
- +20 −0 LayoutTests/fast/dom/HTMLLinkElement/prerender.html
- +1 −0 LayoutTests/platform/gtk/Skipped
- +1 −0 LayoutTests/platform/mac/Skipped
- +1 −0 LayoutTests/platform/qt/Skipped
- +2 −1 LayoutTests/platform/win/Skipped
- +36 −0 Source/WebCore/ChangeLog
- +12 −3 Source/WebCore/html/HTMLLinkElement.cpp
- +2 −0 Source/WebCore/html/HTMLLinkElement.h
- +5 −1 Source/WebCore/loader/cache/CachedResource.cpp
- +4 −2 Source/WebCore/loader/cache/CachedResource.h
- +18 −7 Source/WebCore/loader/cache/CachedResourceLoader.cpp
- +1 −1 Source/WebCore/loader/cache/CachedResourceLoader.h
- +8 −9 Source/WebCore/loader/cache/CachedResourceRequest.cpp
- +1 −0 Source/WebCore/platform/network/ResourceRequestBase.h
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,3 @@ | ||
prefetch.link has MIME type application/octet-stream | ||
PASS onload called! | ||
This test will only print "PASS" or "FAIL" if link prefetches are enabled, otherwise it will show nothing below. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,20 @@ | ||
<body> | ||
<div id="console"></div> | ||
<script src="../../js/resources/js-test-pre.js"></script> | ||
<script> | ||
function prefetch_onload() { | ||
testPassed('onload called!'); | ||
layoutTestController.notifyDone(); | ||
} | ||
if (window.layoutTestController) { | ||
layoutTestController.waitUntilDone(); | ||
layoutTestController.dumpAsText(); | ||
layoutTestController.dumpResourceResponseMIMETypes(); | ||
} | ||
</script> | ||
<html> | ||
<p>This test will only print "PASS" or "FAIL" if link prefetches are | ||
enabled, otherwise it will show nothing below.</p> | ||
<link href="prefetch.link" rel="prerender" onload="prefetch_onload()" onerror="testFailed('onerror')" /> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -65,6 +65,7 @@ namespace WebCore { | ||
TargetIsWorker, | ||
TargetIsSharedWorker, | ||
TargetIsPrefetch, | ||
TargetIsPrerender, | ||
TargetIsFavicon, | ||
}; | ||
|
||