<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[214139] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/214139">214139</a></dd>
<dt>Author</dt> <dd>jonlee@apple.com</dd>
<dt>Date</dt> <dd>2017-03-18 13:22:18 -0700 (Sat, 18 Mar 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>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:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaesgcmencryptmalformedparametersexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-gcm-encrypt-malformed-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaesgeneratekeymalformedparametersexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-generate-key-malformed-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacgeneratekeymalformedparametersexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebCryptoAPIencrypt_decryptaes_gcmworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/encrypt_decrypt/aes_gcm.worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebCryptoAPIencrypt_decrypttest_aes_gcmexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestStandaloneDictionarycpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (214138 => 214139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-18 20:21:51 UTC (rev 214138)
+++ trunk/LayoutTests/ChangeLog        2017-03-18 20:22:18 UTC (rev 214139)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-03-18 Jon Lee <jonlee@apple.com>
+
+ Add support for ImplementedAs, Clamp, EnforceRange, TreatNullAs for dictionary members
+ https://bugs.webkit.org/show_bug.cgi?id=169731
+
+ Reviewed by Alex Christensen.
+
+ 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:
+
</ins><span class="cx"> 2017-03-18 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Allow setting the prototype of cross-origin objects, as long as they don't change
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaesgcmencryptmalformedparametersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-gcm-encrypt-malformed-parameters-expected.txt (214138 => 214139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-gcm-encrypt-malformed-parameters-expected.txt        2017-03-18 20:21:51 UTC (rev 214138)
+++ trunk/LayoutTests/crypto/subtle/aes-gcm-encrypt-malformed-parameters-expected.txt        2017-03-18 20:22:18 UTC (rev 214139)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> PASS crypto.subtle.encrypt({name: "aes-gcm", iv: asciiToUint8Array("jnOw99oOZFLIEPMrd"), tagLength: 0}, key, plainText) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
</span><del>-PASS crypto.subtle.encrypt({name: "aes-gcm", iv: asciiToUint8Array("jnOw99oOZFLIEPMrd"), tagLength: -1}, key, plainText) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
</del><ins>+PASS crypto.subtle.encrypt({name: "aes-gcm", iv: asciiToUint8Array("jnOw99oOZFLIEPMrd"), tagLength: -1}, key, plainText) rejected promise with TypeError: Value -1 is outside the range [0, 255].
</ins><span class="cx"> PASS crypto.subtle.encrypt({name: "aes-gcm", iv: asciiToUint8Array("jnOw99oOZFLIEPMrd"), tagLength: 129}, key, plainText) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
</span><span class="cx"> PASS crypto.subtle.encrypt({name: "aes-gcm", iv: asciiToUint8Array("jnOw99oOZFLIEPMrd"), tagLength: 70}, key, plainText) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaesgeneratekeymalformedparametersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/aes-generate-key-malformed-parameters-expected.txt (214138 => 214139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-generate-key-malformed-parameters-expected.txt        2017-03-18 20:21:51 UTC (rev 214138)
+++ trunk/LayoutTests/crypto/subtle/aes-generate-key-malformed-parameters-expected.txt        2017-03-18 20:22:18 UTC (rev 214139)
</span><span class="lines">@@ -9,8 +9,8 @@
</span><span class="cx"> PASS crypto.subtle.generateKey({name: "aes-cbc", length: null}, extractable, ["encrypt", "decrypt"]) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
</span><span class="cx"> PASS crypto.subtle.generateKey({name: "aes-cbc", length: undefined}, extractable, ["encrypt", "decrypt"]) rejected promise with TypeError: Member AesKeyParams.length is required and must be an instance of unsigned short.
</span><span class="cx"> PASS crypto.subtle.generateKey({name: "aes-cbc", length: Symbol()}, extractable, ["encrypt", "decrypt"]) rejected promise with TypeError: Cannot convert a symbol to a number.
</span><del>-PASS crypto.subtle.generateKey({name: "aes-cbc", length: { }}, extractable, ["encrypt", "decrypt"]) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
-PASS crypto.subtle.generateKey({name: "aes-cbc", length: "foo"}, extractable, ["encrypt", "decrypt"]) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
</del><ins>+PASS crypto.subtle.generateKey({name: "aes-cbc", length: { }}, extractable, ["encrypt", "decrypt"]) rejected promise with TypeError: Value NaN is outside the range [0, 65535].
+PASS crypto.subtle.generateKey({name: "aes-cbc", length: "foo"}, extractable, ["encrypt", "decrypt"]) rejected promise with TypeError: Value NaN is outside the range [0, 65535].
</ins><span class="cx"> PASS crypto.subtle.generateKey({name: "aes-cbc", length: 128}, extractable, ["sign"]) rejected promise with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
</span><span class="cx"> PASS crypto.subtle.generateKey({name: "aes-cbc", length: 128}, extractable, ["verify"]) rejected promise with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
</span><span class="cx"> PASS crypto.subtle.generateKey({name: "aes-cbc", length: 128}, extractable, ["deriveKey"]) rejected promise with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacgeneratekeymalformedparametersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt (214138 => 214139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt        2017-03-18 20:21:51 UTC (rev 214138)
+++ trunk/LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt        2017-03-18 20:22:18 UTC (rev 214139)
</span><span class="lines">@@ -7,8 +7,8 @@
</span><span class="cx"> PASS crypto.subtle.generateKey({name: "hmac"}, extractable, ["sign", "verify"]) rejected promise with TypeError: Member HmacKeyParams.hash is required and must be an instance of any.
</span><span class="cx"> PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: null}, extractable, ["sign", "verify"]) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
</span><span class="cx"> PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: Symbol()}, extractable, ["sign", "verify"]) rejected promise with TypeError: Cannot convert a symbol to a number.
</span><del>-PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: { }}, extractable, ["sign", "verify"]) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
-PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: "foo"}, extractable, ["sign", "verify"]) rejected promise with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
</del><ins>+PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: { }}, extractable, ["sign", "verify"]) rejected promise with TypeError: Value NaN is outside the range [0, 4294967295].
+PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1", length: "foo"}, extractable, ["sign", "verify"]) rejected promise with TypeError: Value NaN is outside the range [0, 4294967295].
</ins><span class="cx"> PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, extractable, ["encrypt"]) rejected promise with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
</span><span class="cx"> PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, extractable, ["decrypt"]) rejected promise with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
</span><span class="cx"> PASS crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, extractable, ["deriveKey"]) rejected promise with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (214138 => 214139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2017-03-18 20:21:51 UTC (rev 214138)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2017-03-18 20:22:18 UTC (rev 214139)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-03-18 Jon Lee <jonlee@apple.com>
+
+ Add support for ImplementedAs, Clamp, EnforceRange, TreatNullAs for dictionary members
+ https://bugs.webkit.org/show_bug.cgi?id=169731
+
+ Reviewed by Alex Christensen.
+
+ 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:
+
</ins><span class="cx"> 2017-03-18 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> innerText setter inserts empty text node if value starts with newline
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebCryptoAPIencrypt_decryptaes_gcmworkerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/encrypt_decrypt/aes_gcm.worker-expected.txt (214138 => 214139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/encrypt_decrypt/aes_gcm.worker-expected.txt        2017-03-18 20:21:51 UTC (rev 214138)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/encrypt_decrypt/aes_gcm.worker-expected.txt        2017-03-18 20:22:18 UTC (rev 214139)
</span><span class="lines">@@ -298,35 +298,35 @@
</span><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 72-bits
</span><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 95-bits
</span><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 129-bits
</span><del>-PASS AES-GCM 128-bit key, illegal tag length 256-bits
</del><ins>+FAIL AES-GCM 128-bit key, illegal tag length 256-bits assert_equals: Should throw an OperationError instead of Type error expected "OperationError" but got "TypeError"
</ins><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 24-bits
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 48-bits
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 72-bits
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 95-bits
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 129-bits
</span><del>-PASS AES-GCM 192-bit key, illegal tag length 256-bits
</del><ins>+FAIL AES-GCM 192-bit key, illegal tag length 256-bits assert_equals: Should throw an OperationError instead of Type error expected "OperationError" but got "TypeError"
</ins><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 24-bits
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 48-bits
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 72-bits
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 95-bits
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 129-bits
</span><del>-PASS AES-GCM 256-bit key, illegal tag length 256-bits
</del><ins>+FAIL AES-GCM 256-bit key, illegal tag length 256-bits assert_equals: Should throw an OperationError instead of Type error expected "OperationError" but got "TypeError"
</ins><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 24-bits decryption
</span><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 48-bits decryption
</span><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 72-bits decryption
</span><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 95-bits decryption
</span><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 129-bits decryption
</span><del>-PASS AES-GCM 128-bit key, illegal tag length 256-bits decryption
</del><ins>+FAIL AES-GCM 128-bit key, illegal tag length 256-bits decryption assert_equals: Should throw an OperationError instead of Type error expected "OperationError" but got "TypeError"
</ins><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 24-bits decryption
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 48-bits decryption
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 72-bits decryption
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 95-bits decryption
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 129-bits decryption
</span><del>-PASS AES-GCM 192-bit key, illegal tag length 256-bits decryption
</del><ins>+FAIL AES-GCM 192-bit key, illegal tag length 256-bits decryption assert_equals: Should throw an OperationError instead of Type error expected "OperationError" but got "TypeError"
</ins><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 24-bits decryption
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 48-bits decryption
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 72-bits decryption
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 95-bits decryption
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 129-bits decryption
</span><del>-PASS AES-GCM 256-bit key, illegal tag length 256-bits decryption
</del><ins>+FAIL AES-GCM 256-bit key, illegal tag length 256-bits decryption assert_equals: Should throw an OperationError instead of Type error expected "OperationError" but got "TypeError"
</ins><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebCryptoAPIencrypt_decrypttest_aes_gcmexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt (214138 => 214139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt        2017-03-18 20:21:51 UTC (rev 214138)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt        2017-03-18 20:22:18 UTC (rev 214139)
</span><span class="lines">@@ -300,35 +300,35 @@
</span><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 72-bits
</span><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 95-bits
</span><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 129-bits
</span><del>-PASS AES-GCM 128-bit key, illegal tag length 256-bits
</del><ins>+FAIL AES-GCM 128-bit key, illegal tag length 256-bits assert_equals: Should throw an OperationError instead of Type error expected "OperationError" but got "TypeError"
</ins><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 24-bits
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 48-bits
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 72-bits
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 95-bits
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 129-bits
</span><del>-PASS AES-GCM 192-bit key, illegal tag length 256-bits
</del><ins>+FAIL AES-GCM 192-bit key, illegal tag length 256-bits assert_equals: Should throw an OperationError instead of Type error expected "OperationError" but got "TypeError"
</ins><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 24-bits
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 48-bits
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 72-bits
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 95-bits
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 129-bits
</span><del>-PASS AES-GCM 256-bit key, illegal tag length 256-bits
</del><ins>+FAIL AES-GCM 256-bit key, illegal tag length 256-bits assert_equals: Should throw an OperationError instead of Type error expected "OperationError" but got "TypeError"
</ins><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 24-bits decryption
</span><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 48-bits decryption
</span><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 72-bits decryption
</span><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 95-bits decryption
</span><span class="cx"> PASS AES-GCM 128-bit key, illegal tag length 129-bits decryption
</span><del>-PASS AES-GCM 128-bit key, illegal tag length 256-bits decryption
</del><ins>+FAIL AES-GCM 128-bit key, illegal tag length 256-bits decryption assert_equals: Should throw an OperationError instead of Type error expected "OperationError" but got "TypeError"
</ins><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 24-bits decryption
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 48-bits decryption
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 72-bits decryption
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 95-bits decryption
</span><span class="cx"> PASS AES-GCM 192-bit key, illegal tag length 129-bits decryption
</span><del>-PASS AES-GCM 192-bit key, illegal tag length 256-bits decryption
</del><ins>+FAIL AES-GCM 192-bit key, illegal tag length 256-bits decryption assert_equals: Should throw an OperationError instead of Type error expected "OperationError" but got "TypeError"
</ins><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 24-bits decryption
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 48-bits decryption
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 72-bits decryption
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 95-bits decryption
</span><span class="cx"> PASS AES-GCM 256-bit key, illegal tag length 129-bits decryption
</span><del>-PASS AES-GCM 256-bit key, illegal tag length 256-bits decryption
</del><ins>+FAIL AES-GCM 256-bit key, illegal tag length 256-bits decryption assert_equals: Should throw an OperationError instead of Type error expected "OperationError" but got "TypeError"
</ins><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (214138 => 214139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-18 20:21:51 UTC (rev 214138)
+++ trunk/Source/WebCore/ChangeLog        2017-03-18 20:22:18 UTC (rev 214139)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2017-03-18 Jon Lee <jonlee@apple.com>
+
+ Add support for ImplementedAs, Clamp, EnforceRange, TreatNullAs for dictionary members
+ https://bugs.webkit.org/show_bug.cgi?id=169731
+
+ Reviewed by Alex Christensen.
+
+ * 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:
+
</ins><span class="cx"> 2017-03-18 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> Use initializers for Document member variables
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (214138 => 214139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2017-03-18 20:21:51 UTC (rev 214138)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2017-03-18 20:22:18 UTC (rev 214139)
</span><span class="lines">@@ -1562,6 +1562,7 @@
</span><span class="cx">
</span><span class="cx"> # 5.1. Let key be the identifier of member.
</span><span class="cx"> my $key = $member->name;
</span><ins>+ my $implementedAsKey = $member->extendedAttributes->{"ImplementedAs"} ? $member->extendedAttributes->{"ImplementedAs"} : $key;
</ins><span class="cx">
</span><span class="cx"> # 5.2. Let value be an ECMAScript value, depending on Type(V):
</span><span class="cx"> $result .= " JSValue ${key}Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, \"${key}\"));\n";
</span><span class="lines">@@ -1570,7 +1571,9 @@
</span><span class="cx">
</span><span class="cx"> # 5.3. If value is not undefined, then:
</span><span class="cx"> $result .= " if (!${key}Value.isUndefined()) {\n";
</span><del>- $result .= " result.$key = convert<${IDLType}>(state, ${key}Value);\n";
</del><ins>+
+ my ($nativeValue, $mayThrowException) = JSValueToNative($typeScope, $member, "${key}Value", $member->extendedAttributes->{Conditional}, "&state", "state");
+ $result .= " result.$implementedAsKey = $nativeValue;\n";
</ins><span class="cx"> $result .= " RETURN_IF_EXCEPTION(throwScope, { });\n";
</span><span class="cx">
</span><span class="cx"> # Value is undefined.
</span><span class="lines">@@ -1577,7 +1580,7 @@
</span><span class="cx"> # 5.4. Otherwise, if value is undefined but the dictionary member has a default value, then:
</span><span class="cx"> if (!$member->isRequired && defined $member->default) {
</span><span class="cx"> $result .= " } else\n";
</span><del>- $result .= " result.$key = " . GenerateDefaultValue($typeScope, $member, $member->type, $member->default) . ";\n";
</del><ins>+ $result .= " result.$implementedAsKey = " . GenerateDefaultValue($typeScope, $member, $member->type, $member->default) . ";\n";
</ins><span class="cx"> } elsif ($member->isRequired) {
</span><span class="cx"> # 5.5. Otherwise, if value is undefined and the dictionary member is a required dictionary member, then throw a TypeError.
</span><span class="cx"> $result .= " } else {\n";
</span><span class="lines">@@ -1611,7 +1614,7 @@
</span><span class="cx"> my @sortedMembers = sort { $a->name cmp $b->name } @{$dictionary->members};
</span><span class="cx"> foreach my $member (@sortedMembers) {
</span><span class="cx"> my $key = $member->name;
</span><del>- my $IDLType = GetIDLType($typeScope, $member->type);
</del><ins>+ my $implementedAsKey = $member->extendedAttributes->{"ImplementedAs"} ? $member->extendedAttributes->{"ImplementedAs"} : $key;
</ins><span class="cx">
</span><span class="cx"> # 1. Let key be the identifier of member.
</span><span class="cx"> # 2. If the dictionary member named key is present in V, then:
</span><span class="lines">@@ -1618,13 +1621,14 @@
</span><span class="cx"> # 1. Let idlValue be the value of member on V.
</span><span class="cx"> # 2. Let value be the result of converting idlValue to an ECMAScript value.
</span><span class="cx"> # 3. Perform ! CreateDataProperty(O, key, value).
</span><ins>+ my $IDLType = GetIDLType($typeScope, $member->type);
</ins><span class="cx"> if (!$member->isRequired && not defined $member->default) {
</span><del>- $result .= " if (!${IDLType}::isNullValue(dictionary.${key})) {\n";
- $result .= " auto ${key}Value = toJS<$IDLType>(state, globalObject, ${IDLType}::extractValueFromNullable(dictionary.${key}));\n";
</del><ins>+ $result .= " if (!${IDLType}::isNullValue(dictionary.${implementedAsKey})) {\n";
+ $result .= " auto ${key}Value = toJS<$IDLType>(state, globalObject, ${IDLType}::extractValueFromNullable(dictionary.${implementedAsKey}));\n";
</ins><span class="cx"> $result .= " result->putDirect(vm, JSC::Identifier::fromString(&vm, \"${key}\"), ${key}Value);\n";
</span><span class="cx"> $result .= " }\n";
</span><span class="cx"> } else {
</span><del>- $result .= " auto ${key}Value = toJS<$IDLType>(state, globalObject, dictionary.${key});\n";
</del><ins>+ $result .= " auto ${key}Value = toJS<$IDLType>(state, globalObject, dictionary.${implementedAsKey});\n";
</ins><span class="cx"> $result .= " result->putDirect(vm, JSC::Identifier::fromString(&vm, \"${key}\"), ${key}Value);\n";
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -5511,8 +5515,7 @@
</span><span class="cx"> sub IsValidContextForJSValueToNative
</span><span class="cx"> {
</span><span class="cx"> my $context = shift;
</span><del>-
- return ref($context) eq "IDLAttribute" || ref($context) eq "IDLArgument";
</del><ins>+ return ref($context) eq "IDLAttribute" || ref($context) eq "IDLArgument" || ref($context) eq "IDLDictionaryMember";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # Returns (convertString, mayThrowException).
</span><span class="lines">@@ -5537,7 +5540,9 @@
</span><span class="cx"> return ("$value.toString($statePointer)->toAtomicString($statePointer)", 1) if $context->extendedAttributes->{AtomicString};
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($codeGenerator->IsEnumType($type)) {
</del><ins>+ # parseEnumeration<> returns a std::optional. For dictionary members we need convert<IDLEnumeration>() which guarantee
+ # the enum, or throws a TypeError. Bypass this check for IDLDictionaryMembers.
+ if ($codeGenerator->IsEnumType($type) && ref($context) ne "IDLDictionaryMember") {
</ins><span class="cx"> return ("parseEnumeration<" . GetEnumerationClassName($type, $interface) . ">($stateReference, $value)", 1);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp (214138 => 214139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp        2017-03-18 20:21:51 UTC (rev 214138)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp        2017-03-18 20:22:18 UTC (rev 214139)
</span><span class="lines">@@ -68,13 +68,13 @@
</span><span class="cx"> result.composed = false;
</span><span class="cx"> JSValue attr2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "attr2"));
</span><span class="cx"> if (!attr2Value.isUndefined()) {
</span><del>- result.attr2 = convert<IDLDOMString>(state, attr2Value);
</del><ins>+ result.attr2 = convert<IDLDOMString>(state, attr2Value, StringConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> } else
</span><span class="cx"> result.attr2 = emptyString();
</span><span class="cx"> JSValue attr3Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "attr3"));
</span><span class="cx"> if (!attr3Value.isUndefined()) {
</span><del>- result.attr3 = convert<IDLDOMString>(state, attr3Value);
</del><ins>+ result.attr3 = convert<IDLDOMString>(state, attr3Value, StringConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> } else
</span><span class="cx"> result.attr3 = emptyString();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (214138 => 214139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2017-03-18 20:21:51 UTC (rev 214138)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2017-03-18 20:22:18 UTC (rev 214139)
</span><span class="lines">@@ -532,31 +532,43 @@
</span><span class="cx"> result.enumerationValueWithoutDefault = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueWithoutDefaultValue);
</span><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> }
</span><ins>+ JSValue fooAliasValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "fooAlias"));
+ if (!fooAliasValue.isUndefined()) {
+ result.foo = convert<IDLAny>(state, fooAliasValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ } else
+ result.foo = jsUndefined();
+ JSValue fooWithDefaultAliasValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "fooWithDefaultAlias"));
+ if (!fooWithDefaultAliasValue.isUndefined()) {
+ result.fooWithDefault = convert<IDLAny>(state, fooWithDefaultAliasValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ } else
+ result.fooWithDefault = 0;
</ins><span class="cx"> JSValue integerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "integer"));
</span><span class="cx"> if (!integerValue.isUndefined()) {
</span><del>- result.integer = convert<IDLLong>(state, integerValue);
</del><ins>+ result.integer = convert<IDLLong>(state, integerValue, IntegerConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> }
</span><span class="cx"> JSValue integerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "integerWithDefault"));
</span><span class="cx"> if (!integerWithDefaultValue.isUndefined()) {
</span><del>- result.integerWithDefault = convert<IDLLong>(state, integerWithDefaultValue);
</del><ins>+ result.integerWithDefault = convert<IDLLong>(state, integerWithDefaultValue, IntegerConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> } else
</span><span class="cx"> result.integerWithDefault = 0;
</span><span class="cx"> JSValue largeIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "largeInteger"));
</span><span class="cx"> if (!largeIntegerValue.isUndefined()) {
</span><del>- result.largeInteger = convert<IDLLongLong>(state, largeIntegerValue);
</del><ins>+ result.largeInteger = convert<IDLLongLong>(state, largeIntegerValue, IntegerConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> }
</span><span class="cx"> JSValue largeIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "largeIntegerWithDefault"));
</span><span class="cx"> if (!largeIntegerWithDefaultValue.isUndefined()) {
</span><del>- result.largeIntegerWithDefault = convert<IDLLongLong>(state, largeIntegerWithDefaultValue);
</del><ins>+ result.largeIntegerWithDefault = convert<IDLLongLong>(state, largeIntegerWithDefaultValue, IntegerConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> } else
</span><span class="cx"> result.largeIntegerWithDefault = 0;
</span><span class="cx"> JSValue nullableIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableIntegerWithDefault"));
</span><span class="cx"> if (!nullableIntegerWithDefaultValue.isUndefined()) {
</span><del>- result.nullableIntegerWithDefault = convert<IDLNullable<IDLLong>>(state, nullableIntegerWithDefaultValue);
</del><ins>+ result.nullableIntegerWithDefault = convert<IDLNullable<IDLLong>>(state, nullableIntegerWithDefaultValue, IntegerConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> } else
</span><span class="cx"> result.nullableIntegerWithDefault = std::nullopt;
</span><span class="lines">@@ -568,7 +580,7 @@
</span><span class="cx"> result.nullableNode = nullptr;
</span><span class="cx"> JSValue nullableStringWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableStringWithDefault"));
</span><span class="cx"> if (!nullableStringWithDefaultValue.isUndefined()) {
</span><del>- result.nullableStringWithDefault = convert<IDLNullable<IDLDOMString>>(state, nullableStringWithDefaultValue);
</del><ins>+ result.nullableStringWithDefault = convert<IDLNullable<IDLDOMString>>(state, nullableStringWithDefaultValue, StringConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> } else
</span><span class="cx"> result.nullableStringWithDefault = String();
</span><span class="lines">@@ -607,34 +619,39 @@
</span><span class="cx"> }
</span><span class="cx"> JSValue smallIntegerClampedValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallIntegerClamped"));
</span><span class="cx"> if (!smallIntegerClampedValue.isUndefined()) {
</span><del>- result.smallIntegerClamped = convert<IDLByte>(state, smallIntegerClampedValue);
</del><ins>+ result.smallIntegerClamped = convert<IDLByte>(state, smallIntegerClampedValue, IntegerConversionConfiguration::Clamp);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> }
</span><span class="cx"> JSValue smallIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallIntegerWithDefault"));
</span><span class="cx"> if (!smallIntegerWithDefaultValue.isUndefined()) {
</span><del>- result.smallIntegerWithDefault = convert<IDLByte>(state, smallIntegerWithDefaultValue);
</del><ins>+ result.smallIntegerWithDefault = convert<IDLByte>(state, smallIntegerWithDefaultValue, IntegerConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> }
</span><span class="cx"> JSValue smallUnsignedIntegerEnforcedRangeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerEnforcedRange"));
</span><span class="cx"> if (!smallUnsignedIntegerEnforcedRangeValue.isUndefined()) {
</span><del>- result.smallUnsignedIntegerEnforcedRange = convert<IDLOctet>(state, smallUnsignedIntegerEnforcedRangeValue);
</del><ins>+ result.smallUnsignedIntegerEnforcedRange = convert<IDLOctet>(state, smallUnsignedIntegerEnforcedRangeValue, IntegerConversionConfiguration::EnforceRange);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> }
</span><span class="cx"> JSValue smallUnsignedIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerWithDefault"));
</span><span class="cx"> if (!smallUnsignedIntegerWithDefaultValue.isUndefined()) {
</span><del>- result.smallUnsignedIntegerWithDefault = convert<IDLOctet>(state, smallUnsignedIntegerWithDefaultValue);
</del><ins>+ result.smallUnsignedIntegerWithDefault = convert<IDLOctet>(state, smallUnsignedIntegerWithDefaultValue, IntegerConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> } else
</span><span class="cx"> result.smallUnsignedIntegerWithDefault = 0;
</span><ins>+ JSValue stringTreatNullAsEmptyStringValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringTreatNullAsEmptyString"));
+ if (!stringTreatNullAsEmptyStringValue.isUndefined()) {
+ result.stringTreatNullAsEmptyString = convert<IDLDOMString>(state, stringTreatNullAsEmptyStringValue, StringConversionConfiguration::TreatNullAsEmptyString);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
</ins><span class="cx"> JSValue stringWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithDefault"));
</span><span class="cx"> if (!stringWithDefaultValue.isUndefined()) {
</span><del>- result.stringWithDefault = convert<IDLDOMString>(state, stringWithDefaultValue);
</del><ins>+ result.stringWithDefault = convert<IDLDOMString>(state, stringWithDefaultValue, StringConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> } else
</span><span class="cx"> result.stringWithDefault = ASCIILiteral("defaultString");
</span><span class="cx"> JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
</span><span class="cx"> if (!stringWithoutDefaultValue.isUndefined()) {
</span><del>- result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue);
</del><ins>+ result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue, StringConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> }
</span><span class="cx"> JSValue unionMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unionMember"));
</span><span class="lines">@@ -666,23 +683,23 @@
</span><span class="cx"> result.unrestrictedFloatWithDefault = 0;
</span><span class="cx"> JSValue unsignedIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedInteger"));
</span><span class="cx"> if (!unsignedIntegerValue.isUndefined()) {
</span><del>- result.unsignedInteger = convert<IDLUnsignedLong>(state, unsignedIntegerValue);
</del><ins>+ result.unsignedInteger = convert<IDLUnsignedLong>(state, unsignedIntegerValue, IntegerConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> }
</span><span class="cx"> JSValue unsignedIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedIntegerWithDefault"));
</span><span class="cx"> if (!unsignedIntegerWithDefaultValue.isUndefined()) {
</span><del>- result.unsignedIntegerWithDefault = convert<IDLUnsignedLong>(state, unsignedIntegerWithDefaultValue);
</del><ins>+ result.unsignedIntegerWithDefault = convert<IDLUnsignedLong>(state, unsignedIntegerWithDefaultValue, IntegerConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> } else
</span><span class="cx"> result.unsignedIntegerWithDefault = 0;
</span><span class="cx"> JSValue unsignedLargeIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedLargeInteger"));
</span><span class="cx"> if (!unsignedLargeIntegerValue.isUndefined()) {
</span><del>- result.unsignedLargeInteger = convert<IDLUnsignedLongLong>(state, unsignedLargeIntegerValue);
</del><ins>+ result.unsignedLargeInteger = convert<IDLUnsignedLongLong>(state, unsignedLargeIntegerValue, IntegerConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> }
</span><span class="cx"> JSValue unsignedLargeIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedLargeIntegerWithDefault"));
</span><span class="cx"> if (!unsignedLargeIntegerWithDefaultValue.isUndefined()) {
</span><del>- result.unsignedLargeIntegerWithDefault = convert<IDLUnsignedLongLong>(state, unsignedLargeIntegerWithDefaultValue);
</del><ins>+ result.unsignedLargeIntegerWithDefault = convert<IDLUnsignedLongLong>(state, unsignedLargeIntegerWithDefaultValue, IntegerConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> } else
</span><span class="cx"> result.unsignedLargeIntegerWithDefault = 0;
</span><span class="lines">@@ -723,6 +740,10 @@
</span><span class="cx"> auto enumerationValueWithoutDefaultValue = toJS<IDLEnumeration<TestObj::EnumType>>(state, globalObject, IDLEnumeration<TestObj::EnumType>::extractValueFromNullable(dictionary.enumerationValueWithoutDefault));
</span><span class="cx"> result->putDirect(vm, JSC::Identifier::fromString(&vm, "enumerationValueWithoutDefault"), enumerationValueWithoutDefaultValue);
</span><span class="cx"> }
</span><ins>+ auto fooAliasValue = toJS<IDLAny>(state, globalObject, dictionary.foo);
+ result->putDirect(vm, JSC::Identifier::fromString(&vm, "fooAlias"), fooAliasValue);
+ auto fooWithDefaultAliasValue = toJS<IDLAny>(state, globalObject, dictionary.fooWithDefault);
+ result->putDirect(vm, JSC::Identifier::fromString(&vm, "fooWithDefaultAlias"), fooWithDefaultAliasValue);
</ins><span class="cx"> if (!IDLLong::isNullValue(dictionary.integer)) {
</span><span class="cx"> auto integerValue = toJS<IDLLong>(state, globalObject, IDLLong::extractValueFromNullable(dictionary.integer));
</span><span class="cx"> result->putDirect(vm, JSC::Identifier::fromString(&vm, "integer"), integerValue);
</span><span class="lines">@@ -773,6 +794,10 @@
</span><span class="cx"> }
</span><span class="cx"> auto smallUnsignedIntegerWithDefaultValue = toJS<IDLOctet>(state, globalObject, dictionary.smallUnsignedIntegerWithDefault);
</span><span class="cx"> result->putDirect(vm, JSC::Identifier::fromString(&vm, "smallUnsignedIntegerWithDefault"), smallUnsignedIntegerWithDefaultValue);
</span><ins>+ if (!IDLDOMString::isNullValue(dictionary.stringTreatNullAsEmptyString)) {
+ auto stringTreatNullAsEmptyStringValue = toJS<IDLDOMString>(state, globalObject, IDLDOMString::extractValueFromNullable(dictionary.stringTreatNullAsEmptyString));
+ result->putDirect(vm, JSC::Identifier::fromString(&vm, "stringTreatNullAsEmptyString"), stringTreatNullAsEmptyStringValue);
+ }
</ins><span class="cx"> auto stringWithDefaultValue = toJS<IDLDOMString>(state, globalObject, dictionary.stringWithDefault);
</span><span class="cx"> result->putDirect(vm, JSC::Identifier::fromString(&vm, "stringWithDefault"), stringWithDefaultValue);
</span><span class="cx"> if (!IDLDOMString::isNullValue(dictionary.stringWithoutDefault)) {
</span><span class="lines">@@ -998,7 +1023,7 @@
</span><span class="cx"> TestObj::ConditionalDictionaryA result;
</span><span class="cx"> JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
</span><span class="cx"> if (!stringWithoutDefaultValue.isUndefined()) {
</span><del>- result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue);
</del><ins>+ result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue, StringConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> }
</span><span class="cx"> return result;
</span><span class="lines">@@ -1025,7 +1050,7 @@
</span><span class="cx"> TestObj::ConditionalDictionaryB result;
</span><span class="cx"> JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
</span><span class="cx"> if (!stringWithoutDefaultValue.isUndefined()) {
</span><del>- result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue);
</del><ins>+ result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue, StringConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> }
</span><span class="cx"> return result;
</span><span class="lines">@@ -1052,7 +1077,7 @@
</span><span class="cx"> TestObj::ConditionalDictionaryC result;
</span><span class="cx"> JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
</span><span class="cx"> if (!stringWithoutDefaultValue.isUndefined()) {
</span><del>- result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue);
</del><ins>+ result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue, StringConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> }
</span><span class="cx"> return result;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestStandaloneDictionarycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp (214138 => 214139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp        2017-03-18 20:21:51 UTC (rev 214138)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp        2017-03-18 20:22:18 UTC (rev 214139)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> }
</span><span class="cx"> JSValue stringMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringMember"));
</span><span class="cx"> if (!stringMemberValue.isUndefined()) {
</span><del>- result.stringMember = convert<IDLDOMString>(state, stringMemberValue);
</del><ins>+ result.stringMember = convert<IDLDOMString>(state, stringMemberValue, StringConversionConfiguration::Normal);
</ins><span class="cx"> RETURN_IF_EXCEPTION(throwScope, { });
</span><span class="cx"> }
</span><span class="cx"> return result;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (214138 => 214139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2017-03-18 20:21:51 UTC (rev 214138)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2017-03-18 20:22:18 UTC (rev 214139)
</span><span class="lines">@@ -436,7 +436,7 @@
</span><span class="cx">
</span><span class="cx"> [
</span><span class="cx"> JSGenerateToJSObject
</span><del>-]dictionary TestDictionary {
</del><ins>+] dictionary TestDictionary {
</ins><span class="cx"> TestEnumType enumerationValueWithoutDefault;
</span><span class="cx"> TestEnumType enumerationValueWithDefault = "enumValue1";
</span><span class="cx"> TestEnumType enumerationValueWithEmptyStringDefault = "";
</span><span class="lines">@@ -443,6 +443,7 @@
</span><span class="cx"> DOMString stringWithDefault = "defaultString";
</span><span class="cx"> DOMString stringWithoutDefault;
</span><span class="cx"> DOMString? nullableStringWithDefault = null;
</span><ins>+ [TreatNullAs=EmptyString] DOMString stringTreatNullAsEmptyString;
</ins><span class="cx"> boolean booleanWithDefault = false;
</span><span class="cx"> boolean booleanWithoutDefault;
</span><span class="cx"> sequence<DOMString> sequenceOfStrings;
</span><span class="lines">@@ -470,6 +471,8 @@
</span><span class="cx"> Node? nullableNode = null;
</span><span class="cx"> any anyValue;
</span><span class="cx"> any anyValueWithNullDefault = null;
</span><ins>+ [ImplementedAs=foo] any fooAlias;
+ [ImplementedAs=fooWithDefault] any fooWithDefaultAlias = 0;
</ins><span class="cx"> AnyTypedef anyTypedefValue;
</span><span class="cx"> TestDictionaryThatShouldTolerateNull dictionaryMember;
</span><span class="cx"> (long or Node) unionMember;
</span></span></pre>
</div>
</div>
</body>
</html>