<!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>[196770] 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/196770">196770</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-02-18 12:18:39 -0800 (Thu, 18 Feb 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Unforgeable] operations should not be writable as per Web IDL
https://bugs.webkit.org/show_bug.cgi?id=154396
&lt;rdar://problem/24721063&gt;

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

[Unforgeable] operations should not be writable as per the Web IDL specification:
http://heycam.github.io/webidl/#es-operations

They were currently non-configurable in WebKit but still writable.

No new tests, already covered by existing test.

* bindings/scripts/CodeGeneratorJS.pm:
Mark [Unforgeable] operations as ReadOnly.

* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
* bindings/scripts/test/TestObj.idl:
Add bindings test coverage for [Unforgeable].</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmldominterfacesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-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="#trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjh">trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestObjCDOMTestObjh">trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestObjCDOMTestObjmm">trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm</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="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (196769 => 196770)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-02-18 20:14:13 UTC (rev 196769)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-02-18 20:18:39 UTC (rev 196770)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2016-02-18  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        [Unforgeable] operations should not be writable as per Web IDL
+        https://bugs.webkit.org/show_bug.cgi?id=154396
+        &lt;rdar://problem/24721063&gt;
+
+        Reviewed by Ryosuke Niwa.
+
+        Rebaseline now that more checks are passing.
+
+        * web-platform-tests/html/dom/interfaces-expected.txt:
+
+2016-02-18  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Fix behavior of reflecting unsigned long IDL attributes that are limited to only non-negative numbers greater than zero
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=154398
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmldominterfacesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (196769 => 196770)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt        2016-02-18 20:14:13 UTC (rev 196769)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt        2016-02-18 20:18:39 UTC (rev 196770)
</span><span class="lines">@@ -4146,11 +4146,11 @@
</span><span class="cx"> PASS Location interface: window.location must have own property &quot;pathname&quot; 
</span><span class="cx"> PASS Location interface: window.location must have own property &quot;search&quot; 
</span><span class="cx"> PASS Location interface: window.location must have own property &quot;hash&quot; 
</span><del>-FAIL Location interface: window.location must have own property &quot;assign&quot; assert_equals: property should be writable if and only if not unforgeable expected false but got true
</del><ins>+PASS Location interface: window.location must have own property &quot;assign&quot; 
</ins><span class="cx"> PASS Location interface: calling assign(USVString) on window.location with too few arguments must throw TypeError 
</span><del>-FAIL Location interface: window.location must have own property &quot;replace&quot; assert_equals: property should be writable if and only if not unforgeable expected false but got true
</del><ins>+PASS Location interface: window.location must have own property &quot;replace&quot; 
</ins><span class="cx"> PASS Location interface: calling replace(USVString) on window.location with too few arguments must throw TypeError 
</span><del>-FAIL Location interface: window.location must have own property &quot;reload&quot; assert_equals: property should be writable if and only if not unforgeable expected false but got true
</del><ins>+PASS Location interface: window.location must have own property &quot;reload&quot; 
</ins><span class="cx"> PASS Location interface: window.location must have own property &quot;ancestorOrigins&quot; 
</span><span class="cx"> PASS PopStateEvent interface: existence and properties of interface object 
</span><span class="cx"> PASS PopStateEvent interface object length 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (196769 => 196770)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-18 20:14:13 UTC (rev 196769)
+++ trunk/Source/WebCore/ChangeLog        2016-02-18 20:18:39 UTC (rev 196770)
</span><span class="lines">@@ -1,5 +1,31 @@
</span><span class="cx"> 2016-02-18  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        [Unforgeable] operations should not be writable as per Web IDL
+        https://bugs.webkit.org/show_bug.cgi?id=154396
+        &lt;rdar://problem/24721063&gt;
+
+        Reviewed by Ryosuke Niwa.
+
+        [Unforgeable] operations should not be writable as per the Web IDL specification:
+        http://heycam.github.io/webidl/#es-operations
+
+        They were currently non-configurable in WebKit but still writable.
+
+        No new tests, already covered by existing test.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        Mark [Unforgeable] operations as ReadOnly.
+
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/ObjC/DOMTestObj.h:
+        * bindings/scripts/test/ObjC/DOMTestObj.mm:
+        * bindings/scripts/test/TestObj.idl:
+        Add bindings test coverage for [Unforgeable].
+
+2016-02-18  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Fix behavior of reflecting unsigned long IDL attributes that are limited to only non-negative numbers greater than zero
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=154398
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (196769 => 196770)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-02-18 20:14:13 UTC (rev 196769)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-02-18 20:18:39 UTC (rev 196770)
</span><span class="lines">@@ -699,7 +699,7 @@
</span><span class="cx"> 
</span><span class="cx">     # [Unforgeable] attributes should be on the instance.
</span><span class="cx">     # https://heycam.github.io/webidl/#Unforgeable
</span><del>-    return 1 if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;} || $interface-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;};
</del><ins>+    return 1 if IsUnforgeable($interface, $attribute);
</ins><span class="cx"> 
</span><span class="cx">     # It becomes hard to reason about attributes that require security checks if we push
</span><span class="cx">     # them down the prototype chain, so before we do these we'll need to carefully consider
</span><span class="lines">@@ -731,7 +731,7 @@
</span><span class="cx"> 
</span><span class="cx">     # [Unforgeable] operations should be on the instance.
</span><span class="cx">     # https://heycam.github.io/webidl/#Unforgeable
</span><del>-    return 1 if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;} || $interface-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;};
</del><ins>+    return 1 if IsUnforgeable($interface, $function);
</ins><span class="cx"> 
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -1397,8 +1397,7 @@
</span><span class="cx">         push(@$hashKeys, $name);
</span><span class="cx"> 
</span><span class="cx">         my @specials = ();
</span><del>-        push(@specials, &quot;DontDelete&quot;) if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;}
-            || $interface-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;};
</del><ins>+        push(@specials, &quot;DontDelete&quot;) if IsUnforgeable($interface, $attribute);
</ins><span class="cx"> 
</span><span class="cx">         # As per Web IDL specification, constructor properties on the ECMAScript global object should not be enumerable.
</span><span class="cx">         my $is_global_constructor = $attribute-&gt;signature-&gt;type =~ /Constructor$/;
</span><span class="lines">@@ -5072,14 +5071,21 @@
</span><span class="cx">     return IsDOMGlobalObject($interface) || $interface-&gt;extendedAttributes-&gt;{&quot;JSCustomNamedGetterOnPrototype&quot;} || $interface-&gt;extendedAttributes-&gt;{&quot;JSCustomDefineOwnPropertyOnPrototype&quot;};
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub IsUnforgeable
+{
+    my $interface = shift;
+    my $property = shift;
+
+    return $property-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;} || $interface-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;};
+}
+
</ins><span class="cx"> sub ComputeFunctionSpecial
</span><span class="cx"> {
</span><span class="cx">     my $interface = shift;
</span><span class="cx">     my $function = shift;
</span><span class="cx"> 
</span><span class="cx">     my @specials = ();
</span><del>-    push(@specials, &quot;DontDelete&quot;) if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;}
-       || $interface-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;};
</del><ins>+    push(@specials, (&quot;DontDelete&quot;, &quot;ReadOnly&quot;)) if IsUnforgeable($interface, $function);
</ins><span class="cx">     push(@specials, &quot;DontEnum&quot;) if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;NotEnumerable&quot;};
</span><span class="cx">     if (IsJSBuiltin($interface, $function)) {
</span><span class="cx">         push(@specials, &quot;JSC::Builtin&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp (196769 => 196770)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp        2016-02-18 20:14:13 UTC (rev 196769)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp        2016-02-18 20:18:39 UTC (rev 196770)
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx">     PROP_STRING_ATTR,
</span><span class="cx">     PROP_TEST_OBJ_ATTR,
</span><span class="cx">     PROP_LENIENT_TEST_OBJ_ATTR,
</span><ins>+    PROP_UNFORGEABLE_ATTR,
</ins><span class="cx">     PROP_XML_OBJ_ATTR,
</span><span class="cx">     PROP_CREATE,
</span><span class="cx">     PROP_REFLECTED_STRING_ATTR,
</span><span class="lines">@@ -303,6 +304,9 @@
</span><span class="cx">     case PROP_LENIENT_TEST_OBJ_ATTR:
</span><span class="cx">         g_value_set_object(value, webkit_dom_test_obj_get_lenient_test_obj_attr(self));
</span><span class="cx">         break;
</span><ins>+    case PROP_UNFORGEABLE_ATTR:
+        g_value_take_string(value, webkit_dom_test_obj_get_unforgeable_attr(self));
+        break;
</ins><span class="cx">     case PROP_XML_OBJ_ATTR:
</span><span class="cx">         g_value_set_object(value, webkit_dom_test_obj_get_xml_obj_attr(self));
</span><span class="cx">         break;
</span><span class="lines">@@ -608,6 +612,16 @@
</span><span class="cx"> 
</span><span class="cx">     g_object_class_install_property(
</span><span class="cx">         gobjectClass,
</span><ins>+        PROP_UNFORGEABLE_ATTR,
+        g_param_spec_string(
+            &quot;unforgeable-attr&quot;,
+            &quot;TestObj:unforgeable-attr&quot;,
+            &quot;read-only gchar* TestObj:unforgeable-attr&quot;,
+            &quot;&quot;,
+            WEBKIT_PARAM_READABLE));
+
+    g_object_class_install_property(
+        gobjectClass,
</ins><span class="cx">         PROP_XML_OBJ_ATTR,
</span><span class="cx">         g_param_spec_object(
</span><span class="cx">             &quot;xml-obj-attr&quot;,
</span><span class="lines">@@ -1212,6 +1226,15 @@
</span><span class="cx">     return WebKit::kit(gobjectResult.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+glong webkit_dom_test_obj_unforgeable_method(WebKitDOMTestObj* self)
+{
+    WebCore::JSMainThreadNullState state;
+    g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0);
+    WebCore::TestObj* item = WebKit::core(self);
+    glong result = item-&gt;unforgeableMethod();
+    return result;
+}
+
</ins><span class="cx"> void webkit_dom_test_obj_method_with_enum_arg(WebKitDOMTestObj* self, WebKitDOMTestEnumType* enumArg)
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><span class="lines">@@ -1844,6 +1867,15 @@
</span><span class="cx">     item-&gt;setLenientTestObjAttr(convertedValue);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+gchar* webkit_dom_test_obj_get_unforgeable_attr(WebKitDOMTestObj* self)
+{
+    WebCore::JSMainThreadNullState state;
+    g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0);
+    WebCore::TestObj* item = WebKit::core(self);
+    gchar* result = convertToUTF8String(item-&gt;unforgeableAttr());
+    return result;
+}
+
</ins><span class="cx"> WebKitDOMTestObj* webkit_dom_test_obj_get_xml_obj_attr(WebKitDOMTestObj* self)
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h (196769 => 196770)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h        2016-02-18 20:14:13 UTC (rev 196769)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h        2016-02-18 20:18:39 UTC (rev 196770)
</span><span class="lines">@@ -236,6 +236,17 @@
</span><span class="cx"> webkit_dom_test_obj_obj_method_with_args(WebKitDOMTestObj* self, glong longArg, const gchar* strArg, WebKitDOMTestObj* objArg);
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * webkit_dom_test_obj_unforgeable_method:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Returns: A #glong
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API glong
+webkit_dom_test_obj_unforgeable_method(WebKitDOMTestObj* self);
+
+/**
</ins><span class="cx">  * webkit_dom_test_obj_method_with_enum_arg:
</span><span class="cx">  * @self: A #WebKitDOMTestObj
</span><span class="cx">  * @enumArg: A #WebKitDOMTestEnumType
</span><span class="lines">@@ -892,6 +903,17 @@
</span><span class="cx"> webkit_dom_test_obj_set_lenient_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value);
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * webkit_dom_test_obj_get_unforgeable_attr:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Returns: A #gchar
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API gchar*
+webkit_dom_test_obj_get_unforgeable_attr(WebKitDOMTestObj* self);
+
+/**
</ins><span class="cx">  * webkit_dom_test_obj_get_xml_obj_attr:
</span><span class="cx">  * @self: A #WebKitDOMTestObj
</span><span class="cx">  *
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (196769 => 196770)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-02-18 20:14:13 UTC (rev 196769)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-02-18 20:18:39 UTC (rev 196770)
</span><span class="lines">@@ -97,6 +97,7 @@
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionLongMethodWithArgs(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethod(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethodWithArgs(JSC::ExecState*);
</span><ins>+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjInstanceFunctionUnforgeableMethod(JSC::ExecState*);
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithSequenceArg(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodReturningSequence(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithEnumArg(JSC::ExecState*);
</span><span class="lines">@@ -212,6 +213,7 @@
</span><span class="cx"> void setJSTestObjTestObjAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><span class="cx"> JSC::EncodedJSValue jsTestObjLenientTestObjAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> void setJSTestObjLenientTestObjAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><ins>+JSC::EncodedJSValue jsTestObjUnforgeableAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</ins><span class="cx"> JSC::EncodedJSValue jsTestObjXMLObjAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> void setJSTestObjXMLObjAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><span class="cx"> JSC::EncodedJSValue jsTestObjCreate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="lines">@@ -365,29 +367,30 @@
</span><span class="cx"> /* Hash table */
</span><span class="cx"> 
</span><span class="cx"> static const struct CompactHashIndex JSTestObjTableIndex[17] = {
</span><del>-    { 4, -1 },
</del><ins>+    { 5, -1 },
</ins><span class="cx">     { -1, -1 },
</span><ins>+    { 6, -1 },
</ins><span class="cx">     { -1, -1 },
</span><span class="cx">     { -1, -1 },
</span><span class="cx">     { -1, -1 },
</span><ins>+    { 4, -1 },
</ins><span class="cx">     { -1, -1 },
</span><del>-    { 3, -1 },
-    { -1, -1 },
-    { -1, -1 },
</del><span class="cx">     { 1, -1 },
</span><ins>+    { 2, -1 },
</ins><span class="cx">     { 0, 16 },
</span><span class="cx">     { -1, -1 },
</span><span class="cx">     { -1, -1 },
</span><span class="cx">     { -1, -1 },
</span><span class="cx">     { -1, -1 },
</span><span class="cx">     { -1, -1 },
</span><del>-    { 2, -1 },
</del><ins>+    { 3, -1 },
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> static const HashTableValue JSTestObjTableValues[] =
</span><span class="cx"> {
</span><span class="cx">     { &quot;TestSubObjEnabledBySetting&quot;, DontEnum, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjTestSubObjEnabledBySettingConstructor), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjTestSubObjEnabledBySettingConstructor) } },
</span><ins>+    { &quot;unforgeableAttr&quot;, DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjUnforgeableAttr), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(0) } },
</ins><span class="cx"> #if ENABLE(Condition1)
</span><span class="cx">     { &quot;conditionalAttr4&quot;, DontEnum, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjConditionalAttr4Constructor), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjConditionalAttr4Constructor) } },
</span><span class="cx"> #else
</span><span class="lines">@@ -404,9 +407,10 @@
</span><span class="cx">     { 0, 0, NoIntrinsic, { 0, 0 } },
</span><span class="cx"> #endif
</span><span class="cx">     { &quot;contentDocument&quot;, ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjContentDocument), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(0) } },
</span><ins>+    { &quot;unforgeableMethod&quot;, DontDelete | ReadOnly | JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjInstanceFunctionUnforgeableMethod), (intptr_t) (0) } },
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-static const HashTable JSTestObjTable = { 5, 15, true, JSTestObjTableValues, JSTestObjTableIndex };
</del><ins>+static const HashTable JSTestObjTable = { 7, 15, true, JSTestObjTableValues, JSTestObjTableIndex };
</ins><span class="cx"> /* Hash table for constructor */
</span><span class="cx"> 
</span><span class="cx"> static const HashTableValue JSTestObjConstructorTableValues[] =
</span><span class="lines">@@ -744,7 +748,7 @@
</span><span class="cx"> {
</span><span class="cx">     auto* thisObject = jsCast&lt;JSTestObj*&gt;(object);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
</span><del>-    if (getStaticValueSlot&lt;JSTestObj, Base&gt;(state, JSTestObjTable, thisObject, propertyName, slot))
</del><ins>+    if (getStaticPropertySlot&lt;JSTestObj, Base&gt;(state, JSTestObjTable, thisObject, propertyName, slot))
</ins><span class="cx">         return true;
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="lines">@@ -1008,6 +1012,21 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+EncodedJSValue jsTestObjUnforgeableAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(thisValue);
+    JSValue decodedThisValue = JSValue::decode(thisValue);
+    auto* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(decodedThisValue);
+    if (UNLIKELY(!castedThis)) {
+        return throwGetterTypeError(*state, &quot;TestObj&quot;, &quot;unforgeableAttr&quot;);
+    }
+    auto&amp; impl = castedThis-&gt;wrapped();
+    JSValue result = jsStringWithCache(state, impl.unforgeableAttr());
+    return JSValue::encode(result);
+}
+
+
</ins><span class="cx"> EncodedJSValue jsTestObjXMLObjAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(state);
</span><span class="lines">@@ -3190,6 +3209,18 @@
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+EncodedJSValue JSC_HOST_CALL jsTestObjInstanceFunctionUnforgeableMethod(ExecState* state)
+{
+    JSValue thisValue = state-&gt;thisValue();
+    auto castedThis = jsDynamicCast&lt;JSTestObj*&gt;(thisValue);
+    if (UNLIKELY(!castedThis))
+        return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;unforgeableMethod&quot;);
+    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+    auto&amp; impl = castedThis-&gt;wrapped();
+    JSValue result = jsNumber(impl.unforgeableMethod());
+    return JSValue::encode(result);
+}
+
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithSequenceArg(ExecState* state)
</span><span class="cx"> {
</span><span class="cx">     JSValue thisValue = state-&gt;thisValue();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h (196769 => 196770)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h        2016-02-18 20:14:13 UTC (rev 196769)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h        2016-02-18 20:18:39 UTC (rev 196770)
</span><span class="lines">@@ -74,6 +74,7 @@
</span><span class="cx"> @property (copy) NSString *stringAttr;
</span><span class="cx"> @property (strong) DOMTestObj *testObjAttr;
</span><span class="cx"> @property (strong) DOMTestObj *lenientTestObjAttr;
</span><ins>+@property (readonly, copy) NSString *unforgeableAttr;
</ins><span class="cx"> @property (strong) DOMTestObj *XMLObjAttr;
</span><span class="cx"> @property BOOL create;
</span><span class="cx"> @property (copy) NSString *reflectedStringAttr;
</span><span class="lines">@@ -140,6 +141,7 @@
</span><span class="cx"> - (int)longMethodWithArgs:(int)longArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg;
</span><span class="cx"> - (DOMTestObj *)objMethod;
</span><span class="cx"> - (DOMTestObj *)objMethodWithArgs:(int)longArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg;
</span><ins>+- (int)unforgeableMethod;
</ins><span class="cx"> - (void)methodWithEnumArg:(DOMTestEnumType *)enumArg;
</span><span class="cx"> - (void)methodWithOptionalEnumArgAndDefaultValue:(DOMTestEnumType *)enumArg;
</span><span class="cx"> - (DOMTestObj *)methodThatRequiresAllArgsAndThrows:(NSString *)strArg objArg:(DOMTestObj *)objArg;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestObjmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm (196769 => 196770)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm        2016-02-18 20:14:13 UTC (rev 196769)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm        2016-02-18 20:18:39 UTC (rev 196770)
</span><span class="lines">@@ -239,6 +239,12 @@
</span><span class="cx">     IMPL-&gt;setLenientTestObjAttr(core(newLenientTestObjAttr));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (NSString *)unforgeableAttr
+{
+    WebCore::JSMainThreadNullState state;
+    return IMPL-&gt;unforgeableAttr();
+}
+
</ins><span class="cx"> - (DOMTestObj *)XMLObjAttr
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><span class="lines">@@ -957,6 +963,12 @@
</span><span class="cx">     return kit(WTF::getPtr(IMPL-&gt;objMethodWithArgs(longArg, strArg, core(objArg))));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (int)unforgeableMethod
+{
+    WebCore::JSMainThreadNullState state;
+    return IMPL-&gt;unforgeableMethod();
+}
+
</ins><span class="cx"> - (void)methodWithEnumArg:(DOMTestEnumType *)enumArg
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (196769 => 196770)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-02-18 20:14:13 UTC (rev 196769)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-02-18 20:18:39 UTC (rev 196770)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx">     attribute DOMString                stringAttr;
</span><span class="cx">     attribute TestObj                  testObjAttr;
</span><span class="cx">     [LenientThis] attribute TestObj    lenientTestObjAttr;
</span><ins>+    [Unforgeable] readonly attribute DOMString unforgeableAttr;
</ins><span class="cx"> 
</span><span class="cx">     // WK_ucfirst, WK_lcfirst exceptional cases.
</span><span class="cx">     attribute TestObj                  XMLObjAttr;
</span><span class="lines">@@ -92,6 +93,7 @@
</span><span class="cx">     long    longMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
</span><span class="cx">     TestObj objMethod();
</span><span class="cx">     TestObj objMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
</span><ins>+    [Unforgeable] long unforgeableMethod();
</ins><span class="cx"> 
</span><span class="cx">     void methodWithSequenceArg(sequence&lt;ScriptProfile&gt; sequenceArg);
</span><span class="cx">     sequence&lt;ScriptProfile&gt; methodReturningSequence(long longArg);
</span></span></pre>
</div>
</div>

</body>
</html>