localStorage.key(localStorage.length) not returning null as W3C spec says it should

RESOLVED DUPLICATE of bug 738647

Status

()

RESOLVED DUPLICATE of bug 738647
10 years ago
9 days ago

People

(Reporter: brett, Unassigned)

Tracking

({html5, testcase})

Trunk
x86
macOS
html5, testcase
Points:
---
Bug Flags:
wanted1.9.2 ?

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1

The W3C Web Storage spec on localStorage.key() (http://dev.w3.org/html5/webstorage/#dom-storage-key) says that when an argument equal to or greater than the number of entries is given that null should be returned. But in fact an exception is currently being raised.

Reproducible: Always

Steps to Reproduce:
1. run ``localStorage.key(localStorage.length)``
2. Note the raised exception and how null is not returned as expected.
Actual Results:  
[Exception... "Index or size is negative or greater than the allowed amount" code: "1" nsresult: "0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)"

Expected Results:  
null should be returned.
Component: General → DOM: Mozilla Extensions
Product: Firefox → Core
QA Contact: general → general
Reset product/component to something hopefully more sane.

Comment 2

10 years ago
Confirming on Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.3a1pre) Gecko/20090919 Minefield/3.7a1pre

See the URL for the testcase.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: wanted1.9.2?
Keywords: html5, testcase
Version: unspecified → Trunk
Assignee: nobody → honzab.moz

Comment 3

8 years ago
This bug is still current, on Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
Not time to work on this right now.
Assignee: honzab.moz → nobody
Duping forward to bug 738647, because that one has a patch.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 738647
Component: DOM: Mozilla Extensions → DOM
Product: Core → Core
Component: DOM → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.