Diff
Modified: trunk/LayoutTests/ChangeLog (196144 => 196145)
--- trunk/LayoutTests/ChangeLog 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/LayoutTests/ChangeLog 2016-02-04 21:36:04 UTC (rev 196145)
@@ -1,3 +1,31 @@
+2016-02-04 Chris Dumez <[email protected]>
+
+ Object.getOwnPropertyDescriptor() returns incomplete descriptor for instance properties
+ https://bugs.webkit.org/show_bug.cgi?id=153817
+
+ Reviewed by Geoffrey Garen.
+
+ Add layout test coverage for calling Object.getOwnPropertyDescriptor()
+ on instance properties (e.g. Unforgeable properties and Window properties).
+
+ * http/tests/security/cross-origin-window-property-access-expected.txt:
+ * http/tests/security/cross-origin-window-property-access.html:
+ - Fix bug causing the onload function to not find the crossOriginWindow variable.
+ - Update the case for accessing crossOriginWindow.location property as this is
+ actually expected to work as per the specification:
+ https://html.spec.whatwg.org/multipage/browsers.html#security-window
+
+ * js/dom/dom-as-prototype-assignment-exception-expected.txt:
+ * js/dom/getOwnPropertyDescriptor-expected.txt:
+ * js/dom/script-tests/dom-as-prototype-assignment-exception.js:
+ * js/getOwnPropertyDescriptor-unforgeable-attributes-expected.txt: Added.
+ * js/getOwnPropertyDescriptor-unforgeable-attributes.html: Added.
+ * js/getOwnPropertyDescriptor-window-attributes-expected.txt: Added.
+ * js/getOwnPropertyDescriptor-window-attributes.html: Added.
+ * js/instance-property-getter-other-instance-expected.txt: Added.
+ * js/instance-property-getter-other-instance.html: Added.
+ * js/resources/getOwnPropertyDescriptor.js:
+
2016-02-04 Ryan Haddad <[email protected]>
Marking imported/w3c/web-platform-tests/html/semantics/document-metadata/styling/LinkStyle.html as flaky on Mac
Modified: trunk/LayoutTests/http/tests/security/cross-origin-window-property-access-expected.txt (196144 => 196145)
--- trunk/LayoutTests/http/tests/security/cross-origin-window-property-access-expected.txt 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/LayoutTests/http/tests/security/cross-origin-window-property-access-expected.txt 2016-02-04 21:36:04 UTC (rev 196145)
@@ -4,7 +4,7 @@
PASS Object.getOwnPropertyDescriptor(window, "document").get.call(crossOriginWindow) threw exception TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(window, "document").get.call').
-PASS Object.getOwnPropertyDescriptor(window, "location").get.call(crossOriginWindow) threw exception TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(window, "location").get.call').
+PASS Object.getOwnPropertyDescriptor(window, "location").get.call(crossOriginWindow) === crossOriginWindow.location is true
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/http/tests/security/cross-origin-window-property-access.html (196144 => 196145)
--- trunk/LayoutTests/http/tests/security/cross-origin-window-property-access.html 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/LayoutTests/http/tests/security/cross-origin-window-property-access.html 2016-02-04 21:36:04 UTC (rev 196145)
@@ -12,10 +12,10 @@
function runTest()
{
- var crossOriginWindow = window.open("http://127.0.0.1:8000/security/resources/blank.html");
+ crossOriginWindow = window.open("http://127.0.0.1:8000/security/resources/blank.html");
crossOriginWindow._onload_ = function() {
shouldThrow('Object.getOwnPropertyDescriptor(window, "document").get.call(crossOriginWindow)');
- shouldThrow('Object.getOwnPropertyDescriptor(window, "location").get.call(crossOriginWindow)');
+ shouldBeTrue('Object.getOwnPropertyDescriptor(window, "location").get.call(crossOriginWindow) === crossOriginWindow.location')
finishJSTest();
}
}
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (196144 => 196145)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2016-02-04 21:36:04 UTC (rev 196145)
@@ -1,3 +1,17 @@
+2016-02-04 Chris Dumez <[email protected]>
+
+ Object.getOwnPropertyDescriptor() returns incomplete descriptor for instance properties
+ https://bugs.webkit.org/show_bug.cgi?id=153817
+
+ Reviewed by Geoffrey Garen.
+
+ Rebaseline W3C HTML test now that more checks are passing. Some checks are still
+ failing because getter.call(undefined) / getter.call() currently throws an exception
+ for Window properties but shouldn't. Global object property getters should not require
+ an explicit |this|.
+
+ * web-platform-tests/html/dom/interfaces-expected.txt:
+
2016-02-04 Youenn Fablet <[email protected]>
[Fetch API] Add support for iterating over Headers
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (196144 => 196145)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt 2016-02-04 21:36:04 UTC (rev 196145)
@@ -198,7 +198,7 @@
FAIL Document interface: iframe.contentDocument must inherit property "styleSheetSets" with the proper type (32) assert_inherits: property "styleSheetSets" not found in prototype chain
FAIL Document interface: iframe.contentDocument must inherit property "enableStyleSheetsForSet" with the proper type (33) assert_inherits: property "enableStyleSheetsForSet" not found in prototype chain
FAIL Document interface: calling enableStyleSheetsForSet(DOMString) on iframe.contentDocument with too few arguments must throw TypeError assert_inherits: property "enableStyleSheetsForSet" not found in prototype chain
-FAIL Document interface: iframe.contentDocument must have own property "location" assert_equals: getter must be Function expected "function" but got "undefined"
+PASS Document interface: iframe.contentDocument must have own property "location"
PASS Document interface: iframe.contentDocument must inherit property "domain" with the proper type (35)
PASS Document interface: iframe.contentDocument must inherit property "referrer" with the proper type (36)
PASS Document interface: iframe.contentDocument must inherit property "cookie" with the proper type (37)
@@ -513,7 +513,7 @@
FAIL Document interface: document.implementation.createDocument(null, "", null) must inherit property "styleSheetSets" with the proper type (32) assert_inherits: property "styleSheetSets" not found in prototype chain
FAIL Document interface: document.implementation.createDocument(null, "", null) must inherit property "enableStyleSheetsForSet" with the proper type (33) assert_inherits: property "enableStyleSheetsForSet" not found in prototype chain
FAIL Document interface: calling enableStyleSheetsForSet(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_inherits: property "enableStyleSheetsForSet" not found in prototype chain
-FAIL Document interface: document.implementation.createDocument(null, "", null) must have own property "location" assert_equals: getter must be Function expected "function" but got "undefined"
+PASS Document interface: document.implementation.createDocument(null, "", null) must have own property "location"
PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "domain" with the proper type (35)
PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "referrer" with the proper type (36)
PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "cookie" with the proper type (37)
@@ -3800,30 +3800,30 @@
PASS Window interface object name
FAIL Window interface: existence and properties of interface prototype object assert_equals: Class name for prototype of Window.prototype is not "WindowProperties" expected "[object WindowProperties]" but got "[object Object]"
FAIL Window interface: existence and properties of interface prototype object's "constructor" property assert_own_property: Window.prototype does not have own property "constructor" expected property "constructor" missing
-FAIL Window interface: attribute self assert_equals: "self" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute name assert_equals: "name" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute history assert_equals: "history" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute locationbar assert_equals: "locationbar" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute menubar assert_equals: "menubar" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute personalbar assert_equals: "personalbar" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute scrollbars assert_equals: "scrollbars" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute statusbar assert_equals: "statusbar" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute toolbar assert_equals: "toolbar" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute status assert_equals: "status" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute self The DOMWindow.self getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute name The DOMWindow.name getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute history The DOMWindow.history getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute locationbar The DOMWindow.locationbar getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute menubar The DOMWindow.menubar getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute personalbar The DOMWindow.personalbar getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute scrollbars The DOMWindow.scrollbars getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute statusbar The DOMWindow.statusbar getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute toolbar The DOMWindow.toolbar getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute status The DOMWindow.status getter can only be used on instances of DOMWindow
FAIL Window interface: operation close() assert_equals: property should be writable if and only if not unforgeable expected true but got false
-FAIL Window interface: attribute closed assert_equals: "closed" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute closed The DOMWindow.closed getter can only be used on instances of DOMWindow
FAIL Window interface: operation stop() desc is not an Object. (evaluating '"get" in desc')
FAIL Window interface: operation focus() assert_equals: property should be writable if and only if not unforgeable expected true but got false
FAIL Window interface: operation blur() assert_equals: property should be writable if and only if not unforgeable expected true but got false
-FAIL Window interface: attribute frames assert_equals: "frames" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute length assert_equals: "length" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute opener assert_equals: "opener" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute parent assert_equals: "parent" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute frameElement assert_equals: "frameElement" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute frames The DOMWindow.frames getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute length The DOMWindow.length getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute opener The DOMWindow.opener getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute parent The DOMWindow.parent getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute frameElement The DOMWindow.frameElement getter can only be used on instances of DOMWindow
FAIL Window interface: operation open(DOMString,DOMString,DOMString,boolean) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: attribute navigator assert_equals: "navigator" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute navigator The DOMWindow.navigator getter can only be used on instances of DOMWindow
FAIL Window interface: attribute external assert_own_property: The global object must have a property "external" expected property "external" missing
-FAIL Window interface: attribute applicationCache assert_equals: "applicationCache" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute applicationCache The DOMWindow.applicationCache getter can only be used on instances of DOMWindow
FAIL Window interface: operation alert() desc is not an Object. (evaluating '"get" in desc')
FAIL Window interface: operation confirm(DOMString) desc is not an Object. (evaluating '"get" in desc')
FAIL Window interface: operation prompt(DOMString,DOMString) desc is not an Object. (evaluating '"get" in desc')
@@ -3832,82 +3832,82 @@
FAIL Window interface: operation postMessage(any,DOMString,[object Object]) assert_equals: property should be writable if and only if not unforgeable expected true but got false
FAIL Window interface: operation captureEvents() desc is not an Object. (evaluating '"get" in desc')
FAIL Window interface: operation releaseEvents() desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: attribute onabort assert_equals: "onabort" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute onabort The DOMWindow.onabort getter can only be used on instances of DOMWindow
FAIL Window interface: attribute onautocomplete assert_own_property: The global object must have a property "onautocomplete" expected property "onautocomplete" missing
FAIL Window interface: attribute onautocompleteerror assert_own_property: The global object must have a property "onautocompleteerror" expected property "onautocompleteerror" missing
-FAIL Window interface: attribute onblur assert_equals: "onblur" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute onblur The DOMWindow.onblur getter can only be used on instances of DOMWindow
FAIL Window interface: attribute oncancel assert_own_property: The global object must have a property "oncancel" expected property "oncancel" missing
-FAIL Window interface: attribute oncanplay assert_equals: "oncanplay" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute oncanplaythrough assert_equals: "oncanplaythrough" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onchange assert_equals: "onchange" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onclick assert_equals: "onclick" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute oncanplay The DOMWindow.oncanplay getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute oncanplaythrough The DOMWindow.oncanplaythrough getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onchange The DOMWindow.onchange getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onclick The DOMWindow.onclick getter can only be used on instances of DOMWindow
FAIL Window interface: attribute onclose assert_own_property: The global object must have a property "onclose" expected property "onclose" missing
-FAIL Window interface: attribute oncontextmenu assert_equals: "oncontextmenu" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute oncontextmenu The DOMWindow.oncontextmenu getter can only be used on instances of DOMWindow
FAIL Window interface: attribute oncuechange assert_own_property: The global object must have a property "oncuechange" expected property "oncuechange" missing
-FAIL Window interface: attribute ondblclick assert_equals: "ondblclick" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute ondrag assert_equals: "ondrag" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute ondragend assert_equals: "ondragend" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute ondragenter assert_equals: "ondragenter" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute ondblclick The DOMWindow.ondblclick getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute ondrag The DOMWindow.ondrag getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute ondragend The DOMWindow.ondragend getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute ondragenter The DOMWindow.ondragenter getter can only be used on instances of DOMWindow
FAIL Window interface: attribute ondragexit assert_own_property: The global object must have a property "ondragexit" expected property "ondragexit" missing
-FAIL Window interface: attribute ondragleave assert_equals: "ondragleave" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute ondragover assert_equals: "ondragover" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute ondragstart assert_equals: "ondragstart" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute ondrop assert_equals: "ondrop" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute ondurationchange assert_equals: "ondurationchange" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onemptied assert_equals: "onemptied" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onended assert_equals: "onended" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onerror assert_equals: "onerror" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onfocus assert_equals: "onfocus" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute oninput assert_equals: "oninput" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute oninvalid assert_equals: "oninvalid" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onkeydown assert_equals: "onkeydown" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onkeypress assert_equals: "onkeypress" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onkeyup assert_equals: "onkeyup" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onload assert_equals: "onload" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onloadeddata assert_equals: "onloadeddata" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onloadedmetadata assert_equals: "onloadedmetadata" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onloadstart assert_equals: "onloadstart" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onmousedown assert_equals: "onmousedown" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onmouseenter assert_equals: "onmouseenter" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onmouseleave assert_equals: "onmouseleave" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onmousemove assert_equals: "onmousemove" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onmouseout assert_equals: "onmouseout" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onmouseover assert_equals: "onmouseover" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onmouseup assert_equals: "onmouseup" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onmousewheel assert_equals: "onmousewheel" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onpause assert_equals: "onpause" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onplay assert_equals: "onplay" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onplaying assert_equals: "onplaying" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onprogress assert_equals: "onprogress" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onratechange assert_equals: "onratechange" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onreset assert_equals: "onreset" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onresize assert_equals: "onresize" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onscroll assert_equals: "onscroll" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onseeked assert_equals: "onseeked" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onseeking assert_equals: "onseeking" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onselect assert_equals: "onselect" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute ondragleave The DOMWindow.ondragleave getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute ondragover The DOMWindow.ondragover getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute ondragstart The DOMWindow.ondragstart getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute ondrop The DOMWindow.ondrop getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute ondurationchange The DOMWindow.ondurationchange getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onemptied The DOMWindow.onemptied getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onended The DOMWindow.onended getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onerror The DOMWindow.onerror getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onfocus The DOMWindow.onfocus getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute oninput The DOMWindow.oninput getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute oninvalid The DOMWindow.oninvalid getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onkeydown The DOMWindow.onkeydown getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onkeypress The DOMWindow.onkeypress getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onkeyup The DOMWindow.onkeyup getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onload The DOMWindow.onload getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onloadeddata The DOMWindow.onloadeddata getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onloadedmetadata The DOMWindow.onloadedmetadata getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onloadstart The DOMWindow.onloadstart getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onmousedown The DOMWindow.onmousedown getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onmouseenter assert_equals: Gets on a global should not require an explicit this expected (undefined) undefined but got (object) null
+FAIL Window interface: attribute onmouseleave assert_equals: Gets on a global should not require an explicit this expected (undefined) undefined but got (object) null
+FAIL Window interface: attribute onmousemove The DOMWindow.onmousemove getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onmouseout The DOMWindow.onmouseout getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onmouseover The DOMWindow.onmouseover getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onmouseup The DOMWindow.onmouseup getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onmousewheel The DOMWindow.onmousewheel getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onpause The DOMWindow.onpause getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onplay The DOMWindow.onplay getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onplaying The DOMWindow.onplaying getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onprogress The DOMWindow.onprogress getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onratechange The DOMWindow.onratechange getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onreset The DOMWindow.onreset getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onresize The DOMWindow.onresize getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onscroll The DOMWindow.onscroll getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onseeked The DOMWindow.onseeked getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onseeking The DOMWindow.onseeking getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onselect The DOMWindow.onselect getter can only be used on instances of DOMWindow
FAIL Window interface: attribute onshow assert_own_property: The global object must have a property "onshow" expected property "onshow" missing
FAIL Window interface: attribute onsort assert_own_property: The global object must have a property "onsort" expected property "onsort" missing
-FAIL Window interface: attribute onstalled assert_equals: "onstalled" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onsubmit assert_equals: "onsubmit" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onsuspend assert_equals: "onsuspend" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute ontimeupdate assert_equals: "ontimeupdate" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute onstalled The DOMWindow.onstalled getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onsubmit The DOMWindow.onsubmit getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onsuspend The DOMWindow.onsuspend getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute ontimeupdate The DOMWindow.ontimeupdate getter can only be used on instances of DOMWindow
FAIL Window interface: attribute ontoggle assert_own_property: The global object must have a property "ontoggle" expected property "ontoggle" missing
-FAIL Window interface: attribute onvolumechange assert_equals: "onvolumechange" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onwaiting assert_equals: "onwaiting" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute onvolumechange The DOMWindow.onvolumechange getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onwaiting The DOMWindow.onwaiting getter can only be used on instances of DOMWindow
FAIL Window interface: attribute onafterprint assert_own_property: The global object must have a property "onafterprint" expected property "onafterprint" missing
FAIL Window interface: attribute onbeforeprint assert_own_property: The global object must have a property "onbeforeprint" expected property "onbeforeprint" missing
-FAIL Window interface: attribute onbeforeunload assert_equals: "onbeforeunload" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onhashchange assert_equals: "onhashchange" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute onbeforeunload The DOMWindow.onbeforeunload getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onhashchange The DOMWindow.onhashchange getter can only be used on instances of DOMWindow
FAIL Window interface: attribute onlanguagechange assert_own_property: The global object must have a property "onlanguagechange" expected property "onlanguagechange" missing
-FAIL Window interface: attribute onmessage assert_equals: "onmessage" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onoffline assert_equals: "onoffline" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute ononline assert_equals: "ononline" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onpagehide assert_equals: "onpagehide" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onpageshow assert_equals: "onpageshow" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onpopstate assert_equals: "onpopstate" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onstorage assert_equals: "onstorage" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute onunload assert_equals: "onunload" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute onmessage The DOMWindow.onmessage getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onoffline The DOMWindow.onoffline getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute ononline The DOMWindow.ononline getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onpagehide The DOMWindow.onpagehide getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onpageshow The DOMWindow.onpageshow getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onpopstate The DOMWindow.onpopstate getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onstorage The DOMWindow.onstorage getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute onunload The DOMWindow.onunload getter can only be used on instances of DOMWindow
FAIL Window interface: operation btoa(DOMString) desc is not an Object. (evaluating '"get" in desc')
FAIL Window interface: operation atob(DOMString) desc is not an Object. (evaluating '"get" in desc')
FAIL Window interface: operation setTimeout(Function,long,any) desc is not an Object. (evaluating '"get" in desc')
@@ -3917,15 +3917,15 @@
FAIL Window interface: operation setInterval(DOMString,long,any) desc is not an Object. (evaluating '"get" in desc')
FAIL Window interface: operation clearInterval(long) desc is not an Object. (evaluating '"get" in desc')
FAIL Window interface: operation createImageBitmap(ImageBitmapSource,long,long,long,long) assert_own_property: global object missing non-static operation expected property "createImageBitmap" missing
-FAIL Window interface: attribute sessionStorage assert_equals: "sessionStorage" must have a getter expected "function" but got "undefined"
-FAIL Window interface: attribute localStorage assert_equals: "localStorage" must have a getter expected "function" but got "undefined"
+FAIL Window interface: attribute sessionStorage The DOMWindow.sessionStorage getter can only be used on instances of DOMWindow
+FAIL Window interface: attribute localStorage The DOMWindow.localStorage getter can only be used on instances of DOMWindow
PASS Window must be primary interface of window
PASS Stringification of window
-FAIL Window interface: window must have own property "window" assert_false: property descriptor has value but is supposed to be accessor expected false got true
+PASS Window interface: window must have own property "window"
PASS Window interface: window must inherit property "self" with the proper type (1)
-FAIL Window interface: window must have own property "document" assert_false: property descriptor has value but is supposed to be accessor expected false got true
+PASS Window interface: window must have own property "document"
PASS Window interface: window must inherit property "name" with the proper type (3)
-FAIL Window interface: window must have own property "location" assert_equals: getter must be Function expected "function" but got "undefined"
+PASS Window interface: window must have own property "location"
PASS Window interface: window must inherit property "history" with the proper type (5)
PASS Window interface: window must inherit property "locationbar" with the proper type (6)
PASS Window interface: window must inherit property "menubar" with the proper type (7)
@@ -3941,7 +3941,7 @@
PASS Window interface: window must inherit property "blur" with the proper type (17)
PASS Window interface: window must inherit property "frames" with the proper type (18)
PASS Window interface: window must inherit property "length" with the proper type (19)
-FAIL Window interface: window must have own property "top" assert_equals: getter must be Function expected "function" but got "undefined"
+PASS Window interface: window must have own property "top"
PASS Window interface: window must inherit property "opener" with the proper type (21)
PASS Window interface: window must inherit property "parent" with the proper type (22)
PASS Window interface: window must inherit property "frameElement" with the proper type (23)
@@ -4117,21 +4117,21 @@
PASS Location interface: existence and properties of interface prototype object's "constructor" property
PASS Location must be primary interface of window.location
PASS Stringification of window.location
-FAIL Location interface: window.location must have own property "href" assert_equals: getter must be Function expected "function" but got "undefined"
-FAIL Location interface: window.location must have own property "origin" assert_equals: getter must be Function expected "function" but got "undefined"
-FAIL Location interface: window.location must have own property "protocol" assert_equals: getter must be Function expected "function" but got "undefined"
-FAIL Location interface: window.location must have own property "host" assert_equals: getter must be Function expected "function" but got "undefined"
-FAIL Location interface: window.location must have own property "hostname" assert_equals: getter must be Function expected "function" but got "undefined"
-FAIL Location interface: window.location must have own property "port" assert_equals: getter must be Function expected "function" but got "undefined"
-FAIL Location interface: window.location must have own property "pathname" assert_equals: getter must be Function expected "function" but got "undefined"
-FAIL Location interface: window.location must have own property "search" assert_equals: getter must be Function expected "function" but got "undefined"
-FAIL Location interface: window.location must have own property "hash" assert_equals: getter must be Function expected "function" but got "undefined"
+PASS Location interface: window.location must have own property "href"
+FAIL Location interface: window.location must have own property "origin" assert_equals: setter must be function for PutForwards, Replaceable, or non-readonly attributes expected "function" but got "undefined"
+PASS Location interface: window.location must have own property "protocol"
+PASS Location interface: window.location must have own property "host"
+PASS Location interface: window.location must have own property "hostname"
+PASS Location interface: window.location must have own property "port"
+PASS Location interface: window.location must have own property "pathname"
+PASS Location interface: window.location must have own property "search"
+PASS Location interface: window.location must have own property "hash"
FAIL Location interface: window.location must have own property "assign" assert_own_property: Doesn't have the unforgeable operation property expected property "assign" missing
FAIL Location interface: calling assign(USVString) on window.location with too few arguments must throw TypeError assert_own_property: expected property "assign" missing
FAIL Location interface: window.location must have own property "replace" assert_own_property: Doesn't have the unforgeable operation property expected property "replace" missing
FAIL Location interface: calling replace(USVString) on window.location with too few arguments must throw TypeError assert_own_property: expected property "replace" missing
FAIL Location interface: window.location must have own property "reload" assert_own_property: Doesn't have the unforgeable operation property expected property "reload" missing
-FAIL Location interface: window.location must have own property "ancestorOrigins" assert_equals: getter must be Function expected "function" but got "undefined"
+PASS Location interface: window.location must have own property "ancestorOrigins"
FAIL PopStateEvent interface: existence and properties of interface object assert_equals: class string of PopStateEvent expected "[object Function]" but got "[object PopStateEventConstructor]"
PASS PopStateEvent interface object length
PASS PopStateEvent interface object name
Modified: trunk/LayoutTests/js/dom/dom-as-prototype-assignment-exception-expected.txt (196144 => 196145)
--- trunk/LayoutTests/js/dom/dom-as-prototype-assignment-exception-expected.txt 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/LayoutTests/js/dom/dom-as-prototype-assignment-exception-expected.txt 2016-02-04 21:36:04 UTC (rev 196145)
@@ -5,7 +5,7 @@
PASS testObject.id threw exception TypeError: The Element.id getter can only be used on instances of Element.
PASS testObject.id="foo" threw exception TypeError: The Element.id setter can only be used on instances of Element.
-PASS testObject.length is 1
+PASS testObject.length threw exception TypeError: The HTMLCollection.length getter can only be used on instances of HTMLCollection.
PASS div.id is 'test'
PASS div.hasOwnProperty('id') is false
PASS div.__proto__.id threw exception TypeError: The Element.id getter can only be used on instances of Element.
Modified: trunk/LayoutTests/js/dom/getOwnPropertyDescriptor-expected.txt (196144 => 196145)
--- trunk/LayoutTests/js/dom/getOwnPropertyDescriptor-expected.txt 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/LayoutTests/js/dom/getOwnPropertyDescriptor-expected.txt 2016-02-04 21:36:04 UTC (rev 196145)
@@ -124,23 +124,11 @@
PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').configurable is true
-PASS Object.getOwnPropertyDescriptor(global, 'length').get is undefined
-PASS Object.getOwnPropertyDescriptor(global, 'length').set is undefined
-PASS Object.getOwnPropertyDescriptor(global, 'length').hasOwnProperty('value') is false
-PASS Object.getOwnPropertyDescriptor(global, 'length').hasOwnProperty('writable') is false
-PASS Object.getOwnPropertyDescriptor(global, 'length').enumerable is true
-PASS Object.getOwnPropertyDescriptor(global, 'length').configurable is false
PASS Object.getOwnPropertyDescriptor(global, 0).value is global[0]
PASS Object.getOwnPropertyDescriptor(global, 0).hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 0).hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 0).enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 0).configurable is false
-PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 'length').get is undefined
-PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 'length').set is undefined
-PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 'length').hasOwnProperty('value') is false
-PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 'length').hasOwnProperty('writable') is false
-PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 'length').enumerable is true
-PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 'length').configurable is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 0).value is document.getElementsByTagName('div')[0]
PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 0).hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 0).hasOwnProperty('set') is false
@@ -151,23 +139,11 @@
PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 0).hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 0).enumerable is true
PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 0).configurable is false
-PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 'length').get is undefined
-PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 'length').set is undefined
-PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 'length').hasOwnProperty('value') is false
-PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 'length').hasOwnProperty('writable') is false
-PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 'length').enumerable is true
-PASS Object.getOwnPropertyDescriptor(document.getElementsByClassName('pass'), 'length').configurable is false
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 0).value is canvasPixelArray[0]
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 0).hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 0).hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 0).enumerable is true
PASS Object.getOwnPropertyDescriptor(canvasPixelArray, 0).configurable is false
-PASS Object.getOwnPropertyDescriptor(select, 'length').get is undefined
-PASS Object.getOwnPropertyDescriptor(select, 'length').set is undefined
-PASS Object.getOwnPropertyDescriptor(select, 'length').hasOwnProperty('value') is false
-PASS Object.getOwnPropertyDescriptor(select, 'length').hasOwnProperty('writable') is false
-PASS Object.getOwnPropertyDescriptor(select, 'length').enumerable is true
-PASS Object.getOwnPropertyDescriptor(select, 'length').configurable is false
PASS Object.getOwnPropertyDescriptor(select, 0).value is select[0]
PASS Object.getOwnPropertyDescriptor(select, 0).hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(select, 0).hasOwnProperty('set') is false
Modified: trunk/LayoutTests/js/dom/script-tests/dom-as-prototype-assignment-exception.js (196144 => 196145)
--- trunk/LayoutTests/js/dom/script-tests/dom-as-prototype-assignment-exception.js 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/LayoutTests/js/dom/script-tests/dom-as-prototype-assignment-exception.js 2016-02-04 21:36:04 UTC (rev 196145)
@@ -11,7 +11,7 @@
shouldThrow('testObject.id="foo"')
testObject = {__proto__: document.getElementsByTagName("div")}
-shouldBe("testObject.length", '1')
+shouldThrow("testObject.length")
shouldBe("div.id", "'test'")
shouldBeFalse("div.hasOwnProperty('id')")
Added: trunk/LayoutTests/js/getOwnPropertyDescriptor-unforgeable-attributes-expected.txt (0 => 196145)
--- trunk/LayoutTests/js/getOwnPropertyDescriptor-unforgeable-attributes-expected.txt (rev 0)
+++ trunk/LayoutTests/js/getOwnPropertyDescriptor-unforgeable-attributes-expected.txt 2016-02-04 21:36:04 UTC (rev 196145)
@@ -0,0 +1,134 @@
+Tests that Object.getOwnPropertyDescriptor() works correctly for [Unforgeable] IDL attributes.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+* Document.location
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is an instance of Function
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The Document.location getter can only be used on instances of Document.
+PASS descriptor.get.call(document) is document.location
+
+* Location.href
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is an instance of Function
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The Location.href getter can only be used on instances of Location.
+PASS descriptor.get.call(document.location) === document.location.href is true
+
+* Location.protocol
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is an instance of Function
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The Location.protocol getter can only be used on instances of Location.
+PASS descriptor.get.call(document.location) === document.location.protocol is true
+
+* Location.host
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is an instance of Function
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The Location.host getter can only be used on instances of Location.
+PASS descriptor.get.call(document.location) === document.location.host is true
+
+* Location.hostname
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is an instance of Function
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The Location.hostname getter can only be used on instances of Location.
+PASS descriptor.get.call(document.location) === document.location.hostname is true
+
+* Location.port
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is an instance of Function
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The Location.port getter can only be used on instances of Location.
+PASS descriptor.get.call(document.location) === document.location.port is true
+
+* Location.pathname
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is an instance of Function
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The Location.pathname getter can only be used on instances of Location.
+PASS descriptor.get.call(document.location) === document.location.pathname is true
+
+* Location.search
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is an instance of Function
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The Location.search getter can only be used on instances of Location.
+PASS descriptor.get.call(document.location) === document.location.search is true
+
+* Location.hash
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is an instance of Function
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The Location.hash getter can only be used on instances of Location.
+PASS descriptor.get.call(document.location) === document.location.hash is true
+
+* Location.origin
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is undefined.
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The Location.origin getter can only be used on instances of Location.
+PASS descriptor.get.call(document.location) === document.location.origin is true
+
+* Location.ancestorOrigins
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is undefined.
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The Location.ancestorOrigins getter can only be used on instances of Location.
+
+* Window.location
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is an instance of Function
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The DOMWindow.location getter can only be used on instances of DOMWindow.
+PASS descriptor.get.call(window) === window.location is true
+
+* Window.self
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is an instance of Function
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The DOMWindow.self getter can only be used on instances of DOMWindow.
+PASS descriptor.get.call(window) === window.self is true
+
+* Window.window
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is undefined.
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The DOMWindow.window getter can only be used on instances of DOMWindow.
+PASS descriptor.get.call(window) === window.window is true
+
+* Window.top
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is undefined.
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The DOMWindow.top getter can only be used on instances of DOMWindow.
+PASS descriptor.get.call(window) === window.top is true
+
+* Window.document
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is undefined.
+PASS descriptor.enumerable is true
+PASS descriptor.configurable is false
+PASS descriptor.get.call(invalidObject) threw exception TypeError: The DOMWindow.document getter can only be used on instances of DOMWindow.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/js/getOwnPropertyDescriptor-unforgeable-attributes.html (0 => 196145)
--- trunk/LayoutTests/js/getOwnPropertyDescriptor-unforgeable-attributes.html (rev 0)
+++ trunk/LayoutTests/js/getOwnPropertyDescriptor-unforgeable-attributes.html 2016-02-04 21:36:04 UTC (rev 196145)
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<script src=""
+<script>
+description("Tests that Object.getOwnPropertyDescriptor() works correctly for [Unforgeable] IDL attributes.");
+
+function checkUnforgeablePropertyDescriptor(descriptor, readOnly)
+{
+ shouldBeType("descriptor.get", "Function");
+ if (readOnly)
+ shouldBeUndefined("descriptor.set");
+ else
+ shouldBeType("descriptor.set", "Function");
+ shouldBeTrue("descriptor.enumerable");
+ shouldBeFalse("descriptor.configurable");
+ invalidObject = { };
+ shouldThrow("descriptor.get.call(invalidObject)");
+}
+
+debug("* Document.location");
+descriptor = Object.getOwnPropertyDescriptor(document, "location");
+checkUnforgeablePropertyDescriptor(descriptor);
+shouldBe("descriptor.get.call(document)", "document.location");
+
+var locationProperties = Object.getOwnPropertyNames(document.location);
+for (var i = 0; i < locationProperties.length; i++) {
+ var propertyName = locationProperties[i];
+ descriptor = Object.getOwnPropertyDescriptor(document.location, propertyName);
+ if (descriptor.value)
+ continue;
+
+ debug("");
+ debug("* Location." + propertyName);
+ var isReadOnly = propertyName == "origin" || propertyName == "ancestorOrigins";
+ checkUnforgeablePropertyDescriptor(descriptor, isReadOnly);
+ if (propertyName != "ancestorOrigins")
+ shouldBeTrue("descriptor.get.call(document.location) === document.location." + propertyName);
+}
+
+debug("");
+debug("* Window.location");
+descriptor = Object.getOwnPropertyDescriptor(window, "location");
+checkUnforgeablePropertyDescriptor(descriptor);
+shouldBeTrue("descriptor.get.call(window) === window.location");
+
+debug("");
+debug("* Window.self");
+descriptor = Object.getOwnPropertyDescriptor(window, "self");
+checkUnforgeablePropertyDescriptor(descriptor);
+shouldBeTrue("descriptor.get.call(window) === window.self");
+
+debug("");
+debug("* Window.window");
+descriptor = Object.getOwnPropertyDescriptor(window, "window");
+checkUnforgeablePropertyDescriptor(descriptor, true);
+shouldBeTrue("descriptor.get.call(window) === window.window");
+
+debug("");
+debug("* Window.top");
+descriptor = Object.getOwnPropertyDescriptor(window, "top");
+checkUnforgeablePropertyDescriptor(descriptor, true);
+shouldBeTrue("descriptor.get.call(window) === window.top");
+
+debug("");
+debug("* Window.document");
+descriptor = Object.getOwnPropertyDescriptor(window, "document");
+checkUnforgeablePropertyDescriptor(descriptor, true);
+
+</script>
+<script src=""
Added: trunk/LayoutTests/js/getOwnPropertyDescriptor-window-attributes-expected.txt (0 => 196145)
--- trunk/LayoutTests/js/getOwnPropertyDescriptor-window-attributes-expected.txt (rev 0)
+++ trunk/LayoutTests/js/getOwnPropertyDescriptor-window-attributes-expected.txt 2016-02-04 21:36:04 UTC (rev 196145)
@@ -0,0 +1,44 @@
+Tests that Object.getOwnPropertyDescriptor() works correctly for Window properties
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+* Window.screen
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is an instance of Function
+PASS descriptor.enumerable is true
+FAIL descriptor.configurable should be true. Was false.
+PASS descriptor.get.call(nonWindowObject) threw exception TypeError: The DOMWindow.screen getter can only be used on instances of DOMWindow.
+PASS descriptor.get.call(window) === window.screen is true
+FAIL descriptor.get.call() === window.screen should be true. Threw exception TypeError: The DOMWindow.screen getter can only be used on instances of DOMWindow
+
+* Window.navigator
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is an instance of Function
+PASS descriptor.enumerable is true
+FAIL descriptor.configurable should be true. Was false.
+PASS descriptor.get.call(nonWindowObject) threw exception TypeError: The DOMWindow.navigator getter can only be used on instances of DOMWindow.
+PASS descriptor.get.call(window) === window.navigator is true
+FAIL descriptor.get.call() === window.navigator should be true. Threw exception TypeError: The DOMWindow.navigator getter can only be used on instances of DOMWindow
+
+* Window.frameElement
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is undefined.
+PASS descriptor.enumerable is true
+FAIL descriptor.configurable should be true. Was false.
+PASS descriptor.get.call(nonWindowObject) threw exception TypeError: The DOMWindow.frameElement getter can only be used on instances of DOMWindow.
+PASS descriptor.get.call(window) === window.frameElement is true
+FAIL descriptor.get.call() === window.frameElement should be true. Threw exception TypeError: The DOMWindow.frameElement getter can only be used on instances of DOMWindow
+
+* Window.name
+PASS descriptor.get is an instance of Function
+PASS descriptor.set is an instance of Function
+PASS descriptor.enumerable is true
+FAIL descriptor.configurable should be true. Was false.
+PASS descriptor.get.call(nonWindowObject) threw exception TypeError: The DOMWindow.name getter can only be used on instances of DOMWindow.
+PASS descriptor.get.call(window) === window.name is true
+FAIL descriptor.get.call() === window.name should be true. Threw exception TypeError: The DOMWindow.name getter can only be used on instances of DOMWindow
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/js/getOwnPropertyDescriptor-window-attributes.html (0 => 196145)
--- trunk/LayoutTests/js/getOwnPropertyDescriptor-window-attributes.html (rev 0)
+++ trunk/LayoutTests/js/getOwnPropertyDescriptor-window-attributes.html 2016-02-04 21:36:04 UTC (rev 196145)
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<script src=""
+<script>
+description("Tests that Object.getOwnPropertyDescriptor() works correctly for Window properties");
+
+function checkWindowPropertyDescriptor(descriptor, readOnly)
+{
+ shouldBeType("descriptor.get", "Function");
+ if (readOnly)
+ shouldBeUndefined("descriptor.set");
+ else
+ shouldBeType("descriptor.set", "Function");
+ shouldBeTrue("descriptor.enumerable");
+ shouldBeTrue("descriptor.configurable");
+ nonWindowObject = document;
+ shouldThrow("descriptor.get.call(nonWindowObject)");
+}
+
+// The properties of global objects (such as Window) need to be on the instance as per the Web IDL specification,
+// even if they are not marked as [Unforgeable].
+
+debug("* Window.screen");
+descriptor = Object.getOwnPropertyDescriptor(window, "screen");
+checkWindowPropertyDescriptor(descriptor, false);
+shouldBeTrue("descriptor.get.call(window) === window.screen");
+shouldBeTrue("descriptor.get.call() === window.screen");
+
+debug("");
+debug("* Window.navigator");
+descriptor = Object.getOwnPropertyDescriptor(window, "navigator");
+checkWindowPropertyDescriptor(descriptor, false);
+shouldBeTrue("descriptor.get.call(window) === window.navigator");
+shouldBeTrue("descriptor.get.call() === window.navigator");
+
+debug("");
+debug("* Window.frameElement");
+descriptor = Object.getOwnPropertyDescriptor(window, "frameElement");
+checkWindowPropertyDescriptor(descriptor, true);
+shouldBeTrue("descriptor.get.call(window) === window.frameElement");
+shouldBeTrue("descriptor.get.call() === window.frameElement");
+
+debug("");
+debug("* Window.name");
+descriptor = Object.getOwnPropertyDescriptor(window, "name");
+checkWindowPropertyDescriptor(descriptor, false);
+shouldBeTrue("descriptor.get.call(window) === window.name");
+shouldBeTrue("descriptor.get.call() === window.name");
+
+</script>
+<script src=""
Added: trunk/LayoutTests/js/instance-property-getter-other-instance-expected.txt (0 => 196145)
--- trunk/LayoutTests/js/instance-property-getter-other-instance-expected.txt (rev 0)
+++ trunk/LayoutTests/js/instance-property-getter-other-instance-expected.txt 2016-02-04 21:36:04 UTC (rev 196145)
@@ -0,0 +1,14 @@
+Tests that calling an instance property getter on another instance works as expected
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS locationGetter is an instance of function Function() {
+ [native code]
+}
+PASS locationGetter.call(otherWindow.document).toString() is "about:blank"
+FAIL locationGetter.call(window.document) === window.document.location should be true. Was false.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/js/instance-property-getter-other-instance.html (0 => 196145)
--- trunk/LayoutTests/js/instance-property-getter-other-instance.html (rev 0)
+++ trunk/LayoutTests/js/instance-property-getter-other-instance.html 2016-02-04 21:36:04 UTC (rev 196145)
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<body _onload_="runTest()">
+<script src=""
+<script>
+description("Tests that calling an instance property getter on another instance works as expected");
+jsTestIsAsync = true;
+
+if (window.testRunner)
+ testRunner.setCanOpenWindows();
+
+function runTest()
+{
+ otherWindow = window.open("about:blank");
+ locationGetter = Object.getOwnPropertyDescriptor(otherWindow.document, "location").get;
+ shouldBeType("locationGetter", Function);
+ shouldBeEqualToString("locationGetter.call(otherWindow.document).toString()", "about:blank");
+ // Should return the current document's location.
+ shouldBeTrue("locationGetter.call(window.document) === window.document.location");
+ finishJSTest();
+}
+</script>
+<script src=""
+</body>
Modified: trunk/LayoutTests/js/resources/getOwnPropertyDescriptor.js (196144 => 196145)
--- trunk/LayoutTests/js/resources/getOwnPropertyDescriptor.js 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/LayoutTests/js/resources/getOwnPropertyDescriptor.js 2016-02-04 21:36:04 UTC (rev 196145)
@@ -43,18 +43,14 @@
descriptorShouldBe("global", "'Infinity'", {writable: false, enumerable: false, configurable: false, value:"Infinity"});
descriptorShouldBe("global", "'window'", {writable: false, enumerable: true, configurable: false, value:"global"});
descriptorShouldBe("global", "'XMLHttpRequest'", {writable: true, enumerable: false, configurable: true, value:"XMLHttpRequest"});
-descriptorShouldBe("global", "'length'", {get: undefined, set: undefined, enumerable: true, configurable: false});
descriptorShouldBe("global", "0", {writable: true, enumerable: false, configurable: false, value:"global[0]"});
-descriptorShouldBe("document.getElementsByTagName('div')", "'length'", {get: undefined, set: undefined, enumerable: true, configurable: false});
descriptorShouldBe("document.getElementsByTagName('div')", "0", {writable: false, enumerable: true, configurable: false, value:"document.getElementsByTagName('div')[0]"});
descriptorShouldBe("document.getElementsByClassName('pass')", "0", {writable: false, enumerable: true, configurable: false, value:"document.getElementsByClassName('pass')[0]"});
-descriptorShouldBe("document.getElementsByClassName('pass')", "'length'", {get: undefined, set: undefined, enumerable: true, configurable: false});
var canvas = document.createElement("canvas");
var canvasPixelArray = canvas.getContext("2d").createImageData(10,10).data;
descriptorShouldBe("canvasPixelArray", "0", {writable: true, enumerable: true, configurable: false, value:"canvasPixelArray[0]"});
var select = document.createElement("select");
select.innerHTML = "<option>foo</option>";
-descriptorShouldBe("select", "'length'", {get: undefined, set: undefined, enumerable: true, configurable: false});
descriptorShouldBe("select", "0", {writable: true, enumerable: true, configurable: false, value:"select[0]"});
var objectWithGetter = {};
Modified: trunk/Source/_javascript_Core/ChangeLog (196144 => 196145)
--- trunk/Source/_javascript_Core/ChangeLog 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-02-04 21:36:04 UTC (rev 196145)
@@ -1,3 +1,44 @@
+2016-02-04 Chris Dumez <[email protected]>
+
+ Object.getOwnPropertyDescriptor() returns incomplete descriptor for instance properties
+ https://bugs.webkit.org/show_bug.cgi?id=153817
+
+ Reviewed by Geoffrey Garen.
+
+ Extend support for Object.getOwnPropertyDescriptor() on native bindings
+ to instance properties (e.g. Unforgeable properties or Global object
+ properties) so that the returned descriptor has getter / setter
+ functions, as expected.
+
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::reifyAllStaticProperties):
+ Add method that reifies all static properties, including the custom
+ accessors. This is similar to what is done eagerly on the prototype
+ objects in the bindings code.
+
+ (JSC::JSObject::getOwnPropertyDescriptor):
+ getOwnPropertyDescriptor() would previously fails for custom accessors
+ that are on the instance because getDirect() does not check the static
+ property table and those custom accessors were not reified (We only
+ reified all properties eagerly - including custom accessors - on
+ prototype objects. To address this issue, we now call
+ reifyAllStaticProperties() if the call to getDirect() fails and then
+ call getDirect() again. This fix is however insufficient for Window
+ properties because |this| is a JSDOMWindowShell / JSProxy in this case
+ and getDirect() / reifyAllStaticProperties() would fail as the proxy
+ does not actually have the properties. This issue was addressed by
+ checking if |this| is a JSProxy and then using JSProxy::target() instead
+ of |this| for the calls to getDirect() and for the reification.
+
+ * runtime/JSObject.h:
+ * runtime/Lookup.h:
+ (JSC::reifyStaticProperty):
+ (JSC::reifyStaticProperties):
+ Move most code in reifyStaticProperties() to a separate function so the
+ code can be shared with JSObject::reifyAllStaticProperties().
+ reifyStaticProperties() is currently called by the bindings on the
+ prototype objects.
+
2016-02-04 Alex Christensen <[email protected]>
Fix internal Windows build
Modified: trunk/Source/_javascript_Core/runtime/JSObject.cpp (196144 => 196145)
--- trunk/Source/_javascript_Core/runtime/JSObject.cpp 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/Source/_javascript_Core/runtime/JSObject.cpp 2016-02-04 21:36:04 UTC (rev 196145)
@@ -1683,6 +1683,26 @@
structure(vm)->setStaticFunctionsReified(true);
}
+void JSObject::reifyAllStaticProperties(ExecState* exec)
+{
+ VM& vm = exec->vm();
+
+ for (const ClassInfo* info = classInfo(); info; info = info->parentClass) {
+ const HashTable* hashTable = info->staticPropHashTable;
+ if (!hashTable)
+ continue;
+
+ for (auto iter = hashTable->begin(); iter != hashTable->end(); ++iter) {
+ unsigned attributes;
+ PropertyOffset offset = getDirectOffset(vm, Identifier::fromString(&vm, iter.key()), attributes);
+ if (!isValidOffset(offset))
+ reifyStaticProperty(vm, *iter.value(), *this);
+ }
+ }
+
+ structure(vm)->setStaticFunctionsReified(true);
+}
+
bool JSObject::removeDirect(VM& vm, PropertyName propertyName)
{
Structure* structure = this->structure(vm);
@@ -2555,16 +2575,22 @@
else if (slot.attributes() & CustomAccessor) {
descriptor.setCustomDescriptor(slot.attributes());
- JSValue maybeGetterSetter = getDirect(exec->vm(), propertyName);
- // FIXME: This currently does not work for properties that are on the instance and not reified.
- if (maybeGetterSetter) {
- auto* getterSetter = jsCast<CustomGetterSetter*>(maybeGetterSetter);
- ASSERT(getterSetter);
- if (getterSetter->getter())
- descriptor.setGetter(getBoundSlotBaseFunctionForGetterSetter(exec, propertyName, slot, getterSetter, JSBoundSlotBaseFunction::Type::Getter));
- if (getterSetter->setter())
- descriptor.setSetter(getBoundSlotBaseFunctionForGetterSetter(exec, propertyName, slot, getterSetter, JSBoundSlotBaseFunction::Type::Setter));
+ JSObject* thisObject = this;
+ if (auto* proxy = jsDynamicCast<JSProxy*>(this))
+ thisObject = proxy->target();
+
+ JSValue maybeGetterSetter = thisObject->getDirect(exec->vm(), propertyName);
+ if (!maybeGetterSetter) {
+ thisObject->reifyAllStaticProperties(exec);
+ maybeGetterSetter = thisObject->getDirect(exec->vm(), propertyName);
}
+
+ ASSERT(maybeGetterSetter);
+ auto* getterSetter = jsCast<CustomGetterSetter*>(maybeGetterSetter);
+ if (getterSetter->getter())
+ descriptor.setGetter(getBoundSlotBaseFunctionForGetterSetter(exec, propertyName, slot, getterSetter, JSBoundSlotBaseFunction::Type::Getter));
+ if (getterSetter->setter())
+ descriptor.setSetter(getBoundSlotBaseFunctionForGetterSetter(exec, propertyName, slot, getterSetter, JSBoundSlotBaseFunction::Type::Setter));
} else
descriptor.setDescriptor(slot.getValue(exec, propertyName), slot.attributes());
return true;
Modified: trunk/Source/_javascript_Core/runtime/JSObject.h (196144 => 196145)
--- trunk/Source/_javascript_Core/runtime/JSObject.h 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/Source/_javascript_Core/runtime/JSObject.h 2016-02-04 21:36:04 UTC (rev 196145)
@@ -623,7 +623,8 @@
}
bool staticFunctionsReified() { return structure()->staticFunctionsReified(); }
- void reifyStaticFunctionsForDelete(ExecState* exec);
+ void reifyStaticFunctionsForDelete(ExecState*);
+ void reifyAllStaticProperties(ExecState*);
JS_EXPORT_PRIVATE Butterfly* growOutOfLineStorage(VM&, size_t oldSize, size_t newSize);
void setButterflyWithoutChangingStructure(VM&, Butterfly*);
Modified: trunk/Source/_javascript_Core/runtime/Lookup.h (196144 => 196145)
--- trunk/Source/_javascript_Core/runtime/Lookup.h 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/Source/_javascript_Core/runtime/Lookup.h 2016-02-04 21:36:04 UTC (rev 196145)
@@ -298,45 +298,49 @@
return true;
}
-template<unsigned numberOfValues>
-inline void reifyStaticProperties(VM& vm, const HashTableValue (&values)[numberOfValues], JSObject& thisObj)
+inline void reifyStaticProperty(VM& vm, const HashTableValue& value, JSObject& thisObj)
{
- BatchedTransitionOptimizer transitionOptimizer(vm, &thisObj);
- for (auto& value : values) {
- if (!value.m_key)
- continue;
+ if (!value.m_key)
+ return;
- Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>(value.m_key), strlen(value.m_key));
- if (value.attributes() & Builtin) {
- if (value.attributes() & Accessor)
- reifyStaticAccessor(vm, value, thisObj, propertyName);
- else
- thisObj.putDirectBuiltinFunction(vm, thisObj.globalObject(), propertyName, value.builtinGenerator()(vm), attributesForStructure(value.attributes()));
- continue;
- }
+ Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>(value.m_key), strlen(value.m_key));
+ if (value.attributes() & Builtin) {
+ if (value.attributes() & Accessor)
+ reifyStaticAccessor(vm, value, thisObj, propertyName);
+ else
+ thisObj.putDirectBuiltinFunction(vm, thisObj.globalObject(), propertyName, value.builtinGenerator()(vm), attributesForStructure(value.attributes()));
+ return;
+ }
- if (value.attributes() & Function) {
- thisObj.putDirectNativeFunction(
- vm, thisObj.globalObject(), propertyName, value.functionLength(),
- value.function(), value.intrinsic(), attributesForStructure(value.attributes()));
- continue;
- }
+ if (value.attributes() & Function) {
+ thisObj.putDirectNativeFunction(
+ vm, thisObj.globalObject(), propertyName, value.functionLength(),
+ value.function(), value.intrinsic(), attributesForStructure(value.attributes()));
+ return;
+ }
- if (value.attributes() & ConstantInteger) {
- thisObj.putDirect(vm, propertyName, jsNumber(value.constantInteger()), attributesForStructure(value.attributes()));
- continue;
- }
+ if (value.attributes() & ConstantInteger) {
+ thisObj.putDirect(vm, propertyName, jsNumber(value.constantInteger()), attributesForStructure(value.attributes()));
+ return;
+ }
- if (value.attributes() & Accessor) {
- reifyStaticAccessor(vm, value, thisObj, propertyName);
- continue;
- }
+ if (value.attributes() & Accessor) {
+ reifyStaticAccessor(vm, value, thisObj, propertyName);
+ return;
+ }
- CustomGetterSetter* customGetterSetter = CustomGetterSetter::create(vm, value.propertyGetter(), value.propertyPutter());
- thisObj.putDirectCustomAccessor(vm, propertyName, customGetterSetter, attributesForStructure(value.attributes()));
- }
+ CustomGetterSetter* customGetterSetter = CustomGetterSetter::create(vm, value.propertyGetter(), value.propertyPutter());
+ thisObj.putDirectCustomAccessor(vm, propertyName, customGetterSetter, attributesForStructure(value.attributes()));
}
+template<unsigned numberOfValues>
+inline void reifyStaticProperties(VM& vm, const HashTableValue (&values)[numberOfValues], JSObject& thisObj)
+{
+ BatchedTransitionOptimizer transitionOptimizer(vm, &thisObj);
+ for (auto& value : values)
+ reifyStaticProperty(vm, value, thisObj);
+}
+
} // namespace JSC
#endif // Lookup_h
Modified: trunk/Source/WebCore/ChangeLog (196144 => 196145)
--- trunk/Source/WebCore/ChangeLog 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/Source/WebCore/ChangeLog 2016-02-04 21:36:04 UTC (rev 196145)
@@ -1,3 +1,63 @@
+2016-02-04 Chris Dumez <[email protected]>
+
+ Object.getOwnPropertyDescriptor() returns incomplete descriptor for instance properties
+ https://bugs.webkit.org/show_bug.cgi?id=153817
+
+ Reviewed by Geoffrey Garen.
+
+ Update the bindings generator so that property getters / setters now
+ make sure |this| has the right type and throw a TypeError if it does
+ not, as per:
+ - http://heycam.github.io/webidl/#dfn-attribute-getter (step 2.4.2)
+ - http://heycam.github.io/webidl/#dfn-attribute-setter (step 3.5)
+
+ This was an issue when doing something like:
+ Object.getOwnPropertyDescriptor(window, "location").get.call(nonWindow)
+
+ We would call toJSDOMWindow(thisValue), which would return null as
+ thisValue is not a JSDOMWindow. We would then dereference this null
+ pointer and crash. We now do a null check and throw a TypeError in
+ this case, as per the Web IDL specification.
+
+ The generated bindings still have some non-spec compliant behavior
+ though:
+ 1. The getters / setters of instance properties use slotBase instead
+ of thisValue, which means that calling instanceA's getter on
+ instanceB returns instanceA's property insteas of instanceB's.
+ 2. Global object property getters should not require an explicit
+ |this| so calling the following should work:
+ - Object.getOwnPropertyDescriptor(window, "location").get.call()
+ We currently throw in this case.
+
+ These issues will be addressed in follow-up patches.
+
+ Tests: js/getOwnPropertyDescriptor-unforgeable-attributes.html
+ js/getOwnPropertyDescriptor-window-attributes.html
+ js/instance-property-getter-other-instance.html
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation):
+ * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
+ (WebCore::jsTestActiveDOMObjectExcitingAttr):
+ * bindings/scripts/test/JS/JSTestException.cpp:
+ (WebCore::jsTestExceptionName):
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::jsTestObjConstructorTestSubObj):
+ (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
+ (WebCore::jsTestObjConditionalAttr4Constructor):
+ (WebCore::jsTestObjConditionalAttr5Constructor):
+ (WebCore::jsTestObjConditionalAttr6Constructor):
+ (WebCore::jsTestObjContentDocument):
+ (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
+ (WebCore::setJSTestObjConditionalAttr4Constructor):
+ (WebCore::setJSTestObjConditionalAttr5Constructor):
+ (WebCore::setJSTestObjConditionalAttr6Constructor):
+ (WebCore::setJSTestObjConstructor): Deleted.
+ (WebCore::setJSTestObjConstructorStaticStringAttr): Deleted.
+ (WebCore::setJSTestObjConditionalAttr3): Deleted.
+ * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+ (WebCore::jsTestTypedefsConstructorTestSubObj):
+
2016-02-04 Brady Eidson <[email protected]>
Modern IDB: LayoutTest imported/w3c/indexeddb/keyorder-private.html is flaky.
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (196144 => 196145)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-02-04 21:36:04 UTC (rev 196145)
@@ -2285,24 +2285,27 @@
push(@implContent, " UNUSED_PARAM(slotBase);\n");
push(@implContent, " UNUSED_PARAM(thisValue);\n");
if (!$attribute->isStatic || $attribute->signature->type =~ /Constructor$/) {
+ my $variableForTypeCheck = "castedThis";
if ($interface->extendedAttributes->{"CustomProxyToJSObject"}) {
push(@implContent, " auto* castedThis = to${className}(JSValue::decode(thisValue));\n");
} elsif (AttributeShouldBeOnInstance($interface, $attribute)) {
+ # FIXME: This does not seem right, we should likely use thisValue instead of slotBase here to match the specification:
+ # http://heycam.github.io/webidl/#dfn-attribute-getter
push(@implContent, " auto* castedThis = jsCast<JS${interfaceName}*>(slotBase);\n");
- if (InterfaceRequiresAttributesOnInstanceForCompatibility($interface)) {
- push(@implContent, " ${className}* castedThisObject = " . GetCastingHelperForThisObject($interface) . "(JSValue::decode(thisValue));\n");
- push(@implContent, " if (UNLIKELY(!castedThisObject))\n");
- push(@implContent, " reportDeprecatedGetterError(*state, \"$interfaceName\", \"$name\");\n");
- }
+ push(@implContent, " ${className}* castedThisObject = " . GetCastingHelperForThisObject($interface) . "(JSValue::decode(thisValue));\n");
+ $variableForTypeCheck = "castedThisObject";
} else {
push(@implContent, " ${className}* castedThis = " . GetCastingHelperForThisObject($interface) . "(JSValue::decode(thisValue));\n");
- push(@implContent, " if (UNLIKELY(!castedThis))\n");
- if ($attribute->signature->extendedAttributes->{"LenientThis"}) {
- push(@implContent, " return JSValue::encode(jsUndefined());\n");
- } else {
- push(@implContent, " return throwGetterTypeError(*state, \"$interfaceName\", \"$name\");\n");
- }
}
+ # FIXME: Getters on a global should not require an explicit this.
+ push(@implContent, " if (UNLIKELY(!$variableForTypeCheck))\n");
+ if ($attribute->signature->extendedAttributes->{"LenientThis"}) {
+ push(@implContent, " return JSValue::encode(jsUndefined());\n");
+ } elsif (InterfaceRequiresAttributesOnInstanceForCompatibility($interface)) {
+ push(@implContent, " reportDeprecatedGetterError(*state, \"$interfaceName\", \"$name\");\n");
+ } else {
+ push(@implContent, " return throwGetterTypeError(*state, \"$interfaceName\", \"$name\");\n");
+ }
}
my @arguments = ();
@@ -2619,28 +2622,26 @@
push(@implContent, " JSValue value = JSValue::decode(encodedValue);\n");
push(@implContent, " UNUSED_PARAM(baseObject);\n");
if (!$attribute->isStatic) {
+ my $variableForTypeCheck = "castedThis";
if ($interface->extendedAttributes->{"CustomProxyToJSObject"}) {
push(@implContent, " ${className}* castedThis = to${className}(JSValue::decode(thisValue));\n");
} elsif (AttributeShouldBeOnInstance($interface, $attribute)) {
- push(@implContent, " UNUSED_PARAM(thisValue);\n");
push(@implContent, " auto* castedThis = jsCast<JS${interfaceName}*>(baseObject);\n");
- if (InterfaceRequiresAttributesOnInstanceForCompatibility($interface)) {
- push(@implContent, " ${className}* castedThisObject = " . GetCastingHelperForThisObject($interface) . "(JSValue::decode(thisValue));\n");
- push(@implContent, " if (UNLIKELY(!castedThisObject))\n");
- push(@implContent, " reportDeprecatedSetterError(*state, \"$interfaceName\", \"$name\");\n");
- } else {
- push(@implContent, " UNUSED_PARAM(thisValue);\n");
- push(@implContent, " UNUSED_PARAM(state);\n");
- }
+ push(@implContent, " ${className}* castedThisObject = " . GetCastingHelperForThisObject($interface) . "(JSValue::decode(thisValue));\n");
+ $variableForTypeCheck = "castedThisObject";
} else {
push(@implContent, " ${className}* castedThis = " . GetCastingHelperForThisObject($interface) . "(JSValue::decode(thisValue));\n");
- push(@implContent, " if (UNLIKELY(!castedThis)) {\n");
- if (!$attribute->signature->extendedAttributes->{"LenientThis"}) {
- push(@implContent, " throwSetterTypeError(*state, \"$interfaceName\", \"$name\");\n");
- }
+ }
+ push(@implContent, " if (UNLIKELY(!$variableForTypeCheck)) {\n");
+ if ($attribute->signature->extendedAttributes->{"LenientThis"}) {
push(@implContent, " return;\n");
- push(@implContent, " }\n");
+ } elsif (InterfaceRequiresAttributesOnInstanceForCompatibility($interface)) {
+ push(@implContent, " reportDeprecatedSetterError(*state, \"$interfaceName\", \"$name\");\n");
+ } else {
+ push(@implContent, " throwSetterTypeError(*state, \"$interfaceName\", \"$name\");\n");
+ push(@implContent, " return;\n");
}
+ push(@implContent, " }\n");
}
if ($interface->extendedAttributes->{"CheckSecurity"} && !$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"}) {
if ($interfaceName eq "DOMWindow") {
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp (196144 => 196145)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp 2016-02-04 21:36:04 UTC (rev 196145)
@@ -150,6 +150,9 @@
UNUSED_PARAM(slotBase);
UNUSED_PARAM(thisValue);
auto* castedThis = jsCast<JSTestActiveDOMObject*>(slotBase);
+ JSTestActiveDOMObject* castedThisObject = jsDynamicCast<JSTestActiveDOMObject*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThisObject))
+ return throwGetterTypeError(*state, "TestActiveDOMObject", "excitingAttr");
if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, castedThis->wrapped()))
return JSValue::encode(jsUndefined());
auto& impl = castedThis->wrapped();
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp (196144 => 196145)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp 2016-02-04 21:36:04 UTC (rev 196145)
@@ -140,6 +140,9 @@
UNUSED_PARAM(slotBase);
UNUSED_PARAM(thisValue);
auto* castedThis = jsCast<JSTestException*>(slotBase);
+ JSTestException* castedThisObject = jsDynamicCast<JSTestException*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThisObject))
+ return throwGetterTypeError(*state, "TestException", "name");
auto& impl = castedThis->wrapped();
JSValue result = jsStringWithCache(state, impl.name());
return JSValue::encode(result);
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (196144 => 196145)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-02-04 21:36:04 UTC (rev 196145)
@@ -810,6 +810,9 @@
UNUSED_PARAM(slotBase);
UNUSED_PARAM(thisValue);
auto* castedThis = jsCast<JSTestObj*>(slotBase);
+ JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThisObject))
+ return throwGetterTypeError(*state, "TestObj", "TestSubObj");
return JSValue::encode(JSTestSubObj::getConstructor(state->vm(), castedThis->globalObject()));
}
@@ -820,6 +823,9 @@
UNUSED_PARAM(slotBase);
UNUSED_PARAM(thisValue);
auto* castedThis = jsCast<JSTestObj*>(slotBase);
+ JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThisObject))
+ return throwGetterTypeError(*state, "TestObj", "TestSubObjEnabledBySetting");
if (!castedThis->wrapped().frame())
return JSValue::encode(jsUndefined());
Settings& settings = castedThis->wrapped().frame()->settings();
@@ -1506,6 +1512,9 @@
UNUSED_PARAM(slotBase);
UNUSED_PARAM(thisValue);
auto* castedThis = jsCast<JSTestObj*>(slotBase);
+ JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThisObject))
+ return throwGetterTypeError(*state, "TestObj", "conditionalAttr4");
return JSValue::encode(JSTestObjectA::getConstructor(state->vm(), castedThis->globalObject()));
}
@@ -1518,6 +1527,9 @@
UNUSED_PARAM(slotBase);
UNUSED_PARAM(thisValue);
auto* castedThis = jsCast<JSTestObj*>(slotBase);
+ JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThisObject))
+ return throwGetterTypeError(*state, "TestObj", "conditionalAttr5");
return JSValue::encode(JSTestObjectB::getConstructor(state->vm(), castedThis->globalObject()));
}
@@ -1530,6 +1542,9 @@
UNUSED_PARAM(slotBase);
UNUSED_PARAM(thisValue);
auto* castedThis = jsCast<JSTestObj*>(slotBase);
+ JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThisObject))
+ return throwGetterTypeError(*state, "TestObj", "conditionalAttr6");
return JSValue::encode(JSTestObjectC::getConstructor(state->vm(), castedThis->globalObject()));
}
@@ -1589,6 +1604,9 @@
UNUSED_PARAM(slotBase);
UNUSED_PARAM(thisValue);
auto* castedThis = jsCast<JSTestObj*>(slotBase);
+ JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThisObject))
+ return throwGetterTypeError(*state, "TestObj", "contentDocument");
auto& impl = castedThis->wrapped();
return JSValue::encode(shouldAllowAccessToNode(state, impl.contentDocument()) ? toJS(state, castedThis->globalObject(), WTF::getPtr(impl.contentDocument())) : jsNull());
}
@@ -1884,10 +1902,12 @@
{
JSValue value = JSValue::decode(encodedValue);
UNUSED_PARAM(baseObject);
- UNUSED_PARAM(thisValue);
auto* castedThis = jsCast<JSTestObj*>(baseObject);
- UNUSED_PARAM(thisValue);
- UNUSED_PARAM(state);
+ JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThisObject)) {
+ throwSetterTypeError(*state, "TestObj", "TestSubObjEnabledBySetting");
+ return;
+ }
// Shadowing a built-in constructor.
castedThis->putDirect(state->vm(), Identifier::fromString(state, "TestSubObjEnabledBySetting"), value);
}
@@ -2670,10 +2690,12 @@
{
JSValue value = JSValue::decode(encodedValue);
UNUSED_PARAM(baseObject);
- UNUSED_PARAM(thisValue);
auto* castedThis = jsCast<JSTestObj*>(baseObject);
- UNUSED_PARAM(thisValue);
- UNUSED_PARAM(state);
+ JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThisObject)) {
+ throwSetterTypeError(*state, "TestObj", "conditionalAttr4");
+ return;
+ }
// Shadowing a built-in constructor.
castedThis->putDirect(state->vm(), Identifier::fromString(state, "conditionalAttr4"), value);
}
@@ -2685,10 +2707,12 @@
{
JSValue value = JSValue::decode(encodedValue);
UNUSED_PARAM(baseObject);
- UNUSED_PARAM(thisValue);
auto* castedThis = jsCast<JSTestObj*>(baseObject);
- UNUSED_PARAM(thisValue);
- UNUSED_PARAM(state);
+ JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThisObject)) {
+ throwSetterTypeError(*state, "TestObj", "conditionalAttr5");
+ return;
+ }
// Shadowing a built-in constructor.
castedThis->putDirect(state->vm(), Identifier::fromString(state, "conditionalAttr5"), value);
}
@@ -2700,10 +2724,12 @@
{
JSValue value = JSValue::decode(encodedValue);
UNUSED_PARAM(baseObject);
- UNUSED_PARAM(thisValue);
auto* castedThis = jsCast<JSTestObj*>(baseObject);
- UNUSED_PARAM(thisValue);
- UNUSED_PARAM(state);
+ JSTestObj* castedThisObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThisObject)) {
+ throwSetterTypeError(*state, "TestObj", "conditionalAttr6");
+ return;
+ }
// Shadowing a built-in constructor.
castedThis->putDirect(state->vm(), Identifier::fromString(state, "conditionalAttr6"), value);
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (196144 => 196145)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp 2016-02-04 21:20:10 UTC (rev 196144)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp 2016-02-04 21:36:04 UTC (rev 196145)
@@ -244,6 +244,9 @@
UNUSED_PARAM(slotBase);
UNUSED_PARAM(thisValue);
auto* castedThis = jsCast<JSTestTypedefs*>(slotBase);
+ JSTestTypedefs* castedThisObject = jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThisObject))
+ return throwGetterTypeError(*state, "TestTypedefs", "TestSubObj");
return JSValue::encode(JSTestSubObj::getConstructor(state->vm(), castedThis->globalObject()));
}