[Fetch API] Add support for iterating over Headers
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Feb 2016 17:43:05 +0000 (17:43 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Feb 2016 17:43:05 +0000 (17:43 +0000)
commit605545c8f8a52bcf339480c1cef70f4a650aaeac
treef6e5538ab7b7a49c9fe51e8e62f41284be9c68be
parent4cee8ac46032abe1051b8c9d69ff1fe9178345d6
[Fetch API] Add support for iterating over Headers
https://bugs.webkit.org/show_bug.cgi?id=153787

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Relanding.

* web-platform-tests/fetch/api/headers/headers-basic-expected.txt:
* web-platform-tests/fetch/api/headers/headers-basic.html:
* web-platform-tests/fetch/api/headers/headers-structure-expected.txt:
* web-platform-tests/fetch/api/request/request-clone.sub-expected.txt:
* web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt:
* web-platform-tests/fetch/api/resources/utils.js:
(checkRequest):
(readTextStream):

Source/WebCore:

Relanding, updating bindings/js/JSKeyValueIterator.h for Windows bots.

Covered by updated tests.
Introducing template class (JSKeyValueIterator) to support key-value iterators in DOM classes.
Using JSKeyValueIterator to implement Headers entries(), keys() and values() as custom methods.
Binding generator should be updated to generate directly these custom methods and handle iterator Symbol.

* CMakeLists.txt:
* Modules/fetch/FetchHeaders.cpp:
(WebCore::FetchHeaders::Iterator::next):
(WebCore::FetchHeaders::Iterator::Iterator):
* Modules/fetch/FetchHeaders.h:
(WebCore::FetchHeaders::createIterator):
* Modules/fetch/FetchHeaders.idl:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMBinding.h:
(WebCore::jsPair):
* bindings/js/JSFetchHeadersCustom.cpp: Added.
(WebCore::JSFetchHeaders::entries):
(WebCore::JSFetchHeaders::keys):
(WebCore::JSFetchHeaders::values):
* bindings/js/JSKeyValueIterator.h: Added.
(WebCore::JSKeyValueIteratorPrototype::create):
(WebCore::JSKeyValueIteratorPrototype::createStructure):
(WebCore::JSKeyValueIteratorPrototype::JSKeyValueIteratorPrototype):
(WebCore::createIterator):
(WebCore::DOMWrapped>::destroy):
(WebCore::DOMWrapped>::next):
(WebCore::DOMWrapped>::finishCreation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 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-structure-expected.txt
LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-clone.sub-expected.txt
LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt
LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/utils.js
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/fetch/FetchHeaders.cpp
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/JSDOMBinding.h
Source/WebCore/bindings/js/JSFetchHeadersCustom.cpp [new file with mode: 0644]
Source/WebCore/bindings/js/JSKeyValueIterator.h [new file with mode: 0644]