Closed Bug 422264 Opened 18 years ago Closed 18 years ago

retrieving iterator of applicationCache throws NS_ERROR_DOM_INVALID_STATE_ERR

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: HeroreV, Assigned: dcamp)

Details

(Keywords: html5, verified1.9.0.1, Whiteboard: [firebug-p3])

Attachments

(3 files, 2 obsolete files)

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.
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.
This bug cause exceptions in Firebug.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [firebug-p3]
This looks like an html5 bug; html5 says the length should just be 0 in this case.
Keywords: html5
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.
Flags: wanted1.9.1+
Flags: wanted1.9.0.x?
Assignee: nobody → dcamp
Version: unspecified → Trunk
Attached patch fixSplinter Review
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.
Attachment #325627 - Flags: superreview?(jst)
Attachment #325627 - Flags: review?(jst)
Attachment #325627 - Flags: superreview?(jst)
Attachment #325627 - Flags: superreview+
Attachment #325627 - Flags: review?(jst)
Attachment #325627 - Flags: review+
Comment on attachment 325627 [details] [diff] [review] fix I think this is a simple-enough fix and worth taking for 1.9.0.1.
Attachment #325627 - Flags: approval1.9.0.1?
Comment on attachment 325627 [details] [diff] [review] fix agreed, a=shaver
Attachment #325627 - Flags: approval1.9.0.1? → approval1.9.0.1+
Pushed to mozilla-central, rev 8ecd07b476fd
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
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
Keywords: fixed1.9.0.1
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".
Flags: wanted1.9.0.x? → wanted1.9.0.x+
Attached file hm (obsolete) (deleted) —
Attached file Mandella (obsolete) (deleted) —
Attachment #485900 - Flags: review+
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.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: