Title: [209841] trunk
Revision
209841
Author
wei...@apple.com
Date
2016-12-14 16:04:01 -0800 (Wed, 14 Dec 2016)

Log Message

Source/WebCore:
REGRESSION (204679): Google notifications never load (expecting DOMStringList rather than JS array for Location.ancestorOrigins)
<rdar://problem/29573563>
https://bugs.webkit.org/show_bug.cgi?id=165872

Reviewed by Chris Dumez.

Revert the Location.ancestorOrigins part of r204679 because google.com is relying on
it returning a DOMStringList (or at least something with a .item() function), rather
than a frozen _javascript_ array.
        
Spec changes are tracked with https://github.com/whatwg/html/issues/2179.

* page/Location.cpp:
(WebCore::Location::ancestorOrigins):
* page/Location.h:
* page/Location.idl:
Change Location.ancestorOrigins back to returning a DOMStringList.

Source/WebKit2:
[WebIDL] Add support for converting dictionaries to JS
https://bugs.webkit.org/show_bug.cgi?id=165367

Reviewed by Chris Dumez.

* CMakeLists.txt:
Add missing directories to look in for headers.

LayoutTests:
REGRESSION (204679): Google notifications never load (expecting DOMStringList rather than JS array for Location.ancestorOrigins)
<rdar://problem/29573563>
https://bugs.webkit.org/show_bug.cgi?id=165872

Reviewed by Chris Dumez.

* fast/dom/Window/Location/ancestor-origins-expected.txt:
* fast/dom/Window/Location/ancestor-origins.html:
Change back to test that Location.ancestorOrigins returns a DOMStringList.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (209840 => 209841)


--- trunk/LayoutTests/ChangeLog	2016-12-15 00:00:38 UTC (rev 209840)
+++ trunk/LayoutTests/ChangeLog	2016-12-15 00:04:01 UTC (rev 209841)
@@ -1,3 +1,15 @@
+2016-12-14  Sam Weinig  <s...@webkit.org>
+
+        REGRESSION (204679): Google notifications never load (expecting DOMStringList rather than JS array for Location.ancestorOrigins)
+        <rdar://problem/29573563>
+        https://bugs.webkit.org/show_bug.cgi?id=165872
+
+        Reviewed by Chris Dumez.
+
+        * fast/dom/Window/Location/ancestor-origins-expected.txt:
+        * fast/dom/Window/Location/ancestor-origins.html:
+        Change back to test that Location.ancestorOrigins returns a DOMStringList.
+
 2016-12-14  Ryan Haddad  <ryanhad...@apple.com>
 
         Marking streams/pipe-to.html as flaky on macOS debug.

Modified: trunk/LayoutTests/fast/dom/Window/Location/ancestor-origins-expected.txt (209840 => 209841)


--- trunk/LayoutTests/fast/dom/Window/Location/ancestor-origins-expected.txt	2016-12-15 00:00:38 UTC (rev 209840)
+++ trunk/LayoutTests/fast/dom/Window/Location/ancestor-origins-expected.txt	2016-12-15 00:04:01 UTC (rev 209841)
@@ -3,11 +3,9 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS window.location.ancestorOrigins is an instance of Array
+PASS window.location.ancestorOrigins is an instance of DOMStringList
 PASS window.location.ancestorOrigins.length is 0
-PASS Object.isFrozen(window.location.ancestorOrigins) is true
 PASS window.location.ancestorOrigins === window.location.ancestorOrigins is true
-PASS subframeOrigins is an instance of Array
 PASS subframeOrigins.length is 1
 PASS subframeOrigins[0] is 'file://'
 PASS successfullyParsed is true

Modified: trunk/LayoutTests/fast/dom/Window/Location/ancestor-origins.html (209840 => 209841)


--- trunk/LayoutTests/fast/dom/Window/Location/ancestor-origins.html	2016-12-15 00:00:38 UTC (rev 209840)
+++ trunk/LayoutTests/fast/dom/Window/Location/ancestor-origins.html	2016-12-15 00:04:01 UTC (rev 209841)
@@ -9,9 +9,8 @@
 
 description("Test the Location object's ancestorOrigins property.")
 
-shouldBeType("window.location.ancestorOrigins", "Array");
+shouldBeType("window.location.ancestorOrigins", "DOMStringList");
 shouldBe("window.location.ancestorOrigins.length", "0");
-shouldBeTrue("Object.isFrozen(window.location.ancestorOrigins)");
 shouldBeTrue("window.location.ancestorOrigins === window.location.ancestorOrigins");
 
 var subframeOrigins;
@@ -20,7 +19,6 @@
 {
     subframeOrigins = event.data;
 
-    shouldBeType("subframeOrigins", "Array");
     shouldBe("subframeOrigins.length", "1");
     shouldBe("subframeOrigins[0]", "'file://'");
 
@@ -30,7 +28,11 @@
 </script>
 <iframe srcdoc="
   <script>
-    top.postMessage(location.ancestorOrigins, '*')
+    var origins = [];
+    for (var i = 0; i < location.ancestorOrigins.length; ++i) {
+        origins.push(location.ancestorOrigins.item(i));
+    }
+    top.postMessage(origins, '*')
   </script>
 "></iframe>
 <script src=""

Modified: trunk/Source/WebCore/ChangeLog (209840 => 209841)


--- trunk/Source/WebCore/ChangeLog	2016-12-15 00:00:38 UTC (rev 209840)
+++ trunk/Source/WebCore/ChangeLog	2016-12-15 00:04:01 UTC (rev 209841)
@@ -1,3 +1,23 @@
+2016-12-14  Sam Weinig  <s...@webkit.org>
+
+        REGRESSION (204679): Google notifications never load (expecting DOMStringList rather than JS array for Location.ancestorOrigins)
+        <rdar://problem/29573563>
+        https://bugs.webkit.org/show_bug.cgi?id=165872
+
+        Reviewed by Chris Dumez.
+
+        Revert the Location.ancestorOrigins part of r204679 because google.com is relying on
+        it returning a DOMStringList (or at least something with a .item() function), rather
+        than a frozen _javascript_ array.
+        
+        Spec changes are tracked with https://github.com/whatwg/html/issues/2179.
+
+        * page/Location.cpp:
+        (WebCore::Location::ancestorOrigins):
+        * page/Location.h:
+        * page/Location.idl:
+        Change Location.ancestorOrigins back to returning a DOMStringList.
+
 2016-12-14  Dave Hyatt  <hy...@apple.com>
 
         [CSS Parser] Rename StyleKeyframe to StyleRuleKeyframe

Modified: trunk/Source/WebCore/page/Location.cpp (209840 => 209841)


--- trunk/Source/WebCore/page/Location.cpp	2016-12-15 00:00:38 UTC (rev 209840)
+++ trunk/Source/WebCore/page/Location.cpp	2016-12-15 00:04:01 UTC (rev 209841)
@@ -131,13 +131,13 @@
     return SecurityOrigin::create(url())->toString();
 }
 
-Vector<String> Location::ancestorOrigins() const
+Ref<DOMStringList> Location::ancestorOrigins() const
 {
-    Vector<String> origins;
+    auto origins = DOMStringList::create();
     if (!m_frame)
         return origins;
     for (Frame* frame = m_frame->tree().parent(); frame; frame = frame->tree().parent())
-        origins.append(frame->document()->securityOrigin()->toString());
+        origins->append(frame->document()->securityOrigin()->toString());
     return origins;
 }
 

Modified: trunk/Source/WebCore/page/Location.h (209840 => 209841)


--- trunk/Source/WebCore/page/Location.h	2016-12-15 00:00:38 UTC (rev 209840)
+++ trunk/Source/WebCore/page/Location.h	2016-12-15 00:04:01 UTC (rev 209841)
@@ -68,7 +68,7 @@
 
     String toString() const { return href(); }
 
-    Vector<String> ancestorOrigins() const;
+    Ref<DOMStringList> ancestorOrigins() const;
 
 private:
     explicit Location(Frame*);

Modified: trunk/Source/WebCore/page/Location.idl (209840 => 209841)


--- trunk/Source/WebCore/page/Location.idl	2016-12-15 00:00:38 UTC (rev 209840)
+++ trunk/Source/WebCore/page/Location.idl	2016-12-15 00:04:01 UTC (rev 209841)
@@ -58,6 +58,6 @@
 
     readonly attribute USVString origin;
 
-    // FIXME: Add support for SameObject
-    [Unforgeable, CachedAttribute] readonly attribute FrozenArray<USVString> ancestorOrigins;
+    // FIXME: Add support for SameObject.
+    [Unforgeable, CachedAttribute] readonly attribute DOMStringList ancestorOrigins;
 };

Modified: trunk/Source/WebKit2/ChangeLog (209840 => 209841)


--- trunk/Source/WebKit2/ChangeLog	2016-12-15 00:00:38 UTC (rev 209840)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-15 00:04:01 UTC (rev 209841)
@@ -1,3 +1,13 @@
+2016-12-04  Sam Weinig  <s...@webkit.org>
+
+        [WebIDL] Add support for converting dictionaries to JS
+        https://bugs.webkit.org/show_bug.cgi?id=165367
+
+        Reviewed by Chris Dumez.
+
+        * CMakeLists.txt:
+        Add missing directories to look in for headers.
+
 2016-12-14  Anders Carlsson  <ander...@apple.com>
 
         Add WKContextRefreshPlugIns
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to