indexeddbshim / IndexedDBShim

A polyfill for IndexedDB using WebSql
Other
968 stars 191 forks source link

util.js/StringList does not match the behaviour of DOMStringList in any modern browser. #50

Closed Psithief closed 11 years ago

Psithief commented 11 years ago

The numeric indices should be properties of the object. Both Firefox and WebKit browsers allow access to the properties with a for-length construct.

for(var i = 0;i<list.length;i++)
  console.log(list[i])

StringList needs to replicate this behaviour because it is how everyone expects it to work.

http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMStringList Attributes length of type unsigned long, readonly The number of DOMStrings in the list. The range of valid child node indices is 0 to length-1 inclusive.

.length is an attribute but not the only property, each child node should also be accessible as a property.

mikaelletang commented 11 years ago

As a side note, this prevent the shim to work with db.js: db.js tries to iterate through db.objectStoreNames to assign each dataStore as a property of the db object, and this iteration fails because db.objectStoreNames[i] returns undefined.

axemclion commented 11 years ago

Would appreciate a pull request for this. :)

gabrielmaldi commented 11 years ago

This breaks Android's 2.3 stock Browser, see: https://github.com/axemclion/IndexedDBShim/issues/73