Bug 26421
| Summary: | resources not fetched when application cache is on | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Yong Li <yong.li.webkit> |
| Component: | Page Loading | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | ap, beidson, koivisto, staikos |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | All | ||
Yong Li
When application cache is used, fetching some resources that are neither in the cache nor in application cache fallback URL list can be refused.
As a result, the software doesn't show the list of checkboxes on http://static.webvm.net/appcache/todo.html
bool DocumentLoader::shouldLoadResourceFromApplicationCache(const ResourceRequest& request, ApplicationCacheResource*& resource)
{
ApplicationCache* cache = applicationCache();
if (!cache || !cache->isComplete())
return false;
// If the resource is not a HTTP/HTTPS GET, then abort
if (!ApplicationCache::requestIsHTTPOrHTTPSGet(request))
return false;
// If the resource's URL is an master entry, the manifest, an explicit entry, a fallback entry, or a dynamic entry
// in the application cache, then get the resource from the cache (instead of fetching it).
resource = cache->resourceForURL(request.url());
// Resources that match fallback namespaces or online whitelist entries are fetched from the network,
// unless they are also cached.
if (!resource && (cache->urlMatchesFallbackNamespace(request.url()) || cache->isURLInOnlineWhitelist(request.url())))
return false;
// Resources that are not present in the manifest will always fail to load (at least, after the
// cache has been primed the first time), making the testing of offline applications simpler.
return true;
}
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Yong Li
Possible solution?
change the following code:
if (!resource && (cache->urlMatchesFallbackNamespace(request.url()) || cache->isURLInOnlineWhitelist(request.url())))
return false;
into:
if (!resource || cache->urlMatchesFallbackNamespace(request.url()) || cache->isURLInOnlineWhitelist(request.url()))
return false;
Anders Carlsson
It's actually a feature not to fetch resources not listed in the manifest when using the application cache, see
http://www.whatwg.org/specs/web-apps/current-work/#changesToNetworkingModel