Binding generator should support key value iterable
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Feb 2016 08:31:14 +0000 (08:31 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Feb 2016 08:31:14 +0000 (08:31 +0000)
commit28aab8b5cf1944e120d36294f27e5981323d7453
tree8b8bd93801c5f47d59cd86c06fb3112b2ba2d0c6
parentd16b352200c47e88d39996b3c9980cfc63980a53
Binding generator should support key value iterable
https://bugs.webkit.org/show_bug.cgi?id=154413

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/headers/headers-basic-expected.txt:
* web-platform-tests/fetch/api/headers/headers-basic.html:

Source/WebCore:

Covered by added layout and binding tests.

iterable<key, value> in a IDL file will trigger the generation of entries, keys, values, [Symbol.iterator] and forEach methods to the prototype.
Updated FetchHeaders and FontFaceSet to use it.

IDLParser.pm parses the iterable<> and adds an iterable field in the interface containing the iterable information and objects for the five operations.
IDLParser.pm is cleaned up a bit to remove previous Iterator support, which does not seem to be supported.

CodeGeneratorJS.pm is updated to generate the code for the five operations, using JSKeyValueIterator. Set iterators are not yet supported.
Moved definition of Iterator Key and Value Type to binding generated JSXX class based on iterable<> declaration in the IDL.

Added binding test and Fetch Headers tests.

* CMakeLists.txt:
* Modules/fetch/FetchHeaders.idl:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSFetchHeadersCustom.cpp: Removed.
* bindings/js/JSFontFaceSetCustom.cpp:
(WebCore::JSFontFaceSet::ready): Removed iterable custom methods.
* bindings/js/JSKeyValueIterator.h:
(WebCore::createKeyValueIterator):
(WebCore::keyValueIteratorForEach):
* bindings/scripts/CodeGeneratorJS.pm:
(GetFunctionName):
(PrototypeFunctionCount):
(PrototypePropertyCount):
(GeneratePropertiesHashTable):
(GenerateImplementation):
(GenerateImplementationFunctionCall):
(GenerateImplementationIterableFunctions):
* bindings/scripts/IDLParser.pm:
(parseOperationOrIterator):
(parseOperationOrIteratorRest):
(parseIterableRest):
(parseOptionalIterableInterface):
(applyMemberList):
(parseSpecial): Deleted.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
(WebCore::jsTestObjPrototypeFunctionSymbolIterator):
(WebCore::jsTestObjPrototypeFunctionEntries):
(WebCore::jsTestObjPrototypeFunctionKeys):
(WebCore::jsTestObjPrototypeFunctionValues):
(WebCore::jsTestObjPrototypeFunctionForEach):
* bindings/scripts/test/TestObj.idl:
* css/FontFaceSet.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-basic-expected.txt
LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-basic.html
LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-errors-expected.txt
LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-errors.html
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/fetch/FetchHeaders.h
Source/WebCore/Modules/fetch/FetchHeaders.idl
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/JSFetchHeadersCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSFontFaceSetCustom.cpp
Source/WebCore/bindings/js/JSKeyValueIterator.h
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLParser.pm
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
Source/WebCore/bindings/scripts/test/TestObj.idl
Source/WebCore/css/FontFaceSet.cpp
Source/WebCore/css/FontFaceSet.h
Source/WebCore/css/FontFaceSet.idl