New issue
Advanced search Search tips

Issue 679465 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

IDBObjectStore/IDBIndex.getAll/getAllKeys should have [EnforceRange]

Project Member Reported by jsb...@chromium.org, Jan 9 2017

Issue description

Repro:

objectStore.getAll(null, -1);

Expected:

Throws, per WebIDL (https://heycam.github.io/webidl/#EnforceRange)

Actual:

-1 is treated as unbounded (probably turns into 0xFFFFFFFF

Firefox:

Throws, as per spec.
 
Status: Started (was: Assigned)
Project Member

Comment 2 by bugdroid1@chromium.org, Jan 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/99435bd5b9707422116b5aa06e4fc81adbeb34b7

commit 99435bd5b9707422116b5aa06e4fc81adbeb34b7
Author: jsbell <jsbell@chromium.org>
Date: Tue Jan 10 00:28:49 2017

IDBObjectStore/IDBIndex.getAll/getAllKeys should have [EnforceRange]

Per spec, the |count| argument for the getAll() and getAllKeys()
method should have the [EnforceRange] extended attribute which makes
the method throw if an invalid number or number out of range is passed
(e.g. not a number, infinity, negative, etc) rather than silently
coercing as is the default (for historical reasons).

Blink was just missing these attributes on three of the four methods.
Firefox has them. Added the attributes and test cases.

BUG= 679465 
R=pwnall@chromium.org

Review-Url: https://codereview.chromium.org/2627453002
Cr-Commit-Position: refs/heads/master@{#442419}

[add] https://crrev.com/99435bd5b9707422116b5aa06e4fc81adbeb34b7/third_party/WebKit/LayoutTests/storage/indexeddb/idbindex-getAll-enforcerange.html
[add] https://crrev.com/99435bd5b9707422116b5aa06e4fc81adbeb34b7/third_party/WebKit/LayoutTests/storage/indexeddb/idbindex-getAllKeys-enforcerange.html
[add] https://crrev.com/99435bd5b9707422116b5aa06e4fc81adbeb34b7/third_party/WebKit/LayoutTests/storage/indexeddb/idbobjectstore-getAll-enforcerange.html
[add] https://crrev.com/99435bd5b9707422116b5aa06e4fc81adbeb34b7/third_party/WebKit/LayoutTests/storage/indexeddb/idbobjectstore-getAllKeys-enforcerange.html
[modify] https://crrev.com/99435bd5b9707422116b5aa06e4fc81adbeb34b7/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl
[modify] https://crrev.com/99435bd5b9707422116b5aa06e4fc81adbeb34b7/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl

Comment 3 by jsb...@chromium.org, Jan 10 2017

Status: Fixed (was: Started)

Sign in to add a comment