Microdata: itemType[index] must be undefined for out-of-range index.
authorarko@motorola.com <arko@motorola.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Aug 2012 07:00:09 +0000 (07:00 +0000)
committerarko@motorola.com <arko@motorola.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Aug 2012 07:00:09 +0000 (07:00 +0000)
commitf07a31e48c3dc21f7659269e0e7c30cb0508ca01
tree0f46d81b769148b027731892145dfb61977f73b5
parent5b3bd6f970a73f8b92d3c6c377ef13ec1b44d51f
Microdata: itemType[index] must be undefined for out-of-range index.
https://bugs.webkit.org/show_bug.cgi?id=92988

Reviewed by Kentaro Hara.

Source/WebCore:

Made changes in IndexedGetter property so that it returns undefined
for out-of-range index.
Spec: http://www.w3.org/TR/WebIDL/#idl-indexed-properties
Firefox and Opera's behavior is consistent with the spec. Both returns
undefined for out-of-range index.

Also renamed the function name collectionStringOrNullIndexedPropertyGetter and
setCollectionStringOrNullIndexedGetter to collectionStringOrUndefinedIndexedPropertyGetter
and setCollectionStringOrUndefinedIndexedGetter respectively.

Test: fast/dom/MicroData/domsettabletokenlist-attributes-out-of-range-index.html

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateImplementationIndexer):
* bindings/v8/V8Collection.h:
(WebCore::collectionStringOrUndefinedIndexedPropertyGetter):
(WebCore::setCollectionStringOrUndefinedIndexedGetter):

LayoutTests:

Added a test to verify itemType[index], itemRef[index], itemProp[index]
behavior for out-of-range index.

Rebased existing test cases for IndexedGetter property.

* fast/dom/HTMLElement/class-list-expected.txt:
* fast/dom/HTMLElement/class-list-quirks-expected.txt:
* fast/dom/HTMLElement/script-tests/class-list.js:
* fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt:
* fast/dom/HTMLOutputElement/script-tests/dom-settable-token-list.js:
* fast/dom/MicroData/domsettabletokenlist-attributes-out-of-range-index-expected.txt: Added.
* fast/dom/MicroData/domsettabletokenlist-attributes-out-of-range-index.html: Added.
* fast/dom/StyleSheet/css-medialist-item-expected.txt:
* fast/dom/StyleSheet/script-tests/css-medialist-item.js:
* storage/indexeddb/database-basics-expected.txt:
* storage/indexeddb/objectstore-basics-expected.txt:
* storage/indexeddb/objectstore-basics-workers-expected.txt:
* storage/indexeddb/resources/database-basics.js:
(createObjectStore):
* storage/indexeddb/resources/objectstore-basics.js:
(checkMetadata):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124859 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLElement/class-list-expected.txt
LayoutTests/fast/dom/HTMLElement/class-list-quirks-expected.txt
LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js
LayoutTests/fast/dom/HTMLOutputElement/dom-settable-token-list-expected.txt
LayoutTests/fast/dom/HTMLOutputElement/script-tests/dom-settable-token-list.js
LayoutTests/fast/dom/MicroData/domsettabletokenlist-attributes-out-of-range-index-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/MicroData/domsettabletokenlist-attributes-out-of-range-index.html [new file with mode: 0644]
LayoutTests/fast/dom/StyleSheet/css-medialist-item-expected.txt
LayoutTests/fast/dom/StyleSheet/script-tests/css-medialist-item.js
LayoutTests/storage/indexeddb/database-basics-expected.txt
LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
LayoutTests/storage/indexeddb/objectstore-basics-workers-expected.txt
LayoutTests/storage/indexeddb/resources/database-basics.js
LayoutTests/storage/indexeddb/resources/objectstore-basics.js
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/v8/V8Collection.h