Changeset 270702 in webkit
- Timestamp:
- Dec 11, 2020 12:39:38 PM (20 months ago)
- Location:
- trunk
- Files:
-
- 4 added
- 9 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/security/preventExtensions-window-location-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prevent-extensions-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prevent-extensions.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prevent-extensions-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prevent-extensions.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (modified) (1 diff)
-
Source/WebCore/bindings/js/JSLocationCustom.cpp (modified) (1 diff)
-
Source/WebCore/bindings/js/JSRemoteDOMWindowCustom.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r270699 r270702 1 2020-12-11 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Reflect.preventExtensions should not throw if called on WindowProxy or Location 4 https://bugs.webkit.org/show_bug.cgi?id=219270 5 6 Reviewed by Darin Adler. 7 8 * http/tests/security/preventExtensions-window-location-expected.txt: 9 1 10 2020-12-11 Fujii Hironori <Hironori.Fujii@sony.com> 2 11 -
trunk/LayoutTests/http/tests/security/preventExtensions-window-location-expected.txt
r211778 r270702 6 6 * Cross origin 7 7 PASS Object.isExtensible(frames[0]) is true 8 PASS Object.preventExtensions(frames[0]) threw exception TypeError: Cannot prevent extensions on this object.8 PASS Object.preventExtensions(frames[0]) threw exception TypeError: Unable to prevent extension in Object.preventExtensions. 9 9 PASS Object.isExtensible(frames[0]) is true 10 10 PASS Object.isExtensible(frames[0].location) is true 11 PASS Object.preventExtensions(frames[0].location) threw exception TypeError: Cannot prevent extensions on this object.11 PASS Object.preventExtensions(frames[0].location) threw exception TypeError: Unable to prevent extension in Object.preventExtensions. 12 12 PASS Object.isExtensible(frames[0].location) is true 13 13 14 14 * Same origin 15 15 PASS Object.isExtensible(window) is true 16 PASS Object.preventExtensions(window) threw exception TypeError: Cannot prevent extensions on this object.16 PASS Object.preventExtensions(window) threw exception TypeError: Unable to prevent extension in Object.preventExtensions. 17 17 PASS Object.isExtensible(window) is true 18 18 PASS Object.isExtensible(window.location) is true 19 PASS Object.preventExtensions(window.location) threw exception TypeError: Cannot prevent extensions on this object.19 PASS Object.preventExtensions(window.location) threw exception TypeError: Unable to prevent extension in Object.preventExtensions. 20 20 PASS Object.isExtensible(window.location) is true 21 21 PASS successfullyParsed is true -
trunk/LayoutTests/imported/w3c/ChangeLog
r270617 r270702 1 2020-12-11 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Reflect.preventExtensions should not throw if called on WindowProxy or Location 4 https://bugs.webkit.org/show_bug.cgi?id=219270 5 6 Reviewed by Darin Adler. 7 8 * web-platform-tests/html/browsers/history/the-location-interface/location-prevent-extensions-expected.txt: Added. 9 * web-platform-tests/html/browsers/history/the-location-interface/location-prevent-extensions.html: Added. 10 * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt: 11 * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html: 12 * web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prevent-extensions-expected.txt: Added. 13 * web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prevent-extensions.html: Added. 14 1 15 2020-12-09 Sergio Villar Senin <svillar@igalia.com> 2 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt
r269451 r270702 61 61 PASS [[IsExtensible]] should return true for cross-origin objects (same-origin + document.domain) 62 62 PASS [[IsExtensible]] should return true for cross-origin objects (cross-site) 63 PASS [[PreventExtensions]] should throw forcross-origin objects (cross-origin)64 PASS [[PreventExtensions]] should throw forcross-origin objects (same-origin + document.domain)65 PASS [[PreventExtensions]] should throw forcross-origin objects (cross-site)63 PASS [[PreventExtensions]] should return false cross-origin objects (cross-origin) 64 PASS [[PreventExtensions]] should return false cross-origin objects (same-origin + document.domain) 65 PASS [[PreventExtensions]] should return false cross-origin objects (cross-site) 66 66 PASS [[GetOwnProperty]] - Properties on cross-origin objects should be reported |own| (cross-origin) 67 67 PASS [[GetOwnProperty]] - Properties on cross-origin objects should be reported |own| (same-origin + document.domain) -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html
r269451 r270702 380 380 assert_throws_js(TypeError, function() { Object.preventExtensions(win.location) }, 381 381 "preventExtensions on cross-origin Location should throw"); 382 }, "[[PreventExtensions]] should throw for cross-origin objects"); 382 assert_false(Reflect.preventExtensions(win), 383 "Reflect.preventExtensions on cross-origin Window"); 384 assert_false(Reflect.preventExtensions(win.location), 385 "Reflect.preventExtensions on cross-origin Location"); 386 }, "[[PreventExtensions]] should return false cross-origin objects"); 383 387 384 388 /* -
trunk/Source/WebCore/ChangeLog
r270699 r270702 1 2020-12-11 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Reflect.preventExtensions should not throw if called on WindowProxy or Location 4 https://bugs.webkit.org/show_bug.cgi?id=219270 5 6 Reviewed by Darin Adler. 7 8 Since r254626 fixed Object.preventExtensions to throw a TypeError on 9 `false` result, this patch makes [[PreventExtensions]] overrides pure, 10 aligning Reflect.preventExtensions behavior with the spec [1], Gecko, 11 and (only for WindowProxy [2]) Blink. 12 13 [1]: https://html.spec.whatwg.org/multipage/history.html#location-preventextensions 14 [2]: https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-preventextensions 15 16 Tests: imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prevent-extensions.html 17 imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html 18 imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prevent-extensions.html 19 20 * bindings/js/JSDOMWindowCustom.cpp: 21 (WebCore::JSDOMWindow::preventExtensions): 22 * bindings/js/JSLocationCustom.cpp: 23 (WebCore::JSLocation::preventExtensions): 24 * bindings/js/JSRemoteDOMWindowCustom.cpp: 25 (WebCore::JSRemoteDOMWindow::preventExtensions): 26 1 27 2020-12-11 Fujii Hironori <Hironori.Fujii@sony.com> 2 28 -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r268990 r270702 496 496 } 497 497 498 bool JSDOMWindow::preventExtensions(JSObject*, JSGlobalObject* lexicalGlobalObject) 499 { 500 auto scope = DECLARE_THROW_SCOPE(lexicalGlobalObject->vm()); 501 502 throwTypeError(lexicalGlobalObject, scope, "Cannot prevent extensions on this object"_s); 498 bool JSDOMWindow::preventExtensions(JSObject*, JSGlobalObject*) 499 { 503 500 return false; 504 501 } -
trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp
r268551 r270702 221 221 } 222 222 223 bool JSLocation::preventExtensions(JSObject*, JSGlobalObject* lexicalGlobalObject) 224 { 225 auto scope = DECLARE_THROW_SCOPE(lexicalGlobalObject->vm()); 226 227 throwTypeError(lexicalGlobalObject, scope, "Cannot prevent extensions on this object"_s); 223 bool JSLocation::preventExtensions(JSObject*, JSGlobalObject*) 224 { 228 225 return false; 229 226 } -
trunk/Source/WebCore/bindings/js/JSRemoteDOMWindowCustom.cpp
r257399 r270702 123 123 } 124 124 125 bool JSRemoteDOMWindow::preventExtensions(JSObject*, JSGlobalObject* lexicalGlobalObject)125 bool JSRemoteDOMWindow::preventExtensions(JSObject*, JSGlobalObject*) 126 126 { 127 auto scope = DECLARE_THROW_SCOPE(lexicalGlobalObject->vm());128 throwTypeError(lexicalGlobalObject, scope, "Cannot prevent extensions on this object"_s);129 127 return false; 130 128 }
Note: See TracChangeset
for help on using the changeset viewer.