Changeset 69553 in webkit
- Timestamp:
- Oct 11, 2010 7:12:51 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r69550 r69553 1 2010-10-11 Michael Saboff <msaboff@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Added and changed tests to verify that DOMWindow objects are 6 create with appropriate constructors and that those constructors 7 are not callable directly. 8 https://bugs.webkit.org/show_bug.cgi?id=47422 9 10 * fast/dom/Window/window-constructor-expected.txt: Added. 11 * fast/dom/Window/window-constructor.html: Added. 12 * fast/dom/Window/window-properties-expected.txt: 13 * fast/dom/Window/window-property-descriptors-expected.txt: 14 * fast/dom/prototype-inheritance-2-expected.txt: 15 * fast/dom/script-tests/constructors-cached.js: 16 * fast/dom/wrapper-classes-expected.txt: 17 * http/tests/security/cross-frame-access-get-expected.txt: 18 * http/tests/security/cross-frame-access-get.html: 19 * http/tests/security/cross-frame-access-put.html: 20 * inspector/console-dir-global-expected.txt: 21 * java/lc3/JSObject/ToJSObject-001-expected.txt: 22 * java/lc3/JSObject/ToObject-001-expected.txt: 23 1 24 2010-10-11 Prasad Tammana <prasadt@chromium.org> 2 25 -
trunk/LayoutTests/fast/dom/Window/script-tests/window-property-descriptors.js
r66462 r69553 8 8 // Don't log DumpRenderTree injected objects 9 9 "layoutTestController" : 1, // Work around http://bugs.webkit.org/show_bug.cgi?id=11373 10 "constructor" : 0, // Workaround to include constructor in windowPropertyNames 10 11 "GCController" : 1, 11 12 "accessibilityController" : 1, … … 60 61 if (protoPropertyNames[i] == "createBlobURL" || protoPropertyNames[i] == "revokeBlobURL") 61 62 continue; 63 if (protoPropertyNames[i] == "constructor") 64 continue; 62 65 shouldBeUndefined("Object.getOwnPropertyDescriptor(window, '" + protoPropertyNames[i] + "')"); 63 66 } -
trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt
r68440 r69553 2193 2193 window.console.trace [function] 2194 2194 window.console.warn [function] 2195 window.constructor [object DOMWindowConstructor] 2196 window.constructor.prototype [object DOMWindowPrototype] 2197 window.constructor.prototype.addEventListener [function] 2198 window.constructor.prototype.alert [function] 2199 window.constructor.prototype.atob [function] 2200 window.constructor.prototype.blur [function] 2201 window.constructor.prototype.btoa [function] 2202 window.constructor.prototype.captureEvents [function] 2203 window.constructor.prototype.clearInterval [function] 2204 window.constructor.prototype.clearTimeout [function] 2205 window.constructor.prototype.close [function] 2206 window.constructor.prototype.confirm [function] 2207 window.constructor.prototype.createBlobURL [function] 2208 window.constructor.prototype.dispatchEvent [function] 2209 window.constructor.prototype.find [function] 2210 window.constructor.prototype.focus [function] 2211 window.constructor.prototype.getComputedStyle [function] 2212 window.constructor.prototype.getMatchedCSSRules [function] 2213 window.constructor.prototype.getSelection [function] 2214 window.constructor.prototype.moveBy [function] 2215 window.constructor.prototype.moveTo [function] 2216 window.constructor.prototype.open [function] 2217 window.constructor.prototype.openDatabase [function] 2218 window.constructor.prototype.postMessage [function] 2219 window.constructor.prototype.print [function] 2220 window.constructor.prototype.prompt [function] 2221 window.constructor.prototype.releaseEvents [function] 2222 window.constructor.prototype.removeEventListener [function] 2223 window.constructor.prototype.resizeBy [function] 2224 window.constructor.prototype.resizeTo [function] 2225 window.constructor.prototype.revokeBlobURL [function] 2226 window.constructor.prototype.scroll [function] 2227 window.constructor.prototype.scrollBy [function] 2228 window.constructor.prototype.scrollTo [function] 2229 window.constructor.prototype.setInterval [function] 2230 window.constructor.prototype.setTimeout [function] 2231 window.constructor.prototype.showModalDialog [function] 2232 window.constructor.prototype.stop [function] 2233 window.constructor.prototype.webkitConvertPointFromNodeToPage [function] 2234 window.constructor.prototype.webkitConvertPointFromPageToNode [function] 2195 2235 window.crypto [undefined] 2196 2236 window.decodeURI [function] -
trunk/LayoutTests/fast/dom/Window/window-property-descriptors-expected.txt
r68440 r69553 334 334 PASS typeof Object.getOwnPropertyDescriptor(window, 'closed') is 'object' 335 335 PASS typeof Object.getOwnPropertyDescriptor(window, 'console') is 'object' 336 PASS typeof Object.getOwnPropertyDescriptor(window, 'constructor') is 'object' 336 337 PASS typeof Object.getOwnPropertyDescriptor(window, 'crypto') is 'object' 337 338 PASS typeof Object.getOwnPropertyDescriptor(window, 'debug') is 'object' … … 498 499 PASS Object.getOwnPropertyDescriptor(window, 'close') is undefined. 499 500 PASS Object.getOwnPropertyDescriptor(window, 'confirm') is undefined. 500 PASS Object.getOwnPropertyDescriptor(window, 'constructor') is undefined.501 501 PASS Object.getOwnPropertyDescriptor(window, 'dispatchEvent') is undefined. 502 502 PASS Object.getOwnPropertyDescriptor(window, 'find') is undefined. -
trunk/LayoutTests/fast/dom/prototype-inheritance-2-expected.txt
r68440 r69553 82 82 PASS DOMTokenListPrototype from inner.document.forms.testForm.0.0.classList.__proto__ 83 83 PASS DOMWindow from inner 84 PASS DOMWindowConstructor from inner.document.forms.testForm.0.ownerDocument.defaultView.constructor 84 85 PASS DOMWindowPrototype from inner.document.forms.testForm.0.ownerDocument.defaultView.__proto__ 85 86 PASS DocumentPrototype from inner.document.forms.testForm.0.ownerDocument.__proto__.__proto__ -
trunk/LayoutTests/fast/dom/script-tests/constructors-cached.js
r48551 r69553 1 1 description("This test ensures that objects with security restrictions are cached correctly"); 2 2 3 var c onstructors = ["Image", "Option", "XMLHttpRequest", "Audio"];3 var ctors = ["Image", "Option", "XMLHttpRequest", "Audio"]; 4 4 5 for (var i = 0; i < c onstructors.length; i++) {6 var c onstructor = constructors[i];5 for (var i = 0; i < ctors.length; i++) { 6 var ctor = ctors[i]; 7 7 try { 8 8 // Test retrieving the object twice results in the same object 9 shouldBe(c onstructor, constructor);9 shouldBe(ctor, ctor); 10 10 11 11 // Be paranoid -- make sure that setting a property results in that property 12 12 // stays 13 this[c onstructor].testProperty = "property set successfully";14 shouldBe(c onstructor + ".testProperty", '"property set successfully"');13 this[ctor].testProperty = "property set successfully"; 14 shouldBe(ctor + ".testProperty", '"property set successfully"'); 15 15 } catch (e) { 16 testFailed("Testing " + c onstructor + " threw " + e);16 testFailed("Testing " + ctor + " threw " + e); 17 17 } 18 18 } -
trunk/LayoutTests/fast/dom/wrapper-classes-expected.txt
r61322 r69553 131 131 PASS jsWrapperClass(window) is 'DOMWindow' 132 132 PASS jsWrapperClass(window.__proto__) is 'DOMWindowPrototype' 133 FAIL jsWrapperClass(window.constructor) should be DOMWindowConstructor. Was Function. 133 PASS jsWrapperClass(window.constructor) is 'DOMWindowConstructor' 134 134 135 135 HTML DOM -
trunk/LayoutTests/http/tests/security/cross-frame-access-get-expected.txt
r61599 r69553 1 CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-get-test.html from frame with URL http://127.0.0.1:8000/security/cross-frame-access-get.html. Domains, protocols and ports must match. 2 1 3 CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-get-test.html from frame with URL http://127.0.0.1:8000/security/cross-frame-access-get.html. Domains, protocols and ports must match. 2 4 … … 516 518 PASS: canGet('targetWindow.clearTimeout') should be 'false' and is. 517 519 PASS: canGet('targetWindow.confirm') should be 'false' and is. 520 PASS: canGet('targetWindow.constructor') should be 'false' and is. 518 521 PASS: canGet('targetWindow.find') should be 'false' and is. 519 522 PASS: canGet('targetWindow.getComputedStyle') should be 'false' and is. -
trunk/LayoutTests/http/tests/security/cross-frame-access-get.html
r61599 r69553 115 115 "clearTimeout", 116 116 "confirm", 117 "constructor", 117 118 "find", 118 119 "getComputedStyle", -
trunk/LayoutTests/http/tests/security/cross-frame-access-put.html
r44906 r69553 207 207 setForbiddenProperty(targetWindow, "close"); 208 208 setForbiddenProperty(targetWindow, "confirm"); 209 setForbiddenProperty(targetWindow, "constructor"); 209 210 setForbiddenProperty(targetWindow, "eval"); 210 211 setForbiddenProperty(targetWindow, "find"); -
trunk/LayoutTests/inspector/console-dir-global-expected.txt
r61010 r69553 5 5 Array : 1 6 6 console : 1 7 constructor : 1 7 8 document : 1 8 9 doit : 1 -
trunk/LayoutTests/java/lc3/JSObject/ToJSObject-001-expected.txt
r66156 r69553 17 17 FAIL jsoc.setJSObject( THIS ); jsoc.PUB_JSOBJECT should be [object DOMWindow]. Was [object DOMWindow]. 18 18 PASS jsoc.setJSObject( THIS ); jsoc.getJSObject() is this 19 PASS jsoc.getJSObject().constructor is Object19 PASS jsoc.getJSObject().constructor is this.constructor 20 20 FAIL jsoc.setJSObject( Math ); jsoc.PUB_JSOBJECT should be [object Math]. Was [object Math]. 21 21 PASS jsoc.setJSObject( Math ); jsoc.getJSObject() is Math -
trunk/LayoutTests/java/lc3/JSObject/ToJSObject-001.js
r55469 r69553 174 174 "jsoc.getJSObject().constructor", 175 175 'this', 176 ' Object');176 'this.constructor'); 177 177 178 178 a[i++] = new TestObject( -
trunk/LayoutTests/java/lc3/JSObject/ToObject-001-expected.txt
r66156 r69553 44 44 FAIL dt.setObject( THIS ); dt.PUB_OBJECT should be [object DOMWindow]. Was [object DOMWindow]. 45 45 PASS dt.setObject( THIS ); dt.getObject() is this 46 PASS dt.getObject().constructor is Object46 PASS dt.getObject().constructor is this.constructor 47 47 FAIL dt.setObject( Math ); dt.PUB_OBJECT should be [object Math]. Was [object Math]. 48 48 PASS dt.setObject( Math ); dt.getObject() is Math -
trunk/LayoutTests/java/lc3/JSObject/ToObject-001.js
r55469 r69553 176 176 "dt.getObject().constructor", 177 177 'this', 178 ' Object');178 'this.constructor'); 179 179 180 180 a[i++] = new TestObject( -
trunk/WebCore/ChangeLog
r69551 r69553 1 2010-10-11 Michael Saboff <msaboff@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Changed DOMWindow to have a constructor. Updated the code generator 6 to add security checks to the constructors if CheckDomainSecurity is 7 set. Also changed the constructor generation code to use 8 globalObject->prototype() for DOMWindow object prototypes instead 9 of "self". 10 https://bugs.webkit.org/show_bug.cgi?id=47422 11 12 Test: fast/dom/Window/window-constructor.html 13 14 * bindings/scripts/CodeGeneratorJS.pm: 15 * page/DOMWindow.idl: 16 1 17 2010-10-11 Daniel Cheng <dcheng@chromium.org> 2 18 -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r68440 r69553 1633 1633 push(@implContent, "{\n"); 1634 1634 push(@implContent, " ${className}* domObject = static_cast<$className*>(asObject(slotBase));\n"); 1635 1636 if ($dataNode->extendedAttributes->{"CheckDomainSecurity"}) { 1637 push(@implContent, " if (!domObject->allowsAccessFrom(exec))\n"); 1638 push(@implContent, " return jsUndefined();\n"); 1639 } 1640 1635 1641 push(@implContent, " return ${className}::getConstructor(exec, domObject->globalObject());\n"); 1636 1642 push(@implContent, "}\n"); … … 2839 2845 push(@$outputArray, " : DOMConstructorObject(${constructorClassName}::createStructure(globalObject->objectPrototype()), globalObject)\n"); 2840 2846 push(@$outputArray, "{\n"); 2841 push(@$outputArray, " putDirect(exec->propertyNames().prototype, ${protoClassName}::self(exec, globalObject), DontDelete | ReadOnly);\n"); 2847 if ($interfaceName eq "DOMWindow") { 2848 push(@$outputArray, " putDirect(exec->propertyNames().prototype, globalObject->prototype(), DontDelete | ReadOnly);\n"); 2849 } else { 2850 push(@$outputArray, " putDirect(exec->propertyNames().prototype, ${protoClassName}::self(exec, globalObject), DontDelete | ReadOnly);\n"); 2851 } 2842 2852 push(@$outputArray, " putDirect(exec->propertyNames().length, jsNumber(exec, ${numberOfconstructParameters}), ReadOnly | DontDelete | DontEnum);\n") if $numberOfconstructParameters; 2843 2853 push(@$outputArray, "}\n\n"); -
trunk/WebCore/page/DOMWindow.idl
r69540 r69553 39 39 CustomPutFunction, 40 40 EventTarget, 41 OmitConstructor,42 41 ExtendsDOMGlobalObject, 43 42 GenerateNativeConverter,
Note: See TracChangeset
for help on using the changeset viewer.