Title: [206233] trunk
- Revision
- 206233
- Author
- cdu...@apple.com
- Date
- 2016-09-21 13:47:00 -0700 (Wed, 21 Sep 2016)
Log Message
Fix enumeration of properties cross origin
https://bugs.webkit.org/show_bug.cgi?id=162328
Reviewed by Darin Adler.
LayoutTests/imported/w3c:
Rebaseline W3C test now that one more check is passing.
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:
Source/WebCore:
All cross origin properties for Window / Location are supposed to be not enumerable:
- https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
Therefore, there should be no properties to iterate on for cross origin Window /
Location objects.
No new tests, rebaselined existing test.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertyNames):
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::getOwnPropertyNames):
Modified Paths
Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (206232 => 206233)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2016-09-21 20:40:59 UTC (rev 206232)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2016-09-21 20:47:00 UTC (rev 206233)
@@ -1,5 +1,16 @@
2016-09-21 Chris Dumez <cdu...@apple.com>
+ Fix enumeration of properties cross origin
+ https://bugs.webkit.org/show_bug.cgi?id=162328
+
+ Reviewed by Darin Adler.
+
+ Rebaseline W3C test now that one more check is passing.
+
+ * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:
+
+2016-09-21 Chris Dumez <cdu...@apple.com>
+
Object.getOwnPropertyDescriptor() does not work correctly cross origin
https://bugs.webkit.org/show_bug.cgi?id=162311
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt (206232 => 206233)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt 2016-09-21 20:40:59 UTC (rev 206232)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt 2016-09-21 20:47:00 UTC (rev 206233)
@@ -11,7 +11,7 @@
PASS [[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly
PASS [[Delete]] Should throw on cross-origin objects
PASS [[DefineOwnProperty]] Should throw for cross-origin objects
-FAIL [[Enumerate]] should return an empty iterator assert_unreached: Shouldn't have been able to enumerate href on cross-origin Location Reached unreachable code
+PASS [[Enumerate]] should return an empty iterator
PASS [[OwnPropertyKeys]] should return all properties from cross-origin objects
PASS A and B jointly observe the same identity for cross-origin Window and Location
PASS Cross-origin functions get local Function.prototype
Modified: trunk/Source/WebCore/ChangeLog (206232 => 206233)
--- trunk/Source/WebCore/ChangeLog 2016-09-21 20:40:59 UTC (rev 206232)
+++ trunk/Source/WebCore/ChangeLog 2016-09-21 20:47:00 UTC (rev 206233)
@@ -1,3 +1,23 @@
+2016-09-21 Chris Dumez <cdu...@apple.com>
+
+ Fix enumeration of properties cross origin
+ https://bugs.webkit.org/show_bug.cgi?id=162328
+
+ Reviewed by Darin Adler.
+
+ All cross origin properties for Window / Location are supposed to be not enumerable:
+ - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
+
+ Therefore, there should be no properties to iterate on for cross origin Window /
+ Location objects.
+
+ No new tests, rebaselined existing test.
+
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::getOwnPropertyNames):
+ * bindings/js/JSLocationCustom.cpp:
+ (WebCore::JSLocation::getOwnPropertyNames):
+
2016-09-21 Alex Christensen <achristen...@webkit.org>
URLParser should fail when parsing invalid relative URLs with no schemes
Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (206232 => 206233)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2016-09-21 20:40:59 UTC (rev 206232)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2016-09-21 20:47:00 UTC (rev 206233)
@@ -339,7 +339,8 @@
{
JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object);
if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, thisObject->wrapped(), DoNotReportSecurityError)) {
- addCrossOriginWindowPropertyNames(*exec, propertyNames);
+ if (mode.includeDontEnumProperties())
+ addCrossOriginWindowPropertyNames(*exec, propertyNames);
return;
}
Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
Modified: trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp (206232 => 206233)
--- trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp 2016-09-21 20:40:59 UTC (rev 206232)
+++ trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp 2016-09-21 20:47:00 UTC (rev 206233)
@@ -128,7 +128,8 @@
{
JSLocation* thisObject = jsCast<JSLocation*>(object);
if (!BindingSecurity::shouldAllowAccessToFrame(exec, thisObject->wrapped().frame(), DoNotReportSecurityError)) {
- addCrossOriginLocationPropertyNames(*exec, propertyNames);
+ if (mode.includeDontEnumProperties())
+ addCrossOriginLocationPropertyNames(*exec, propertyNames);
return;
}
Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes