User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9b4) Gecko/2008031113 Minefield/3.0b4 Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9b4) Gecko/2008031113 Minefield/3.0b4 When trying to obtain the iterator of the window.applicationCache object, an exception is thrown. Reproducible: Always Steps to Reproduce: 1. Try to obtain the iterator of the applicationCache object, e.g. Iterator(applicationCache) or for( var i in applicationCache ){} Actual Results: An "NS_ERROR_DOM_INVALID_STATE_ERR" exception is thrown. Expected Results: An iterator should be created that yields the values stored in the application cache. I compiled my build from the source here: ftp://ftp.mozilla.org/pub/firefox/releases/3.0b4/linux-i686/en-US/firefox-3.0b4.tar.bz2 I compiled it myself since Mozilla does not offer 64-bit builds.
Created attachment 324958 [details] applicationCache exception testcase Testcase showing the described behavior. I get two exceptions when running this on a stock build of a release client of Firefox 3 on Kubuntu 8.04 64-bit.
Created attachment 325578 [details] web page tried to get window.appliationCache.length
This bug cause exceptions in Firebug.
This looks like an html5 bug; html5 says the length should just be 0 in this case.
We should definitely fix this for 1.9.1, and if the fix isn't too involved or scary, I think it'd be a good candidate for backporting to 1.9.0.x.
Created attachment 325627 [details] [diff] [review] fix Attached patch returns 0 if there is no manifest. We also check the offline-app permission before allowing access to .length and .item. I think this is probably a mistake - we should probably allow access to those (like we do with .status) without the permission, since they don't allow modification of the application cache.
Comment on attachment 325627 [details] [diff] [review] fix I think this is a simple-enough fix and worth taking for 1.9.0.1.
Comment on attachment 325627 [details] [diff] [review] fix agreed, a=shaver
Pushed to mozilla-central, rev 8ecd07b476fd
Checking in dom/src/offline/nsDOMOfflineResourceList.cpp; /cvsroot/mozilla/dom/src/offline/nsDOMOfflineResourceList.cpp,v <-- nsDOMOfflineResourceList.cpp new revision: 1.7; previous revision: 1.6 done Checking in dom/tests/mochitest/ajax/offline/Makefile.in; /cvsroot/mozilla/dom/tests/mochitest/ajax/offline/Makefile.in,v <-- Makefile.in new revision: 1.9; previous revision: 1.8 done RCS file: /cvsroot/mozilla/dom/tests/mochitest/ajax/offline/test_noManifest.html,v done Checking in dom/tests/mochitest/ajax/offline/test_noManifest.html; /cvsroot/mozilla/dom/tests/mochitest/ajax/offline/test_noManifest.html,v <-- test_noManifest.html initial revision: 1.1 done
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1 Verified on 1.9.0.1 based on testcase in comment 1. Instead of an exception, returns "window.applicationCache.length = 0".
Created attachment 432976 [details] hm
Created attachment 485900 [details] Mandella
The content of attachment 432976 [details] has been deleted by Reed Loden [:reed] (busy; not reading bugmail regularly) <reed@reedloden.com> who provided the following reason: A head made of pills has nothing to do with this bug. The token used to delete this attachment was generated at 2010-10-25 17:12:43 PDT.
The content of attachment 485900 [details] has been deleted by Reed Loden [:reed] (busy; not reading bugmail regularly) <reed@reedloden.com> who provided the following reason: Nelson Mandela has nothing to do with this bug. The token used to delete this attachment was generated at 2010-10-25 17:12:48 PDT.