Closed
Bug 445544
Opened 16 years ago
Closed 16 years ago
Navigating away from offline application fails
Categories
(Core :: Networking: Cache, defect)
Core
Networking: Cache
Tracking
()
RESOLVED
FIXED
People
(Reporter: mayhemer, Assigned: dcamp)
References
Details
(Keywords: fixed1.9.1)
Attachments
(2 files, 2 obsolete files)
(deleted),
patch
|
bzbarsky
:
review+
mayhemer
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
When assign window.location or simply using the address bar in tab where an offline application is running (i.e. a document with associated application cache) navigation fails ("we are in offline mode" page is shown, see bug 443450. This happens in case the new URL we want to navigate to is not contained in the application cache associated with the document (most cases).
The reason is the document is still assigned an application cache even after the location is changed and the underlying channel loads only from the application cache gained from the above document (what is correct!).
We must remove the application cache from the document on the right place under the correct condition. Probably nsLocation::Assign is the right place? Or somewhere above in docshell where it is more easy to recognize the document is top level?
Assignee | ||
Comment 1•16 years ago
|
||
So it looks like what's happening here is that the http channel for the new location is asking the docshell (via the loadgroup) for the current application cache. Until SetupNewViewer() is called, the docshell is still returning the current toplevel's doc to satisfy the request.
The attached patch adds a load flag to the channel that inhibits inheriting the app cache from the docshell. The docshell passes this flag in to toplevel document loads to prevent them from inheriting the old application cache setting.
Reporter | ||
Updated•16 years ago
|
Attachment #329939 -
Attachment is patch: true
Attachment #329939 -
Attachment mime type: application/octet-stream → text/plain
Reporter | ||
Comment 2•16 years ago
|
||
This patch works for problem with navigation. But it bypasses cache grab from document when refreshing the page that leads to violation of the spec: when new version of the cache is published the cache is swapped when page is reload and not after the swapCache method is called.
This nit can be held as known issue in my opinion.
Just a question: isn't testing of LOAD_INITIAL_DOCUMENT_URI flag sufficient?
Summary: Navigating away from offline application failes → Navigating away from offline application fails
Reporter | ||
Comment 3•16 years ago
|
||
This is the same as v1 but prevents bypass of the cache when the page is being reloaded. Not sure this is clean solution, but preserves the correct behavior.
Reporter | ||
Comment 4•16 years ago
|
||
Comment on attachment 330044 [details] [diff] [review]
v2
I misunderstood the expected behavior: on reload the document must use the newer cache, so v1 patch is correct and sufficient solution to this issue.
Reporter | ||
Updated•16 years ago
|
Attachment #330044 -
Attachment is obsolete: true
Updated•16 years ago
|
Flags: blocking1.9.1?
Assignee | ||
Comment 5•16 years ago
|
||
New version uses a new interface (nsIApplicationCacheChannel) rather than a new load flag. This interface also includes an attribute for the equivalent of LOAD_CHECK_OFFLINE_CACHE.
I also included a fix for 450175, as this patch adds a new attribute to potentially be propagated.
LOAD_CHECK_OFFLINE_CACHE shouldn't really be needed anymore, and we could remove it to get an extra flag back. I can either include that in this patch or file a followup.
Assignee: honzab → dcamp
Attachment #329939 -
Attachment is obsolete: true
Attachment #343622 -
Flags: superreview?(bzbarsky)
Attachment #343622 -
Flags: review?(bzbarsky)
Updated•16 years ago
|
Attachment #343622 -
Flags: superreview?(bzbarsky)
Attachment #343622 -
Flags: superreview+
Attachment #343622 -
Flags: review?(honzab)
Attachment #343622 -
Flags: review?(bzbarsky)
Attachment #343622 -
Flags: review+
Comment 6•16 years ago
|
||
Comment on attachment 343622 [details] [diff] [review]
new patch
Why not have the new interface inherit from nsIApplicationCacheContainer?
> I can either include that in this patch or file a followup.
Followup is fine.
The rest looks fine to me; I'd like Honza to double-check the actual cache logic and test.
Reporter | ||
Updated•16 years ago
|
Attachment #343622 -
Flags: review?(honzab) → review+
Reporter | ||
Comment 7•16 years ago
|
||
Comment on attachment 343622 [details] [diff] [review]
new patch
This conforms the previous version of the spec. Looks ok, I would just expect (root == this) check - check for top level document - is present also in OnRedirectStateChange before chooseAppCache is set. And yes, we should remove the LOAD_CHECK_OFFLINE_CACHE flag. It is now useless.
Assignee | ||
Comment 8•16 years ago
|
||
(In reply to comment #7)
> (From update of attachment 343622 [details] [diff] [review])
> This conforms the previous version of the spec. Looks ok, I would just expect
> (root == this) check - check for top level document - is present also in
> OnRedirectStateChange before chooseAppCache is set.
ShouldCheckAppCache() does the (root == this) check. LoadURI() does it also because it needs to set inheritApplicationCache, but that's copied to the new channel during redirect.
Updated•16 years ago
|
Flags: blocking1.9.1? → blocking1.9.1+
Assignee | ||
Comment 9•16 years ago
|
||
interdiff of the review request fix (deriving nsIApplicationCacheChannel from nsIApplicationCacheContainer).
Attachment #345395 -
Flags: review?(bzbarsky)
Updated•16 years ago
|
Attachment #345395 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 10•16 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Keywords: fixed1.9.1
Updated•16 years ago
|
Flags: in-testsuite?
Assignee | ||
Updated•16 years ago
|
Flags: in-testsuite? → in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•