Merge mozilla-inbound to mozilla-central. a=merge
authorDorel Luca <dluca@mozilla.com>
Sun, 28 Oct 2018 00:52:51 +0300
changeset 443258 6d7686f1082fbfc2ff22854ad7b69201e03370fb
parent 443257 6771e96bb3761db4c5c6b7c76762b4ec8ff8c532 (current diff)
parent 443253 e11449a47b08244567e6252a662950f9d1e44edc (diff)
child 443259 b55eb489f1e65bfbfdd28efb92dd9092f07af656
push id109330
push useraciure@mozilla.com
push dateSun, 28 Oct 2018 09:55:35 +0000
treeherdermozilla-inbound@ba284d91a4bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone65.0a1
first release with
nightly linux32
6d7686f1082f / 65.0a1 / 20181027220121 / files
nightly linux64
6d7686f1082f / 65.0a1 / 20181027220121 / files
nightly mac
6d7686f1082f / 65.0a1 / 20181027220121 / files
nightly win32
6d7686f1082f / 65.0a1 / 20181027220121 / files
nightly win64
6d7686f1082f / 65.0a1 / 20181027220121 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-inbound to mozilla-central. a=merge
testing/web-platform/meta/FileAPI/blob/Blob-constructor.html.ini
testing/web-platform/meta/FileAPI/file/File-constructor-endings.html.ini
testing/web-platform/meta/FileAPI/idlharness.html.ini
testing/web-platform/meta/FileAPI/idlharness.worker.js.ini
--- a/browser/base/content/test/sanitize/browser_cookiePermission.js
+++ b/browser/base/content/test/sanitize/browser_cookiePermission.js
@@ -1,113 +1,171 @@
+const STORAGE = "storage";
+const HOST_COOKIE = "host cookie";
+const DOMAIN_COOKIE = "domain cookie";
+
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Sanitizer} = ChromeUtils.import("resource:///modules/Sanitizer.jsm", {});
 const {SiteDataTestUtils} = ChromeUtils.import("resource://testing-common/SiteDataTestUtils.jsm", {});
 
 function hasIndexedDB(origin) {
   return new Promise(resolve => {
-    let hasData = true;
+    let data = true;
     let uri = Services.io.newURI(origin);
     let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
     let request = indexedDB.openForPrincipal(principal, "TestDatabase", 1);
     request.onupgradeneeded = function(e) {
-      hasData = false;
+      data = false;
     };
     request.onsuccess = function(e) {
-      resolve(hasData);
+      resolve(data);
     };
   });
 }
 
-async function createData(host) {
-  let origin = "https://" + host;
-  await SiteDataTestUtils.addToIndexedDB(origin);
+async function createData(host, what) {
+  if (what == STORAGE) {
+    let origin = "https://" + host;
+    await SiteDataTestUtils.addToIndexedDB(origin);
+    return;
+  }
+
+  if (what == HOST_COOKIE) {
+    Services.cookies.add(host, "/test1", "foo", "bar",
+      false, false, false, Date.now() + 24000 * 60 * 60, {},
+      Ci.nsICookie2.SAMESITE_UNSET);
+    return;
+  }
+
+  if (what == DOMAIN_COOKIE) {
+    Services.cookies.add("." + host, "/test1", "foo", "bar",
+      false, false, false, Date.now() + 24000 * 60 * 60, {},
+      Ci.nsICookie2.SAMESITE_UNSET);
+    return;
+  }
+
+  ok(false, "Invalid arguments");
 }
 
-add_task(async function deleteAllOnShutdown() {
+async function hasData(host, what) {
+  if (what == STORAGE) {
+    return hasIndexedDB("https://" + host);
+  }
+
+  if (what == HOST_COOKIE || what == DOMAIN_COOKIE) {
+    for (let cookie of Services.cookies.enumerator) {
+      if (cookie.host.includes(host)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  ok(false, "Invalid arguments");
+  return false;
+}
+
+async function deleteOnShutdown(what) {
+  // Let's clean up all the data.
+  await new Promise(resolve => {
+    Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
+  });
+
   // Let's force the session-only cookie pref.
   await SpecialPowers.pushPrefEnv({"set": [
     ["network.cookie.lifetimePolicy", Ci.nsICookieService.ACCEPT_SESSION],
   ]});
 
   // Let's create a tab with some IDB data.
-  await createData("example.org");
-  ok(await hasIndexedDB("https://example.org"),
-    "We have indexedDB data for example.org");
+  await createData("example.org", what);
+  ok(await hasData("example.org", what), "We have data for example.org");
 
   // Cleaning up.
   await Sanitizer.runSanitizeOnShutdown();
 
   // All gone!
-  ok(!(await hasIndexedDB("https://example.org")),
-    "We don't have indexedDB data for example.org");
+  ok(!(await hasData("example.org", what)), "We don't have data for example.org");
 
   // Clean up.
   await Sanitizer.sanitize([ "cookies", "offlineApps" ]);
-});
+}
+
+add_task(async function deleteStorageOnShutdown() { await deleteOnShutdown(STORAGE); });
+add_task(async function deleteHostCookieOnShutdown() { await deleteOnShutdown(HOST_COOKIE); });
+add_task(async function deleteDomainCookieOnShutdown() { await deleteOnShutdown(DOMAIN_COOKIE); });
 
-add_task(async function deleteAllWithCustomPermission() {
+async function deleteWithCustomPermission(what) {
+  // Let's clean up all the data.
+  await new Promise(resolve => {
+    Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
+  });
+
   // Let's force the session-only cookie pref.
   await SpecialPowers.pushPrefEnv({"set": [
     ["network.cookie.lifetimePolicy", Ci.nsICookieService.ACCEPT_SESSION],
   ]});
 
   let uri = Services.io.newURI("https://example.com");
   Services.perms.add(uri, "cookie", Ci.nsICookiePermission.ACCESS_ALLOW);
 
   // Let's create a couple of tabs with some IDB data.
-  await createData("example.org");
-  ok(await hasIndexedDB("https://example.org"),
-    "We have indexedDB data for example.org");
-  await createData("example.com");
-  ok(await hasIndexedDB("https://example.com"),
-    "We have indexedDB data for example.com");
+  await createData("example.org", what);
+  ok(await hasData("example.org", what), "We have data for example.org");
+  await createData("example.com", what);
+  ok(await hasData("example.com", what), "We have data for example.com");
 
   // Cleaning up.
   await Sanitizer.runSanitizeOnShutdown();
 
   // All gone!
-  ok(!(await hasIndexedDB("https://example.org")),
-    "We don't have indexedDB data for example.org");
-  ok(await hasIndexedDB("https://example.com"),
-    "We do have indexedDB data for example.com");
+  ok(!(await hasData("example.org", what)), "We don't have data for example.org");
+  ok(await hasData("example.com", what), "We do have data for example.com");
 
   // Clean up.
   await Sanitizer.sanitize([ "cookies", "offlineApps" ]);
 
   // Remove custom permission
   uri = Services.io.newURI("https://example.com");
   Services.perms.remove(uri, "cookie");
-});
+}
+
+add_task(async function deleteStorageWithCustomPermission() { await deleteWithCustomPermission(STORAGE); });
+add_task(async function deleteHostCookieWithCustomPermission() { await deleteWithCustomPermission(HOST_COOKIE); });
+add_task(async function deleteDomainCookieWithCustomPermission() { await deleteWithCustomPermission(DOMAIN_COOKIE); });
 
-add_task(async function deleteOnlyCustomPermission() {
+async function deleteOnlyCustomPermission(what) {
+  // Let's clean up all the data.
+  await new Promise(resolve => {
+    Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
+  });
+
   // Let's force the session-only cookie pref.
   await SpecialPowers.pushPrefEnv({"set": [
     ["network.cookie.lifetimePolicy", Ci.nsICookieService.ACCEPT_NORMALLY],
   ]});
 
   let uri = Services.io.newURI("https://example.com");
   Services.perms.add(uri, "cookie", Ci.nsICookiePermission.ACCESS_SESSION);
 
   // Let's create a couple of tabs with some IDB data.
-  await createData("example.org");
-  ok(await hasIndexedDB("https://example.org"),
-    "We have indexedDB data for example.org");
-  await createData("example.com");
-  ok(await hasIndexedDB("https://example.com"),
-    "We have indexedDB data for example.com");
+  await createData("example.org", what);
+  ok(await hasData("example.org", what), "We have data for example.org");
+  await createData("example.com", what);
+  ok(await hasData("example.com", what), "We have data for example.com");
 
   // Cleaning up.
   await Sanitizer.runSanitizeOnShutdown();
 
   // All gone!
-  ok(await hasIndexedDB("https://example.org"),
-    "We do have indexedDB data for example.org");
-  ok(!await hasIndexedDB("https://example.com"),
-    "We don't have indexedDB data for example.com");
+  ok(await hasData("example.org", what), "We do have for example.org");
+  ok(!await hasData("example.com", what), "We don't have data for example.com");
 
   // Clean up.
   await Sanitizer.sanitize([ "cookies", "offlineApps" ]);
 
   // Remove custom permission
   uri = Services.io.newURI("https://example.com");
   Services.perms.remove(uri, "cookie");
-});
+}
+
+add_task(async function deleteStorageOnlyCustomPermission() { await deleteOnlyCustomPermission(STORAGE); });
+add_task(async function deleteHostCookieOnlyCustomPermission() { await deleteOnlyCustomPermission(HOST_COOKIE); });
+add_task(async function deleteDomainCookieOnlyCustomPermission() { await deleteOnlyCustomPermission(DOMAIN_COOKIE); });
--- a/browser/modules/Sanitizer.jsm
+++ b/browser/modules/Sanitizer.jsm
@@ -737,17 +737,17 @@ async function sanitizeSessionPrincipals
     let sw = serviceWorkers.queryElementAt(i, Ci.nsIServiceWorkerRegistrationInfo);
     principals.push(sw.principal);
   }
 
   // Let's take the list of unique hosts+OA from cookies.
   let enumerator = Services.cookies.enumerator;
   let hosts = new Set();
   for (let cookie of enumerator) {
-    hosts.add(cookie.host + ChromeUtils.originAttributesToSuffix(cookie.originAttributes));
+    hosts.add(cookie.rawHost + ChromeUtils.originAttributesToSuffix(cookie.originAttributes));
   }
 
   hosts.forEach(host => {
     // Cookies and permissions are handled by origin/host. Doesn't matter if we
     // use http: or https: schema here.
     principals.push(
       Services.scriptSecurityManager.createCodebasePrincipalFromOrigin("https://" + host));
   });
--- a/dom/file/File.cpp
+++ b/dom/file/File.cpp
@@ -132,17 +132,17 @@ File::Constructor(const GlobalObject& aG
   // Normalizing the filename
   nsString name(aName);
   name.ReplaceChar('/', ':');
 
   RefPtr<MultipartBlobImpl> impl = new MultipartBlobImpl(name);
 
   nsAutoString type(aBag.mType);
   MakeValidBlobType(type);
-  impl->InitializeBlob(aData, type, false, aRv);
+  impl->InitializeBlob(aData, type, aBag.mEndings == EndingTypes::Native, aRv);
   if (aRv.Failed()) {
     return nullptr;
   }
   MOZ_ASSERT(impl->IsFile());
 
   if (aBag.mLastModified.WasPassed()) {
     impl->SetLastModified(aBag.mLastModified.Value());
   }
--- a/dom/webidl/File.webidl
+++ b/dom/webidl/File.webidl
@@ -14,18 +14,17 @@ interface nsIFile;
  Exposed=(Window,Worker)]
 interface File : Blob {
   readonly attribute DOMString name;
 
   [GetterThrows]
   readonly attribute long long lastModified;
 };
 
-dictionary FilePropertyBag {
-  DOMString type = "";
+dictionary FilePropertyBag : BlobPropertyBag {
   long long lastModified;
 };
 
 dictionary ChromeFilePropertyBag : FilePropertyBag {
   DOMString name = "";
   boolean existenceCheck = true;
 };
 
--- a/servo/components/selectors/builder.rs
+++ b/servo/components/selectors/builder.rs
@@ -67,17 +67,17 @@ impl<Impl: SelectorImpl> Push<Component<
         self.push_simple_selector(value);
     }
 }
 
 impl<Impl: SelectorImpl> SelectorBuilder<Impl> {
     /// Pushes a simple selector onto the current compound selector.
     #[inline(always)]
     pub fn push_simple_selector(&mut self, ss: Component<Impl>) {
-        debug_assert!(!ss.is_combinator());
+        assert!(!ss.is_combinator());
         self.simple_selectors.push(ss);
         self.current_len += 1;
     }
 
     /// Completes the current compound selector and starts a new one, delimited
     /// by the given combinator.
     #[inline(always)]
     pub fn push_combinator(&mut self, c: Combinator) {
@@ -100,17 +100,17 @@ impl<Impl: SelectorImpl> SelectorBuilder
     /// Consumes the builder, producing a Selector.
     #[inline(always)]
     pub fn build(
         &mut self,
         parsed_pseudo: bool,
         parsed_slotted: bool,
     ) -> ThinArc<SpecificityAndFlags, Component<Impl>> {
         // Compute the specificity and flags.
-        let mut spec = SpecificityAndFlags(specificity(&*self, self.simple_selectors.iter()));
+        let mut spec = SpecificityAndFlags(specificity(self.simple_selectors.iter()));
         if parsed_pseudo {
             spec.0 |= HAS_PSEUDO_BIT;
         }
 
         if parsed_slotted {
             spec.0 |= HAS_SLOTTED_BIT;
         }
 
@@ -276,43 +276,36 @@ impl From<Specificity> for u32 {
     #[inline]
     fn from(specificity: Specificity) -> u32 {
         cmp::min(specificity.id_selectors, MAX_10BIT) << 20 |
             cmp::min(specificity.class_like_selectors, MAX_10BIT) << 10 |
             cmp::min(specificity.element_selectors, MAX_10BIT)
     }
 }
 
-fn specificity<Impl>(builder: &SelectorBuilder<Impl>, iter: slice::Iter<Component<Impl>>) -> u32
+fn specificity<Impl>(iter: slice::Iter<Component<Impl>>) -> u32
 where
     Impl: SelectorImpl,
 {
-    complex_selector_specificity(builder, iter).into()
+    complex_selector_specificity(iter).into()
 }
 
-fn complex_selector_specificity<Impl>(
-    builder: &SelectorBuilder<Impl>,
-    mut iter: slice::Iter<Component<Impl>>,
-) -> Specificity
+fn complex_selector_specificity<Impl>(iter: slice::Iter<Component<Impl>>) -> Specificity
 where
     Impl: SelectorImpl,
 {
     fn simple_selector_specificity<Impl>(
-        builder: &SelectorBuilder<Impl>,
         simple_selector: &Component<Impl>,
         specificity: &mut Specificity,
     ) where
         Impl: SelectorImpl,
     {
         match *simple_selector {
-            Component::Combinator(ref combinator) => {
-                unreachable!(
-                    "Found combinator {:?} in simple selectors vector? {:?}",
-                    combinator, builder,
-                );
+            Component::Combinator(..) => {
+                unreachable!("Found combinator in simple selectors vector?");
             },
             Component::PseudoElement(..) | Component::LocalName(..) => {
                 specificity.element_selectors += 1
             },
             Component::Slotted(ref selector) => {
                 specificity.element_selectors += 1;
                 // Note that due to the way ::slotted works we only compete with
                 // other ::slotted rules, so the above rule doesn't really
@@ -356,20 +349,20 @@ where
             Component::ExplicitAnyNamespace |
             Component::ExplicitNoNamespace |
             Component::DefaultNamespace(..) |
             Component::Namespace(..) => {
                 // Does not affect specificity
             },
             Component::Negation(ref negated) => {
                 for ss in negated.iter() {
-                    simple_selector_specificity(builder, &ss, specificity);
+                    simple_selector_specificity(&ss, specificity);
                 }
             },
         }
     }
 
     let mut specificity = Default::default();
-    for simple_selector in &mut iter {
-        simple_selector_specificity(builder, &simple_selector, &mut specificity);
+    for simple_selector in iter {
+        simple_selector_specificity(&simple_selector, &mut specificity);
     }
     specificity
 }
deleted file mode 100644
--- a/testing/web-platform/meta/FileAPI/blob/Blob-constructor.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[Blob-constructor.html]
-  [The 'endings' property should be ignored.]
-    expected: FAIL
-
-  [Newlines should not change when endings is 'native'.]
-    expected: FAIL
-
deleted file mode 100644
--- a/testing/web-platform/meta/FileAPI/file/File-constructor-endings.html.ini
+++ /dev/null
@@ -1,95 +0,0 @@
-[File-constructor-endings.html]
-  [Invalid "endings" value: null]
-    expected: FAIL
-
-  [Invalid "endings" value: ""]
-    expected: FAIL
-
-  [Invalid "endings" value: "invalidEnumValue"]
-    expected: FAIL
-
-  [Invalid "endings" value: "Transparent"]
-    expected: FAIL
-
-  [Invalid "endings" value: "NATIVE"]
-    expected: FAIL
-
-  [Invalid "endings" value: 0]
-    expected: FAIL
-
-  [Invalid "endings" value: {}]
-    expected: FAIL
-
-  [Exception propagation from options]
-    expected: FAIL
-
-  [The "endings" options property is used]
-    expected: FAIL
-
-  [Input LF with endings 'native']
-    expected:
-      if debug and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-      if not debug and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-      if debug and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-      if not debug and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-      if debug and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-
-  [Input CR with endings 'native']
-    expected: FAIL
-
-  [Input CRLF with endings 'native']
-    expected:
-      if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-      if debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-      if not debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
-      if not debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
-      if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
-      if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
-      if debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
-
-  [Input CRCR with endings 'native']
-    expected: FAIL
-
-  [Input LFCR with endings 'native']
-    expected: FAIL
-
-  [Input LFLF with endings 'native']
-    expected:
-      if debug and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-      if not debug and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): FAIL
-      if debug and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-      if not debug and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-      if debug and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-
-  [Input CRCRLF with endings 'native']
-    expected: FAIL
-
-  [Input CRLFLF with endings 'native']
-    expected: FAIL
-
-  [Input CRLFCR with endings 'native']
-    expected:
-      if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-      if debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-      if not debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
-      if not debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
-      if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
-      if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
-      if debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
-
-  [Input CRLFCRLF with endings 'native']
-    expected:
-      if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-      if debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-      if not debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
-      if not debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
-      if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
-      if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
-      if debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
-
-  [Input LFCRLFCR with endings 'native']
-    expected: FAIL
-
-  [CR/LF in adjacent input strings]
-    expected: FAIL
-
deleted file mode 100644
--- a/testing/web-platform/meta/FileAPI/idlharness.html.ini
+++ /dev/null
@@ -1,22 +0,0 @@
-[idlharness.html]
-  [FileReaderSync interface object length]
-    expected: FAIL
-
-  [FileReaderSync interface: existence and properties of interface prototype object]
-    expected: FAIL
-
-  [FileReaderSync interface: existence and properties of interface prototype object's "constructor" property]
-    expected: FAIL
-
-  [FileReaderSync interface: operation readAsArrayBuffer(Blob)]
-    expected: FAIL
-
-  [FileReaderSync interface: operation readAsText(Blob,DOMString)]
-    expected: FAIL
-
-  [FileReaderSync interface: operation readAsDataURL(Blob)]
-    expected: FAIL
-
-  [File API automated IDL tests]
-    expected: FAIL
-
deleted file mode 100644
--- a/testing/web-platform/meta/FileAPI/idlharness.worker.js.ini
+++ /dev/null
@@ -1,30 +0,0 @@
-[idlharness.worker]
-  [ArrayBuffer interface: existence and properties of interface object]
-    expected: FAIL
-
-  [URL interface: existence and properties of interface object]
-    expected: FAIL
-
-  [EventTarget interface: existence and properties of interface object]
-    expected: FAIL
-
-  [Event interface: existence and properties of interface object]
-    expected: FAIL
-
-
-[idlharness.worker.html]
-  [ArrayBuffer interface: existence and properties of interface object]
-    expected: FAIL
-
-  [EventTarget interface: existence and properties of interface object]
-    expected: FAIL
-
-  [Event interface: existence and properties of interface object]
-    expected: FAIL
-
-  [URL interface: existence and properties of interface object]
-    expected: FAIL
-
-  [idlharness]
-    expected: FAIL
-