Changeset 224464 in webkit
- Timestamp:
- Nov 4, 2017 5:54:32 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r224457 r224464 1 2017-11-04 Chris Dumez <cdumez@apple.com> 2 3 Index properties on cross origin Window objects should be enumerable 4 https://bugs.webkit.org/show_bug.cgi?id=179289 5 6 Reviewed by Darin Adler. 7 8 Update / rebaseline existing test to match new expected behavior. 9 10 * js/dom/getOwnPropertyDescriptor-expected.txt: 11 * js/resources/getOwnPropertyDescriptor.js: 12 1 13 2017-11-04 Aishwarya Nirmal <anirmal@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/ChangeLog
r224453 r224464 1 2017-11-04 Chris Dumez <cdumez@apple.com> 2 3 Index properties on cross origin Window objects should be enumerable 4 https://bugs.webkit.org/show_bug.cgi?id=179289 5 6 Reviewed by Darin Adler. 7 8 Re-sync WPT test after: 9 - https://github.com/w3c/web-platform-tests/pull/8045 10 11 Rebaseline a couple of WPT tests now that more checks are passing. 12 13 * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt: 14 * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html: 15 * web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt: 16 1 17 2017-11-03 Youenn Fablet <youenn@apple.com> 2 18 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt
r224287 r224464 7 7 PASS [[PreventExtensions]] should throw for cross-origin objects 8 8 PASS [[GetOwnProperty]] - Properties on cross-origin objects should be reported |own| 9 FAIL [[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly assert_equals: property descriptor for 0 should be enumerable expected true but got false 9 PASS [[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly 10 10 PASS [[Delete]] Should throw on cross-origin objects 11 11 PASS [[DefineOwnProperty]] Should throw for cross-origin objects 12 FAIL Can only enumerate safelisted properties assert_equals: Enumerate all safelisted cross-origin Window properties expected 15 but got 0 13 FAIL [[OwnPropertyKeys]] should return all properties from cross-origin objects assert_array_equals: Object.keys() gives the right answer for cross-origin Window lengths differ, expected 15 got 0 12 PASS Can only enumerate safelisted enumerable properties 13 PASS [[OwnPropertyKeys]] should return all properties from cross-origin objects 14 14 PASS [[OwnPropertyKeys]] should return the right symbol-named properties for cross-origin objects 15 15 PASS [[OwnPropertyKeys]] should place the symbols after the property names after the subframe indices -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html
r219659 r224464 185 185 186 186 function checkPropertyDescriptor(desc, propName, expectWritable) { 187 var isSymbol = (typeof(propName) == "symbol"); 187 const isSymbol = typeof(propName) === "symbol"; 188 const isArrayIndexPropertyName = !isSymbol && !isNaN(parseInt(propName, 10)); 188 189 propName = String(propName); 189 190 assert_true(isObject(desc), "property descriptor for " + propName + " should exist"); 190 191 assert_equals(desc.configurable, true, "property descriptor for " + propName + " should be configurable"); 191 if (isSymbol) { 192 assert_equals(desc.enumerable, false, "symbol-property descriptor for " + propName + " should not be enumerable"); 193 assert_true("value" in desc, 194 "property descriptor for " + propName + " should be a value descriptor"); 195 assert_equals(desc.value, undefined, 192 if (!isArrayIndexPropertyName) { 193 assert_equals(desc.enumerable, false, "property descriptor for " + propName + " should not be enumerable"); 194 if(isSymbol) { 195 assert_true("value" in desc, 196 "property descriptor for " + propName + " should be a value descriptor"); 197 assert_equals(desc.value, undefined, 196 198 "symbol-named cross-origin visible prop " + propName + 197 199 " should come back as undefined"); 200 } 198 201 } else { 199 202 assert_equals(desc.enumerable, true, "property descriptor for " + propName + " should be enumerable"); … … 266 269 for (var prop in C) { 267 270 i++; 268 assert_true(whitelistedWindow PropNames.includes(prop), prop + " is not safelisted for a cross-origin Window");269 } 270 assert_equals(i, whitelistedWindow PropNames.length, "Enumerate allsafelisted cross-origin Window properties");271 assert_true(whitelistedWindowIndices.includes(prop), prop + " is not safelisted for a cross-origin Window"); 272 } 273 assert_equals(i, whitelistedWindowIndices.length, "Enumerate all enumerable safelisted cross-origin Window properties"); 271 274 i = 0; 272 275 for (var prop in C.location) { 273 276 i++; 274 assert_true(whitelistedLocationPropNames.includes(prop), prop + " is not safelisted for a cross-origin Location"); 275 } 276 assert_equals(i, whitelistedLocationPropNames.length, "Enumerate all safelisted cross-origin Location properties"); 277 }, "Can only enumerate safelisted properties"); 277 } 278 assert_equals(i, 0, "There's nothing to enumerate for cross-origin Location properties"); 279 }, "Can only enumerate safelisted enumerable properties"); 278 280 279 281 /* … … 286 288 "Object.getOwnPropertyNames() gives the right answer for cross-origin Window"); 287 289 assert_array_equals(Object.keys(C).sort(), 288 whitelistedWindow PropNames,290 whitelistedWindowIndices, 289 291 "Object.keys() gives the right answer for cross-origin Window"); 290 292 assert_array_equals(Object.getOwnPropertyNames(C.location).sort(), 291 293 whitelistedLocationPropNames, 292 294 "Object.getOwnPropertyNames() gives the right answer for cross-origin Location"); 293 assert_array_equals(Object.keys(C.location).sort(), 294 whitelistedLocationPropNames, 295 assert_equals(Object.keys(C.location).length, 0, 295 296 "Object.keys() gives the right answer for cross-origin Location"); 296 297 }, "[[OwnPropertyKeys]] should return all properties from cross-origin objects"); -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt
r224287 r224464 1 1 2 2 PASS Indexed properties of the window object (non-strict mode) 3 FAIL Ensure indexed properties have the correct configuration assert_true: expected true got false 3 PASS Ensure indexed properties have the correct configuration 4 4 FAIL Indexed properties of the window object (non-strict mode) 1 assert_throws: function "() => Object.defineProperty(window, 0, { value: "bar" })" did not throw 5 5 FAIL Indexed properties of the window object (non-strict mode) 2 assert_throws: function "() => Object.defineProperty(window, 1, { value: "bar" })" did not throw -
trunk/LayoutTests/js/dom/getOwnPropertyDescriptor-expected.txt
r224287 r224464 129 129 PASS Object.getOwnPropertyDescriptor(global, 0).hasOwnProperty('get') is false 130 130 PASS Object.getOwnPropertyDescriptor(global, 0).hasOwnProperty('set') is false 131 PASS Object.getOwnPropertyDescriptor(global, 0).enumerable is false131 PASS Object.getOwnPropertyDescriptor(global, 0).enumerable is true 132 132 PASS Object.getOwnPropertyDescriptor(global, 0).configurable is true 133 133 PASS Object.getOwnPropertyDescriptor(document.getElementsByTagName('div'), 0).value is document.getElementsByTagName('div')[0] -
trunk/LayoutTests/js/resources/getOwnPropertyDescriptor.js
r224287 r224464 45 45 descriptorShouldBe("global", "'window'", {get: 'globalWindowGetter', set: undefined, enumerable: true, configurable: false}); 46 46 descriptorShouldBe("global", "'XMLHttpRequest'", {writable: true, enumerable: false, configurable: true, value:"XMLHttpRequest"}); 47 descriptorShouldBe("global", "0", {writable: true, enumerable: false, configurable: true, value:"global[0]"});47 descriptorShouldBe("global", "0", {writable: true, enumerable: true, configurable: true, value:"global[0]"}); 48 48 descriptorShouldBe("document.getElementsByTagName('div')", "0", {writable: false, enumerable: true, configurable: true, value:"document.getElementsByTagName('div')[0]"}); 49 49 descriptorShouldBe("document.getElementsByClassName('pass')", "0", {writable: false, enumerable: true, configurable: true, value:"document.getElementsByClassName('pass')[0]"}); -
trunk/Source/WebCore/ChangeLog
r224463 r224464 1 2017-11-04 Chris Dumez <cdumez@apple.com> 2 3 Index properties on cross origin Window objects should be enumerable 4 https://bugs.webkit.org/show_bug.cgi?id=179289 5 6 Reviewed by Darin Adler. 7 8 Index properties on cross origin Window objects should be enumerable: 9 - https://github.com/whatwg/html/pull/3186 10 - https://github.com/w3c/web-platform-tests/pull/8045 11 12 All exposed properties used to be enumerable but we had to revert this in 13 r224287 because it was not Web-compatible. The HTML specification has now 14 been updated so that only index properties are enumerable cross origin. 15 16 No new tests, rebaselined existing tests. 17 18 * bindings/js/JSDOMWindowCustom.cpp: 19 (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): 20 (WebCore::JSDOMWindow::getOwnPropertyNames): 21 1 22 2017-11-04 Simon Fraser <simon.fraser@apple.com> 2 23 -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r224287 r224464 234 234 // These are also allowed cross-orgin, so come before the access check. 235 235 if (frame && index < frame->tree().scopedChildCount()) { 236 slot.setValue(thisObject, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum), toJS(state, frame->tree().scopedChild(index)->document()->domWindow()));236 slot.setValue(thisObject, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly), toJS(state, frame->tree().scopedChild(index)->document()->domWindow())); 237 237 return true; 238 238 } … … 352 352 JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object); 353 353 354 if (mode.includeDontEnumProperties()) 355 addScopedChildrenIndexes(*exec, thisObject->wrapped(), propertyNames); 354 addScopedChildrenIndexes(*exec, thisObject->wrapped(), propertyNames); 356 355 357 356 if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, thisObject->wrapped(), DoNotReportSecurityError)) {
Note: See TracChangeset
for help on using the changeset viewer.