Last Comment Bug 422264 - retrieving iterator of applicationCache throws NS_ERROR_DOM_INVALID_STATE_ERR
: retrieving iterator of applicationCache throws NS_ERROR_DOM_INVALID_STATE_ERR
Status: RESOLVED FIXED
[firebug-p3]
: html5, verified1.9.0.1
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: x86 Linux
: -- normal with 1 vote (vote)
: ---
Assigned To: Dave Camp (:dcamp)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-11 16:26 PDT by James Justin Harrell
Modified: 2010-10-25 17:16 PDT (History)
19 users (show)
shaver: wanted1.9.1+
dveditz: wanted1.9.0.x+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
applicationCache exception testcase (377 bytes, text/html)
2008-06-13 07:09 PDT, James Justin Harrell
no flags Details
web page tried to get window.appliationCache.length (787 bytes, text/html)
2008-06-18 09:24 PDT, John J. Barton
no flags Details
fix (2.86 KB, patch)
2008-06-18 13:58 PDT, Dave Camp (:dcamp)
jst: review+
jst: superreview+
shaver: approval1.9.0.1+
Details | Diff | Review
hm (deleted)
2010-03-16 18:59 PDT, Bawb Kewper
no flags Details
Mandella (deleted)
2010-10-25 16:25 PDT, saeid tarighat
no flags Details

Description James Justin Harrell 2008-03-11 16:26:34 PDT
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.
Comment 1 James Justin Harrell 2008-06-13 07:09:05 PDT
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.
Comment 2 John J. Barton 2008-06-18 09:24:37 PDT
Created attachment 325578 [details]
web page tried to get window.appliationCache.length
Comment 3 John J. Barton 2008-06-18 09:25:45 PDT
This bug cause exceptions in Firebug.
Comment 4 Boris Zbarsky [:bz] 2008-06-18 09:34:22 PDT
This looks like an html5 bug; html5 says the length should just be 0 in this case.
Comment 5 Mike Shaver (:shaver -- probably not reading bugmail closely) 2008-06-18 09:46:24 PDT
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.
Comment 6 Dave Camp (:dcamp) 2008-06-18 13:58:48 PDT
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 7 Dave Camp (:dcamp) 2008-06-26 17:51:32 PDT
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 8 Mike Shaver (:shaver -- probably not reading bugmail closely) 2008-06-26 19:01:49 PDT
Comment on attachment 325627 [details] [diff] [review]
fix

agreed, a=shaver
Comment 9 Dave Camp (:dcamp) 2008-06-27 17:24:04 PDT
Pushed to mozilla-central, rev 8ecd07b476fd
Comment 10 Dave Camp (:dcamp) 2008-06-30 20:45:31 PDT
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
Comment 11 Hasham 2008-07-02 17:39:16 PDT
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". 
Comment 12 Bawb Kewper 2010-03-16 18:59:05 PDT
Created attachment 432976 [details]
hm
Comment 13 saeid tarighat 2010-10-25 16:25:17 PDT
Created attachment 485900 [details]
Mandella
Comment 14 Reed Loden [:reed] (use needinfo?) 2010-10-25 17:13:22 PDT
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.
Comment 15 Reed Loden [:reed] (use needinfo?) 2010-10-25 17:13:25 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.

Note You need to log in before you can comment on or make changes to this bug.


Privacy Policy