Bug 26925 - URL fragment breaks application cache loads
Summary: URL fragment breaks application cache loads
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P3 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords: HasReduction, InRadar
Depends on:
Blocks:
 
Reported: 2009-07-02 10:36 PDT by Andrew Grieve
Modified: 2009-07-28 15:24 PDT (History)
8 users (show)

See Also:


Attachments
proposed fix (14.94 KB, patch)
2009-07-13 16:26 PDT, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Grieve 2009-07-02 10:36:47 PDT
The URL Hash is store in the AppCache database and it does not allow an appcached page to be loaded from appcache with a different fragment from the one it was initially loaded with.

Steps to reproduce:

1. Create a Hello World style webpage and a manifest that has no entries in it.
2. Open the page and change the URL hash to #foo
2. Do a browser refresh (to put it into AppCache)
3. Go offline
4. Do a browser refresh and ensure the page refreshes from AppCache.
5. Change the URL hash to #bar
6. Do a browser refresh and notice that it fails to load.
Comment 1 Mark Rowe (bdash) 2009-07-02 21:53:44 PDT
<rdar://problem/7029995>
Comment 2 Andrew Grieve 2009-07-03 08:48:58 PDT
I also opened a radar bug for this (sorry for not mentioning it before):

<rdar://problem/7027850>

Also, I've found an existing hello world style page to test against:

http://www.thecssninja.com/demo/offline_webapp/index.html
Comment 3 Alexey Proskuryakov 2009-07-09 17:07:18 PDT
I think that the behavior is correct per the current spec - it never says that fragments should be ignored when loading resources, or when storing implicit resources. It only says that fragments should be ignored on URLs in manifests, as far as I can see.

But I also think that the desired behavior is to ignore them.
Comment 4 Michael Nordman 2009-07-09 21:15:56 PDT
I think the spec has a bug if that's what it says case :)
Comment 5 Ian 'Hixie' Hickson 2009-07-13 16:18:48 PDT
http://www.whatwg.org/specs/web-apps/current-work/#parsing-cache-manifests

The spec says to drop the fragment identifier part of any URLs parsed in the manifest.
Comment 6 Ian 'Hixie' Hickson 2009-07-13 16:22:30 PDT
Nevermind, I understand now. Yeah, this is wrong in the spec.
Comment 7 Alexey Proskuryakov 2009-07-13 16:26:13 PDT
Created attachment 32687 [details]
proposed fix
Comment 8 Darin Adler 2009-07-13 16:55:19 PDT
Comment on attachment 32687 [details]
proposed fix

r=me

Should we use KURL more and String less?
Comment 9 Alexey Proskuryakov 2009-07-13 17:09:12 PDT
Committed <http://trac.webkit.org/changeset/45848>.

(In reply to comment #8)
> Should we use KURL more and String less?

Probably not worth it in most cases here, as they only check hasRef() in debug builds.
Comment 10 Ian 'Hixie' Hickson 2009-07-28 14:35:25 PDT
spec is fixed
Comment 11 Alexey Proskuryakov 2009-07-28 15:24:24 PDT
Oops, forgot to mark this bug as fixed: <http://trac.webkit.org/projects/webkit/changeset/45848>.