Add support for ImplementedAs, Clamp, EnforceRange, TreatNullAs for dictionary members
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Mar 2017 20:22:18 +0000 (20:22 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Mar 2017 20:22:18 +0000 (20:22 +0000)
commitbee0294c3a6ca9f549ecf01cfd07af1152141cfc
tree163a97b35f86cbc54735a3d56cd806499d231b47
parentcff2f46640b60b1262df715baca6baa23c4363d6
Add support for ImplementedAs, Clamp, EnforceRange, TreatNullAs for dictionary members
https://bugs.webkit.org/show_bug.cgi?id=169731

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline tests. The results seem to show a problem in the original tests.
* web-platform-tests/WebCryptoAPI/encrypt_decrypt/aes_gcm.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt:

Source/WebCore:

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent): Create a new $implementationAsKey. Look for
ImplementedAs, and if it exists, override the value with the alias. Set the parameters of
convert<>() using JSValueToNative.
(IsValidContextForJSValueToNative): Update to include IDLDictionaryMembers.
(JSValueToNative): Bypass parseEnumeration serialization for enums if the context is an
IDLDictionaryMember. Dictionary members need convert<IDLEnumeration> which throw a TypeError
or return the enum (and utilizes parseEnumeration). parseEnumeration, in contrast, returns
an optional.

* bindings/scripts/test/TestObj.idl: Add test cases in TestDictionary.

Update test results.
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:

LayoutTests:

Rebaseline. The enhancement progressed the results of these tests.
* crypto/subtle/aes-gcm-encrypt-malformed-parameters-expected.txt:
* crypto/subtle/aes-generate-key-malformed-parameters-expected.txt:
* crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/crypto/subtle/aes-gcm-encrypt-malformed-parameters-expected.txt
LayoutTests/crypto/subtle/aes-generate-key-malformed-parameters-expected.txt
LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/encrypt_decrypt/aes_gcm.worker-expected.txt
LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp
Source/WebCore/bindings/scripts/test/TestObj.idl