This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 16513 - Use WebIDL enum for IDBDatabase.transaction's mode argument
Summary: Use WebIDL enum for IDBDatabase.transaction's mode argument
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Indexed Database API (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-25 14:02 UTC by Ms2ger
Modified: 2013-02-28 22:45 UTC (History)
6 users (show)

See Also:


Attachments

Description Ms2ger 2012-03-25 14:02:59 UTC
enum TransactionMode { "readonly", "readwrite" };
interface IDBDatabase : EventTarget {
  IDBTransaction transaction (any storeNames, optional TransactionMode mode);
};

would do it. This could also have the benefit that you can remove "The value for the mode parameter is invalid.", which doesn't actually explain when the value is invalid.
Comment 1 Jonas Sicking (Not reading bugmail) 2012-05-02 21:35:56 UTC
I don't think we can do this until ReSpec supports it. The spec as it's written now has the correct normative requirements so this is essentially a editorial issue.

Robin, are there any plans to add support for enums to ReSpec?
Comment 2 Joshua Bell 2013-02-28 22:45:15 UTC
Spec updated: https://dvcs.w3.org/hg/IndexedDB/rev/f3d40c6295ac

* TransactionMode enum declared using WebIDL, definitions of "readonly", "readwrite", "versionchange" incorporated

* IDBDatabase.transaction() and IDBDatabaseSync.transaction() updated in WebIDL to reference TransactionMode enum and prose to drop explicit references to throwing TypeError.

* IDBTransaction.mode and IDBTransactionSync.mode updated to reference TransactionMode enum