Title: [204196] trunk

Diff

Modified: trunk/LayoutTests/ChangeLog (204195 => 204196)


--- trunk/LayoutTests/ChangeLog	2016-08-05 21:54:59 UTC (rev 204195)
+++ trunk/LayoutTests/ChangeLog	2016-08-05 22:26:01 UTC (rev 204196)
@@ -1,3 +1,15 @@
+2016-08-05  Ryan Haddad  <[email protected]>
+
+        Unreviewed, rolling out r204181.
+
+        This change caused an existing LayoutTest to fail on WK1
+
+        Reverted changeset:
+
+        "Don't set document.domain to an IP address fragment"
+        https://bugs.webkit.org/show_bug.cgi?id=126045
+        http://trac.webkit.org/changeset/204181
+
 2016-08-05  Simon Fraser  <[email protected]>
 
         Sierra WK1: compositing/masks/compositing-clip-path-change-no-repaint.html failing

Modified: trunk/LayoutTests/http/tests/security/aboutBlank/security-context-alias.html (204195 => 204196)


--- trunk/LayoutTests/http/tests/security/aboutBlank/security-context-alias.html	2016-08-05 21:54:59 UTC (rev 204195)
+++ trunk/LayoutTests/http/tests/security/aboutBlank/security-context-alias.html	2016-08-05 22:26:01 UTC (rev 204196)
@@ -7,9 +7,6 @@
 if (window.testRunner)
   testRunner.dumpAsText();
 
-if (window.internals)
-    window.internals.settings.setTreatIPAddressAsDomain(true);
-
 document.write('--- Test begins ---\n');
 document.write('* "about:blank"\n');
 document.write('document.domain = ' + frames[0].document.domain + '\n');

Modified: trunk/LayoutTests/http/tests/security/aboutBlank/security-context-grandchildren-alias.html (204195 => 204196)


--- trunk/LayoutTests/http/tests/security/aboutBlank/security-context-grandchildren-alias.html	2016-08-05 21:54:59 UTC (rev 204195)
+++ trunk/LayoutTests/http/tests/security/aboutBlank/security-context-grandchildren-alias.html	2016-08-05 22:26:01 UTC (rev 204196)
@@ -6,9 +6,6 @@
   testRunner.waitUntilDone();
 }
 
-if (window.internals)
-    window.internals.settings.setTreatIPAddressAsDomain(true);
-
 function log(msg) {
   var line = document.createElement('div');
   line.appendChild(document.createTextNode(msg));

Modified: trunk/LayoutTests/http/tests/security/postMessage/origin-unaffected-by-document-domain.html (204195 => 204196)


--- trunk/LayoutTests/http/tests/security/postMessage/origin-unaffected-by-document-domain.html	2016-08-05 21:54:59 UTC (rev 204195)
+++ trunk/LayoutTests/http/tests/security/postMessage/origin-unaffected-by-document-domain.html	2016-08-05 22:26:01 UTC (rev 204196)
@@ -8,9 +8,6 @@
     testRunner.waitUntilDone();
 }
 
-if (window.internals)
-    window.internals.settings.setTreatIPAddressAsDomain(true);
-
 addEventListener("message", recv, false);
 
 function test() {

Deleted: trunk/LayoutTests/http/tests/security/set-domain-remove-subdomain-for-ip-address-expected.txt (204195 => 204196)


--- trunk/LayoutTests/http/tests/security/set-domain-remove-subdomain-for-ip-address-expected.txt	2016-08-05 21:54:59 UTC (rev 204195)
+++ trunk/LayoutTests/http/tests/security/set-domain-remove-subdomain-for-ip-address-expected.txt	2016-08-05 22:26:01 UTC (rev 204196)
@@ -1,11 +0,0 @@
-Test whether a page loaded straight from an IP address can set document.domain and wrongly treat IP address octets as subdomains.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.domain = '0.0.1' threw exception SecurityError (DOM Exception 18): The operation is insecure..
-PASS document.domain is "127.0.0.1"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/http/tests/security/set-domain-remove-subdomain-for-ip-address.html (204195 => 204196)


--- trunk/LayoutTests/http/tests/security/set-domain-remove-subdomain-for-ip-address.html	2016-08-05 21:54:59 UTC (rev 204195)
+++ trunk/LayoutTests/http/tests/security/set-domain-remove-subdomain-for-ip-address.html	2016-08-05 22:26:01 UTC (rev 204196)
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <title>Try to set document.domain and wrongly treat IP address octets as subdomains</title>
-    <script src=""
-</head>
-<body>
-<script>
-    description("Test whether a page loaded straight from an IP address can set document.domain and wrongly treat IP address octets as subdomains.");
-
-    if (document.domain != "127.0.0.1") {
-        document.location.hostname = "127.0.0.1";
-    }
-
-    shouldThrow("document.domain = '0.0.1'", "'SecurityError (DOM Exception 18): The operation is insecure.'");
-    shouldBeEqualToString("document.domain", "127.0.0.1");
-</script>
-<script src=""
-</body>
-</html>

Modified: trunk/LayoutTests/http/tests/workers/worker-document-domain-security.html (204195 => 204196)


--- trunk/LayoutTests/http/tests/workers/worker-document-domain-security.html	2016-08-05 21:54:59 UTC (rev 204195)
+++ trunk/LayoutTests/http/tests/workers/worker-document-domain-security.html	2016-08-05 22:26:01 UTC (rev 204196)
@@ -5,9 +5,6 @@
 if (window.testRunner)
     testRunner.dumpAsText();
 
-if (window.internals)
-    window.internals.settings.setTreatIPAddressAsDomain(true);
-
 function log(message)
 {
     document.getElementById("result").innerHTML += message + "<br>";

Modified: trunk/LayoutTests/http/tests/xmlhttprequest/document-domain-set.html (204195 => 204196)


--- trunk/LayoutTests/http/tests/xmlhttprequest/document-domain-set.html	2016-08-05 21:54:59 UTC (rev 204195)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/document-domain-set.html	2016-08-05 22:26:01 UTC (rev 204196)
@@ -5,9 +5,6 @@
 if (window.testRunner)
   testRunner.dumpAsText();
 
-if (window.internals)
-    window.internals.settings.setTreatIPAddressAsDomain(true);
-
 document.domain = '0.0.1';
 
 document.write('Waiting...\n');

Modified: trunk/Source/WebCore/ChangeLog (204195 => 204196)


--- trunk/Source/WebCore/ChangeLog	2016-08-05 21:54:59 UTC (rev 204195)
+++ trunk/Source/WebCore/ChangeLog	2016-08-05 22:26:01 UTC (rev 204196)
@@ -1,3 +1,15 @@
+2016-08-05  Ryan Haddad  <[email protected]>
+
+        Unreviewed, rolling out r204181.
+
+        This change caused an existing LayoutTest to fail on WK1
+
+        Reverted changeset:
+
+        "Don't set document.domain to an IP address fragment"
+        https://bugs.webkit.org/show_bug.cgi?id=126045
+        http://trac.webkit.org/changeset/204181
+
 2016-08-05  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r204128.

Modified: trunk/Source/WebCore/dom/Document.cpp (204195 => 204196)


--- trunk/Source/WebCore/dom/Document.cpp	2016-08-05 21:54:59 UTC (rev 204195)
+++ trunk/Source/WebCore/dom/Document.cpp	2016-08-05 22:26:01 UTC (rev 204196)
@@ -121,7 +121,6 @@
 #include "NodeIterator.h"
 #include "NodeRareData.h"
 #include "NodeWithIndex.h"
-#include "OriginAccessEntry.h"
 #include "OverflowEvent.h"
 #include "PageConsoleClient.h"
 #include "PageGroup.h"
@@ -4498,13 +4497,6 @@
         return;
     }
 
-    OriginAccessEntry::IPAddressSetting ipAddressSetting = settings() && settings()->treatIPAddressAsDomain() ? OriginAccessEntry::TreatIPAddressAsDomain : OriginAccessEntry::TreatIPAddressAsIPAddress;
-    OriginAccessEntry accessEntry(securityOrigin()->protocol(), newDomain, OriginAccessEntry::AllowSubdomains, ipAddressSetting);
-    if (!accessEntry.matchesOrigin(*securityOrigin())) {
-        ec = SECURITY_ERR;
-        return;
-    }
-
     String test = domain();
     // Check that it's a subdomain, not e.g. "ebkit.org"
     if (test[oldLength - newLength - 1] != '.') {

Modified: trunk/Source/WebCore/page/OriginAccessEntry.cpp (204195 => 204196)


--- trunk/Source/WebCore/page/OriginAccessEntry.cpp	2016-08-05 21:54:59 UTC (rev 204195)
+++ trunk/Source/WebCore/page/OriginAccessEntry.cpp	2016-08-05 22:26:01 UTC (rev 204196)
@@ -35,11 +35,10 @@
 
 namespace WebCore {
     
-OriginAccessEntry::OriginAccessEntry(const String& protocol, const String& host, SubdomainSetting subdomainSetting, IPAddressSetting ipAddressSetting)
+OriginAccessEntry::OriginAccessEntry(const String& protocol, const String& host, SubdomainSetting subdomainSetting)
     : m_protocol(protocol.convertToASCIILowercase())
     , m_host(host.convertToASCIILowercase())
     , m_subdomainSettings(subdomainSetting)
-    , m_ipAddressSettings(ipAddressSetting)
 {
     ASSERT(subdomainSetting == AllowSubdomains || subdomainSetting == DisallowSubdomains);
 
@@ -66,9 +65,9 @@
     // Otherwise we can only match if we're matching subdomains.
     if (m_subdomainSettings == DisallowSubdomains)
         return false;
-
+    
     // Don't try to do subdomain matching on IP addresses.
-    if (m_hostIsIPAddress && m_ipAddressSettings == TreatIPAddressAsIPAddress)
+    if (m_hostIsIPAddress)
         return false;
     
     // Match subdomains.

Modified: trunk/Source/WebCore/page/OriginAccessEntry.h (204195 => 204196)


--- trunk/Source/WebCore/page/OriginAccessEntry.h	2016-08-05 21:54:59 UTC (rev 204195)
+++ trunk/Source/WebCore/page/OriginAccessEntry.h	2016-08-05 22:26:01 UTC (rev 204196)
@@ -44,34 +44,24 @@
         DisallowSubdomains
     };
 
-    enum IPAddressSetting {
-        TreatIPAddressAsDomain,
-        TreatIPAddressAsIPAddress
-    };
-
     // If host is empty string and SubdomainSetting is AllowSubdomains, the entry will match all domains in the specified protocol.
-    OriginAccessEntry(const String& protocol, const String& host, SubdomainSetting, IPAddressSetting);
+    OriginAccessEntry(const String& protocol, const String& host, SubdomainSetting);
     bool matchesOrigin(const SecurityOrigin&) const;
 
     const String& protocol() const { return m_protocol; }
     const String& host() const { return m_host; }
     SubdomainSetting subdomainSettings() const { return m_subdomainSettings; }
-    IPAddressSetting ipAddressSettings() const { return m_ipAddressSettings; }
 
 private:
     String m_protocol;
     String m_host;
     SubdomainSetting m_subdomainSettings;
-    IPAddressSetting m_ipAddressSettings;
     bool m_hostIsIPAddress;
 };
 
 inline bool operator==(const OriginAccessEntry& a, const OriginAccessEntry& b)
 {
-    return equalIgnoringASCIICase(a.protocol(), b.protocol())
-        && equalIgnoringASCIICase(a.host(), b.host())
-        && a.subdomainSettings() == b.subdomainSettings()
-        && a.ipAddressSettings() == b.ipAddressSettings();
+    return equalIgnoringASCIICase(a.protocol(), b.protocol()) && equalIgnoringASCIICase(a.host(), b.host()) && a.subdomainSettings() == b.subdomainSettings();
 }
 
 inline bool operator!=(const OriginAccessEntry& a, const OriginAccessEntry& b)

Modified: trunk/Source/WebCore/page/SecurityPolicy.cpp (204195 => 204196)


--- trunk/Source/WebCore/page/SecurityPolicy.cpp	2016-08-05 21:54:59 UTC (rev 204195)
+++ trunk/Source/WebCore/page/SecurityPolicy.cpp	2016-08-05 22:26:01 UTC (rev 204196)
@@ -139,7 +139,7 @@
         result.iterator->value = std::make_unique<OriginAccessWhiteList>();
 
     OriginAccessWhiteList* list = result.iterator->value.get();
-    list->append(OriginAccessEntry(destinationProtocol, destinationDomain, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains, OriginAccessEntry::TreatIPAddressAsIPAddress));
+    list->append(OriginAccessEntry(destinationProtocol, destinationDomain, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains));
 }
 
 void SecurityPolicy::removeOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains)
@@ -156,7 +156,7 @@
         return;
 
     OriginAccessWhiteList& list = *it->value;
-    OriginAccessEntry originAccessEntry(destinationProtocol, destinationDomain, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains, OriginAccessEntry::TreatIPAddressAsIPAddress);
+    OriginAccessEntry originAccessEntry(destinationProtocol, destinationDomain, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains);
     if (!list.removeFirst(originAccessEntry))
         return;
 

Modified: trunk/Source/WebCore/page/Settings.in (204195 => 204196)


--- trunk/Source/WebCore/page/Settings.in	2016-08-05 21:54:59 UTC (rev 204195)
+++ trunk/Source/WebCore/page/Settings.in	2016-08-05 22:26:01 UTC (rev 204196)
@@ -271,5 +271,3 @@
 shouldConvertInvalidURLsToBlank initial=true
 
 springTimingFunctionEnabled initial=false
-
-treatIPAddressAsDomain initial=false
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to