Title: [195969] trunk
Revision
195969
Author
[email protected]
Date
2016-02-01 11:42:14 -0800 (Mon, 01 Feb 2016)

Log Message

Move properties that use custom bindings to the prototype
https://bugs.webkit.org/show_bug.cgi?id=153735

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

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

Source/WebCore:

Move properties that use custom bindings to the prototype. Whether a
property's bindings code is generated or custom-written should not
impact where the property is located.

No new tests, already covered by existing tests.

* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::getOwnPropertySlot):
Add null-check for staticPropHashTable. HTMLDocument no longer has
any property on the instance so staticPropHashTable is now null.

* bindings/scripts/CodeGeneratorJS.pm:

LayoutTests:

Rebaseline / update existing tests now that properties using custom
bindings are on the prototype, as expected.

* fast/mediastream/MediaStream-video-element-expected.txt:
* fast/xmlhttprequest/xmlhttprequest-properties-prototype-expected.txt:
* inspector/model/remote-object-get-properties-expected.txt:
* js/dom/dom-attributes-on-mismatch-type-expected.txt:
* js/dom/dom-attributes-on-mismatch-type.html:
* platform/mac/inspector/model/remote-object-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (195968 => 195969)


--- trunk/LayoutTests/ChangeLog	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/LayoutTests/ChangeLog	2016-02-01 19:42:14 UTC (rev 195969)
@@ -1,3 +1,20 @@
+2016-02-01  Chris Dumez  <[email protected]>
+
+        Move properties that use custom bindings to the prototype
+        https://bugs.webkit.org/show_bug.cgi?id=153735
+
+        Reviewed by Darin Adler.
+
+        Rebaseline / update existing tests now that properties using custom
+        bindings are on the prototype, as expected.
+
+        * fast/mediastream/MediaStream-video-element-expected.txt:
+        * fast/xmlhttprequest/xmlhttprequest-properties-prototype-expected.txt:
+        * inspector/model/remote-object-get-properties-expected.txt:
+        * js/dom/dom-attributes-on-mismatch-type-expected.txt:
+        * js/dom/dom-attributes-on-mismatch-type.html:
+        * platform/mac/inspector/model/remote-object-expected.txt:
+
 2016-02-01  Youenn Fablet  <[email protected]>
 
         [Fetch API] Implement Fetch API Request

Modified: trunk/LayoutTests/fast/mediastream/MediaStream-video-element-expected.txt (195968 => 195969)


--- trunk/LayoutTests/fast/mediastream/MediaStream-video-element-expected.txt	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/LayoutTests/fast/mediastream/MediaStream-video-element-expected.txt	2016-02-01 19:42:14 UTC (rev 195969)
@@ -33,10 +33,10 @@
 PASS video.videoTracks[0].kind is "main"
 
 video.videoTracks[0] properties:
+  track.id = <UUID>
   track.kind = main
+  track.label = Mock video device
   track.language = 
-  track.id = <UUID>
-  track.label = Mock video device
   track.selected = true
   track.sourceBuffer = null
 
@@ -47,10 +47,10 @@
 PASS video.audioTracks[0].kind is "main"
 
 video.audioTracks[0] properties:
+  track.id = <UUID>
   track.kind = main
+  track.label = Mock audio device
   track.language = 
-  track.id = <UUID>
-  track.label = Mock audio device
   track.enabled = true
   track.sourceBuffer = null
 

Modified: trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-properties-prototype-expected.txt (195968 => 195969)


--- trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-properties-prototype-expected.txt	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-properties-prototype-expected.txt	2016-02-01 19:42:14 UTC (rev 195969)
@@ -12,16 +12,16 @@
 PASS properties.enumerable is true
 
 * response
-FAIL xhr.hasOwnProperty(propertyName) should be false. Was true.
-FAIL xhr.__proto__.hasOwnProperty(propertyName) should be true. Was false.
-FAIL properties.configurable should be true. Threw exception TypeError: undefined is not an object (evaluating 'properties.configurable')
-FAIL properties.enumerable should be true. Threw exception TypeError: undefined is not an object (evaluating 'properties.enumerable')
+PASS xhr.hasOwnProperty(propertyName) is false
+PASS xhr.__proto__.hasOwnProperty(propertyName) is true
+PASS properties.configurable is true
+PASS properties.enumerable is true
 
 * responseText
-FAIL xhr.hasOwnProperty(propertyName) should be false. Was true.
-FAIL xhr.__proto__.hasOwnProperty(propertyName) should be true. Was false.
-FAIL properties.configurable should be true. Threw exception TypeError: undefined is not an object (evaluating 'properties.configurable')
-FAIL properties.enumerable should be true. Threw exception TypeError: undefined is not an object (evaluating 'properties.enumerable')
+PASS xhr.hasOwnProperty(propertyName) is false
+PASS xhr.__proto__.hasOwnProperty(propertyName) is true
+PASS properties.configurable is true
+PASS properties.enumerable is true
 
 * responseType
 PASS xhr.hasOwnProperty(propertyName) is false

Modified: trunk/LayoutTests/http/tests/security/cross-frame-access-enumeration-expected.txt (195968 => 195969)


--- trunk/LayoutTests/http/tests/security/cross-frame-access-enumeration-expected.txt	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/LayoutTests/http/tests/security/cross-frame-access-enumeration-expected.txt	2016-02-01 19:42:14 UTC (rev 195969)
@@ -5,6 +5,7 @@
 CONSOLE MESSAGE: line 29: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
 CONSOLE MESSAGE: line 29: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
 CONSOLE MESSAGE: line 29: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 29: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
 CONSOLE MESSAGE: line 75: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
 CONSOLE MESSAGE: line 82: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
 CONSOLE MESSAGE: line 29: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (195968 => 195969)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-02-01 19:42:14 UTC (rev 195969)
@@ -1,3 +1,16 @@
+2016-02-01  Chris Dumez  <[email protected]>
+
+        Move properties that use custom bindings to the prototype
+        https://bugs.webkit.org/show_bug.cgi?id=153735
+
+        Reviewed by Darin Adler.
+
+        Rebaseline several W3C tests now that more checks are passing.
+
+        * web-platform-tests/dom/interfaces-expected.txt:
+        * web-platform-tests/html/dom/interfaces-expected.txt:
+        * web-platform-tests/XMLHttpRequest/interfaces-expected.txt:
+
 2016-02-01  Youenn Fablet  <[email protected]>
 
         [Fetch API] Implement Fetch API Request

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/interfaces-expected.txt (195968 => 195969)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/interfaces-expected.txt	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/interfaces-expected.txt	2016-02-01 19:42:14 UTC (rev 195969)
@@ -70,8 +70,8 @@
 PASS XMLHttpRequest interface: operation getAllResponseHeaders() 
 PASS XMLHttpRequest interface: operation overrideMimeType(DOMString) 
 FAIL XMLHttpRequest interface: attribute responseType assert_equals: getter must be Function expected "function" but got "undefined"
-FAIL XMLHttpRequest interface: attribute response assert_true: The prototype object must have a property "response" expected true got false
-FAIL XMLHttpRequest interface: attribute responseText assert_true: The prototype object must have a property "responseText" expected true got false
+FAIL XMLHttpRequest interface: attribute response assert_equals: getter must be Function expected "function" but got "undefined"
+FAIL XMLHttpRequest interface: attribute responseText assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL XMLHttpRequest interface: attribute responseXML assert_equals: getter must be Function expected "function" but got "undefined"
 PASS XMLHttpRequest must be primary interface of new XMLHttpRequest() 
 PASS Stringification of new XMLHttpRequest() 
@@ -103,8 +103,8 @@
 PASS XMLHttpRequest interface: new XMLHttpRequest() must inherit property "overrideMimeType" with the proper type (20) 
 PASS XMLHttpRequest interface: calling overrideMimeType(DOMString) on new XMLHttpRequest() with too few arguments must throw TypeError 
 PASS XMLHttpRequest interface: new XMLHttpRequest() must inherit property "responseType" with the proper type (21) 
-FAIL XMLHttpRequest interface: new XMLHttpRequest() must inherit property "response" with the proper type (22) assert_inherits: property "response" found on object expected in prototype chain
-FAIL XMLHttpRequest interface: new XMLHttpRequest() must inherit property "responseText" with the proper type (23) assert_inherits: property "responseText" found on object expected in prototype chain
+PASS XMLHttpRequest interface: new XMLHttpRequest() must inherit property "response" with the proper type (22) 
+PASS XMLHttpRequest interface: new XMLHttpRequest() must inherit property "responseText" with the proper type (23) 
 PASS XMLHttpRequest interface: new XMLHttpRequest() must inherit property "responseXML" with the proper type (24) 
 PASS XMLHttpRequestEventTarget interface: new XMLHttpRequest() must inherit property "onloadstart" with the proper type (0) 
 PASS XMLHttpRequestEventTarget interface: new XMLHttpRequest() must inherit property "onprogress" with the proper type (1) 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt (195968 => 195969)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt	2016-02-01 19:42:14 UTC (rev 195969)
@@ -76,11 +76,11 @@
 PASS CustomEvent interface object name 
 PASS CustomEvent interface: existence and properties of interface prototype object 
 PASS CustomEvent interface: existence and properties of interface prototype object's "constructor" property 
-FAIL CustomEvent interface: attribute detail assert_true: The prototype object must have a property "detail" expected true got false
+FAIL CustomEvent interface: attribute detail assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL CustomEvent interface: operation initCustomEvent(DOMString,boolean,boolean,any) assert_equals: property has wrong .length expected 4 but got 0
 PASS CustomEvent must be primary interface of new CustomEvent("foo") 
 PASS Stringification of new CustomEvent("foo") 
-FAIL CustomEvent interface: new CustomEvent("foo") must inherit property "detail" with the proper type (0) assert_inherits: property "detail" found on object expected in prototype chain
+PASS CustomEvent interface: new CustomEvent("foo") must inherit property "detail" with the proper type (0) 
 PASS CustomEvent interface: new CustomEvent("foo") must inherit property "initCustomEvent" with the proper type (1) 
 FAIL CustomEvent interface: calling initCustomEvent(DOMString,boolean,boolean,any) on new CustomEvent("foo") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
     [native code]

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (195968 => 195969)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-02-01 19:42:14 UTC (rev 195969)
@@ -271,7 +271,7 @@
 PASS Document interface: iframe.contentDocument must inherit property "clear" with the proper type (79) 
 PASS Document interface: iframe.contentDocument must inherit property "captureEvents" with the proper type (80) 
 PASS Document interface: iframe.contentDocument must inherit property "releaseEvents" with the proper type (81) 
-FAIL Document interface: iframe.contentDocument must inherit property "all" with the proper type (82) assert_inherits: property "all" found on object expected in prototype chain
+PASS Document interface: iframe.contentDocument must inherit property "all" with the proper type (82) 
 PASS Document interface: iframe.contentDocument must inherit property "getElementById" with the proper type (83) 
 FAIL Document interface: calling getElementById(DOMString) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
     [native code]
@@ -1942,7 +1942,7 @@
 PASS HTMLMediaElement interface: document.createElement("video") must inherit property "play" with the proper type (32) 
 PASS HTMLMediaElement interface: document.createElement("video") must inherit property "pause" with the proper type (33) 
 PASS HTMLMediaElement interface: document.createElement("video") must inherit property "mediaGroup" with the proper type (34) 
-FAIL HTMLMediaElement interface: document.createElement("video") must inherit property "controller" with the proper type (35) assert_inherits: property "controller" found on object expected in prototype chain
+PASS HTMLMediaElement interface: document.createElement("video") must inherit property "controller" with the proper type (35) 
 PASS HTMLMediaElement interface: document.createElement("video") must inherit property "controls" with the proper type (36) 
 PASS HTMLMediaElement interface: document.createElement("video") must inherit property "volume" with the proper type (37) 
 PASS HTMLMediaElement interface: document.createElement("video") must inherit property "muted" with the proper type (38) 
@@ -1998,7 +1998,7 @@
 PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "play" with the proper type (32) 
 PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "pause" with the proper type (33) 
 PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "mediaGroup" with the proper type (34) 
-FAIL HTMLMediaElement interface: document.createElement("audio") must inherit property "controller" with the proper type (35) assert_inherits: property "controller" found on object expected in prototype chain
+PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "controller" with the proper type (35) 
 PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "controls" with the proper type (36) 
 PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "volume" with the proper type (37) 
 PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "muted" with the proper type (38) 
@@ -2049,7 +2049,7 @@
 PASS HTMLMediaElement interface: new Audio() must inherit property "play" with the proper type (32) 
 PASS HTMLMediaElement interface: new Audio() must inherit property "pause" with the proper type (33) 
 PASS HTMLMediaElement interface: new Audio() must inherit property "mediaGroup" with the proper type (34) 
-FAIL HTMLMediaElement interface: new Audio() must inherit property "controller" with the proper type (35) assert_inherits: property "controller" found on object expected in prototype chain
+PASS HTMLMediaElement interface: new Audio() must inherit property "controller" with the proper type (35) 
 PASS HTMLMediaElement interface: new Audio() must inherit property "controls" with the proper type (36) 
 PASS HTMLMediaElement interface: new Audio() must inherit property "volume" with the proper type (37) 
 PASS HTMLMediaElement interface: new Audio() must inherit property "muted" with the proper type (38) 
@@ -2158,7 +2158,7 @@
 PASS HTMLMediaElement interface: operation play() 
 PASS HTMLMediaElement interface: operation pause() 
 FAIL HTMLMediaElement interface: attribute mediaGroup assert_equals: getter must be Function expected "function" but got "undefined"
-FAIL HTMLMediaElement interface: attribute controller assert_true: The prototype object must have a property "controller" expected true got false
+FAIL HTMLMediaElement interface: attribute controller assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL HTMLMediaElement interface: attribute controls assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL HTMLMediaElement interface: attribute volume assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL HTMLMediaElement interface: attribute muted assert_equals: getter must be Function expected "function" but got "undefined"
@@ -2337,9 +2337,9 @@
 PASS TextTrack interface object name 
 FAIL TextTrack interface: existence and properties of interface prototype object assert_equals: prototype of TextTrack.prototype is not EventTarget.prototype expected object "[object EventTargetPrototype]" but got object "[object Object]"
 PASS TextTrack interface: existence and properties of interface prototype object's "constructor" property 
-FAIL TextTrack interface: attribute kind assert_true: The prototype object must have a property "kind" expected true got false
+FAIL TextTrack interface: attribute kind assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL TextTrack interface: attribute label assert_equals: getter must be Function expected "function" but got "undefined"
-FAIL TextTrack interface: attribute language assert_true: The prototype object must have a property "language" expected true got false
+FAIL TextTrack interface: attribute language assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL TextTrack interface: attribute id assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL TextTrack interface: attribute inBandMetadataTrackDispatchType assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL TextTrack interface: attribute mode assert_equals: getter must be Function expected "function" but got "undefined"
@@ -2350,9 +2350,9 @@
 FAIL TextTrack interface: attribute oncuechange assert_equals: getter must be Function expected "function" but got "undefined"
 PASS TextTrack must be primary interface of document.createElement("track").track 
 PASS Stringification of document.createElement("track").track 
-FAIL TextTrack interface: document.createElement("track").track must inherit property "kind" with the proper type (0) assert_inherits: property "kind" found on object expected in prototype chain
+PASS TextTrack interface: document.createElement("track").track must inherit property "kind" with the proper type (0) 
 PASS TextTrack interface: document.createElement("track").track must inherit property "label" with the proper type (1) 
-FAIL TextTrack interface: document.createElement("track").track must inherit property "language" with the proper type (2) assert_inherits: property "language" found on object expected in prototype chain
+PASS TextTrack interface: document.createElement("track").track must inherit property "language" with the proper type (2) 
 PASS TextTrack interface: document.createElement("track").track must inherit property "id" with the proper type (3) 
 PASS TextTrack interface: document.createElement("track").track must inherit property "inBandMetadataTrackDispatchType" with the proper type (4) 
 PASS TextTrack interface: document.createElement("track").track must inherit property "mode" with the proper type (5) 
@@ -2417,7 +2417,7 @@
 PASS TrackEvent interface object name 
 PASS TrackEvent interface: existence and properties of interface prototype object 
 PASS TrackEvent interface: existence and properties of interface prototype object's "constructor" property 
-FAIL TrackEvent interface: attribute track assert_true: The prototype object must have a property "track" expected true got false
+FAIL TrackEvent interface: attribute track assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL TrackEvent must be primary interface of new TrackEvent("addtrack"; {track:document.createElement("track").track}) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end a ..."
 FAIL Stringification of new TrackEvent("addtrack"; {track:document.createElement("track").track}) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end a ..."
 FAIL TrackEvent interface: new TrackEvent("addtrack"; {track:document.createElement("track").track}) must inherit property "track" with the proper type (0) assert_equals: Unexpected exception when evaluating object expected null but got object "SyntaxError: Unexpected token ';'. Expected ')' to end a ..."
@@ -2853,9 +2853,9 @@
 PASS HTMLInputElement interface: operation setCustomValidity(DOMString) 
 FAIL HTMLInputElement interface: attribute labels assert_equals: getter must be Function expected "function" but got "undefined"
 PASS HTMLInputElement interface: operation select() 
-FAIL HTMLInputElement interface: attribute selectionStart assert_true: The prototype object must have a property "selectionStart" expected true got false
-FAIL HTMLInputElement interface: attribute selectionEnd assert_true: The prototype object must have a property "selectionEnd" expected true got false
-FAIL HTMLInputElement interface: attribute selectionDirection assert_true: The prototype object must have a property "selectionDirection" expected true got false
+FAIL HTMLInputElement interface: attribute selectionStart assert_equals: getter must be Function expected "function" but got "undefined"
+FAIL HTMLInputElement interface: attribute selectionEnd assert_equals: getter must be Function expected "function" but got "undefined"
+FAIL HTMLInputElement interface: attribute selectionDirection assert_equals: getter must be Function expected "function" but got "undefined"
 PASS HTMLInputElement interface: operation setRangeText(DOMString) 
 PASS HTMLInputElement interface: operation setRangeText(DOMString,unsigned long,unsigned long,SelectionMode) 
 FAIL HTMLInputElement interface: operation setSelectionRange(unsigned long,unsigned long,DOMString) assert_equals: property has wrong .length expected 2 but got 0
@@ -2916,9 +2916,9 @@
 PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on document.createElement("input") with too few arguments must throw TypeError 
 PASS HTMLInputElement interface: document.createElement("input") must inherit property "labels" with the proper type (48) 
 PASS HTMLInputElement interface: document.createElement("input") must inherit property "select" with the proper type (49) 
-FAIL HTMLInputElement interface: document.createElement("input") must inherit property "selectionStart" with the proper type (50) assert_inherits: property "selectionStart" found on object expected in prototype chain
-FAIL HTMLInputElement interface: document.createElement("input") must inherit property "selectionEnd" with the proper type (51) assert_inherits: property "selectionEnd" found on object expected in prototype chain
-FAIL HTMLInputElement interface: document.createElement("input") must inherit property "selectionDirection" with the proper type (52) assert_inherits: property "selectionDirection" found on object expected in prototype chain
+PASS HTMLInputElement interface: document.createElement("input") must inherit property "selectionStart" with the proper type (50) 
+PASS HTMLInputElement interface: document.createElement("input") must inherit property "selectionEnd" with the proper type (51) 
+PASS HTMLInputElement interface: document.createElement("input") must inherit property "selectionDirection" with the proper type (52) 
 PASS HTMLInputElement interface: document.createElement("input") must inherit property "setRangeText" with the proper type (53) 
 PASS HTMLInputElement interface: calling setRangeText(DOMString) on document.createElement("input") with too few arguments must throw TypeError 
 PASS HTMLInputElement interface: document.createElement("input") must inherit property "setRangeText" with the proper type (54) 
@@ -3422,7 +3422,7 @@
 PASS HTMLTemplateElement interface object name 
 PASS HTMLTemplateElement interface: existence and properties of interface prototype object 
 PASS HTMLTemplateElement interface: existence and properties of interface prototype object's "constructor" property 
-FAIL HTMLTemplateElement interface: attribute content assert_true: The prototype object must have a property "content" expected true got false
+FAIL HTMLTemplateElement interface: attribute content assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL HTMLCanvasElement interface: existence and properties of interface object assert_equals: class string of HTMLCanvasElement expected "[object Function]" but got "[object HTMLCanvasElementConstructor]"
 PASS HTMLCanvasElement interface object length 
 PASS HTMLCanvasElement interface object name 
@@ -3482,8 +3482,8 @@
 FAIL CanvasRenderingContext2D interface: attribute globalAlpha assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL CanvasRenderingContext2D interface: attribute globalCompositeOperation assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL CanvasRenderingContext2D interface: attribute imageSmoothingEnabled assert_equals: getter must be Function expected "function" but got "undefined"
-FAIL CanvasRenderingContext2D interface: attribute strokeStyle assert_true: The prototype object must have a property "strokeStyle" expected true got false
-FAIL CanvasRenderingContext2D interface: attribute fillStyle assert_true: The prototype object must have a property "fillStyle" expected true got false
+FAIL CanvasRenderingContext2D interface: attribute strokeStyle assert_equals: getter must be Function expected "function" but got "undefined"
+FAIL CanvasRenderingContext2D interface: attribute fillStyle assert_equals: getter must be Function expected "function" but got "undefined"
 PASS CanvasRenderingContext2D interface: operation createLinearGradient(double,double,double,double) 
 PASS CanvasRenderingContext2D interface: operation createRadialGradient(double,double,double,double,double,double) 
 PASS CanvasRenderingContext2D interface: operation createPattern(CanvasImageSource,DOMString) 
@@ -3569,8 +3569,8 @@
 PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "globalAlpha" with the proper type (13) 
 PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "globalCompositeOperation" with the proper type (14) 
 PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "imageSmoothingEnabled" with the proper type (15) 
-FAIL CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "strokeStyle" with the proper type (16) assert_inherits: property "strokeStyle" found on object expected in prototype chain
-FAIL CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "fillStyle" with the proper type (17) assert_inherits: property "fillStyle" found on object expected in prototype chain
+FAIL CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "strokeStyle" with the proper type (16) Unrecognized type [object Object],[object Object],[object Object]
+FAIL CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "fillStyle" with the proper type (17) Unrecognized type [object Object],[object Object],[object Object]
 PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "createLinearGradient" with the proper type (18) 
 PASS CanvasRenderingContext2D interface: calling createLinearGradient(double,double,double,double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError 
 PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "createRadialGradient" with the proper type (19) 
@@ -3759,7 +3759,7 @@
 FAIL DataTransfer interface: attribute effectAllowed assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL DataTransfer interface: attribute items assert_true: The prototype object must have a property "items" expected true got false
 PASS DataTransfer interface: operation setDragImage(Element,long,long) 
-FAIL DataTransfer interface: attribute types assert_true: The prototype object must have a property "types" expected true got false
+FAIL DataTransfer interface: attribute types assert_equals: getter must be Function expected "function" but got "undefined"
 PASS DataTransfer interface: operation getData(DOMString) 
 PASS DataTransfer interface: operation setData(DOMString,DOMString) 
 PASS DataTransfer interface: operation clearData(DOMString) 
@@ -4080,7 +4080,7 @@
 PASS History interface: existence and properties of interface prototype object 
 PASS History interface: existence and properties of interface prototype object's "constructor" property 
 FAIL History interface: attribute length assert_true: The prototype object must have a property "length" expected true got false
-FAIL History interface: attribute state assert_true: The prototype object must have a property "state" expected true got false
+FAIL History interface: attribute state assert_equals: getter must be Function expected "function" but got "undefined"
 PASS History interface: operation go(long) 
 PASS History interface: operation back() 
 PASS History interface: operation forward() 
@@ -4089,7 +4089,7 @@
 PASS History must be primary interface of window.history 
 PASS Stringification of window.history 
 FAIL History interface: window.history must inherit property "length" with the proper type (0) assert_inherits: property "length" found on object expected in prototype chain
-FAIL History interface: window.history must inherit property "state" with the proper type (1) assert_inherits: property "state" found on object expected in prototype chain
+PASS History interface: window.history must inherit property "state" with the proper type (1) 
 PASS History interface: window.history must inherit property "go" with the proper type (2) 
 PASS History interface: calling go(long) on window.history with too few arguments must throw TypeError 
 PASS History interface: window.history must inherit property "back" with the proper type (3) 
@@ -4129,10 +4129,10 @@
 PASS PopStateEvent interface object name 
 PASS PopStateEvent interface: existence and properties of interface prototype object 
 PASS PopStateEvent interface: existence and properties of interface prototype object's "constructor" property 
-FAIL PopStateEvent interface: attribute state assert_true: The prototype object must have a property "state" expected true got false
+FAIL PopStateEvent interface: attribute state assert_equals: getter must be Function expected "function" but got "undefined"
 PASS PopStateEvent must be primary interface of new PopStateEvent("popstate", { data: {} }) 
 PASS Stringification of new PopStateEvent("popstate", { data: {} }) 
-FAIL PopStateEvent interface: new PopStateEvent("popstate", { data: {} }) must inherit property "state" with the proper type (0) assert_inherits: property "state" found on object expected in prototype chain
+PASS PopStateEvent interface: new PopStateEvent("popstate", { data: {} }) must inherit property "state" with the proper type (0) 
 PASS Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "type" with the proper type (0) 
 PASS Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "target" with the proper type (1) 
 PASS Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "currentTarget" with the proper type (2) 
@@ -4360,7 +4360,7 @@
 PASS MessageEvent interface object name 
 PASS MessageEvent interface: existence and properties of interface prototype object 
 PASS MessageEvent interface: existence and properties of interface prototype object's "constructor" property 
-FAIL MessageEvent interface: attribute data assert_true: The prototype object must have a property "data" expected true got false
+FAIL MessageEvent interface: attribute data assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL MessageEvent interface: attribute origin assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL MessageEvent interface: attribute lastEventId assert_equals: getter must be Function expected "function" but got "undefined"
 FAIL MessageEvent interface: attribute source assert_equals: getter must be Function expected "function" but got "undefined"

Modified: trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt (195968 => 195969)


--- trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt	2016-02-01 19:42:14 UTC (rev 195969)
@@ -37,11 +37,9 @@
 description: Event
 
 OWN PROPERTIES:
-    clipboardData
     __proto__
 
 DISPLAYABLE PROPERTIES:
-    clipboardData
     type
     target
     currentTarget
@@ -53,10 +51,10 @@
     srcElement
     returnValue
     cancelBubble
+    clipboardData
     __proto__
 
 ALL PROPERTIES:
-    clipboardData
     constructor
     type
     target
@@ -69,6 +67,7 @@
     srcElement
     returnValue
     cancelBubble
+    clipboardData
     NONE
     CAPTURING_PHASE
     AT_TARGET

Modified: trunk/LayoutTests/js/dom/dom-attributes-on-mismatch-type-expected.txt (195968 => 195969)


--- trunk/LayoutTests/js/dom/dom-attributes-on-mismatch-type-expected.txt	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/LayoutTests/js/dom/dom-attributes-on-mismatch-type-expected.txt	2016-02-01 19:42:14 UTC (rev 195969)
@@ -3,7 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS objectWithDocumentAsPrototype.all is undefined.
+PASS objectWithDocumentAsPrototype.all threw exception TypeError: The HTMLDocument.all getter can only be used on instances of HTMLDocument.
 See what happens if we put the anchor prototype on a div
 PASS testDiv instanceof HTMLAnchorElement is true
 PASS testDiv.href threw exception TypeError: The HTMLAnchorElement.href getter can only be used on instances of HTMLAnchorElement.

Modified: trunk/LayoutTests/js/dom/dom-attributes-on-mismatch-type.html (195968 => 195969)


--- trunk/LayoutTests/js/dom/dom-attributes-on-mismatch-type.html	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/LayoutTests/js/dom/dom-attributes-on-mismatch-type.html	2016-02-01 19:42:14 UTC (rev 195969)
@@ -12,7 +12,7 @@
         var testDiv = document.getElementById("testDiv");
         var testAnchor = document.getElementById("testAnchor");
         var objectWithDocumentAsPrototype = { __proto__: document };
-        shouldBeUndefined("objectWithDocumentAsPrototype.all");
+        shouldThrow("objectWithDocumentAsPrototype.all");
         debug("See what happens if we put the anchor prototype on a div");
         testDiv.__proto__ = testAnchor.__proto__;
         shouldBeTrue("testDiv instanceof HTMLAnchorElement")

Modified: trunk/LayoutTests/platform/mac/inspector/model/remote-object-expected.txt (195968 => 195969)


--- trunk/LayoutTests/platform/mac/inspector/model/remote-object-expected.txt	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/LayoutTests/platform/mac/inspector/model/remote-object-expected.txt	2016-02-01 19:42:14 UTC (rev 195969)
@@ -1596,12 +1596,6 @@
     "_properties": [
       {
         "_listeners": null,
-        "_name": "clipboardData",
-        "_type": "undefined",
-        "_value": "undefined"
-      },
-      {
-        "_listeners": null,
         "_name": "type",
         "_type": "string",
         "_value": "load"
@@ -1624,6 +1618,12 @@
         "_name": "eventPhase",
         "_type": "number",
         "_value": "2"
+      },
+      {
+        "_listeners": null,
+        "_name": "bubbles",
+        "_type": "boolean",
+        "_value": "false"
       }
     ],
     "_entries": null
@@ -1905,33 +1905,33 @@
     "_properties": [
       {
         "_listeners": null,
-        "_name": "selectionStart",
-        "_type": "number",
-        "_value": "0"
+        "_name": "accept",
+        "_type": "string",
+        "_value": ""
       },
       {
         "_listeners": null,
-        "_name": "selectionEnd",
-        "_type": "number",
-        "_value": "0"
+        "_name": "alt",
+        "_type": "string",
+        "_value": ""
       },
       {
         "_listeners": null,
-        "_name": "selectionDirection",
+        "_name": "autocomplete",
         "_type": "string",
-        "_value": "none"
+        "_value": ""
       },
       {
         "_listeners": null,
-        "_name": "accept",
-        "_type": "string",
-        "_value": ""
+        "_name": "autofocus",
+        "_type": "boolean",
+        "_value": "false"
       },
       {
         "_listeners": null,
-        "_name": "alt",
-        "_type": "string",
-        "_value": ""
+        "_name": "defaultChecked",
+        "_type": "boolean",
+        "_value": "false"
       }
     ],
     "_entries": null

Modified: trunk/Source/WebCore/ChangeLog (195968 => 195969)


--- trunk/Source/WebCore/ChangeLog	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/Source/WebCore/ChangeLog	2016-02-01 19:42:14 UTC (rev 195969)
@@ -1,3 +1,23 @@
+2016-02-01  Chris Dumez  <[email protected]>
+
+        Move properties that use custom bindings to the prototype
+        https://bugs.webkit.org/show_bug.cgi?id=153735
+
+        Reviewed by Darin Adler.
+
+        Move properties that use custom bindings to the prototype. Whether a
+        property's bindings code is generated or custom-written should not
+        impact where the property is located.
+
+        No new tests, already covered by existing tests.
+
+        * bindings/js/JSHTMLDocumentCustom.cpp:
+        (WebCore::JSHTMLDocument::getOwnPropertySlot):
+        Add null-check for staticPropHashTable. HTMLDocument no longer has
+        any property on the instance so staticPropHashTable is now null.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+
 2016-02-01  Jer Noble  <[email protected]>
 
         REGRESSION(r195770): Use-after-free in ResourceLoaderOptions::cachingPolicy

Modified: trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp (195968 => 195969)


--- trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp	2016-02-01 19:42:14 UTC (rev 195969)
@@ -71,9 +71,11 @@
         return true;
     }
 
-    if (const HashTableValue* entry = JSHTMLDocument::info()->staticPropHashTable->entry(propertyName)) {
-        slot.setCacheableCustom(thisObject, entry->attributes(), entry->propertyGetter());
-        return true;
+    if (auto* table = JSHTMLDocument::info()->staticPropHashTable) {
+        if (const HashTableValue* entry = table->entry(propertyName)) {
+            slot.setCacheableCustom(thisObject, entry->attributes(), entry->propertyGetter());
+            return true;
+        }
     }
 
     return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (195968 => 195969)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-02-01 19:42:14 UTC (rev 195969)
@@ -704,8 +704,6 @@
 
     return 1 if InterfaceRequiresAttributesOnInstance($interface);
     return 1 if $attribute->signature->type =~ /Constructor$/;
-    return 1 if HasCustomGetter($attribute->signature->extendedAttributes);
-    return 1 if HasCustomSetter($attribute->signature->extendedAttributes);
 
     # [Unforgeable] attributes should be on the instance.
     # https://heycam.github.io/webidl/#Unforgeable

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (195968 => 195969)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp	2016-02-01 19:42:14 UTC (rev 195969)
@@ -151,31 +151,6 @@
 
 typedef JSDOMConstructor<JSTestInterface> JSTestInterfaceConstructor;
 
-/* Hash table */
-
-static const struct CompactHashIndex JSTestInterfaceTableIndex[4] = {
-    { -1, -1 },
-    { 0, -1 },
-    { -1, -1 },
-    { 1, -1 },
-};
-
-
-static const HashTableValue JSTestInterfaceTableValues[] =
-{
-#if ENABLE(Condition22) || ENABLE(Condition23)
-    { "implementsStr3", DontDelete | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsStr3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceImplementsStr3) } },
-#else
-    { 0, 0, NoIntrinsic, { 0, 0 } },
-#endif
-#if ENABLE(Condition11) || ENABLE(Condition12)
-    { "supplementalStr3", DontDelete | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceSupplementalStr3) } },
-#else
-    { 0, 0, NoIntrinsic, { 0, 0 } },
-#endif
-};
-
-static const HashTable JSTestInterfaceTable = { 2, 3, true, JSTestInterfaceTableValues, JSTestInterfaceTableIndex };
 /* Hash table for constructor */
 
 static const HashTableValue JSTestInterfaceConstructorTableValues[] =
@@ -306,6 +281,11 @@
     { 0, 0, NoIntrinsic, { 0, 0 } },
 #endif
 #if ENABLE(Condition22) || ENABLE(Condition23)
+    { "implementsStr3", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsStr3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceImplementsStr3) } },
+#else
+    { 0, 0, NoIntrinsic, { 0, 0 } },
+#endif
+#if ENABLE(Condition22) || ENABLE(Condition23)
     { "implementsNode", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsNode), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceImplementsNode) } },
 #else
     { 0, 0, NoIntrinsic, { 0, 0 } },
@@ -321,6 +301,11 @@
     { 0, 0, NoIntrinsic, { 0, 0 } },
 #endif
 #if ENABLE(Condition11) || ENABLE(Condition12)
+    { "supplementalStr3", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceSupplementalStr3) } },
+#else
+    { 0, 0, NoIntrinsic, { 0, 0 } },
+#endif
+#if ENABLE(Condition11) || ENABLE(Condition12)
     { "supplementalNode", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalNode), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceSupplementalNode) } },
 #else
     { 0, 0, NoIntrinsic, { 0, 0 } },
@@ -395,7 +380,7 @@
     reifyStaticProperties(vm, JSTestInterfacePrototypeTableValues, *this);
 }
 
-const ClassInfo JSTestInterface::s_info = { "TestInterface", &Base::s_info, &JSTestInterfaceTable, CREATE_METHOD_TABLE(JSTestInterface) };
+const ClassInfo JSTestInterface::s_info = { "TestInterface", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestInterface) };
 
 JSTestInterface::JSTestInterface(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestInterface>&& impl)
     : JSDOMWrapper<TestInterface>(structure, globalObject, WTFMove(impl))
@@ -418,15 +403,6 @@
     thisObject->JSTestInterface::~JSTestInterface();
 }
 
-bool JSTestInterface::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
-{
-    auto* thisObject = jsCast<JSTestInterface*>(object);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    if (getStaticValueSlot<JSTestInterface, Base>(state, JSTestInterfaceTable, thisObject, propertyName, slot))
-        return true;
-    return false;
-}
-
 #if ENABLE(Condition22) || ENABLE(Condition23)
 EncodedJSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttr(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
 {
@@ -489,7 +465,9 @@
     UNUSED_PARAM(state);
     UNUSED_PARAM(slotBase);
     UNUSED_PARAM(thisValue);
-    auto* castedThis = jsCast<JSTestInterface*>(slotBase);
+    JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
+    if (UNLIKELY(!castedThis))
+        return throwGetterTypeError(*state, "TestInterface", "implementsStr3");
     return JSValue::encode(castedThis->implementsStr3(*state));
 }
 
@@ -573,7 +551,9 @@
     UNUSED_PARAM(state);
     UNUSED_PARAM(slotBase);
     UNUSED_PARAM(thisValue);
-    auto* castedThis = jsCast<JSTestInterface*>(slotBase);
+    JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
+    if (UNLIKELY(!castedThis))
+        return throwGetterTypeError(*state, "TestInterface", "supplementalStr3");
     return JSValue::encode(castedThis->supplementalStr3(*state));
 }
 
@@ -673,10 +653,11 @@
 {
     JSValue value = JSValue::decode(encodedValue);
     UNUSED_PARAM(baseObject);
-    UNUSED_PARAM(thisValue);
-    auto* castedThis = jsCast<JSTestInterface*>(baseObject);
-    UNUSED_PARAM(thisValue);
-    UNUSED_PARAM(state);
+    JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
+    if (UNLIKELY(!castedThis)) {
+        throwSetterTypeError(*state, "TestInterface", "implementsStr3");
+        return;
+    }
     castedThis->setImplementsStr3(*state, value);
 }
 
@@ -738,10 +719,11 @@
 {
     JSValue value = JSValue::decode(encodedValue);
     UNUSED_PARAM(baseObject);
-    UNUSED_PARAM(thisValue);
-    auto* castedThis = jsCast<JSTestInterface*>(baseObject);
-    UNUSED_PARAM(thisValue);
-    UNUSED_PARAM(state);
+    JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
+    if (UNLIKELY(!castedThis)) {
+        throwSetterTypeError(*state, "TestInterface", "supplementalStr3");
+        return;
+    }
     castedThis->setSupplementalStr3(*state, value);
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h (195968 => 195969)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h	2016-02-01 19:42:14 UTC (rev 195969)
@@ -42,7 +42,6 @@
     static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static TestInterface* toWrapped(JSC::JSValue);
-    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static void put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
     static void putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
     bool putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
@@ -78,8 +77,6 @@
 #if ENABLE(Condition11) || ENABLE(Condition12)
     JSC::JSValue supplementalMethod3(JSC::ExecState&);
 #endif
-public:
-    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
 protected:
     JSTestInterface(JSC::Structure*, JSDOMGlobalObject&, Ref<TestInterface>&&);
 

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp (195968 => 195969)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp	2016-02-01 19:42:14 UTC (rev 195969)
@@ -70,23 +70,6 @@
 
 typedef JSBuiltinConstructor<JSTestJSBuiltinConstructor> JSTestJSBuiltinConstructorConstructor;
 
-/* Hash table for constructor */
-
-static const struct CompactHashIndex JSTestJSBuiltinConstructorTableIndex[4] = {
-    { 0, -1 },
-    { -1, -1 },
-    { 1, -1 },
-    { -1, -1 },
-};
-
-
-static const HashTableValue JSTestJSBuiltinConstructorTableValues[] =
-{
-    { "testAttributeCustom", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestJSBuiltinConstructorTestAttributeCustom), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
-    { "testAttributeRWCustom", DontDelete | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestJSBuiltinConstructorTestAttributeRWCustom), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestJSBuiltinConstructorTestAttributeRWCustom) } },
-};
-
-static const HashTable JSTestJSBuiltinConstructorTable = { 2, 3, true, JSTestJSBuiltinConstructorTableValues, JSTestJSBuiltinConstructorTableIndex };
 template<> void JSTestJSBuiltinConstructorConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
 {
     putDirect(vm, vm.propertyNames->prototype, JSTestJSBuiltinConstructor::getPrototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum);
@@ -107,6 +90,8 @@
 {
     { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestJSBuiltinConstructorConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestJSBuiltinConstructorConstructor) } },
     { "testAttribute", Accessor | Builtin, NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(testJSBuiltinConstructorTestAttributeCodeGenerator), (intptr_t) (setTestJSBuiltinConstructorTestAttributeCodeGenerator) } },
+    { "testAttributeCustom", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestJSBuiltinConstructorTestAttributeCustom), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
+    { "testAttributeRWCustom", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestJSBuiltinConstructorTestAttributeRWCustom), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestJSBuiltinConstructorTestAttributeRWCustom) } },
     { "testFunction", JSC::Builtin, NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(testJSBuiltinConstructorTestFunctionCodeGenerator), (intptr_t) (0) } },
     { "testCustomFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestJSBuiltinConstructorPrototypeFunctionTestCustomFunction), (intptr_t) (0) } },
 };
@@ -119,7 +104,7 @@
     reifyStaticProperties(vm, JSTestJSBuiltinConstructorPrototypeTableValues, *this);
 }
 
-const ClassInfo JSTestJSBuiltinConstructor::s_info = { "TestJSBuiltinConstructor", &Base::s_info, &JSTestJSBuiltinConstructorTable, CREATE_METHOD_TABLE(JSTestJSBuiltinConstructor) };
+const ClassInfo JSTestJSBuiltinConstructor::s_info = { "TestJSBuiltinConstructor", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestJSBuiltinConstructor) };
 
 JSTestJSBuiltinConstructor::JSTestJSBuiltinConstructor(Structure* structure, JSDOMGlobalObject& globalObject)
     : JSDOMObject(structure, globalObject) { }
@@ -140,21 +125,14 @@
     thisObject->JSTestJSBuiltinConstructor::~JSTestJSBuiltinConstructor();
 }
 
-bool JSTestJSBuiltinConstructor::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
-{
-    auto* thisObject = jsCast<JSTestJSBuiltinConstructor*>(object);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    if (getStaticValueSlot<JSTestJSBuiltinConstructor, Base>(state, JSTestJSBuiltinConstructorTable, thisObject, propertyName, slot))
-        return true;
-    return false;
-}
-
 EncodedJSValue jsTestJSBuiltinConstructorTestAttributeCustom(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
 {
     UNUSED_PARAM(state);
     UNUSED_PARAM(slotBase);
     UNUSED_PARAM(thisValue);
-    auto* castedThis = jsCast<JSTestJSBuiltinConstructor*>(slotBase);
+    JSTestJSBuiltinConstructor* castedThis = jsDynamicCast<JSTestJSBuiltinConstructor*>(JSValue::decode(thisValue));
+    if (UNLIKELY(!castedThis))
+        return throwGetterTypeError(*state, "TestJSBuiltinConstructor", "testAttributeCustom");
     return JSValue::encode(castedThis->testAttributeCustom(*state));
 }
 
@@ -164,7 +142,9 @@
     UNUSED_PARAM(state);
     UNUSED_PARAM(slotBase);
     UNUSED_PARAM(thisValue);
-    auto* castedThis = jsCast<JSTestJSBuiltinConstructor*>(slotBase);
+    JSTestJSBuiltinConstructor* castedThis = jsDynamicCast<JSTestJSBuiltinConstructor*>(JSValue::decode(thisValue));
+    if (UNLIKELY(!castedThis))
+        return throwGetterTypeError(*state, "TestJSBuiltinConstructor", "testAttributeRWCustom");
     return JSValue::encode(castedThis->testAttributeRWCustom(*state));
 }
 
@@ -194,10 +174,11 @@
 {
     JSValue value = JSValue::decode(encodedValue);
     UNUSED_PARAM(baseObject);
-    UNUSED_PARAM(thisValue);
-    auto* castedThis = jsCast<JSTestJSBuiltinConstructor*>(baseObject);
-    UNUSED_PARAM(thisValue);
-    UNUSED_PARAM(state);
+    JSTestJSBuiltinConstructor* castedThis = jsDynamicCast<JSTestJSBuiltinConstructor*>(JSValue::decode(thisValue));
+    if (UNLIKELY(!castedThis)) {
+        throwSetterTypeError(*state, "TestJSBuiltinConstructor", "testAttributeRWCustom");
+        return;
+    }
     castedThis->setTestAttributeRWCustom(*state, value);
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h (195968 => 195969)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h	2016-02-01 19:42:14 UTC (rev 195969)
@@ -37,7 +37,6 @@
 
     static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
-    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static void destroy(JSC::JSCell*);
 
     DECLARE_INFO;
@@ -58,8 +57,6 @@
 
     // Custom functions
     JSC::JSValue testCustomFunction(JSC::ExecState&);
-public:
-    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
 protected:
     JSTestJSBuiltinConstructor(JSC::Structure*, JSDOMGlobalObject&);
 

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (195968 => 195969)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-02-01 19:05:43 UTC (rev 195968)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-02-01 19:42:14 UTC (rev 195969)
@@ -364,30 +364,29 @@
 /* Hash table */
 
 static const struct CompactHashIndex JSTestObjTableIndex[17] = {
-    { 5, -1 },
+    { 4, -1 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 4, -1 },
+    { 3, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 2, -1 },
+    { 1, -1 },
     { 0, 16 },
     { -1, -1 },
-    { 1, -1 },
     { -1, -1 },
     { -1, -1 },
     { -1, -1 },
-    { 3, -1 },
+    { -1, -1 },
+    { 2, -1 },
 };
 
 
 static const HashTableValue JSTestObjTableValues[] =
 {
     { "TestSubObjEnabledBySetting", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestSubObjEnabledBySettingConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjTestSubObjEnabledBySettingConstructor) } },
-    { "customAttr", DontDelete | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCustomAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjCustomAttr) } },
 #if ENABLE(Condition1)
     { "conditionalAttr4", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr4Constructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConditionalAttr4Constructor) } },
 #else
@@ -406,7 +405,7 @@
     { "contentDocument", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjContentDocument), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
 };
 
-static const HashTable JSTestObjTable = { 6, 15, true, JSTestObjTableValues, JSTestObjTableIndex };
+static const HashTable JSTestObjTable = { 5, 15, true, JSTestObjTableValues, JSTestObjTableIndex };
 /* Hash table for constructor */
 
 static const HashTableValue JSTestObjConstructorTableValues[] =
@@ -525,6 +524,7 @@
     { "stringAttrWithGetterException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithGetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringAttrWithGetterException) } },
     { "stringAttrWithSetterException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithSetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringAttrWithSetterException) } },
     { "strictTypeCheckingAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStrictTypeCheckingAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStrictTypeCheckingAttribute) } },
+    { "customAttr", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCustomAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjCustomAttr) } },
 #if ENABLE(Condition4)
     { "jsBuiltinAttribute", Accessor | Builtin, NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(testObjJsBuiltinAttributeCodeGenerator), (intptr_t) (setTestObjJsBuiltinAttributeCodeGenerator) } },
 #else
@@ -1284,7 +1284,9 @@
     UNUSED_PARAM(state);
     UNUSED_PARAM(slotBase);
     UNUSED_PARAM(thisValue);
-    auto* castedThis = jsCast<JSTestObj*>(slotBase);
+    JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+    if (UNLIKELY(!castedThis))
+        return throwGetterTypeError(*state, "TestObj", "customAttr");
     return JSValue::encode(castedThis->customAttr(*state));
 }
 
@@ -2416,10 +2418,11 @@
 {
     JSValue value = JSValue::decode(encodedValue);
     UNUSED_PARAM(baseObject);
-    UNUSED_PARAM(thisValue);
-    auto* castedThis = jsCast<JSTestObj*>(baseObject);
-    UNUSED_PARAM(thisValue);
-    UNUSED_PARAM(state);
+    JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+    if (UNLIKELY(!castedThis)) {
+        throwSetterTypeError(*state, "TestObj", "customAttr");
+        return;
+    }
     castedThis->setCustomAttr(*state, value);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to