Source/WebCore:
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Dec 2016 00:04:01 +0000 (00:04 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Dec 2016 00:04:01 +0000 (00:04 +0000)
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209841 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dom/Window/Location/ancestor-origins-expected.txt
LayoutTests/fast/dom/Window/Location/ancestor-origins.html
Source/WebCore/ChangeLog
Source/WebCore/page/Location.cpp
Source/WebCore/page/Location.h
Source/WebCore/page/Location.idl
Source/WebKit2/ChangeLog

index 03cfef2..f535d05 100644 (file)
@@ -1,3 +1,15 @@
+2016-12-14  Sam Weinig  <sam@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  <ryanhaddad@apple.com>
 
         Marking streams/pipe-to.html as flaky on macOS debug.
index 2de6d10..6fe12a1 100644 (file)
@@ -3,11 +3,9 @@ Test the Location object's ancestorOrigins property.
 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
index f9912e5..ff45a52 100644 (file)
@@ -9,9 +9,8 @@ self.jsTestIsAsync = true;
 
 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 @@ window.onmessage = function(event)
 {
     subframeOrigins = event.data;
 
-    shouldBeType("subframeOrigins", "Array");
     shouldBe("subframeOrigins.length", "1");
     shouldBe("subframeOrigins[0]", "'file://'");
 
@@ -30,7 +28,11 @@ window.onmessage = function(event)
 </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="../../../../resources/js-test-post.js"></script>
index 62d361f..2756035 100644 (file)
@@ -1,3 +1,23 @@
+2016-12-14  Sam Weinig  <sam@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  <hyatt@apple.com>
 
         [CSS Parser] Rename StyleKeyframe to StyleRuleKeyframe
index 076b7c0..8d839d1 100644 (file)
@@ -131,13 +131,13 @@ String Location::origin() const
     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;
 }
 
index 4e77a70..c70d9c8 100644 (file)
@@ -68,7 +68,7 @@ public:
 
     String toString() const { return href(); }
 
-    Vector<String> ancestorOrigins() const;
+    Ref<DOMStringList> ancestorOrigins() const;
 
 private:
     explicit Location(Frame*);
index e435eeb..ae6d811 100644 (file)
@@ -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;
 };
index ff77473..0406470 100644 (file)
@@ -1,3 +1,13 @@
+2016-12-04  Sam Weinig  <sam@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  <andersca@apple.com>
 
         Add WKContextRefreshPlugIns