Merge mozilla-central to autoland. a=merge CLOSED TREE
authorCiure Andrei <aciure@mozilla.com>
Thu, 24 Jan 2019 05:47:10 +0200
changeset 515232 c7085705cd57dd0902055a77bfa5fbc017f6c837
parent 515219 768f85969239f064d87a0776afc12ac851d0ec9d (current diff)
parent 515231 3e5f4a8daaee1b9ccad2fe88666a3cfadffb2a78 (diff)
child 515233 1fce91651f4385b00e99a76338c2ee4e475b1adf
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to autoland. a=merge CLOSED TREE
dom/smil/nsSMILTypes.h
dom/smil/nsSMILValue.cpp
dom/smil/nsSMILValue.h
dom/svg/nsSVGAttrTearoffTable.h
dom/tests/mochitest/localstorage/test_firstPartyOnlyPermission.html
layout/painting/nsDisplayList.cpp
testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/base.py.orig
testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/fennec.py.orig
testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/sauce.py.orig
testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py.orig
toolkit/mozapps/update/tests/browser/browser_about_bc_downloaded.js
toolkit/mozapps/update/tests/browser/browser_about_bc_downloaded_staged.js
toolkit/mozapps/update/tests/browser/browser_about_fc_check_cantApply.js
toolkit/mozapps/update/tests/browser/browser_about_fc_check_malformedXML.js
toolkit/mozapps/update/tests/browser/browser_about_fc_check_noUpdate.js
toolkit/mozapps/update/tests/browser/browser_about_fc_check_otherInstance.js
toolkit/mozapps/update/tests/browser/browser_about_fc_check_unsupported.js
toolkit/mozapps/update/tests/browser/browser_about_fc_downloadAuto.js
toolkit/mozapps/update/tests/browser/browser_about_fc_downloadAuto_staging.js
toolkit/mozapps/update/tests/browser/browser_about_fc_downloadOptIn.js
toolkit/mozapps/update/tests/browser/browser_about_fc_downloadOptIn_staging.js
toolkit/mozapps/update/tests/browser/browser_about_fc_patch_completeBadSize.js
toolkit/mozapps/update/tests/browser/browser_about_fc_patch_partialBadSize.js
toolkit/mozapps/update/tests/browser/browser_about_fc_patch_partialBadSize_complete.js
toolkit/mozapps/update/tests/browser/browser_about_fc_patch_partialBadSize_completeBadSize.js
toolkit/mozapps/update/tests/browser/browser_updateAutoPrefUI.js
xpcom/threads/LabeledEventQueue.h
xpcom/threads/Scheduler.cpp
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -815,17 +815,17 @@ dependencies = [
 name = "dump_syms_rust_demangle"
 version = "0.1.0"
 dependencies = [
  "rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "dwrote"
-version = "0.7.0"
+version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_derive 1.0.80 (git+https://github.com/servo/serde?branch=deserialize_from_enums9)",
  "winapi 0.3.6 (git+https://github.com/froydnj/winapi-rs?branch=aarch64)",
 ]
@@ -3016,17 +3016,17 @@ dependencies = [
  "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-text 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "dwrote 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "dwrote 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "freetype 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "gleam 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "malloc_size_of_derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3049,17 +3049,16 @@ version = "0.58.0"
 dependencies = [
  "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "derive_more 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "dwrote 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "malloc_size_of_derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_bytes 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_derive 1.0.80 (git+https://github.com/servo/serde?branch=deserialize_from_enums9)",
  "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
  "wr_malloc_size_of 0.0.1",
 ]
@@ -3067,17 +3066,17 @@ dependencies = [
 [[package]]
 name = "webrender_bindings"
 version = "0.1.0"
 dependencies = [
  "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "dwrote 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "dwrote 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "foreign-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "gleam 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "nsstring 0.1.0",
  "rayon 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3295,17 +3294,17 @@ dependencies = [
 "checksum devd-rs 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e7c9ac481c38baf400d3b732e4a06850dfaa491d1b6379a249d9d40d14c2434c"
 "checksum diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3c2b69f912779fbb121ceb775d74d51e915af17aaebc38d28a592843a2dd0a3a"
 "checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90"
 "checksum digest 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05f47366984d3ad862010e22c7ce81a7dbcaebbdfb37241a620f8b6596ee135c"
 "checksum dirs 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "88972de891f6118092b643d85a0b28e0678e0f948d7f879aa32f2d5aafe97d2a"
 "checksum docopt 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d8acd393692c503b168471874953a2531df0e9ab77d0b6bbc582395743300a4a"
 "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab"
 "checksum dtoa-short 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "068d4026697c1a18f0b0bb8cfcad1b0c151b90d8edb9bf4c235ad68128920d1d"
-"checksum dwrote 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d2ea0fd88d96838ce5ed30326338cc04a0eb4cff10e3e15d188d74112777103"
+"checksum dwrote 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c31c624339dab99c223a4b26c2e803b7c248adaca91549ce654c76f39a03f5c8"
 "checksum either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18785c1ba806c258137c937e44ada9ee7e69a37e3c72077542cd2f069d78562a"
 "checksum ena 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "88dc8393b3c7352f94092497f6b52019643e493b6b890eb417cdb7c46117e621"
 "checksum encoding_c 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "769ecb8b33323998e482b218c0d13cd64c267609023b4b7ec3ee740714c318ee"
 "checksum encoding_rs 0.8.14 (registry+https://github.com/rust-lang/crates.io-index)" = "a69d152eaa438a291636c1971b0a370212165ca8a75759eb66818c5ce9b538f7"
 "checksum env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0561146661ae44c579e993456bc76d11ce1e0c7d745e57b2fa7146b6e49fa2ad"
 "checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3"
 "checksum euclid 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d1a7698bdda3d7444a79d33bdc96e8b518d44ea3ff101d8492a6ca1207b886ea"
 "checksum euclid_macros 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcb84c18ea5037a1c5a23039b4ff29403abce2e0d6b1daa11cf0bde2b30be15"
--- a/browser/components/preferences/permissions.js
+++ b/browser/components/preferences/permissions.js
@@ -126,53 +126,64 @@ var gPermissionManager = {
     if (permission.type !== this._type)
       return;
 
     if (data == "added") {
       this._addPermissionToList(permission);
       this.buildPermissionsList();
     } else if (data == "changed") {
       let p = this._permissions.get(permission.principal.origin);
-      p.capability = permission.capability;
-      this._handleCapabilityChange(p);
+      // Maybe this item has been excluded before because it had an invalid capability.
+      if (p) {
+        p.capability = permission.capability;
+        this._handleCapabilityChange(p);
+      } else {
+        this._addPermissionToList(permission);
+      }
       this.buildPermissionsList();
     } else if (data == "deleted") {
       this._removePermissionFromList(permission.principal.origin);
     }
   },
 
   _handleCapabilityChange(perm) {
     let permissionlistitem = document.getElementsByAttribute("origin", perm.origin)[0];
     document.l10n.setAttributes(permissionlistitem.querySelector(".website-capability-value"), this._getCapabilityL10nId(perm.capability));
   },
 
+  _isCapabilitySupported(capability) {
+     return capability == Ci.nsIPermissionManager.ALLOW_ACTION ||
+            capability == Ci.nsIPermissionManager.DENY_ACTION ||
+            capability == Ci.nsICookiePermission.ACCESS_SESSION;
+  },
+
   _getCapabilityL10nId(capability) {
     let stringKey = null;
     switch (capability) {
     case Ci.nsIPermissionManager.ALLOW_ACTION:
       stringKey = "permissions-capabilities-listitem-allow";
       break;
     case Ci.nsIPermissionManager.DENY_ACTION:
       stringKey = "permissions-capabilities-listitem-block";
       break;
-    case Ci.nsICookiePermission.ACCESS_ALLOW_FIRST_PARTY_ONLY:
-      stringKey = "permissions-capabilities-listitem-allow-first-party";
-      break;
     case Ci.nsICookiePermission.ACCESS_SESSION:
       stringKey = "permissions-capabilities-listitem-allow-session";
       break;
     default:
       throw new Error(`Unknown capability: ${capability}`);
     }
     return stringKey;
   },
 
   _addPermissionToList(perm) {
     if (perm.type !== this._type)
       return;
+    if (!this._isCapabilitySupported(perm.capability))
+      return;
+
     let p = new Permission(perm.principal, perm.type, perm.capability);
     this._permissions.set(p.origin, p);
   },
 
   addPermission(capability) {
     let textbox = document.getElementById("url");
     let input_url = textbox.value.replace(/^\s*/, ""); // trim any leading space
     let principal;
--- a/browser/components/sessionstore/SessionStorage.jsm
+++ b/browser/components/sessionstore/SessionStorage.jsm
@@ -140,22 +140,24 @@ var SessionStorageInternal = {
         let dataPrincipal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin);
         principal = Services.scriptSecurityManager.createCodebasePrincipal(dataPrincipal.URI, attrs);
       } catch (e) {
         console.error(e);
         continue;
       }
 
       let storageManager = aDocShell.QueryInterface(Ci.nsIDOMStorageManager);
-      let window = aDocShell.domWindow;
 
-      // There is no need to pass documentURI, it's only used to fill documentURI property of
-      // domstorage event, which in this case has no consumer. Prevention of events in case
-      // of missing documentURI will be solved in a followup bug to bug 600307.
-      let storage = storageManager.createStorage(window, principal, "", aDocShell.usePrivateBrowsing);
+      // There is no need to pass documentURI, it's only used to fill
+      // documentURI property of domstorage event, which in this case has no
+      // consumer. Prevention of events in case of missing documentURI will be
+      // solved in a followup bug to bug 600307.
+      // Null window because the current window doesn't match the principal yet
+      // and loads about:blank.
+      let storage = storageManager.createStorage(null, principal, "", aDocShell.usePrivateBrowsing);
 
       for (let key of Object.keys(data)) {
         try {
           storage.setItem(key, data[key]);
         } catch (e) {
           // throws e.g. for URIs that can't have sessionStorage
           console.error(e);
         }
--- a/browser/components/touchbar/MacTouchBar.js
+++ b/browser/components/touchbar/MacTouchBar.js
@@ -302,16 +302,17 @@ class TouchBarHelper {
         this._updateTouchBarInput("ReaderView");
         break;
       case "intl:app-locales-changed":
         // On locale change, refresh all inputs after loading new localTitle.
         for (let inputName of this._storedLayout) {
           delete kBuiltInInputs[inputName].localTitle;
           this._updateTouchBarInput(inputName);
         }
+        break;
       case "quit-application":
         this.destructor();
         break;
     }
   }
 }
 
 const helperProto = TouchBarHelper.prototype;
--- a/browser/config/whats_new_page.yml
+++ b/browser/config/whats_new_page.yml
@@ -13,107 +13,60 @@
       blob-types: [wnp]
       release-types: [release, release-rc]
       products: [firefox]
       update-channel: release
       # e.g.: ["<61.0"]. {version.major_number} reflects the current version.
       # This is done by taskgraph.
       versions: ["<{version.major_number}.0"]
       locales:
-          - ach
-          - af
-          - an
           - ar
-          - as
-          - ast
           - az
           - be
-          - bg
-          - bn-BD
-          - bn-IN
-          - br
-          - bs
-          - ca
           - cak
           - cs
           - cy
           - da
           - de
           - dsb
-          - el
           - en-CA
           - en-GB
           - en-US
-          - en-ZA
-          - eo
           - es-AR
           - es-CL
           - es-ES
           - es-MX
           - et
-          - eu
-          - fa
-          - ff
-          - fi
           - fr
           - fy-NL
-          - ga-IE
-          - gd
           - gl
           - gn
           - gu-IN
-          - he
           - hi-IN
-          - hr
           - hsb
           - hu
-          - hy-AM
           - ia
           - id
-          - is
           - it
-          - ja
           - ka
-          - kab
-          - kk
-          - km
-          - kn
           - ko
           - lij
           - lt
-          - lv
-          - mai
-          - mk
-          - ml
-          - mr
           - ms
-          - my
           - nb-NO
-          - ne-NP
           - nl
           - nn-NO
-          - oc
-          - or
-          - pa-IN
           - pl
           - pt-BR
           - pt-PT
           - rm
           - ro
           - ru
-          - si
           - sk
           - sl
-          - son
           - sq
-          - sr
           - sv-SE
-          - ta
-          - te
           - th
           - tr
           - uk
-          - ur
-          - uz
           - vi
-          - xh
           - zh-CN
           - zh-TW
--- a/browser/locales/en-US/browser/preferences/permissions.ftl
+++ b/browser/locales/en-US/browser/preferences/permissions.ftl
@@ -55,18 +55,16 @@ permissions-capabilities-block =
     .label = Block
 permissions-capabilities-prompt =
     .label = Always Ask
 
 permissions-capabilities-listitem-allow =
     .value = Allow
 permissions-capabilities-listitem-block =
     .value = Block
-permissions-capabilities-listitem-allow-first-party =
-    .value = Allow first party only
 permissions-capabilities-listitem-allow-session =
     .value = Allow for Session
 
 ## Invalid Hostname Dialog
 
 permissions-invalid-uri-title = Invalid Hostname Entered
 permissions-invalid-uri-label = Please enter a valid hostname
 
--- a/browser/locales/en-US/chrome/browser/tabbrowser.properties
+++ b/browser/locales/en-US/chrome/browser/tabbrowser.properties
@@ -21,17 +21,17 @@ tabs.closeWarningMultiple=;You are about
 # The forms for 0 or 1 items are not considered since this string is used only
 # for multiple tabs.
 # If
 #   "Tabs in non-private windows will be restored when you restart"
 # is difficult to translate, you could translate
 #   "Tabs (except those in private windows) will be restored when you restart"
 # instead.
 tabs.closeWarningMultipleSessionRestore2=;You are about to close #1 tabs. Tabs in non-private windows will be restored when you restart. Are you sure you want to continue?
-tabs.closeButtonMultiple=Close tabs
+tabs.closeButtonMultiple=Close Tabs
 tabs.closeWarningPromptMe=Warn me when I attempt to close multiple tabs
 
 # LOCALIZATION NOTE (tabs.closeWarningMultipleWindows):
 # Semicolon-separated list of plural forms. See:
 # http://developer.mozilla.org/en/docs/Localization_and_Plurals
 # The forms for 0 or 1 items are not considered since this string is used only for
 # multiple windows. The %S replacement form will be replaced with the contents
 # of tabs.closeWarningMultipleWindowsTabSnippet, which will contain the number
--- a/browser/modules/Sanitizer.jsm
+++ b/browser/modules/Sanitizer.jsm
@@ -794,19 +794,17 @@ async function maybeSanitizeSessionPrinc
 
   return Promise.all(promises);
 }
 
 function cookiesAllowedForDomainOrSubDomain(principal) {
   // If we have the 'cookie' permission for this principal, let's return
   // immediately.
   let p = Services.perms.testPermissionFromPrincipal(principal, "cookie");
-  if (p == Ci.nsICookiePermission.ACCESS_ALLOW ||
-      p == Ci.nsICookiePermission.ACCESS_ALLOW_FIRST_PARTY_ONLY ||
-      p == Ci.nsICookiePermission.ACCESS_LIMIT_THIRD_PARTY) {
+  if (p == Ci.nsICookiePermission.ACCESS_ALLOW) {
     return true;
   }
 
   if (p == Ci.nsICookiePermission.ACCESS_DENY ||
       p == Ci.nsICookiePermission.ACCESS_SESSION) {
     return false;
   }
 
--- a/devtools/client/inspector/animation/test/browser.ini
+++ b/devtools/client/inspector/animation/test/browser.ini
@@ -66,16 +66,17 @@ skip-if = (os == "win" && ccov) # Bug 14
 [browser_animation_logic_adjust-time.js]
 [browser_animation_logic_adjust-time-with-playback-rate.js]
 [browser_animation_logic_auto-stop.js]
 [browser_animation_logic_avoid-updating-during-hiding.js]
 [browser_animation_logic_created-time.js]
 [browser_animation_logic_mutations.js]
 [browser_animation_logic_mutations_add_remove_immediately.js]
 [browser_animation_logic_mutations_fast.js]
+skip-if = debug && (os == "mac" || os =="linux" && bits == 64) # Bug 1507337
 [browser_animation_logic_mutations_properties.js]
 [browser_animation_logic_overflowed_delay_end-delay.js]
 skip-if = debug #bug 1480027
 [browser_animation_logic_scroll-amount.js]
 [browser_animation_pause-resume-button.js]
 [browser_animation_pause-resume-button_end-time.js]
 [browser_animation_pause-resume-button_respectively.js]
 [browser_animation_pause-resume-button_spacebar.js]
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -8078,80 +8078,94 @@ bool nsContentUtils::IsNonSubresourceInt
          aType == nsIContentPolicy::TYPE_INTERNAL_IFRAME ||
          aType == nsIContentPolicy::TYPE_INTERNAL_FRAME ||
          aType == nsIContentPolicy::TYPE_INTERNAL_WORKER ||
          aType == nsIContentPolicy::TYPE_INTERNAL_SHARED_WORKER;
 }
 
 // static, public
 nsContentUtils::StorageAccess nsContentUtils::StorageAllowedForWindow(
-    nsPIDOMWindowInner* aWindow) {
+    nsPIDOMWindowInner* aWindow, uint32_t* aRejectedReason) {
+  uint32_t rejectedReason;
+  if (!aRejectedReason) {
+    aRejectedReason = &rejectedReason;
+  }
+
+  *aRejectedReason = 0;
+
   if (Document* document = aWindow->GetExtantDoc()) {
     nsCOMPtr<nsIPrincipal> principal = document->NodePrincipal();
     // Note that GetChannel() below may return null, but that's OK, since the
     // callee is able to deal with a null channel argument, and if passed null,
     // will only fail to notify the UI in case storage gets blocked.
     nsIChannel* channel = document->GetChannel();
     return InternalStorageAllowedForPrincipal(principal, aWindow, nullptr,
-                                              channel);
-  }
-
+                                              channel, *aRejectedReason);
+  }
+
+  // No document? Let's return a generic rejected reason.
   return StorageAccess::eDeny;
 }
 
 // static, public
 nsContentUtils::StorageAccess nsContentUtils::StorageAllowedForDocument(
     Document* aDoc) {
   MOZ_ASSERT(aDoc);
 
   if (nsPIDOMWindowInner* inner = aDoc->GetInnerWindow()) {
     nsCOMPtr<nsIPrincipal> principal = aDoc->NodePrincipal();
     // Note that GetChannel() below may return null, but that's OK, since the
     // callee is able to deal with a null channel argument, and if passed null,
     // will only fail to notify the UI in case storage gets blocked.
     nsIChannel* channel = aDoc->GetChannel();
+
+    uint32_t rejectedReason = 0;
     return InternalStorageAllowedForPrincipal(principal, inner, nullptr,
-                                              channel);
+                                              channel, rejectedReason);
   }
 
   return StorageAccess::eDeny;
 }
 
 // static, public
 nsContentUtils::StorageAccess nsContentUtils::StorageAllowedForNewWindow(
     nsIPrincipal* aPrincipal, nsIURI* aURI, nsPIDOMWindowInner* aParent) {
   MOZ_ASSERT(aPrincipal);
   MOZ_ASSERT(aURI);
   // parent may be nullptr
 
-  return InternalStorageAllowedForPrincipal(aPrincipal, aParent, aURI, nullptr);
+  uint32_t rejectedReason = 0;
+  return InternalStorageAllowedForPrincipal(aPrincipal, aParent, aURI, nullptr,
+                                            rejectedReason);
 }
 
 // static, public
 nsContentUtils::StorageAccess nsContentUtils::StorageAllowedForChannel(
     nsIChannel* aChannel) {
   MOZ_DIAGNOSTIC_ASSERT(sSecurityManager);
   MOZ_DIAGNOSTIC_ASSERT(aChannel);
 
   nsCOMPtr<nsIPrincipal> principal;
   Unused << sSecurityManager->GetChannelResultPrincipal(
       aChannel, getter_AddRefs(principal));
   NS_ENSURE_TRUE(principal, nsContentUtils::StorageAccess::eDeny);
 
-  nsContentUtils::StorageAccess result =
-      InternalStorageAllowedForPrincipal(principal, nullptr, nullptr, aChannel);
+  uint32_t rejectedReason = 0;
+  nsContentUtils::StorageAccess result = InternalStorageAllowedForPrincipal(
+      principal, nullptr, nullptr, aChannel, rejectedReason);
 
   return result;
 }
 
 // static, public
 nsContentUtils::StorageAccess nsContentUtils::StorageAllowedForPrincipal(
     nsIPrincipal* aPrincipal) {
+  uint32_t rejectedReason = 0;
   return InternalStorageAllowedForPrincipal(aPrincipal, nullptr, nullptr,
-                                            nullptr);
+                                            nullptr, rejectedReason);
 }
 
 // static, private
 void nsContentUtils::GetCookieLifetimePolicyForPrincipal(
     nsIPrincipal* aPrincipal, uint32_t* aLifetimePolicy) {
   *aLifetimePolicy = sCookiesLifetimePolicy;
 
   // Any permissions set for the given principal will override our default
@@ -8169,32 +8183,16 @@ void nsContentUtils::GetCookieLifetimePo
       *aLifetimePolicy = nsICookieService::ACCEPT_NORMALLY;
       break;
     case nsICookiePermission::ACCESS_DENY:
       *aLifetimePolicy = nsICookieService::ACCEPT_NORMALLY;
       break;
     case nsICookiePermission::ACCESS_SESSION:
       *aLifetimePolicy = nsICookieService::ACCEPT_SESSION;
       break;
-    case nsICookiePermission::ACCESS_ALLOW_FIRST_PARTY_ONLY:
-      // NOTE: The decision was made here to override the lifetime policy to be
-      // ACCEPT_NORMALLY for consistency with ACCESS_ALLOW, but this does
-      // prevent us from expressing BEHAVIOR_REJECT_FOREIGN/ACCEPT_SESSION for a
-      // specific domain. As BEHAVIOR_REJECT_FOREIGN isn't visible in our UI,
-      // this is probably not an issue.
-      *aLifetimePolicy = nsICookieService::ACCEPT_NORMALLY;
-      break;
-    case nsICookiePermission::ACCESS_LIMIT_THIRD_PARTY:
-      // NOTE: The decision was made here to override the lifetime policy to be
-      // ACCEPT_NORMALLY for consistency with ACCESS_ALLOW, but this does
-      // prevent us from expressing BEHAVIOR_REJECT_FOREIGN/ACCEPT_SESSION for a
-      // specific domain. As BEHAVIOR_LIMIT_FOREIGN isn't visible in our UI,
-      // this is probably not an issue.
-      *aLifetimePolicy = nsICookieService::ACCEPT_NORMALLY;
-      break;
   }
 }
 
 // static public
 bool nsContentUtils::IsThirdPartyWindowOrChannel(nsPIDOMWindowInner* aWindow,
                                                  nsIChannel* aChannel,
                                                  nsIURI* aURI) {
   MOZ_ASSERT(!aWindow || !aChannel,
@@ -8290,80 +8288,83 @@ bool nsContentUtils::IsThirdPartyTrackin
 
   return httpChannel->GetIsThirdPartyTrackingResource();
 }
 
 static bool StorageDisabledByAntiTrackingInternal(nsPIDOMWindowInner* aWindow,
                                                   nsIChannel* aChannel,
                                                   nsIPrincipal* aPrincipal,
                                                   nsIURI* aURI,
-                                                  uint32_t* aRejectedReason) {
+                                                  uint32_t& aRejectedReason) {
   MOZ_ASSERT(aWindow || aChannel || aPrincipal);
 
   if (aWindow) {
     nsIURI* documentURI = aURI ? aURI : aWindow->GetDocumentURI();
     return !documentURI ||
            !AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
-               aWindow, documentURI, aRejectedReason);
+               aWindow, documentURI, &aRejectedReason);
   }
 
   if (aChannel) {
     nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
     if (!httpChannel) {
       return false;
     }
 
     nsCOMPtr<nsIURI> uri;
     nsresult rv = httpChannel->GetURI(getter_AddRefs(uri));
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return false;
     }
 
     return !AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
-        httpChannel, uri, aRejectedReason);
+        httpChannel, uri, &aRejectedReason);
   }
 
   MOZ_ASSERT(aPrincipal);
   return !AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(aPrincipal);
 }
 
 // static public
 bool nsContentUtils::StorageDisabledByAntiTracking(nsPIDOMWindowInner* aWindow,
                                                    nsIChannel* aChannel,
                                                    nsIPrincipal* aPrincipal,
-                                                   nsIURI* aURI) {
-  uint32_t rejectedReason = 0;
+                                                   nsIURI* aURI,
+                                                   uint32_t& aRejectedReason) {
   bool disabled = StorageDisabledByAntiTrackingInternal(
-      aWindow, aChannel, aPrincipal, aURI, &rejectedReason);
+      aWindow, aChannel, aPrincipal, aURI, aRejectedReason);
   if (sAntiTrackingControlCenterUIEnabled) {
     if (aWindow) {
       AntiTrackingCommon::NotifyBlockingDecision(
           aWindow,
           disabled ? AntiTrackingCommon::BlockingDecision::eBlock
                    : AntiTrackingCommon::BlockingDecision::eAllow,
-          rejectedReason);
+          aRejectedReason);
     } else if (aChannel) {
       AntiTrackingCommon::NotifyBlockingDecision(
           aChannel,
           disabled ? AntiTrackingCommon::BlockingDecision::eBlock
                    : AntiTrackingCommon::BlockingDecision::eAllow,
-          rejectedReason);
+          aRejectedReason);
     }
   }
   return disabled;
 }
 
 // static, private
 nsContentUtils::StorageAccess
 nsContentUtils::InternalStorageAllowedForPrincipal(nsIPrincipal* aPrincipal,
                                                    nsPIDOMWindowInner* aWindow,
                                                    nsIURI* aURI,
-                                                   nsIChannel* aChannel) {
+                                                   nsIChannel* aChannel,
+                                                   uint32_t& aRejectedReason) {
   MOZ_ASSERT(aPrincipal);
 
+  aRejectedReason = 0;
+
   StorageAccess access = StorageAccess::eAllow;
 
   // We don't allow storage on the null principal, in general. Even if the
   // calling context is chrome.
   if (aPrincipal->GetIsNullPrincipal()) {
     return StorageAccess::eDeny;
   }
 
@@ -8432,23 +8433,24 @@ nsContentUtils::InternalStorageAllowedFo
   if (uri) {
     bool isAbout = false;
     MOZ_ALWAYS_SUCCEEDS(uri->SchemeIs("about", &isAbout));
     if (isAbout) {
       return access;
     }
   }
 
-  if (!StorageDisabledByAntiTracking(aWindow, aChannel, aPrincipal, aURI)) {
+  if (!StorageDisabledByAntiTracking(aWindow, aChannel, aPrincipal, aURI,
+                                     aRejectedReason)) {
     return access;
   }
 
-  static const char* kPrefName =
-      "privacy.restrict3rdpartystorage.partitionedHosts";
-  if (IsURIInPrefList(uri, kPrefName)) {
+  // We want to have a partitioned storage only for trackers.
+  if (aRejectedReason ==
+      nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER) {
     return StorageAccess::ePartitionedOrDeny;
   }
 
   return StorageAccess::eDeny;
 }
 
 namespace {
 
@@ -10433,17 +10435,17 @@ static bool JSONCreator(const char16_t* 
                  false);
   aOutStr = serializedValue;
   return true;
 }
 
 /* static */
 bool nsContentUtils::HighPriorityEventPendingForTopLevelDocumentBeforeContentfulPaint(
     Document* aDocument) {
-  if (!aDocument) {
+  if (!aDocument || aDocument->IsLoadedAsData()) {
     return false;
   }
 
   Document* topLevel = aDocument->GetTopLevelContentDocument();
   return topLevel && topLevel->GetShell() &&
          topLevel->GetShell()->GetPresContext() &&
          !topLevel->GetShell()->GetPresContext()->HadContentfulPaint() &&
          nsThreadManager::MainThreadHasPendingHighPriorityEvents();
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -2931,17 +2931,18 @@ class nsContentUtils {
   /*
    * Checks if storage for the given window is permitted by a combination of
    * the user's preferences, and whether the window is a third-party iframe.
    *
    * This logic is intended to be shared between the different forms of
    * persistent storage which are available to web pages. Cookies don't use
    * this logic, and security logic related to them must be updated separately.
    */
-  static StorageAccess StorageAllowedForWindow(nsPIDOMWindowInner* aWindow);
+  static StorageAccess StorageAllowedForWindow(
+      nsPIDOMWindowInner* aWindow, uint32_t* aRejectedReason = nullptr);
 
   /*
    * Checks if storage for the given document is permitted by a combination of
    * the user's preferences, and whether the document's window is a third-party
    * iframe.
    *
    * Note, this may be used on documents during the loading process where
    * the window's extant document has not been set yet.  The code in
@@ -2971,36 +2972,38 @@ class nsContentUtils {
    */
   static StorageAccess StorageAllowedForPrincipal(nsIPrincipal* aPrincipal);
 
   /*
    * Returns true if this document should disable storages because of the
    * anti-tracking feature.
    */
   static bool StorageDisabledByAntiTracking(Document* aDocument, nsIURI* aURI) {
+    uint32_t rejectedReason = 0;
     // Note that GetChannel() below may return null, but that's OK, since the
     // callee is able to deal with a null channel argument, and if passed null,
     // will only fail to notify the UI in case storage gets blocked.
-    return StorageDisabledByAntiTracking(aDocument->GetInnerWindow(),
-                                         aDocument->GetChannel(),
-                                         aDocument->NodePrincipal(), aURI);
+    return StorageDisabledByAntiTracking(
+        aDocument->GetInnerWindow(), aDocument->GetChannel(),
+        aDocument->NodePrincipal(), aURI, rejectedReason);
   }
 
  private:
   /*
    * Returns true if this window/channel/aPrincipal should disable storages
    * because of the anti-tracking feature.
    * Note that either aWindow or aChannel may be null when calling this
    * function. If the caller wants the UI to be notified when the storage gets
    * disabled, it must pass a non-null channel object.
    */
   static bool StorageDisabledByAntiTracking(nsPIDOMWindowInner* aWindow,
                                             nsIChannel* aChannel,
                                             nsIPrincipal* aPrincipal,
-                                            nsIURI* aURI);
+                                            nsIURI* aURI,
+                                            uint32_t& aRejectedReason);
 
  public:
   /*
    * Returns true if this window/channel is a 3rd party context.
    */
   static bool IsThirdPartyWindowOrChannel(nsPIDOMWindowInner* aWindow,
                                           nsIChannel* aChannel, nsIURI* aURI);
 
@@ -3378,17 +3381,17 @@ class nsContentUtils {
    * allow a channel instead of the window reference when determining 3rd party
    * status.
    *
    * Used in the implementation of StorageAllowedForWindow and
    * StorageAllowedForPrincipal.
    */
   static StorageAccess InternalStorageAllowedForPrincipal(
       nsIPrincipal* aPrincipal, nsPIDOMWindowInner* aWindow, nsIURI* aURI,
-      nsIChannel* aChannel);
+      nsIChannel* aChannel, uint32_t& aRejectedReason);
 
   static nsINode* GetCommonAncestorHelper(nsINode* aNode1, nsINode* aNode2);
   static nsIContent* GetCommonFlattenedTreeAncestorHelper(
       nsIContent* aContent1, nsIContent* aContent2);
 
   static nsIXPConnect* sXPConnect;
 
   static nsIScriptSecurityManager* sSecurityManager;
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -4394,16 +4394,32 @@ Storage* nsGlobalWindowInner::GetLocalSt
   // doesn't share data with other contexts, and it's just in memory.
   // Partitioned localStorage is available only for trackers listed in the
   // privacy.restrict3rdpartystorage.partitionedHosts pref. See
   // nsContentUtils::IsURIInPrefList to know the syntax for the pref value.
   // This is a temporary web-compatibility hack.
 
   nsContentUtils::StorageAccess access =
       nsContentUtils::StorageAllowedForWindow(this);
+
+  // We allow partitioned localStorage only to some hosts.
+  if (access == nsContentUtils::StorageAccess::ePartitionedOrDeny) {
+    if (!mDoc) {
+      access = nsContentUtils::StorageAccess::eDeny;
+    } else {
+      nsCOMPtr<nsIURI> uri;
+      Unused << mDoc->NodePrincipal()->GetURI(getter_AddRefs(uri));
+      static const char* kPrefName =
+          "privacy.restrict3rdpartystorage.partitionedHosts";
+      if (!uri || !nsContentUtils::IsURIInPrefList(uri, kPrefName)) {
+        access = nsContentUtils::StorageAccess::eDeny;
+      }
+    }
+  }
+
   if (access == nsContentUtils::StorageAccess::eDeny) {
     aError.Throw(NS_ERROR_DOM_SECURITY_ERR);
     return nullptr;
   }
 
   // Note that this behavior is observable: if we grant storage permission to a
   // tracker, we pass from the partitioned LocalStorage to the 'normal'
   // LocalStorage. The previous data is lost and the 2 window.localStorage
--- a/dom/smil/SMILAnimationFunction.cpp
+++ b/dom/smil/SMILAnimationFunction.cpp
@@ -171,26 +171,26 @@ void SMILAnimationFunction::Activate(nsS
 
 void SMILAnimationFunction::Inactivate(bool aIsFrozen) {
   mIsActive = false;
   mIsFrozen = aIsFrozen;
   mHasChanged = true;
 }
 
 void SMILAnimationFunction::ComposeResult(const nsISMILAttr& aSMILAttr,
-                                          nsSMILValue& aResult) {
+                                          SMILValue& aResult) {
   mHasChanged = false;
   mPrevSampleWasSingleValueAnimation = false;
   mWasSkippedInPrevSample = false;
 
   // Skip animations that are inactive or in error
   if (!IsActiveOrFrozen() || mErrorFlags != 0) return;
 
   // Get the animation values
-  nsSMILValueArray values;
+  SMILValueArray values;
   nsresult rv = GetValues(aSMILAttr, values);
   if (NS_FAILED(rv)) return;
 
   // Check that we have the right number of keySplines and keyTimes
   CheckValueListDependentAttrs(values.Length());
   if (mErrorFlags != 0) return;
 
   // If this interval is active, we must have a non-negative mSampleTime
@@ -201,26 +201,26 @@ void SMILAnimationFunction::ComposeResul
 
   // If we want to add but don't have a base value then just fail outright.
   // This can happen when we skipped getting the base value because there's an
   // animation function in the sandwich that should replace it but that function
   // failed unexpectedly.
   bool isAdditive = IsAdditive();
   if (isAdditive && aResult.IsNull()) return;
 
-  nsSMILValue result;
+  SMILValue result;
 
   if (values.Length() == 1 && !IsToAnimation()) {
     // Single-valued animation
     result = values[0];
     mPrevSampleWasSingleValueAnimation = true;
 
   } else if (mLastValue) {
     // Sampling last value
-    const nsSMILValue& last = values[values.Length() - 1];
+    const SMILValue& last = values[values.Length() - 1];
     result = last;
 
     // See comment in AccumulateResult: to-animation does not accumulate
     if (!IsToAnimation() && GetAccumulate() && mRepeatIteration) {
       // If the target attribute type doesn't support addition Add will
       // fail leaving result = last
       result.Add(last, mRepeatIteration);
     }
@@ -293,19 +293,19 @@ bool SMILAnimationFunction::UpdateCached
     return true;
   }
   return false;
 }
 
 //----------------------------------------------------------------------
 // Implementation helpers
 
-nsresult SMILAnimationFunction::InterpolateResult(
-    const nsSMILValueArray& aValues, nsSMILValue& aResult,
-    nsSMILValue& aBaseValue) {
+nsresult SMILAnimationFunction::InterpolateResult(const SMILValueArray& aValues,
+                                                  SMILValue& aResult,
+                                                  SMILValue& aBaseValue) {
   // Sanity check animation values
   if ((!IsToAnimation() && aValues.Length() < 2) ||
       (IsToAnimation() && aValues.Length() != 1)) {
     NS_ERROR("Unexpected number of values");
     return NS_ERROR_FAILURE;
   }
 
   if (IsToAnimation() && aBaseValue.IsNull()) {
@@ -343,18 +343,18 @@ nsresult SMILAnimationFunction::Interpol
   // CSS.
   if (SMILCSSValueType::PropertyFromValue(aValues[0]) ==
       eCSSProperty_visibility) {
     calcMode = CALC_DISCRETE;
   }
 
   if (calcMode != CALC_DISCRETE) {
     // Get the normalised progress between adjacent values
-    const nsSMILValue* from = nullptr;
-    const nsSMILValue* to = nullptr;
+    const SMILValue* from = nullptr;
+    const SMILValue* to = nullptr;
     // Init to -1 to make sure that if we ever forget to set this, the
     // MOZ_ASSERT that tests that intervalProgress is in range will fail.
     double intervalProgress = -1.f;
     if (IsToAnimation()) {
       from = &aBaseValue;
       to = &aValues[0];
       if (calcMode == CALC_PACED) {
         // Note: key[Times/Splines/Points] are ignored for calcMode="paced"
@@ -427,17 +427,17 @@ nsresult SMILAnimationFunction::Interpol
       // a zero-value fixup which means that empty values (values with type
       // SMILCSSValueType but a null pointer value) are converted into
       // a suitable zero value based on whatever they're being interpolated
       // with. For discrete animation, however, since we don't interpolate,
       // that never happens. In some rare cases, such as discrete non-additive
       // by-animation, we can arrive here with |aResult| being such an empty
       // value so we need to manually perform the fixup.
       //
-      // We could define a generic method for this on nsSMILValue but its faster
+      // We could define a generic method for this on SMILValue but its faster
       // and simpler to just special case SMILCSSValueType.
       if (aResult.mType == &SMILCSSValueType::sSingleton) {
         // We have currently only ever encountered this case for the first
         // value of a by-animation (which has two values) and since we have no
         // way of testing other cases we just skip them (but assert if we
         // ever do encounter them so that we can add code to handle them).
         if (index + 1 >= aValues.Length()) {
           MOZ_ASSERT(aResult.mU.mPtr, "The last value should not be empty");
@@ -447,20 +447,20 @@ nsresult SMILAnimationFunction::Interpol
         }
       }
     }
     rv = NS_OK;
   }
   return rv;
 }
 
-nsresult SMILAnimationFunction::AccumulateResult(
-    const nsSMILValueArray& aValues, nsSMILValue& aResult) {
+nsresult SMILAnimationFunction::AccumulateResult(const SMILValueArray& aValues,
+                                                 SMILValue& aResult) {
   if (!IsToAnimation() && GetAccumulate() && mRepeatIteration) {
-    const nsSMILValue& lastValue = aValues[aValues.Length() - 1];
+    const SMILValue& lastValue = aValues[aValues.Length() - 1];
 
     // If the target attribute type doesn't support addition, Add will
     // fail and we leave aResult untouched.
     aResult.Add(lastValue, mRepeatIteration);
   }
 
   return NS_OK;
 }
@@ -471,19 +471,18 @@ nsresult SMILAnimationFunction::Accumula
  *    (returned as aFrom and aTo)
  *  - determines where we are between them
  *    (returned as aIntervalProgress)
  *
  * Returns NS_OK, or NS_ERROR_FAILURE if our values don't support distance
  * computation.
  */
 nsresult SMILAnimationFunction::ComputePacedPosition(
-    const nsSMILValueArray& aValues, double aSimpleProgress,
-    double& aIntervalProgress, const nsSMILValue*& aFrom,
-    const nsSMILValue*& aTo) {
+    const SMILValueArray& aValues, double aSimpleProgress,
+    double& aIntervalProgress, const SMILValue*& aFrom, const SMILValue*& aTo) {
   NS_ASSERTION(0.0f <= aSimpleProgress && aSimpleProgress < 1.0f,
                "aSimpleProgress is out of bounds");
   NS_ASSERTION(GetCalcMode() == CALC_PACED,
                "Calling paced-specific function, but not in paced mode");
   MOZ_ASSERT(aValues.Length() >= 2, "Unexpected number of values");
 
   // Trivial case: If we have just 2 values, then there's only one interval
   // for us to traverse, and our progress across that interval is the exact
@@ -564,17 +563,17 @@ nsresult SMILAnimationFunction::ComputeP
 
 /*
  * Computes the total distance to be travelled by a paced animation.
  *
  * Returns the total distance, or returns COMPUTE_DISTANCE_ERROR if
  * our values don't support distance computation.
  */
 double SMILAnimationFunction::ComputePacedTotalDistance(
-    const nsSMILValueArray& aValues) const {
+    const SMILValueArray& aValues) const {
   NS_ASSERTION(GetCalcMode() == CALC_PACED,
                "Calling paced-specific function, but not in paced mode");
 
   double totalDistance = 0.0;
   for (uint32_t i = 0; i < aValues.Length() - 1; i++) {
     double tmpDist;
     nsresult rv = aValues[i].ComputeDistance(aValues[i + 1], tmpDist);
     if (NS_FAILED(rv)) {
@@ -650,33 +649,33 @@ const nsAttrValue* SMILAnimationFunction
 
 bool SMILAnimationFunction::GetAttr(nsAtom* aAttName,
                                     nsAString& aResult) const {
   return mAnimationElement->GetAttr(aAttName, aResult);
 }
 
 /*
  * A utility function to make querying an attribute that corresponds to an
- * nsSMILValue a little neater.
+ * SMILValue a little neater.
  *
  * @param aAttName    The attribute name (in the global namespace).
  * @param aSMILAttr   The SMIL attribute to perform the parsing.
- * @param[out] aResult        The resulting nsSMILValue.
+ * @param[out] aResult        The resulting SMILValue.
  * @param[out] aPreventCachingOfSandwich
  *                    If |aResult| contains dependencies on its context that
  *                    should prevent the result of the animation sandwich from
  *                    being cached and reused in future samples (as reported
  *                    by nsISMILAttr::ValueFromString), then this outparam
  *                    will be set to true. Otherwise it is left unmodified.
  *
  * Returns false if a parse error occurred, otherwise returns true.
  */
 bool SMILAnimationFunction::ParseAttr(nsAtom* aAttName,
                                       const nsISMILAttr& aSMILAttr,
-                                      nsSMILValue& aResult,
+                                      SMILValue& aResult,
                                       bool& aPreventCachingOfSandwich) const {
   nsAutoString attValue;
   if (GetAttr(aAttName, attValue)) {
     bool preventCachingOfSandwich = false;
     nsresult rv = aSMILAttr.ValueFromString(attValue, mAnimationElement,
                                             aResult, preventCachingOfSandwich);
     if (NS_FAILED(rv)) return false;
 
@@ -697,21 +696,21 @@ bool SMILAnimationFunction::ParseAttr(ns
  * (4) if by is specified without from (by animation), forces additive behaviour
  * (5) if to is specified without from (to animation), special care needs to be
  *     taken when compositing animation as such animations are composited last.
  *
  * This helper method applies these rules to fill in the values list and to set
  * some internal state.
  */
 nsresult SMILAnimationFunction::GetValues(const nsISMILAttr& aSMILAttr,
-                                          nsSMILValueArray& aResult) {
+                                          SMILValueArray& aResult) {
   if (!mAnimationElement) return NS_ERROR_FAILURE;
 
   mValueNeedsReparsingEverySample = false;
-  nsSMILValueArray result;
+  SMILValueArray result;
 
   // If "values" is set, use it
   if (HasAttr(nsGkAtoms::values)) {
     nsAutoString attValue;
     GetAttr(nsGkAtoms::values, attValue);
     bool preventCachingOfSandwich = false;
     if (!SMILParserUtils::ParseValues(attValue, mAnimationElement, aSMILAttr,
                                       result, preventCachingOfSandwich)) {
@@ -720,17 +719,17 @@ nsresult SMILAnimationFunction::GetValue
 
     if (preventCachingOfSandwich) {
       mValueNeedsReparsingEverySample = true;
     }
     // Else try to/from/by
   } else {
     bool preventCachingOfSandwich = false;
     bool parseOk = true;
-    nsSMILValue to, from, by;
+    SMILValue to, from, by;
     parseOk &=
         ParseAttr(nsGkAtoms::to, aSMILAttr, to, preventCachingOfSandwich);
     parseOk &=
         ParseAttr(nsGkAtoms::from, aSMILAttr, from, preventCachingOfSandwich);
     parseOk &=
         ParseAttr(nsGkAtoms::by, aSMILAttr, by, preventCachingOfSandwich);
 
     if (preventCachingOfSandwich) {
@@ -745,21 +744,21 @@ nsresult SMILAnimationFunction::GetValue
     if (!to.IsNull()) {
       if (!from.IsNull()) {
         MOZ_ALWAYS_TRUE(result.AppendElement(from, fallible));
         MOZ_ALWAYS_TRUE(result.AppendElement(to, fallible));
       } else {
         MOZ_ALWAYS_TRUE(result.AppendElement(to, fallible));
       }
     } else if (!by.IsNull()) {
-      nsSMILValue effectiveFrom(by.mType);
+      SMILValue effectiveFrom(by.mType);
       if (!from.IsNull()) effectiveFrom = from;
       // Set values to 'from; from + by'
       MOZ_ALWAYS_TRUE(result.AppendElement(effectiveFrom, fallible));
-      nsSMILValue effectiveTo(effectiveFrom);
+      SMILValue effectiveTo(effectiveFrom);
       if (!effectiveTo.IsNull() && NS_SUCCEEDED(effectiveTo.Add(by))) {
         MOZ_ALWAYS_TRUE(result.AppendElement(effectiveTo, fallible));
       } else {
         // Using by-animation with non-additive type or bad base-value
         return NS_ERROR_FAILURE;
       }
     } else {
       // No values, no to, no by -- call it a day
--- a/dom/smil/SMILAnimationFunction.h
+++ b/dom/smil/SMILAnimationFunction.h
@@ -5,21 +5,21 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_SMILANIMATIONFUNCTION_H_
 #define NS_SMILANIMATIONFUNCTION_H_
 
 #include "mozilla/SMILKeySpline.h"
 #include "mozilla/SMILTargetIdentifier.h"
 #include "mozilla/SMILTimeValue.h"
+#include "mozilla/SMILTypes.h"
+#include "mozilla/SMILValue.h"
 #include "nsAttrValue.h"
 #include "nsGkAtoms.h"
 #include "nsISMILAttr.h"
-#include "nsSMILTypes.h"
-#include "nsSMILValue.h"
 #include "nsString.h"
 #include "nsTArray.h"
 
 namespace mozilla {
 namespace dom {
 class SVGAnimationElement;
 }  // namespace dom
 
@@ -119,17 +119,17 @@ class SMILAnimationFunction {
    * Combines the result of this animation function for the last sample with the
    * specified value.
    *
    * @param aSMILAttr This animation's target attribute. Used here for
    *                  doing attribute-specific parsing of from/to/by/values.
    *
    * @param aResult   The value to compose with.
    */
-  void ComposeResult(const nsISMILAttr& aSMILAttr, nsSMILValue& aResult);
+  void ComposeResult(const nsISMILAttr& aSMILAttr, SMILValue& aResult);
 
   /**
    * Returns the relative priority of this animation to another. The priority is
    * used for determining the position of the animation in the animation
    * sandwich -- higher priority animations are applied on top of lower
    * priority animations.
    *
    * @return  -1 if this animation has lower priority or 1 if this animation has
@@ -150,17 +150,17 @@ class SMILAnimationFunction {
    * animations will not contribute to the composed result.
    *
    * @return  true if the animation is active or frozen, false otherwise.
    */
   bool IsActiveOrFrozen() const {
     /*
      * - Frozen animations should be considered active for the purposes of
      * compositing.
-     * - This function does not assume that our nsSMILValues (by/from/to/values)
+     * - This function does not assume that our SMILValues (by/from/to/values)
      * have already been parsed.
      */
     return (mIsActive || mIsFrozen);
   }
 
   /**
    * Indicates if the animation is active.
    *
@@ -253,17 +253,17 @@ class SMILAnimationFunction {
     bool LessThan(const SMILAnimationFunction* aElem1,
                   const SMILAnimationFunction* aElem2) const {
       return (aElem1->CompareTo(aElem2) < 0);
     }
   };
 
  protected:
   // Typedefs
-  typedef FallibleTArray<nsSMILValue> nsSMILValueArray;
+  typedef FallibleTArray<SMILValue> SMILValueArray;
 
   // Types
   enum nsSMILCalcMode : uint8_t {
     CALC_LINEAR,
     CALC_DISCRETE,
     CALC_PACED,
     CALC_SPLINE
   };
@@ -286,28 +286,25 @@ class SMILAnimationFunction {
   // Property un-setters
   void UnsetAccumulate();
   void UnsetAdditive();
   void UnsetCalcMode();
   void UnsetKeyTimes();
   void UnsetKeySplines();
 
   // Helpers
-  virtual nsresult InterpolateResult(const nsSMILValueArray& aValues,
-                                     nsSMILValue& aResult,
-                                     nsSMILValue& aBaseValue);
-  nsresult AccumulateResult(const nsSMILValueArray& aValues,
-                            nsSMILValue& aResult);
+  virtual nsresult InterpolateResult(const SMILValueArray& aValues,
+                                     SMILValue& aResult, SMILValue& aBaseValue);
+  nsresult AccumulateResult(const SMILValueArray& aValues, SMILValue& aResult);
 
-  nsresult ComputePacedPosition(const nsSMILValueArray& aValues,
+  nsresult ComputePacedPosition(const SMILValueArray& aValues,
                                 double aSimpleProgress,
                                 double& aIntervalProgress,
-                                const nsSMILValue*& aFrom,
-                                const nsSMILValue*& aTo);
-  double ComputePacedTotalDistance(const nsSMILValueArray& aValues) const;
+                                const SMILValue*& aFrom, const SMILValue*& aTo);
+  double ComputePacedTotalDistance(const SMILValueArray& aValues) const;
 
   /**
    * Adjust the simple progress, that is, the point within the simple duration,
    * by applying any keyTimes.
    */
   double ScaleSimpleProgress(double aProgress, nsSMILCalcMode aCalcMode);
   /**
    * Adjust the progress within an interval, that is, between two animation
@@ -317,20 +314,20 @@ class SMILAnimationFunction {
 
   // Convenience attribute getters -- use these instead of querying
   // mAnimationElement as these may need to be overridden by subclasses
   virtual bool HasAttr(nsAtom* aAttName) const;
   virtual const nsAttrValue* GetAttr(nsAtom* aAttName) const;
   virtual bool GetAttr(nsAtom* aAttName, nsAString& aResult) const;
 
   bool ParseAttr(nsAtom* aAttName, const nsISMILAttr& aSMILAttr,
-                 nsSMILValue& aResult, bool& aPreventCachingOfSandwich) const;
+                 SMILValue& aResult, bool& aPreventCachingOfSandwich) const;
 
   virtual nsresult GetValues(const nsISMILAttr& aSMILAttr,
-                             nsSMILValueArray& aResult);
+                             SMILValueArray& aResult);
 
   virtual void CheckValueListDependentAttrs(uint32_t aNumValues);
   void CheckKeyTimes(uint32_t aNumValues);
   void CheckKeySplines(uint32_t aNumValues);
 
   virtual bool IsToAnimation() const {
     return !HasAttr(nsGkAtoms::values) && HasAttr(nsGkAtoms::to) &&
            !HasAttr(nsGkAtoms::from);
--- a/dom/smil/SMILBoolType.cpp
+++ b/dom/smil/SMILBoolType.cpp
@@ -1,69 +1,69 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SMILBoolType.h"
-#include "nsSMILValue.h"
+
+#include "mozilla/SMILValue.h"
 #include "nsDebug.h"
 #include <math.h>
 
 namespace mozilla {
 
-void SMILBoolType::Init(nsSMILValue& aValue) const {
+void SMILBoolType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
   aValue.mU.mBool = false;
   aValue.mType = this;
 }
 
-void SMILBoolType::Destroy(nsSMILValue& aValue) const {
+void SMILBoolType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value");
   aValue.mU.mBool = false;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SMILBoolType::Assign(nsSMILValue& aDest,
-                              const nsSMILValue& aSrc) const {
+nsresult SMILBoolType::Assign(SMILValue& aDest, const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
   aDest.mU.mBool = aSrc.mU.mBool;
   return NS_OK;
 }
 
-bool SMILBoolType::IsEqual(const nsSMILValue& aLeft,
-                           const nsSMILValue& aRight) const {
+bool SMILBoolType::IsEqual(const SMILValue& aLeft,
+                           const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
   return aLeft.mU.mBool == aRight.mU.mBool;
 }
 
-nsresult SMILBoolType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+nsresult SMILBoolType::Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                            uint32_t aCount) const {
   MOZ_ASSERT(aValueToAdd.mType == aDest.mType, "Trying to add invalid types");
   MOZ_ASSERT(aValueToAdd.mType == this, "Unexpected source type");
   return NS_ERROR_FAILURE;  // bool values can't be added to each other
 }
 
-nsresult SMILBoolType::ComputeDistance(const nsSMILValue& aFrom,
-                                       const nsSMILValue& aTo,
+nsresult SMILBoolType::ComputeDistance(const SMILValue& aFrom,
+                                       const SMILValue& aTo,
                                        double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == aTo.mType, "Trying to compare different types");
   MOZ_ASSERT(aFrom.mType == this, "Unexpected source type");
   return NS_ERROR_FAILURE;  // there is no concept of distance between bool
                             // values
 }
 
-nsresult SMILBoolType::Interpolate(const nsSMILValue& aStartVal,
-                                   const nsSMILValue& aEndVal,
+nsresult SMILBoolType::Interpolate(const SMILValue& aStartVal,
+                                   const SMILValue& aEndVal,
                                    double aUnitDistance,
-                                   nsSMILValue& aResult) const {
+                                   SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
   return NS_ERROR_FAILURE;  // bool values do not interpolate
 }
 
 }  // namespace mozilla
--- a/dom/smil/SMILBoolType.h
+++ b/dom/smil/SMILBoolType.h
@@ -9,39 +9,38 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
 namespace mozilla {
 
 class SMILBoolType : public SMILType {
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SMILBoolType* Singleton() {
     static SMILBoolType sSingleton;
     return &sSingleton;
   }
 
  protected:
   // SMILType Methods
   // -------------------
-  virtual void Init(nsSMILValue& aValue) const override;
-  virtual void Destroy(nsSMILValue& aValue) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Init(SMILValue& aValue) const override;
+  virtual void Destroy(SMILValue& aValue) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SMILBoolType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/smil/SMILCSSProperty.cpp
+++ b/dom/smil/SMILCSSProperty.cpp
@@ -7,39 +7,39 @@
 /* representation of a SMIL-animatable CSS property on an element */
 
 #include "SMILCSSProperty.h"
 
 #include "mozilla/dom/Element.h"
 #include "mozilla/Move.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/SMILCSSValueType.h"
+#include "mozilla/SMILValue.h"
 #include "mozilla/StyleAnimationValue.h"
 #include "nsDOMCSSAttrDeclaration.h"
-#include "nsSMILValue.h"
 #include "nsCSSProps.h"
 
 namespace mozilla {
 
 // Class Methods
 SMILCSSProperty::SMILCSSProperty(nsCSSPropertyID aPropID, Element* aElement,
                                  ComputedStyle* aBaseComputedStyle)
     : mPropID(aPropID),
       mElement(aElement),
       mBaseComputedStyle(aBaseComputedStyle) {
   MOZ_ASSERT(IsPropertyAnimatable(mPropID),
              "Creating a SMILCSSProperty for a property "
              "that's not supported for animation");
 }
 
-nsSMILValue SMILCSSProperty::GetBaseValue() const {
+SMILValue SMILCSSProperty::GetBaseValue() const {
   // To benefit from Return Value Optimization and avoid copy constructor calls
   // due to our use of return-by-value, we must return the exact same object
   // from ALL return points. This function must only return THIS variable:
-  nsSMILValue baseValue;
+  SMILValue baseValue;
 
   // SPECIAL CASE: (a) Shorthands
   //               (b) 'display'
   //               (c) No base ComputedStyle
   if (nsCSSProps::IsShorthand(mPropID) || mPropID == eCSSProperty_display ||
       !mBaseComputedStyle) {
     // We can't look up the base (computed-style) value of shorthand
     // properties because they aren't guaranteed to have a consistent computed
@@ -49,17 +49,17 @@ nsSMILValue SMILCSSProperty::GetBaseValu
     // doing so involves clearing and resetting the property which can cause
     // frames to be recreated which we'd like to avoid.
     //
     // Furthermore, if we don't (yet) have a base ComputedStyle we obviously
     // can't resolve a base value.
     //
     // In any case, just return a dummy value (initialized with the right
     // type, so as not to indicate failure).
-    nsSMILValue tmpVal(&SMILCSSValueType::sSingleton);
+    SMILValue tmpVal(&SMILCSSValueType::sSingleton);
     Swap(baseValue, tmpVal);
     return baseValue;
   }
 
   AnimationValue computedValue;
   computedValue.mServo =
       Servo_ComputedValues_ExtractAnimationValue(mBaseComputedStyle, mPropID)
           .Consume();
@@ -69,17 +69,17 @@ nsSMILValue SMILCSSProperty::GetBaseValu
 
   baseValue = SMILCSSValueType::ValueFromAnimationValue(mPropID, mElement,
                                                         computedValue);
   return baseValue;
 }
 
 nsresult SMILCSSProperty::ValueFromString(
     const nsAString& aStr, const SVGAnimationElement* aSrcElement,
-    nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
+    SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
   NS_ENSURE_TRUE(IsPropertyAnimatable(mPropID), NS_ERROR_FAILURE);
 
   SMILCSSValueType::ValueFromString(mPropID, mElement, aStr, aValue,
                                     &aPreventCachingOfSandwich);
 
   if (aValue.IsNull()) {
     return NS_ERROR_FAILURE;
   }
@@ -88,17 +88,17 @@ nsresult SMILCSSProperty::ValueFromStrin
   // culprit), when we have animation setting display:none on a <use> element,
   // if we DON'T set the property every sample, chaos ensues.
   if (!aPreventCachingOfSandwich && mPropID == eCSSProperty_display) {
     aPreventCachingOfSandwich = true;
   }
   return NS_OK;
 }
 
-nsresult SMILCSSProperty::SetAnimValue(const nsSMILValue& aValue) {
+nsresult SMILCSSProperty::SetAnimValue(const SMILValue& aValue) {
   NS_ENSURE_TRUE(IsPropertyAnimatable(mPropID), NS_ERROR_FAILURE);
   return mElement->SMILOverrideStyle()->SetSMILValue(mPropID, aValue);
 }
 
 void SMILCSSProperty::ClearAnimValue() {
   // Put empty string in override style for our property
   mElement->SMILOverrideStyle()->SetPropertyValue(mPropID, EmptyString(),
                                                   nullptr);
--- a/dom/smil/SMILCSSProperty.h
+++ b/dom/smil/SMILCSSProperty.h
@@ -29,28 +29,28 @@ class Element;
 class SMILCSSProperty : public nsISMILAttr {
  public:
   /**
    * Constructs a new SMILCSSProperty.
    * @param  aPropID   The CSS property we're interested in animating.
    * @param  aElement  The element whose CSS property is being animated.
    * @param  aBaseComputedStyle  The ComputedStyle to use when getting the base
    *                             value. If this is nullptr and GetBaseValue is
-   *                             called, an empty nsSMILValue initialized with
+   *                             called, an empty SMILValue initialized with
    *                             the SMILCSSValueType will be returned.
    */
   SMILCSSProperty(nsCSSPropertyID aPropID, dom::Element* aElement,
                   ComputedStyle* aBaseComputedStyle);
 
   // nsISMILAttr methods
   virtual nsresult ValueFromString(
       const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
-      nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-  virtual nsSMILValue GetBaseValue() const override;
-  virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+      SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
+  virtual SMILValue GetBaseValue() const override;
+  virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   virtual void ClearAnimValue() override;
 
   /**
    * Utility method - returns true if the given property is supported for
    * SMIL animation.
    *
    * @param   aProperty  The property to check for animation support.
    * @param   aBackend   The style backend to check for animation support.
--- a/dom/smil/SMILCSSValueType.cpp
+++ b/dom/smil/SMILCSSValueType.cpp
@@ -4,33 +4,33 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* representation of a value for a SMIL-animated CSS property */
 
 #include "SMILCSSValueType.h"
 
 #include "nsComputedDOMStyle.h"
-#include "nsString.h"
-#include "nsSMILValue.h"
+#include "nsColor.h"
 #include "nsCSSProps.h"
 #include "nsCSSValue.h"
-#include "nsColor.h"
+#include "nsDebug.h"
 #include "nsPresContext.h"
+#include "nsString.h"
+#include "nsStyleUtil.h"
 #include "mozilla/DeclarationBlock.h"
 #include "mozilla/ServoBindings.h"
-#include "mozilla/StyleAnimationValue.h"  // For AnimationValue
+#include "mozilla/StyleAnimationValue.h"
 #include "mozilla/ServoCSSParser.h"
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/SMILParserUtils.h"
-#include "mozilla/dom/BaseKeyframeTypesBinding.h"  // For CompositeOperation
+#include "mozilla/SMILValue.h"
+#include "mozilla/dom/BaseKeyframeTypesBinding.h"
+#include "mozilla/dom/Document.h"
 #include "mozilla/dom/Element.h"
-#include "nsDebug.h"
-#include "nsStyleUtil.h"
-#include "mozilla/dom/Document.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
 typedef AutoTArray<RefPtr<RawServoAnimationValue>, 1> ServoAnimationValues;
 
 /*static*/ SMILCSSValueType SMILCSSValueType::sSingleton;
@@ -104,41 +104,41 @@ static bool FinalizeServoAnimationValues
     aValue1 = &aZeroValueStorage;
   } else if (!aValue2) {
     aZeroValueStorage = Servo_AnimationValues_GetZeroValue(*aValue1).Consume();
     aValue2 = &aZeroValueStorage;
   }
   return *aValue1 && *aValue2;
 }
 
-static ValueWrapper* ExtractValueWrapper(nsSMILValue& aValue) {
+static ValueWrapper* ExtractValueWrapper(SMILValue& aValue) {
   return static_cast<ValueWrapper*>(aValue.mU.mPtr);
 }
 
-static const ValueWrapper* ExtractValueWrapper(const nsSMILValue& aValue) {
+static const ValueWrapper* ExtractValueWrapper(const SMILValue& aValue) {
   return static_cast<const ValueWrapper*>(aValue.mU.mPtr);
 }
 
 // Class methods
 // -------------
-void SMILCSSValueType::Init(nsSMILValue& aValue) const {
+void SMILCSSValueType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected SMIL value type");
 
   aValue.mU.mPtr = nullptr;
   aValue.mType = this;
 }
 
-void SMILCSSValueType::Destroy(nsSMILValue& aValue) const {
+void SMILCSSValueType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value type");
   delete static_cast<ValueWrapper*>(aValue.mU.mPtr);
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SMILCSSValueType::Assign(nsSMILValue& aDest,
-                                  const nsSMILValue& aSrc) const {
+nsresult SMILCSSValueType::Assign(SMILValue& aDest,
+                                  const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value type");
   const ValueWrapper* srcWrapper = ExtractValueWrapper(aSrc);
   ValueWrapper* destWrapper = ExtractValueWrapper(aDest);
 
   if (srcWrapper) {
     if (!destWrapper) {
       // barely-initialized dest -- need to alloc & copy
@@ -151,42 +151,42 @@ nsresult SMILCSSValueType::Assign(nsSMIL
     // fully-initialized dest, barely-initialized src -- clear dest
     delete destWrapper;
     aDest.mU.mPtr = destWrapper = nullptr;
   }  // else, both are barely-initialized -- nothing to do.
 
   return NS_OK;
 }
 
-bool SMILCSSValueType::IsEqual(const nsSMILValue& aLeft,
-                               const nsSMILValue& aRight) const {
+bool SMILCSSValueType::IsEqual(const SMILValue& aLeft,
+                               const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected SMIL value");
   const ValueWrapper* leftWrapper = ExtractValueWrapper(aLeft);
   const ValueWrapper* rightWrapper = ExtractValueWrapper(aRight);
 
   if (leftWrapper) {
     if (rightWrapper) {
       // Both non-null
       NS_WARNING_ASSERTION(leftWrapper != rightWrapper,
-                           "Two nsSMILValues with matching ValueWrapper ptr");
+                           "Two SMILValues with matching ValueWrapper ptr");
       return *leftWrapper == *rightWrapper;
     }
     // Left non-null, right null
     return false;
   }
   if (rightWrapper) {
     // Left null, right non-null
     return false;
   }
   // Both null
   return true;
 }
 
-static bool AddOrAccumulateForServo(nsSMILValue& aDest,
+static bool AddOrAccumulateForServo(SMILValue& aDest,
                                     const ValueWrapper* aValueToAddWrapper,
                                     ValueWrapper* aDestWrapper,
                                     CompositeOperation aCompositeOp,
                                     uint64_t aCount) {
   nsCSSPropertyID property =
       aValueToAddWrapper ? aValueToAddWrapper->mPropID : aDestWrapper->mPropID;
   size_t len = aValueToAddWrapper ? aValueToAddWrapper->mServoValues.Length()
                                   : aDestWrapper->mServoValues.Length();
@@ -230,17 +230,17 @@ static bool AddOrAccumulateForServo(nsSM
       return false;
     }
     aDestWrapper->mServoValues[i] = result;
   }
 
   return true;
 }
 
-static bool AddOrAccumulate(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+static bool AddOrAccumulate(SMILValue& aDest, const SMILValue& aValueToAdd,
                             CompositeOperation aCompositeOp, uint64_t aCount) {
   MOZ_ASSERT(aValueToAdd.mType == aDest.mType,
              "Trying to add mismatching types");
   MOZ_ASSERT(aValueToAdd.mType == &SMILCSSValueType::sSingleton,
              "Unexpected SMIL value type");
   MOZ_ASSERT(aCompositeOp == CompositeOperation::Add ||
                  aCompositeOp == CompositeOperation::Accumulate,
              "Composite operation should be add or accumulate");
@@ -271,25 +271,24 @@ static bool AddOrAccumulate(nsSMILValue&
   if (property == eCSSProperty_font) {
     return false;
   }
 
   return AddOrAccumulateForServo(aDest, valueToAddWrapper, destWrapper,
                                  aCompositeOp, aCount);
 }
 
-nsresult SMILCSSValueType::SandwichAdd(nsSMILValue& aDest,
-                                       const nsSMILValue& aValueToAdd) const {
+nsresult SMILCSSValueType::SandwichAdd(SMILValue& aDest,
+                                       const SMILValue& aValueToAdd) const {
   return AddOrAccumulate(aDest, aValueToAdd, CompositeOperation::Add, 1)
              ? NS_OK
              : NS_ERROR_FAILURE;
 }
 
-nsresult SMILCSSValueType::Add(nsSMILValue& aDest,
-                               const nsSMILValue& aValueToAdd,
+nsresult SMILCSSValueType::Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                                uint32_t aCount) const {
   return AddOrAccumulate(aDest, aValueToAdd, CompositeOperation::Accumulate,
                          aCount)
              ? NS_OK
              : NS_ERROR_FAILURE;
 }
 
 static nsresult ComputeDistanceForServo(const ValueWrapper* aFromWrapper,
@@ -324,32 +323,31 @@ static nsresult ComputeDistanceForServo(
     squareDistance += distance * distance;
   }
 
   aDistance = sqrt(squareDistance);
 
   return NS_OK;
 }
 
-nsresult SMILCSSValueType::ComputeDistance(const nsSMILValue& aFrom,
-                                           const nsSMILValue& aTo,
+nsresult SMILCSSValueType::ComputeDistance(const SMILValue& aFrom,
+                                           const SMILValue& aTo,
                                            double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == aTo.mType, "Trying to compare different types");
   MOZ_ASSERT(aFrom.mType == this, "Unexpected source type");
 
   const ValueWrapper* fromWrapper = ExtractValueWrapper(aFrom);
   const ValueWrapper* toWrapper = ExtractValueWrapper(aTo);
   MOZ_ASSERT(toWrapper, "expecting non-null endpoint");
   return ComputeDistanceForServo(fromWrapper, *toWrapper, aDistance);
 }
 
 static nsresult InterpolateForServo(const ValueWrapper* aStartWrapper,
                                     const ValueWrapper& aEndWrapper,
-                                    double aUnitDistance,
-                                    nsSMILValue& aResult) {
+                                    double aUnitDistance, SMILValue& aResult) {
   // For discretely-animated properties Servo_AnimationValues_Interpolate will
   // perform the discrete animation (i.e. 50% flip) and return a success result.
   // However, SMIL has its own special discrete animation behavior that it uses
   // when keyTimes are specified, but we won't run that unless that this method
   // returns a failure to indicate that the property cannot be smoothly
   // interpolated, i.e. that we need to use a discrete calcMode.
   //
   // For shorthands, Servo_Property_IsDiscreteAnimatable will always return
@@ -384,20 +382,20 @@ static nsresult InterpolateForServo(cons
     }
     results.AppendElement(result);
   }
   aResult.mU.mPtr = new ValueWrapper(aEndWrapper.mPropID, std::move(results));
 
   return NS_OK;
 }
 
-nsresult SMILCSSValueType::Interpolate(const nsSMILValue& aStartVal,
-                                       const nsSMILValue& aEndVal,
+nsresult SMILCSSValueType::Interpolate(const SMILValue& aStartVal,
+                                       const SMILValue& aEndVal,
                                        double aUnitDistance,
-                                       nsSMILValue& aResult) const {
+                                       SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
   MOZ_ASSERT(aUnitDistance >= 0.0 && aUnitDistance <= 1.0,
              "unit distance value out of bounds");
   MOZ_ASSERT(!aResult.mU.mPtr, "expecting barely-initialized outparam");
 
@@ -436,17 +434,17 @@ static ServoAnimationValues ValueFromStr
 
   return result;
 }
 
 // static
 void SMILCSSValueType::ValueFromString(nsCSSPropertyID aPropID,
                                        Element* aTargetElement,
                                        const nsAString& aString,
-                                       nsSMILValue& aValue,
+                                       SMILValue& aValue,
                                        bool* aIsContextSensitive) {
   MOZ_ASSERT(aValue.IsNull(), "Outparam should be null-typed");
   nsPresContext* presContext =
       nsContentUtils::GetContextForContent(aTargetElement);
   if (!presContext) {
     NS_WARNING("Not parsing animation value; unable to get PresContext");
     return;
   }
@@ -474,20 +472,20 @@ void SMILCSSValueType::ValueFromString(n
 
   if (!parsedValues.IsEmpty()) {
     sSingleton.Init(aValue);
     aValue.mU.mPtr = new ValueWrapper(aPropID, std::move(parsedValues));
   }
 }
 
 // static
-nsSMILValue SMILCSSValueType::ValueFromAnimationValue(
+SMILValue SMILCSSValueType::ValueFromAnimationValue(
     nsCSSPropertyID aPropID, Element* aTargetElement,
     const AnimationValue& aValue) {
-  nsSMILValue result;
+  SMILValue result;
 
   Document* doc = aTargetElement->GetComposedDoc();
   // We'd like to avoid serializing |aValue| if possible, and since the
   // string passed to CSPAllowsInlineStyle is only used for reporting violations
   // and an intermediate CSS value is not likely to be particularly useful
   // in that case, we just use a generic placeholder string instead.
   static const nsLiteralString kPlaceholderText =
       NS_LITERAL_STRING("[SVG animation of CSS]");
@@ -499,17 +497,17 @@ nsSMILValue SMILCSSValueType::ValueFromA
 
   sSingleton.Init(result);
   result.mU.mPtr = new ValueWrapper(aPropID, aValue);
 
   return result;
 }
 
 // static
-bool SMILCSSValueType::SetPropertyValues(const nsSMILValue& aValue,
+bool SMILCSSValueType::SetPropertyValues(const SMILValue& aValue,
                                          DeclarationBlock& aDecl) {
   MOZ_ASSERT(aValue.mType == &SMILCSSValueType::sSingleton,
              "Unexpected SMIL value type");
   const ValueWrapper* wrapper = ExtractValueWrapper(aValue);
   if (!wrapper) {
     return false;
   }
 
@@ -518,32 +516,32 @@ bool SMILCSSValueType::SetPropertyValues
     changed |=
         Servo_DeclarationBlock_SetPropertyToAnimationValue(aDecl.Raw(), value);
   }
 
   return changed;
 }
 
 // static
-nsCSSPropertyID SMILCSSValueType::PropertyFromValue(const nsSMILValue& aValue) {
+nsCSSPropertyID SMILCSSValueType::PropertyFromValue(const SMILValue& aValue) {
   if (aValue.mType != &SMILCSSValueType::sSingleton) {
     return eCSSProperty_UNKNOWN;
   }
 
   const ValueWrapper* wrapper = ExtractValueWrapper(aValue);
   if (!wrapper) {
     return eCSSProperty_UNKNOWN;
   }
 
   return wrapper->mPropID;
 }
 
 // static
-void SMILCSSValueType::FinalizeValue(nsSMILValue& aValue,
-                                     const nsSMILValue& aValueToMatch) {
+void SMILCSSValueType::FinalizeValue(SMILValue& aValue,
+                                     const SMILValue& aValueToMatch) {
   MOZ_ASSERT(aValue.mType == aValueToMatch.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aValue.mType == &SMILCSSValueType::sSingleton,
              "Unexpected SMIL value type");
 
   ValueWrapper* valueWrapper = ExtractValueWrapper(aValue);
   // If |aValue| already has a value, there's nothing to do here.
   if (valueWrapper) {
     return;
--- a/dom/smil/SMILCSSValueType.h
+++ b/dom/smil/SMILCSSValueType.h
@@ -24,114 +24,111 @@ class Element;
 /*
  * SMILCSSValueType: Represents a SMIL-animated CSS value.
  */
 class SMILCSSValueType : public SMILType {
  public:
   typedef mozilla::dom::Element Element;
   typedef mozilla::AnimationValue AnimationValue;
 
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SMILCSSValueType sSingleton;
 
  protected:
   // SMILType Methods
   // -------------------
-  void Init(nsSMILValue& aValue) const override;
-  void Destroy(nsSMILValue&) const override;
-  nsresult Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const override;
-  bool IsEqual(const nsSMILValue& aLeft,
-               const nsSMILValue& aRight) const override;
-  nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  void Init(SMILValue& aValue) const override;
+  void Destroy(SMILValue&) const override;
+  nsresult Assign(SMILValue& aDest, const SMILValue& aSrc) const override;
+  bool IsEqual(const SMILValue& aLeft, const SMILValue& aRight) const override;
+  nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                uint32_t aCount) const override;
-  nsresult SandwichAdd(nsSMILValue& aDest,
-                       const nsSMILValue& aValueToAdd) const override;
-  nsresult ComputeDistance(const nsSMILValue& aFrom, const nsSMILValue& aTo,
+  nsresult SandwichAdd(SMILValue& aDest,
+                       const SMILValue& aValueToAdd) const override;
+  nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                            double& aDistance) const override;
-  nsresult Interpolate(const nsSMILValue& aStartVal, const nsSMILValue& aEndVal,
-                       double aUnitDistance,
-                       nsSMILValue& aResult) const override;
+  nsresult Interpolate(const SMILValue& aStartVal, const SMILValue& aEndVal,
+                       double aUnitDistance, SMILValue& aResult) const override;
 
  public:
   // Helper Methods
   // --------------
   /**
-   * Sets up the given nsSMILValue to represent the given string value.  The
+   * Sets up the given SMILValue to represent the given string value.  The
    * string is interpreted as a value for the given property on the given
    * element.
    *
    * On failure, this method leaves aValue.mType == SMILNullType::sSingleton.
    * Otherwise, this method leaves aValue.mType == this class's singleton.
    *
    * @param       aPropID         The property for which we're parsing a value.
    * @param       aTargetElement  The target element to whom the property/value
    *                              setting applies.
    * @param       aString         The string to be parsed as a CSS value.
-   * @param [out] aValue          The nsSMILValue to be populated. Should
+   * @param [out] aValue          The SMILValue to be populated. Should
    *                              initially be null-typed.
    * @param [out] aIsContextSensitive Set to true if |aString| may produce
    *                                  a different |aValue| depending on other
    *                                  CSS properties on |aTargetElement|
    *                                  or its ancestors (e.g. 'inherit).
    *                                  false otherwise. May be nullptr.
    *                                  Not set if the method fails.
    * @pre  aValue.IsNull()
    * @post aValue.IsNull() || aValue.mType == SMILCSSValueType::sSingleton
    */
   static void ValueFromString(nsCSSPropertyID aPropID, Element* aTargetElement,
-                              const nsAString& aString, nsSMILValue& aValue,
+                              const nsAString& aString, SMILValue& aValue,
                               bool* aIsContextSensitive);
 
   /**
-   * Creates an nsSMILValue to wrap the given animation value.
+   * Creates a SMILValue to wrap the given animation value.
    *
    * @param aPropID         The property that |aValue| corresponds to.
    * @param aTargetElement  The target element to which the animation value
    *                        applies.
    * @param aValue          The animation value to use.
-   * @return                A new nsSMILValue. On failure, returns an
-   *                        nsSMILValue with the null type (i.e. rv.IsNull()
+   * @return                A new SMILValue. On failure, returns a
+   *                        SMILValue with the null type (i.e. rv.IsNull()
    *                        returns true).
    */
-  static nsSMILValue ValueFromAnimationValue(nsCSSPropertyID aPropID,
-                                             Element* aTargetElement,
-                                             const AnimationValue& aValue);
+  static SMILValue ValueFromAnimationValue(nsCSSPropertyID aPropID,
+                                           Element* aTargetElement,
+                                           const AnimationValue& aValue);
 
   /**
    * Sets the relevant property values in the declaration block.
    *
    * Returns whether the declaration changed.
    */
-  static bool SetPropertyValues(const nsSMILValue&, mozilla::DeclarationBlock&);
+  static bool SetPropertyValues(const SMILValue&, mozilla::DeclarationBlock&);
 
   /**
    * Return the CSS property animated by the specified value.
    *
-   * @param   aValue   The nsSMILValue to examine.
+   * @param   aValue   The SMILValue to examine.
    * @return           The nsCSSPropertyID enum value of the property animated
    *                   by |aValue|, or eCSSProperty_UNKNOWN if the type of
    *                   |aValue| is not SMILCSSValueType.
    */
-  static nsCSSPropertyID PropertyFromValue(const nsSMILValue& aValue);
+  static nsCSSPropertyID PropertyFromValue(const SMILValue& aValue);
 
   /**
    * If |aValue| is an empty value, converts it to a suitable zero value by
    * matching the type of value stored in |aValueToMatch|.
    *
    * There is no indication if this method fails. If a suitable zero value could
    * not be created, |aValue| is simply unmodified.
    *
-   * @param aValue        The nsSMILValue (of type SMILCSSValueType) to
+   * @param aValue        The SMILValue (of type SMILCSSValueType) to
    *                      possibly update.
-   * @param aValueToMatch A nsSMILValue (of type SMILCSSValueType) for which
+   * @param aValueToMatch A SMILValue (of type SMILCSSValueType) for which
    *                      a corresponding zero value will be created if |aValue|
    *                      is empty.
    */
-  static void FinalizeValue(nsSMILValue& aValue,
-                            const nsSMILValue& aValueToMatch);
+  static void FinalizeValue(SMILValue& aValue, const SMILValue& aValueToMatch);
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SMILCSSValueType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/smil/SMILCompositor.cpp
+++ b/dom/smil/SMILCompositor.cpp
@@ -73,17 +73,17 @@ void SMILCompositor::ComposeAttribute(bo
   SMILAnimationFunction::Comparator comparator;
   mAnimationFunctions.Sort(comparator);
 
   // THIRD: Step backwards through animation functions to find out
   // which ones we actually care about.
   uint32_t firstFuncToCompose = GetFirstFuncToAffectSandwich();
 
   // FOURTH: Get & cache base value
-  nsSMILValue sandwichResultValue;
+  SMILValue sandwichResultValue;
   if (!mAnimationFunctions[firstFuncToCompose]->WillReplace()) {
     sandwichResultValue = smilAttr->GetBaseValue();
   }
   UpdateCachedBaseValue(sandwichResultValue);
 
   if (!mForceCompositing) {
     return;
   }
@@ -219,17 +219,17 @@ uint32_t SMILCompositor::GetFirstFuncToA
   if (mForceCompositing) {
     for (uint32_t j = i; j > 0; --j) {
       mAnimationFunctions[j - 1]->SetWasSkipped();
     }
   }
   return i;
 }
 
-void SMILCompositor::UpdateCachedBaseValue(const nsSMILValue& aBaseValue) {
+void SMILCompositor::UpdateCachedBaseValue(const SMILValue& aBaseValue) {
   if (mCachedBaseValue != aBaseValue) {
     // Base value has changed since last sample.
     mCachedBaseValue = aBaseValue;
     mForceCompositing = true;
   }
 }
 
 }  // namespace mozilla
--- a/dom/smil/SMILCompositor.h
+++ b/dom/smil/SMILCompositor.h
@@ -94,17 +94,17 @@ class SMILCompositor : public PLDHashEnt
 
   // Finds the index of the first function that will affect our animation
   // sandwich. Also toggles the 'mForceCompositing' flag if it finds that any
   // (used) functions have changed.
   uint32_t GetFirstFuncToAffectSandwich();
 
   // If the passed-in base value differs from our cached base value, this
   // method updates the cached value (and toggles the 'mForceCompositing' flag)
-  void UpdateCachedBaseValue(const nsSMILValue& aBaseValue);
+  void UpdateCachedBaseValue(const SMILValue& aBaseValue);
 
   // The hash key (tuple of element and attributeName)
   KeyType mKey;
 
   // Hash Value: List of animation functions that animate the specified attr
   nsTArray<SMILAnimationFunction*> mAnimationFunctions;
 
   // Member data for detecting when we need to force-recompose
@@ -112,14 +112,14 @@ class SMILCompositor : public PLDHashEnt
   // Flag for tracking whether we need to compose. Initialized to false, but
   // gets flipped to true if we detect that something has changed.
   bool mForceCompositing;
 
   // Cached base value, so we can detect & force-recompose when it changes
   // from one sample to the next. (SMILAnimationController moves this
   // forward from the previous sample's compositor by calling
   // StealCachedBaseValue.)
-  nsSMILValue mCachedBaseValue;
+  SMILValue mCachedBaseValue;
 };
 
 }  // namespace mozilla
 
 #endif  // NS_SMILCOMPOSITOR_H_
--- a/dom/smil/SMILEnumType.cpp
+++ b/dom/smil/SMILEnumType.cpp
@@ -1,69 +1,69 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SMILEnumType.h"
-#include "nsSMILValue.h"
+
+#include "mozilla/SMILValue.h"
 #include "nsDebug.h"
 #include <math.h>
 
 namespace mozilla {
 
-void SMILEnumType::Init(nsSMILValue& aValue) const {
+void SMILEnumType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
   aValue.mU.mUint = 0;
   aValue.mType = this;
 }
 
-void SMILEnumType::Destroy(nsSMILValue& aValue) const {
+void SMILEnumType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value");
   aValue.mU.mUint = 0;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SMILEnumType::Assign(nsSMILValue& aDest,
-                              const nsSMILValue& aSrc) const {
+nsresult SMILEnumType::Assign(SMILValue& aDest, const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
   aDest.mU.mUint = aSrc.mU.mUint;
   return NS_OK;
 }
 
-bool SMILEnumType::IsEqual(const nsSMILValue& aLeft,
-                           const nsSMILValue& aRight) const {
+bool SMILEnumType::IsEqual(const SMILValue& aLeft,
+                           const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
   return aLeft.mU.mUint == aRight.mU.mUint;
 }
 
-nsresult SMILEnumType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+nsresult SMILEnumType::Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                            uint32_t aCount) const {
   MOZ_ASSERT(aValueToAdd.mType == aDest.mType, "Trying to add invalid types");
   MOZ_ASSERT(aValueToAdd.mType == this, "Unexpected source type");
   return NS_ERROR_FAILURE;  // enum values can't be added to each other
 }
 
-nsresult SMILEnumType::ComputeDistance(const nsSMILValue& aFrom,
-                                       const nsSMILValue& aTo,
+nsresult SMILEnumType::ComputeDistance(const SMILValue& aFrom,
+                                       const SMILValue& aTo,
                                        double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == aTo.mType, "Trying to compare different types");
   MOZ_ASSERT(aFrom.mType == this, "Unexpected source type");
   return NS_ERROR_FAILURE;  // there is no concept of distance between enum
                             // values
 }
 
-nsresult SMILEnumType::Interpolate(const nsSMILValue& aStartVal,
-                                   const nsSMILValue& aEndVal,
+nsresult SMILEnumType::Interpolate(const SMILValue& aStartVal,
+                                   const SMILValue& aEndVal,
                                    double aUnitDistance,
-                                   nsSMILValue& aResult) const {
+                                   SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
   return NS_ERROR_FAILURE;  // enum values do not interpolate
 }
 
 }  // namespace mozilla
--- a/dom/smil/SMILEnumType.h
+++ b/dom/smil/SMILEnumType.h
@@ -9,39 +9,38 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
 namespace mozilla {
 
 class SMILEnumType : public SMILType {
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SMILEnumType* Singleton() {
     static SMILEnumType sSingleton;
     return &sSingleton;
   }
 
  protected:
   // SMILType Methods
   // -------------------
-  virtual void Init(nsSMILValue& aValue) const override;
-  virtual void Destroy(nsSMILValue& aValue) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Init(SMILValue& aValue) const override;
+  virtual void Destroy(SMILValue& aValue) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SMILEnumType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/smil/SMILFloatType.cpp
+++ b/dom/smil/SMILFloatType.cpp
@@ -1,75 +1,75 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SMILFloatType.h"
-#include "nsSMILValue.h"
+
+#include "mozilla/SMILValue.h"
 #include "nsDebug.h"
 #include <math.h>
 
 namespace mozilla {
 
-void SMILFloatType::Init(nsSMILValue& aValue) const {
+void SMILFloatType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
   aValue.mU.mDouble = 0.0;
   aValue.mType = this;
 }
 
-void SMILFloatType::Destroy(nsSMILValue& aValue) const {
+void SMILFloatType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value");
   aValue.mU.mDouble = 0.0;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SMILFloatType::Assign(nsSMILValue& aDest,
-                               const nsSMILValue& aSrc) const {
+nsresult SMILFloatType::Assign(SMILValue& aDest, const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
   aDest.mU.mDouble = aSrc.mU.mDouble;
   return NS_OK;
 }
 
-bool SMILFloatType::IsEqual(const nsSMILValue& aLeft,
-                            const nsSMILValue& aRight) const {
+bool SMILFloatType::IsEqual(const SMILValue& aLeft,
+                            const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
   return aLeft.mU.mDouble == aRight.mU.mDouble;
 }
 
-nsresult SMILFloatType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+nsresult SMILFloatType::Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                             uint32_t aCount) const {
   MOZ_ASSERT(aValueToAdd.mType == aDest.mType, "Trying to add invalid types");
   MOZ_ASSERT(aValueToAdd.mType == this, "Unexpected source type");
   aDest.mU.mDouble += aValueToAdd.mU.mDouble * aCount;
   return NS_OK;
 }
 
-nsresult SMILFloatType::ComputeDistance(const nsSMILValue& aFrom,
-                                        const nsSMILValue& aTo,
+nsresult SMILFloatType::ComputeDistance(const SMILValue& aFrom,
+                                        const SMILValue& aTo,
                                         double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == aTo.mType, "Trying to compare different types");
   MOZ_ASSERT(aFrom.mType == this, "Unexpected source type");
 
   const double& from = aFrom.mU.mDouble;
   const double& to = aTo.mU.mDouble;
 
   aDistance = fabs(to - from);
 
   return NS_OK;
 }
 
-nsresult SMILFloatType::Interpolate(const nsSMILValue& aStartVal,
-                                    const nsSMILValue& aEndVal,
+nsresult SMILFloatType::Interpolate(const SMILValue& aStartVal,
+                                    const SMILValue& aEndVal,
                                     double aUnitDistance,
-                                    nsSMILValue& aResult) const {
+                                    SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
 
   const double& startVal = aStartVal.mU.mDouble;
   const double& endVal = aEndVal.mU.mDouble;
 
--- a/dom/smil/SMILFloatType.h
+++ b/dom/smil/SMILFloatType.h
@@ -9,39 +9,38 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
 namespace mozilla {
 
 class SMILFloatType : public SMILType {
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SMILFloatType* Singleton() {
     static SMILFloatType sSingleton;
     return &sSingleton;
   }
 
  protected:
   // SMILType Methods
   // -------------------
-  virtual void Init(nsSMILValue& aValue) const override;
-  virtual void Destroy(nsSMILValue& aValue) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Init(SMILValue& aValue) const override;
+  virtual void Destroy(SMILValue& aValue) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SMILFloatType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/smil/SMILIntegerType.cpp
+++ b/dom/smil/SMILIntegerType.cpp
@@ -1,71 +1,71 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SMILIntegerType.h"
-#include "nsSMILValue.h"
+
+#include "mozilla/SMILValue.h"
 #include "nsDebug.h"
 #include <math.h>
 
 namespace mozilla {
 
-void SMILIntegerType::Init(nsSMILValue& aValue) const {
+void SMILIntegerType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
   aValue.mU.mInt = 0;
   aValue.mType = this;
 }
 
-void SMILIntegerType::Destroy(nsSMILValue& aValue) const {
+void SMILIntegerType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value");
   aValue.mU.mInt = 0;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SMILIntegerType::Assign(nsSMILValue& aDest,
-                                 const nsSMILValue& aSrc) const {
+nsresult SMILIntegerType::Assign(SMILValue& aDest,
+                                 const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
   aDest.mU.mInt = aSrc.mU.mInt;
   return NS_OK;
 }
 
-bool SMILIntegerType::IsEqual(const nsSMILValue& aLeft,
-                              const nsSMILValue& aRight) const {
+bool SMILIntegerType::IsEqual(const SMILValue& aLeft,
+                              const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
   return aLeft.mU.mInt == aRight.mU.mInt;
 }
 
-nsresult SMILIntegerType::Add(nsSMILValue& aDest,
-                              const nsSMILValue& aValueToAdd,
+nsresult SMILIntegerType::Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                               uint32_t aCount) const {
   MOZ_ASSERT(aValueToAdd.mType == aDest.mType, "Trying to add invalid types");
   MOZ_ASSERT(aValueToAdd.mType == this, "Unexpected source type");
   aDest.mU.mInt += aValueToAdd.mU.mInt * aCount;
   return NS_OK;
 }
 
-nsresult SMILIntegerType::ComputeDistance(const nsSMILValue& aFrom,
-                                          const nsSMILValue& aTo,
+nsresult SMILIntegerType::ComputeDistance(const SMILValue& aFrom,
+                                          const SMILValue& aTo,
                                           double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == aTo.mType, "Trying to compare different types");
   MOZ_ASSERT(aFrom.mType == this, "Unexpected source type");
   aDistance = fabs(double(aTo.mU.mInt - aFrom.mU.mInt));
   return NS_OK;
 }
 
-nsresult SMILIntegerType::Interpolate(const nsSMILValue& aStartVal,
-                                      const nsSMILValue& aEndVal,
+nsresult SMILIntegerType::Interpolate(const SMILValue& aStartVal,
+                                      const SMILValue& aEndVal,
                                       double aUnitDistance,
-                                      nsSMILValue& aResult) const {
+                                      SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
 
   const double startVal = double(aStartVal.mU.mInt);
   const double endVal = double(aEndVal.mU.mInt);
   const double currentVal = startVal + (endVal - startVal) * aUnitDistance;
--- a/dom/smil/SMILIntegerType.h
+++ b/dom/smil/SMILIntegerType.h
@@ -9,30 +9,29 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
 namespace mozilla {
 
 class SMILIntegerType : public SMILType {
  public:
-  virtual void Init(nsSMILValue& aValue) const override;
-  virtual void Destroy(nsSMILValue& aValue) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Init(SMILValue& aValue) const override;
+  virtual void Destroy(SMILValue& aValue) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
   static SMILIntegerType* Singleton() {
     static SMILIntegerType sSingleton;
     return &sSingleton;
   }
 
  private:
   constexpr SMILIntegerType() {}
--- a/dom/smil/SMILMilestone.h
+++ b/dom/smil/SMILMilestone.h
@@ -2,17 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_SMILMILESTONE_H_
 #define NS_SMILMILESTONE_H_
 
-#include "nsSMILTypes.h"
+#include "mozilla/SMILTypes.h"
 
 namespace mozilla {
 
 /*
  * A significant moment in an SMILTimedElement's lifetime where a sample is
  * required.
  *
  * Animations register the next milestone in their lifetime with the time
--- a/dom/smil/SMILNullType.cpp
+++ b/dom/smil/SMILNullType.cpp
@@ -1,56 +1,56 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SMILNullType.h"
-#include "nsSMILValue.h"
+
+#include "mozilla/SMILValue.h"
 #include "nsDebug.h"
 
 namespace mozilla {
 
 /*static*/ SMILNullType* SMILNullType::Singleton() {
   static SMILNullType sSingleton;
   return &sSingleton;
 }
 
-nsresult SMILNullType::Assign(nsSMILValue& aDest,
-                              const nsSMILValue& aSrc) const {
+nsresult SMILNullType::Assign(SMILValue& aDest, const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aSrc.mType == this, "Unexpected source type");
   aDest.mU = aSrc.mU;
   aDest.mType = Singleton();
   return NS_OK;
 }
 
-bool SMILNullType::IsEqual(const nsSMILValue& aLeft,
-                           const nsSMILValue& aRight) const {
+bool SMILNullType::IsEqual(const SMILValue& aLeft,
+                           const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
   return true;  // All null-typed values are equivalent.
 }
 
-nsresult SMILNullType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+nsresult SMILNullType::Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                            uint32_t aCount) const {
   MOZ_ASSERT_UNREACHABLE("Adding NULL type");
   return NS_ERROR_FAILURE;
 }
 
-nsresult SMILNullType::ComputeDistance(const nsSMILValue& aFrom,
-                                       const nsSMILValue& aTo,
+nsresult SMILNullType::ComputeDistance(const SMILValue& aFrom,
+                                       const SMILValue& aTo,
                                        double& aDistance) const {
   MOZ_ASSERT_UNREACHABLE("Computing distance for NULL type");
   return NS_ERROR_FAILURE;
 }
 
-nsresult SMILNullType::Interpolate(const nsSMILValue& aStartVal,
-                                   const nsSMILValue& aEndVal,
+nsresult SMILNullType::Interpolate(const SMILValue& aStartVal,
+                                   const SMILValue& aEndVal,
                                    double aUnitDistance,
-                                   nsSMILValue& aResult) const {
+                                   SMILValue& aResult) const {
   MOZ_ASSERT_UNREACHABLE("Interpolating NULL type");
   return NS_ERROR_FAILURE;
 }
 
 }  // namespace mozilla
--- a/dom/smil/SMILNullType.h
+++ b/dom/smil/SMILNullType.h
@@ -9,39 +9,38 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
 namespace mozilla {
 
 class SMILNullType : public SMILType {
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SMILNullType* Singleton();
 
  protected:
   // SMILType Methods
   // -------------------
-  virtual void Init(nsSMILValue& aValue) const override {}
-  virtual void Destroy(nsSMILValue& aValue) const override {}
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
+  virtual void Init(SMILValue& aValue) const override {}
+  virtual void Destroy(SMILValue& aValue) const override {}
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
 
   // The remaining methods should never be called, so although they're very
   // simple they don't need to be inline.
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SMILNullType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/smil/SMILParserUtils.cpp
+++ b/dom/smil/SMILParserUtils.cpp
@@ -5,21 +5,21 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SMILParserUtils.h"
 
 #include "mozilla/SMILKeySpline.h"
 #include "mozilla/SMILRepeatCount.h"
 #include "mozilla/SMILTimeValue.h"
 #include "mozilla/SMILTimeValueSpecParams.h"
+#include "mozilla/SMILTypes.h"
+#include "mozilla/SMILValue.h"
 #include "mozilla/SVGContentUtils.h"
 #include "mozilla/TextUtils.h"
 #include "nsISMILAttr.h"
-#include "nsSMILValue.h"
-#include "nsSMILTypes.h"
 #include "nsContentUtils.h"
 #include "nsCharSeparatedTokenizer.h"
 
 using namespace mozilla::dom;
 //------------------------------------------------------------------------------
 // Helper functions and Constants
 
 namespace {
@@ -487,25 +487,25 @@ bool SMILParserUtils::ParseSemicolonDeli
 }
 
 // Helper class for ParseValues
 class MOZ_STACK_CLASS SMILValueParser
     : public SMILParserUtils::GenericValueParser {
  public:
   SMILValueParser(const SVGAnimationElement* aSrcElement,
                   const nsISMILAttr* aSMILAttr,
-                  FallibleTArray<nsSMILValue>* aValuesArray,
+                  FallibleTArray<SMILValue>* aValuesArray,
                   bool* aPreventCachingOfSandwich)
       : mSrcElement(aSrcElement),
         mSMILAttr(aSMILAttr),
         mValuesArray(aValuesArray),
         mPreventCachingOfSandwich(aPreventCachingOfSandwich) {}
 
   virtual bool Parse(const nsAString& aValueStr) override {
-    nsSMILValue newValue;
+    SMILValue newValue;
     bool tmpPreventCachingOfSandwich = false;
     if (NS_FAILED(mSMILAttr->ValueFromString(aValueStr, mSrcElement, newValue,
                                              tmpPreventCachingOfSandwich)))
       return false;
 
     if (!mValuesArray->AppendElement(newValue, fallible)) {
       return false;
     }
@@ -513,24 +513,24 @@ class MOZ_STACK_CLASS SMILValueParser
       *mPreventCachingOfSandwich = true;
     }
     return true;
   }
 
  protected:
   const SVGAnimationElement* mSrcElement;
   const nsISMILAttr* mSMILAttr;
-  FallibleTArray<nsSMILValue>* mValuesArray;
+  FallibleTArray<SMILValue>* mValuesArray;
   bool* mPreventCachingOfSandwich;
 };
 
 bool SMILParserUtils::ParseValues(const nsAString& aSpec,
                                   const SVGAnimationElement* aSrcElement,
                                   const nsISMILAttr& aAttribute,
-                                  FallibleTArray<nsSMILValue>& aValuesArray,
+                                  FallibleTArray<SMILValue>& aValuesArray,
                                   bool& aPreventCachingOfSandwich) {
   // Assume all results can be cached, until we find one that can't.
   aPreventCachingOfSandwich = false;
   SMILValueParser valueParser(aSrcElement, &aAttribute, &aValuesArray,
                               &aPreventCachingOfSandwich);
   return ParseValuesGeneric(aSpec, valueParser);
 }
 
--- a/dom/smil/SMILParserUtils.h
+++ b/dom/smil/SMILParserUtils.h
@@ -6,23 +6,25 @@
 
 #ifndef NS_SMILPARSERUTILS_H_
 #define NS_SMILPARSERUTILS_H_
 
 #include "nsTArray.h"
 #include "nsStringFwd.h"
 
 class nsISMILAttr;
-class nsSMILValue;
 
 namespace mozilla {
+
 class SMILKeySpline;
 class SMILRepeatCount;
 class SMILTimeValue;
 class SMILTimeValueSpecParams;
+class SMILValue;
+
 namespace dom {
 class SVGAnimationElement;
 }  // namespace dom
 
 /**
  * Common parsing utilities for the SMIL module. There is little re-use here; it
  * simply serves to simplify other classes by moving parsing outside and to aid
  * unit testing.
@@ -43,17 +45,17 @@ class SMILParserUtils {
   // Used for parsing the |keyTimes| and |keyPoints| attributes.
   static bool ParseSemicolonDelimitedProgressList(
       const nsAString& aSpec, bool aNonDecreasing,
       FallibleTArray<double>& aArray);
 
   static bool ParseValues(const nsAString& aSpec,
                           const mozilla::dom::SVGAnimationElement* aSrcElement,
                           const nsISMILAttr& aAttribute,
-                          FallibleTArray<nsSMILValue>& aValuesArray,
+                          FallibleTArray<SMILValue>& aValuesArray,
                           bool& aPreventCachingOfSandwich);
 
   // Generic method that will run some code on each sub-section of an animation
   // element's "values" list.
   static bool ParseValuesGeneric(const nsAString& aSpec,
                                  GenericValueParser& aParser);
 
   static bool ParseRepeatCount(const nsAString& aSpec,
--- a/dom/smil/SMILStringType.cpp
+++ b/dom/smil/SMILStringType.cpp
@@ -1,75 +1,75 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SMILStringType.h"
-#include "nsSMILValue.h"
+
+#include "mozilla/SMILValue.h"
 #include "nsDebug.h"
 #include "nsString.h"
 
 namespace mozilla {
 
-void SMILStringType::Init(nsSMILValue& aValue) const {
+void SMILStringType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
   aValue.mU.mPtr = new nsString();
   aValue.mType = this;
 }
 
-void SMILStringType::Destroy(nsSMILValue& aValue) const {
+void SMILStringType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value");
   delete static_cast<nsAString*>(aValue.mU.mPtr);
   aValue.mU.mPtr = nullptr;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SMILStringType::Assign(nsSMILValue& aDest,
-                                const nsSMILValue& aSrc) const {
+nsresult SMILStringType::Assign(SMILValue& aDest, const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
 
   const nsAString* src = static_cast<const nsAString*>(aSrc.mU.mPtr);
   nsAString* dst = static_cast<nsAString*>(aDest.mU.mPtr);
   *dst = *src;
   return NS_OK;
 }
 
-bool SMILStringType::IsEqual(const nsSMILValue& aLeft,
-                             const nsSMILValue& aRight) const {
+bool SMILStringType::IsEqual(const SMILValue& aLeft,
+                             const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
   const nsAString* leftString = static_cast<const nsAString*>(aLeft.mU.mPtr);
   const nsAString* rightString = static_cast<nsAString*>(aRight.mU.mPtr);
   return *leftString == *rightString;
 }
 
-nsresult SMILStringType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+nsresult SMILStringType::Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                              uint32_t aCount) const {
   MOZ_ASSERT(aValueToAdd.mType == aDest.mType, "Trying to add invalid types");
   MOZ_ASSERT(aValueToAdd.mType == this, "Unexpected source type");
   return NS_ERROR_FAILURE;  // string values can't be added to each other
 }
 
-nsresult SMILStringType::ComputeDistance(const nsSMILValue& aFrom,
-                                         const nsSMILValue& aTo,
+nsresult SMILStringType::ComputeDistance(const SMILValue& aFrom,
+                                         const SMILValue& aTo,
                                          double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == aTo.mType, "Trying to compare different types");
   MOZ_ASSERT(aFrom.mType == this, "Unexpected source type");
   return NS_ERROR_FAILURE;  // there is no concept of distance between string
                             // values
 }
 
-nsresult SMILStringType::Interpolate(const nsSMILValue& aStartVal,
-                                     const nsSMILValue& aEndVal,
+nsresult SMILStringType::Interpolate(const SMILValue& aStartVal,
+                                     const SMILValue& aEndVal,
                                      double aUnitDistance,
-                                     nsSMILValue& aResult) const {
+                                     SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
   return NS_ERROR_FAILURE;  // string values do not interpolate
 }
 
 }  // namespace mozilla
--- a/dom/smil/SMILStringType.h
+++ b/dom/smil/SMILStringType.h
@@ -9,39 +9,38 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
 namespace mozilla {
 
 class SMILStringType : public SMILType {
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SMILStringType* Singleton() {
     static SMILStringType sSingleton;
     return &sSingleton;
   }
 
  protected:
   // SMILType Methods
   // -------------------
-  virtual void Init(nsSMILValue& aValue) const override;
-  virtual void Destroy(nsSMILValue& aValue) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Init(SMILValue& aValue) const override;
+  virtual void Destroy(SMILValue& aValue) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SMILStringType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/smil/SMILTimeContainer.h
+++ b/dom/smil/SMILTimeContainer.h
@@ -4,18 +4,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_SMILTIMECONTAINER_H_
 #define NS_SMILTIMECONTAINER_H_
 
 #include "mozilla/dom/SVGAnimationElement.h"
 #include "mozilla/SMILMilestone.h"
+#include "mozilla/SMILTypes.h"
 #include "nscore.h"
-#include "nsSMILTypes.h"
 #include "nsTPriorityQueue.h"
 
 namespace mozilla {
 
 class SMILTimeValue;
 
 //----------------------------------------------------------------------
 // SMILTimeContainer
--- a/dom/smil/SMILTimeValue.h
+++ b/dom/smil/SMILTimeValue.h
@@ -2,17 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_SMILTIMEVALUE_H_
 #define NS_SMILTIMEVALUE_H_
 
-#include "nsSMILTypes.h"
+#include "mozilla/SMILTypes.h"
 #include "nsDebug.h"
 
 namespace mozilla {
 
 /*----------------------------------------------------------------------
  * SMILTimeValue class
  *
  * A tri-state time value.
--- a/dom/smil/SMILTimedElement.h
+++ b/dom/smil/SMILTimedElement.h
@@ -9,18 +9,18 @@
 
 #include "mozilla/EventForwards.h"
 #include "mozilla/Move.h"
 #include "mozilla/SMILMilestone.h"
 #include "mozilla/SMILInstanceTime.h"
 #include "mozilla/SMILInterval.h"
 #include "mozilla/SMILRepeatCount.h"
 #include "mozilla/SMILTimeValueSpec.h"
+#include "mozilla/SMILTypes.h"
 #include "mozilla/UniquePtr.h"
-#include "nsSMILTypes.h"
 #include "nsTArray.h"
 #include "nsTHashtable.h"
 #include "nsHashKeys.h"
 #include "nsAutoPtr.h"
 #include "nsAttrValue.h"
 
 class nsAtom;
 
--- a/dom/smil/SMILType.h
+++ b/dom/smil/SMILType.h
@@ -5,33 +5,33 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_ISMILTYPE_H_
 #define NS_ISMILTYPE_H_
 
 #include "mozilla/Attributes.h"
 #include "nscore.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
 
 //////////////////////////////////////////////////////////////////////////////
 // SMILType: Interface for defining the basic operations needed for animating
 // a particular kind of data (e.g. lengths, colors, transformation matrices).
 //
-// This interface is never used directly but always through an nsSMILValue that
+// This interface is never used directly but always through a SMILValue that
 // bundles together a pointer to a concrete implementation of this interface and
 // the data upon which it should operate.
 //
 // We keep the data and type separate rather than just providing different
-// subclasses of nsSMILValue. This is so that sizeof(nsSMILValue) is the same
+// subclasses of SMILValue. This is so that sizeof(SMILValue) is the same
 // for all value types, allowing us to have a type-agnostic nsTArray of
-// nsSMILValue objects (actual objects, not pointers). It also allows most
-// nsSMILValues (except those that need to allocate extra memory for their
+// SMILValue objects (actual objects, not pointers). It also allows most
+// SMILValues (except those that need to allocate extra memory for their
 // data) to be allocated on the stack and directly assigned to one another
 // provided performance benefits for the animation code.
 //
 // Note that different types have different capabilities. Roughly speaking there
 // are probably three main types:
 //
 // +---------------------+---------------+-------------+------------------+
 // | CATEGORY:           | DISCRETE      | LINEAR      | ADDITIVE         |
@@ -44,54 +44,53 @@ namespace mozilla {
 // | -- SandwichAdd?     |     -         |    -?       |    X             |
 // | -- ComputeDistance? |     -         |    -        |    X?            |
 // | -- Interpolate?     |     -         |    X        |    X             |
 // +---------------------+---------------+-------------+------------------+
 //
 
 class SMILType {
   /**
-   * Only give the nsSMILValue class access to this interface.
+   * Only give the SMILValue class access to this interface.
    */
-  friend class ::nsSMILValue;
+  friend class SMILValue;
 
  protected:
   /**
    * Initialises aValue and sets it to some identity value such that adding
    * aValue to another value of the same type has no effect.
    *
    * @pre  aValue.IsNull()
    * @post aValue.mType == this
    */
-  virtual void Init(nsSMILValue& aValue) const = 0;
+  virtual void Init(SMILValue& aValue) const = 0;
 
   /**
    * Destroys any data associated with a value of this type.
    *
    * @pre  aValue.mType == this
    * @post aValue.IsNull()
    */
-  virtual void Destroy(nsSMILValue& aValue) const = 0;
+  virtual void Destroy(SMILValue& aValue) const = 0;
 
   /**
    * Assign this object the value of another. Think of this as the assignment
    * operator.
    *
    * @param   aDest       The left-hand side of the assignment.
    * @param   aSrc        The right-hand side of the assignment.
    * @return  NS_OK on success, an error code on failure such as when the
    *          underlying type of the specified object differs.
    *
    * @pre aDest.mType == aSrc.mType == this
    */
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const = 0;
+  virtual nsresult Assign(SMILValue& aDest, const SMILValue& aSrc) const = 0;
 
   /**
-   * Test two nsSMILValue objects (of this SMILType) for equality.
+   * Test two SMILValue objects (of this SMILType) for equality.
    *
    * A return value of true represents a guarantee that aLeft and aRight are
    * equal. (That is, they would behave identically if passed to the methods
    * Add, SandwichAdd, ComputeDistance, and Interpolate).
    *
    * A return value of false simply indicates that we make no guarantee
    * about equality.
    *
@@ -100,18 +99,18 @@ class SMILType {
    * method more useful for optimization.
    *
    * @param   aLeft       The left-hand side of the equality check.
    * @param   aRight      The right-hand side of the equality check.
    * @return  true if we're sure the values are equal, false otherwise.
    *
    * @pre aDest.mType == aSrc.mType == this
    */
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const = 0;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const = 0;
 
   /**
    * Adds two values.
    *
    * The count parameter facilitates repetition.
    *
    * By equation,
    *
@@ -136,17 +135,17 @@ class SMILType {
    *
    * @param   aDest       The value to add to.
    * @param   aValueToAdd The value to add.
    * @param   aCount      The number of times to add aValueToAdd.
    * @return  NS_OK on success, an error code on failure.
    *
    * @pre aValueToAdd.mType == aDest.mType == this
    */
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const = 0;
 
   /**
    * Adds aValueToAdd to the underlying value in the animation sandwich, aDest.
    *
    * For most types this operation is identical to a regular Add() but for some
    * types (notably <animateTransform>) the operation differs. For
    * <animateTransform> Add() corresponds to simply adding together the
@@ -157,18 +156,18 @@ class SMILType {
    * obvious within the SMIL specifications.)
    *
    * @param   aDest       The value to add to.
    * @param   aValueToAdd The value to add.
    * @return  NS_OK on success, an error code on failure.
    *
    * @pre aValueToAdd.mType == aDest.mType == this
    */
-  virtual nsresult SandwichAdd(nsSMILValue& aDest,
-                               const nsSMILValue& aValueToAdd) const {
+  virtual nsresult SandwichAdd(SMILValue& aDest,
+                               const SMILValue& aValueToAdd) const {
     return Add(aDest, aValueToAdd, 1);
   }
 
   /**
    * Calculates the 'distance' between two values. This is the distance used in
    * paced interpolation.
    *
    * @param   aFrom     The start of the interval for which the distance should
@@ -177,18 +176,17 @@ class SMILType {
    *                    calculated.
    * @param   aDistance The result of the calculation.
    * @return  NS_OK on success, or an appropriate error code if there is no
    *          notion of distance for the underlying data type or the distance
    *          could not be calculated.
    *
    * @pre aFrom.mType == aTo.mType == this
    */
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const = 0;
 
   /**
    * Calculates an interpolated value between two values using the specified
    * proportion.
    *
    * @param   aStartVal     The value defining the start of the interval of
    *                        interpolation.
@@ -199,16 +197,16 @@ class SMILType {
    *                        interval.
    * @param   aResult       The interpolated value.
    * @return  NS_OK on success, NS_ERROR_FAILURE if this data type cannot be
    *          interpolated or NS_ERROR_OUT_OF_MEMORY if insufficient memory was
    *          available for storing the result.
    *
    * @pre aStartVal.mType == aEndVal.mType == aResult.mType == this
    */
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const = 0;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const = 0;
 };
 
 }  // namespace mozilla
 
 #endif  // NS_ISMILTYPE_H_
rename from dom/smil/nsSMILTypes.h
rename to dom/smil/SMILTypes.h
--- a/dom/smil/nsSMILTypes.h
+++ b/dom/smil/SMILTypes.h
@@ -4,23 +4,27 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_SMILTYPES_H_
 #define NS_SMILTYPES_H_
 
 #include <stdint.h>
 
+namespace mozilla {
+
 // A timestamp in milliseconds
 //
 // A time may represent:
 //
 //   simple time -- offset within the simple duration
 //   active time -- offset within the active duration
 //   document time -- offset since the document begin
 //   wallclock time -- "real" time -- offset since the epoch
 //
 // For an overview of how this class is related to other SMIL time classes see
 // the documentation in SMILTimeValue.h
 //
 typedef int64_t nsSMILTime;
 
+}  // namespace mozilla
+
 #endif  // NS_SMILTYPES_H_
rename from dom/smil/nsSMILValue.cpp
rename to dom/smil/SMILValue.cpp
--- a/dom/smil/nsSMILValue.cpp
+++ b/dom/smil/SMILValue.cpp
@@ -1,114 +1,114 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsSMILValue.h"
+#include "SMILValue.h"
+
 #include "nsDebug.h"
 #include <string.h>
 
+namespace mozilla {
+
 //----------------------------------------------------------------------
 // Public methods
 
-nsSMILValue::nsSMILValue(const SMILType* aType)
-    : mType(SMILNullType::Singleton()) {
+SMILValue::SMILValue(const SMILType* aType) : mType(SMILNullType::Singleton()) {
   mU.mBool = false;
   if (!aType) {
-    NS_ERROR("Trying to construct nsSMILValue with null mType pointer");
+    NS_ERROR("Trying to construct SMILValue with null mType pointer");
     return;
   }
 
   InitAndCheckPostcondition(aType);
 }
 
-nsSMILValue::nsSMILValue(const nsSMILValue& aVal)
-    : mType(SMILNullType::Singleton()) {
+SMILValue::SMILValue(const SMILValue& aVal) : mType(SMILNullType::Singleton()) {
   InitAndCheckPostcondition(aVal.mType);
   mType->Assign(*this, aVal);
 }
 
-const nsSMILValue& nsSMILValue::operator=(const nsSMILValue& aVal) {
+const SMILValue& SMILValue::operator=(const SMILValue& aVal) {
   if (&aVal == this) return *this;
 
   if (mType != aVal.mType) {
     DestroyAndReinit(aVal.mType);
   }
 
   mType->Assign(*this, aVal);
 
   return *this;
 }
 
 // Move constructor / reassignment operator:
-nsSMILValue::nsSMILValue(nsSMILValue&& aVal)
+SMILValue::SMILValue(SMILValue&& aVal)
     : mU(aVal.mU),  // Copying union is only OK because we clear aVal.mType
                     // below.
       mType(aVal.mType) {
   // Leave aVal with a null type, so that it's safely destructible (and won't
   // mess with anything referenced by its union, which we've copied).
   aVal.mType = SMILNullType::Singleton();
 }
 
-nsSMILValue& nsSMILValue::operator=(nsSMILValue&& aVal) {
+SMILValue& SMILValue::operator=(SMILValue&& aVal) {
   if (!IsNull()) {
     // Clean up any data we're currently tracking.
     DestroyAndCheckPostcondition();
   }
 
   // Copy the union (which could include a pointer to external memory) & mType:
   mU = aVal.mU;
   mType = aVal.mType;
 
   // Leave aVal with a null type, so that it's safely destructible (and won't
   // mess with anything referenced by its union, which we've now copied).
   aVal.mType = SMILNullType::Singleton();
 
   return *this;
 }
 
-bool nsSMILValue::operator==(const nsSMILValue& aVal) const {
+bool SMILValue::operator==(const SMILValue& aVal) const {
   if (&aVal == this) return true;
 
   return mType == aVal.mType && mType->IsEqual(*this, aVal);
 }
 
-nsresult nsSMILValue::Add(const nsSMILValue& aValueToAdd, uint32_t aCount) {
+nsresult SMILValue::Add(const SMILValue& aValueToAdd, uint32_t aCount) {
   if (aValueToAdd.mType != mType) {
     NS_ERROR("Trying to add incompatible types");
     return NS_ERROR_FAILURE;
   }
 
   return mType->Add(*this, aValueToAdd, aCount);
 }
 
-nsresult nsSMILValue::SandwichAdd(const nsSMILValue& aValueToAdd) {
+nsresult SMILValue::SandwichAdd(const SMILValue& aValueToAdd) {
   if (aValueToAdd.mType != mType) {
     NS_ERROR("Trying to add incompatible types");
     return NS_ERROR_FAILURE;
   }
 
   return mType->SandwichAdd(*this, aValueToAdd);
 }
 
-nsresult nsSMILValue::ComputeDistance(const nsSMILValue& aTo,
-                                      double& aDistance) const {
+nsresult SMILValue::ComputeDistance(const SMILValue& aTo,
+                                    double& aDistance) const {
   if (aTo.mType != mType) {
     NS_ERROR("Trying to calculate distance between incompatible types");
     return NS_ERROR_FAILURE;
   }
 
   return mType->ComputeDistance(*this, aTo, aDistance);
 }
 
-nsresult nsSMILValue::Interpolate(const nsSMILValue& aEndVal,
-                                  double aUnitDistance,
-                                  nsSMILValue& aResult) const {
+nsresult SMILValue::Interpolate(const SMILValue& aEndVal, double aUnitDistance,
+                                SMILValue& aResult) const {
   if (aEndVal.mType != mType) {
     NS_ERROR("Trying to interpolate between incompatible types");
     return NS_ERROR_FAILURE;
   }
 
   if (aResult.mType != mType) {
     // Outparam has wrong type
     aResult.DestroyAndReinit(mType);
@@ -116,25 +116,27 @@ nsresult nsSMILValue::Interpolate(const 
 
   return mType->Interpolate(*this, aEndVal, aUnitDistance, aResult);
 }
 
 //----------------------------------------------------------------------
 // Helper methods
 
 // Wrappers for SMILType::Init & ::Destroy that verify their postconditions
-void nsSMILValue::InitAndCheckPostcondition(const SMILType* aNewType) {
+void SMILValue::InitAndCheckPostcondition(const SMILType* aNewType) {
   aNewType->Init(*this);
   MOZ_ASSERT(mType == aNewType,
-             "Post-condition of Init failed. nsSMILValue is invalid");
+             "Post-condition of Init failed. SMILValue is invalid");
 }
 
-void nsSMILValue::DestroyAndCheckPostcondition() {
+void SMILValue::DestroyAndCheckPostcondition() {
   mType->Destroy(*this);
   MOZ_ASSERT(IsNull(),
              "Post-condition of Destroy failed. "
-             "nsSMILValue not null after destroying");
+             "SMILValue not null after destroying");
 }
 
-void nsSMILValue::DestroyAndReinit(const SMILType* aNewType) {
+void SMILValue::DestroyAndReinit(const SMILType* aNewType) {
   DestroyAndCheckPostcondition();
   InitAndCheckPostcondition(aNewType);
 }
+
+}  // namespace mozilla
rename from dom/smil/nsSMILValue.h
rename to dom/smil/SMILValue.h
--- a/dom/smil/nsSMILValue.h
+++ b/dom/smil/SMILValue.h
@@ -5,54 +5,53 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_SMILVALUE_H_
 #define NS_SMILVALUE_H_
 
 #include "mozilla/SMILNullType.h"
 #include "mozilla/SMILType.h"
 
+namespace mozilla {
+
 /**
  * Although objects of this type are generally only created on the stack and
  * only exist during the taking of a new time sample, that's not always the
- * case. The nsSMILValue objects obtained from attributes' base values are
+ * case. The SMILValue objects obtained from attributes' base values are
  * cached so that the SMIL engine can make certain optimizations during a
  * sample if the base value has not changed since the last sample (potentially
- * avoiding recomposing). These nsSMILValue objects typically live much longer
+ * avoiding recomposing). These SMILValue objects typically live much longer
  * than a single sample.
  */
-class nsSMILValue {
+class SMILValue {
  public:
-  typedef mozilla::SMILNullType SMILNullType;
-  typedef mozilla::SMILType SMILType;
+  SMILValue() : mU(), mType(SMILNullType::Singleton()) {}
+  explicit SMILValue(const SMILType* aType);
+  SMILValue(const SMILValue& aVal);
 
-  nsSMILValue() : mU(), mType(SMILNullType::Singleton()) {}
-  explicit nsSMILValue(const SMILType* aType);
-  nsSMILValue(const nsSMILValue& aVal);
+  ~SMILValue() { mType->Destroy(*this); }
 
-  ~nsSMILValue() { mType->Destroy(*this); }
-
-  const nsSMILValue& operator=(const nsSMILValue& aVal);
+  const SMILValue& operator=(const SMILValue& aVal);
 
   // Move constructor / reassignment operator:
-  nsSMILValue(nsSMILValue&& aVal);
-  nsSMILValue& operator=(nsSMILValue&& aVal);
+  SMILValue(SMILValue&& aVal);
+  SMILValue& operator=(SMILValue&& aVal);
 
   // Equality operators. These are allowed to be conservative (return false
   // more than you'd expect) - see comment above SMILType::IsEqual.
-  bool operator==(const nsSMILValue& aVal) const;
-  bool operator!=(const nsSMILValue& aVal) const { return !(*this == aVal); }
+  bool operator==(const SMILValue& aVal) const;
+  bool operator!=(const SMILValue& aVal) const { return !(*this == aVal); }
 
   bool IsNull() const { return (mType == SMILNullType::Singleton()); }
 
-  nsresult Add(const nsSMILValue& aValueToAdd, uint32_t aCount = 1);
-  nsresult SandwichAdd(const nsSMILValue& aValueToAdd);
-  nsresult ComputeDistance(const nsSMILValue& aTo, double& aDistance) const;
-  nsresult Interpolate(const nsSMILValue& aEndVal, double aUnitDistance,
-                       nsSMILValue& aResult) const;
+  nsresult Add(const SMILValue& aValueToAdd, uint32_t aCount = 1);
+  nsresult SandwichAdd(const SMILValue& aValueToAdd);
+  nsresult ComputeDistance(const SMILValue& aTo, double& aDistance) const;
+  nsresult Interpolate(const SMILValue& aEndVal, double aUnitDistance,
+                       SMILValue& aResult) const;
 
   union {
     bool mBool;
     uint64_t mUint;
     int64_t mInt;
     double mDouble;
     struct {
       float mAngle;
@@ -66,9 +65,11 @@ class nsSMILValue {
   const SMILType* mType;
 
  protected:
   void InitAndCheckPostcondition(const SMILType* aNewType);
   void DestroyAndCheckPostcondition();
   void DestroyAndReinit(const SMILType* aNewType);
 };
 
+}  // namespace mozilla
+
 #endif  // NS_SMILVALUE_H_
--- a/dom/smil/moz.build
+++ b/dom/smil/moz.build
@@ -6,18 +6,16 @@
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "SVG")
 
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
 
 EXPORTS += [
     'nsISMILAttr.h',
-    'nsSMILTypes.h',
-    'nsSMILValue.h',
 ]
 
 EXPORTS.mozilla += [
     'SMILAnimationController.h',
     'SMILAnimationFunction.h',
     'SMILCompositorTable.h',
     'SMILCSSValueType.h',
     'SMILInstanceTime.h',
@@ -30,24 +28,25 @@ EXPORTS.mozilla += [
     'SMILSetAnimationFunction.h',
     'SMILTargetIdentifier.h',
     'SMILTimeContainer.h',
     'SMILTimedElement.h',
     'SMILTimeValue.h',
     'SMILTimeValueSpec.h',
     'SMILTimeValueSpecParams.h',
     'SMILType.h',
+    'SMILTypes.h',
+    'SMILValue.h',
 ]
 
 EXPORTS.mozilla.dom += [
     'TimeEvent.h',
 ]
 
 UNIFIED_SOURCES += [
-    'nsSMILValue.cpp',
     'SMILAnimationController.cpp',
     'SMILAnimationFunction.cpp',
     'SMILBoolType.cpp',
     'SMILCompositor.cpp',
     'SMILCSSProperty.cpp',
     'SMILCSSValueType.cpp',
     'SMILEnumType.cpp',
     'SMILFloatType.cpp',
@@ -59,16 +58,17 @@ UNIFIED_SOURCES += [
     'SMILParserUtils.cpp',
     'SMILRepeatCount.cpp',
     'SMILSetAnimationFunction.cpp',
     'SMILStringType.cpp',
     'SMILTimeContainer.cpp',
     'SMILTimedElement.cpp',
     'SMILTimeValue.cpp',
     'SMILTimeValueSpec.cpp',
+    'SMILValue.cpp',
     'TimeEvent.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/dom/base',
     '/dom/svg',
     '/layout/base',
     '/layout/style',
--- a/dom/smil/nsISMILAttr.h
+++ b/dom/smil/nsISMILAttr.h
@@ -5,38 +5,41 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_ISMILATTR_H_
 #define NS_ISMILATTR_H_
 
 #include "nscore.h"
 #include "nsStringFwd.h"
 
-class nsSMILValue;
 class nsIContent;
 
 namespace mozilla {
+
+class SMILValue;
+
 namespace dom {
 class SVGAnimationElement;
 }  // namespace dom
 }  // namespace mozilla
 
 ////////////////////////////////////////////////////////////////////////
 // nsISMILAttr: A variable targeted by SMIL for animation and can therefore have
 // an underlying (base) value and an animated value For example, an attribute of
 // a particular SVG element.
 //
 // These objects only exist during the compositing phase of SMIL animation
 // calculations. They have a single owner who is responsible for deleting the
 // object.
 
 class nsISMILAttr {
  public:
+  typedef mozilla::SMILValue SMILValue;
   /**
-   * Creates a new nsSMILValue for this attribute from a string. The string is
+   * Creates a new SMILValue for this attribute from a string. The string is
    * parsed in the context of this attribute so that context-dependent values
    * such as em-based units can be resolved into a canonical form suitable for
    * animation (including interpolation etc.).
    *
    * @param aStr        A string defining the new value to be created.
    * @param aSrcElement The source animation element. This may be needed to
    *                    provided additional context data such as for
    *                    animateTransform where the 'type' attribute is needed to
@@ -46,42 +49,42 @@ class nsISMILAttr {
    *                    Outparam to indicate whether the attribute contains
    *                    dependencies on its context that should prevent the
    *                    result of the animation sandwich from being cached and
    *                    reused in future samples.
    * @return NS_OK on success or an error code if creation failed.
    */
   virtual nsresult ValueFromString(
       const nsAString& aStr,
-      const mozilla::dom::SVGAnimationElement* aSrcElement, nsSMILValue& aValue,
+      const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,
       bool& aPreventCachingOfSandwich) const = 0;
 
   /**
    * Gets the underlying value of this attribute.
    *
-   * @return an nsSMILValue object. returned_object.IsNull() will be true if an
+   * @return a SMILValue object. returned_object.IsNull() will be true if an
    * error occurred.
    */
-  virtual nsSMILValue GetBaseValue() const = 0;
+  virtual SMILValue GetBaseValue() const = 0;
 
   /**
    * Clears the animated value of this attribute.
    *
    * NOTE: The animation target is not guaranteed to be in a document when this
    * method is called. (See bug 523188)
    */
   virtual void ClearAnimValue() = 0;
 
   /**
    * Sets the presentation value of this attribute.
    *
    * @param aValue  The value to set.
    * @return NS_OK on success or an error code if setting failed.
    */
-  virtual nsresult SetAnimValue(const nsSMILValue& aValue) = 0;
+  virtual nsresult SetAnimValue(const SMILValue& aValue) = 0;
 
   /**
    * Returns the targeted content node, for any nsISMILAttr implementations
    * that want to expose that to the animation logic.  Otherwise, returns
    * null.
    *
    * @return the targeted content node, if this nsISMILAttr implementation
    * wishes to make it avaiable.  Otherwise, nullptr.
--- a/dom/storage/SessionStorage.cpp
+++ b/dom/storage/SessionStorage.cpp
@@ -7,16 +7,17 @@
 #include "SessionStorage.h"
 #include "SessionStorageCache.h"
 #include "SessionStorageManager.h"
 
 #include "mozilla/dom/StorageBinding.h"
 #include "mozilla/Preferences.h"
 #include "nsContentUtils.h"
 #include "nsIPrincipal.h"
+#include "nsIWebProgressListener.h"
 #include "nsPIDOMWindow.h"
 
 #define DATASET                                          \
   IsSessionOnly() ? SessionStorageCache::eSessionSetType \
                   : SessionStorageCache::eDefaultSetType
 
 namespace mozilla {
 namespace dom {
@@ -158,10 +159,16 @@ bool SessionStorage::IsForkOf(const Stor
   MOZ_ASSERT(aOther);
   if (aOther->Type() != eSessionStorage) {
     return false;
   }
 
   return mCache == static_cast<const SessionStorage*>(aOther)->mCache;
 }
 
+bool SessionStorage::ShouldThrowWhenStorageAccessDenied(
+    uint32_t aRejectedReason) {
+  return aRejectedReason !=
+         nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN;
+}
+
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/storage/SessionStorage.h
+++ b/dom/storage/SessionStorage.h
@@ -60,16 +60,18 @@ class SessionStorage final : public Stor
 
  private:
   ~SessionStorage();
 
   void BroadcastChangeNotification(const nsAString& aKey,
                                    const nsAString& aOldValue,
                                    const nsAString& aNewValue);
 
+  bool ShouldThrowWhenStorageAccessDenied(uint32_t aRejectedReason) override;
+
   RefPtr<SessionStorageCache> mCache;
   RefPtr<SessionStorageManager> mManager;
 
   nsString mDocumentURI;
   bool mIsPrivate;
 };
 
 }  // namespace dom
--- a/dom/storage/Storage.cpp
+++ b/dom/storage/Storage.cpp
@@ -38,25 +38,33 @@ Storage::~Storage() {}
 }
 
 bool Storage::CanUseStorage(nsIPrincipal& aSubjectPrincipal) {
   // This method is responsible for correct setting of mIsSessionOnly.
   if (!StoragePrefIsEnabled()) {
     return false;
   }
 
-  nsContentUtils::StorageAccess access =
-      nsContentUtils::StorageAllowedForPrincipal(Principal());
+  if (nsContentUtils::IsSystemPrincipal(mPrincipal)) {
+    mIsSessionOnly = false;
+  } else if (mWindow) {
+    uint32_t rejectedReason = 0;
+    nsContentUtils::StorageAccess access =
+        nsContentUtils::StorageAllowedForWindow(mWindow, &rejectedReason);
 
-  if (access <= nsContentUtils::StorageAccess::eDeny) {
-    return false;
+    // Note that we allow StorageAccess::ePartitionedOrDeny because we want
+    // tracker to have access to their sessionStorage.
+    if (access == nsContentUtils::StorageAccess::eDeny &&
+        ShouldThrowWhenStorageAccessDenied(rejectedReason)) {
+      return false;
+    }
+
+    mIsSessionOnly = access <= nsContentUtils::StorageAccess::eSessionScoped;
   }
 
-  mIsSessionOnly = access <= nsContentUtils::StorageAccess::eSessionScoped;
-
   return aSubjectPrincipal.Subsumes(mPrincipal);
 }
 
 /* virtual */ JSObject* Storage::WrapObject(JSContext* aCx,
                                             JS::Handle<JSObject*> aGivenProto) {
   return Storage_Binding::Wrap(aCx, this, aGivenProto);
 }
 
--- a/dom/storage/Storage.h
+++ b/dom/storage/Storage.h
@@ -139,16 +139,23 @@ class Storage : public nsISupports, publ
   // session-only flag is properly set according the current settings.
   // It is an optimization since the privileges check and session only
   // state determination are complex and share the code (comes hand in
   // hand together).
   bool CanUseStorage(nsIPrincipal& aSubjectPrincipal);
 
   virtual void LastRelease() {}
 
+  // This method is called when StorageAccess is not granted for the owning
+  // window. aRejectedReason is one of the possible blocking states from
+  // nsIWebProgressListener.
+  virtual bool ShouldThrowWhenStorageAccessDenied(uint32_t aRejectedReason) {
+    return true;
+  }
+
  private:
   nsCOMPtr<nsPIDOMWindowInner> mWindow;
   nsCOMPtr<nsIPrincipal> mPrincipal;
 
   // Whether storage is set to persist data only per session, may change
   // dynamically and is set by CanUseStorage function that is called
   // before any operation on the storage.
   bool mIsSessionOnly : 1;
--- a/dom/svg/DOMSVGAnimatedLengthList.cpp
+++ b/dom/svg/DOMSVGAnimatedLengthList.cpp
@@ -1,31 +1,32 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DOMSVGAnimatedLengthList.h"
+
+#include "nsCOMPtr.h"
 #include "DOMSVGLengthList.h"
 #include "SVGAnimatedLengthList.h"
-#include "SVGElement.h"
-#include "nsCOMPtr.h"
-#include "nsSVGAttrTearoffTable.h"
+#include "SVGAttrTearoffTable.h"
 #include "mozilla/dom/SVGAnimatedLengthListBinding.h"
+#include "mozilla/dom/SVGElement.h"
 
 // See the architecture comment in this file's header.
 
 namespace mozilla {
 namespace dom {
 
-static inline nsSVGAttrTearoffTable<SVGAnimatedLengthList,
-                                    DOMSVGAnimatedLengthList>&
+static inline SVGAttrTearoffTable<SVGAnimatedLengthList,
+                                  DOMSVGAnimatedLengthList>&
 SVGAnimatedLengthListTearoffTable() {
-  static nsSVGAttrTearoffTable<SVGAnimatedLengthList, DOMSVGAnimatedLengthList>
+  static SVGAttrTearoffTable<SVGAnimatedLengthList, DOMSVGAnimatedLengthList>
       sSVGAnimatedLengthListTearoffTable;
   return sSVGAnimatedLengthListTearoffTable;
 }
 
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(DOMSVGAnimatedLengthList,
                                                mElement)
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMSVGAnimatedLengthList, AddRef)
--- a/dom/svg/DOMSVGAnimatedNumberList.cpp
+++ b/dom/svg/DOMSVGAnimatedNumberList.cpp
@@ -1,31 +1,32 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DOMSVGAnimatedNumberList.h"
+
+#include "nsCOMPtr.h"
 #include "DOMSVGNumberList.h"
 #include "SVGAnimatedNumberList.h"
-#include "SVGElement.h"
-#include "nsCOMPtr.h"
-#include "nsSVGAttrTearoffTable.h"
+#include "SVGAttrTearoffTable.h"
 #include "mozilla/dom/SVGAnimatedNumberListBinding.h"
+#include "mozilla/dom/SVGElement.h"
 
 // See the architecture comment in this file's header.
 
 namespace mozilla {
 namespace dom {
 
-static inline nsSVGAttrTearoffTable<SVGAnimatedNumberList,
-                                    DOMSVGAnimatedNumberList>&
+static inline SVGAttrTearoffTable<SVGAnimatedNumberList,
+                                  DOMSVGAnimatedNumberList>&
 SVGAnimatedNumberListTearoffTable() {
-  static nsSVGAttrTearoffTable<SVGAnimatedNumberList, DOMSVGAnimatedNumberList>
+  static SVGAttrTearoffTable<SVGAnimatedNumberList, DOMSVGAnimatedNumberList>
       sSVGAnimatedNumberListTearoffTable;
   return sSVGAnimatedNumberListTearoffTable;
 }
 
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(DOMSVGAnimatedNumberList,
                                                mElement)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGAnimatedNumberList)
--- a/dom/svg/DOMSVGAnimatedTransformList.cpp
+++ b/dom/svg/DOMSVGAnimatedTransformList.cpp
@@ -1,25 +1,26 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DOMSVGAnimatedTransformList.h"
+
 #include "DOMSVGTransformList.h"
 #include "SVGAnimatedTransformList.h"
-#include "nsSVGAttrTearoffTable.h"
+#include "SVGAttrTearoffTable.h"
 #include "mozilla/dom/SVGAnimatedTransformListBinding.h"
 
 namespace mozilla {
 namespace dom {
 
-static nsSVGAttrTearoffTable<SVGAnimatedTransformList,
-                             DOMSVGAnimatedTransformList>
+static SVGAttrTearoffTable<SVGAnimatedTransformList,
+                           DOMSVGAnimatedTransformList>
     sSVGAnimatedTransformListTearoffTable;
 
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(DOMSVGAnimatedTransformList,
                                                mElement)
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMSVGAnimatedTransformList, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMSVGAnimatedTransformList, Release)
 
--- a/dom/svg/DOMSVGLength.cpp
+++ b/dom/svg/DOMSVGLength.cpp
@@ -1,34 +1,35 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DOMSVGLength.h"
+
 #include "DOMSVGLengthList.h"
 #include "DOMSVGAnimatedLengthList.h"
-#include "SVGLength.h"
-#include "SVGAnimatedLengthList.h"
-#include "SVGElement.h"
-#include "nsSVGLength2.h"
 #include "nsError.h"
 #include "nsMathUtils.h"
+#include "SVGAnimatedLengthList.h"
+#include "SVGAttrTearoffTable.h"
+#include "SVGLength.h"
+#include "nsSVGLength2.h"
+#include "mozilla/dom/SVGElement.h"
 #include "mozilla/dom/SVGLengthBinding.h"
 #include "mozilla/FloatingPoint.h"
-#include "nsSVGAttrTearoffTable.h"
 
 // See the architecture comment in DOMSVGAnimatedLengthList.h.
 
 namespace mozilla {
 
 namespace dom {
 
-static nsSVGAttrTearoffTable<nsSVGLength2, DOMSVGLength>
+static SVGAttrTearoffTable<nsSVGLength2, DOMSVGLength>
     sBaseSVGLengthTearOffTable, sAnimSVGLengthTearOffTable;
 
 // We could use NS_IMPL_CYCLE_COLLECTION(, except that in Unlink() we need to
 // clear our list's weak ref to us to be safe. (The other option would be to
 // not unlink and rely on the breaking of the other edges in the cycle, as
 // NS_SVG_VAL_IMPL_CYCLE_COLLECTION does.)
 NS_IMPL_CYCLE_COLLECTION_CLASS(DOMSVGLength)
 
--- a/dom/svg/DOMSVGPathSegList.cpp
+++ b/dom/svg/DOMSVGPathSegList.cpp
@@ -1,33 +1,34 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DOMSVGPathSegList.h"
+
+#include "nsCOMPtr.h"
 #include "DOMSVGPathSeg.h"
 #include "nsError.h"
 #include "SVGAnimatedPathSegList.h"
-#include "nsCOMPtr.h"
-#include "nsSVGAttrTearoffTable.h"
+#include "SVGAttrTearoffTable.h"
 #include "SVGPathSegUtils.h"
 #include "mozilla/dom/SVGElement.h"
 #include "mozilla/dom/SVGPathSegListBinding.h"
 
 using namespace mozilla::dom;
 
 // See the comment in this file's header.
 
 namespace mozilla {
 
-static inline nsSVGAttrTearoffTable<void, DOMSVGPathSegList>&
+static inline SVGAttrTearoffTable<void, DOMSVGPathSegList>&
 SVGPathSegListTearoffTable() {
-  static nsSVGAttrTearoffTable<void, DOMSVGPathSegList>
+  static SVGAttrTearoffTable<void, DOMSVGPathSegList>
       sSVGPathSegListTearoffTable;
   return sSVGPathSegListTearoffTable;
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(DOMSVGPathSegList)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGPathSegList)
   // No unlinking of mElement, we'd need to null out the value pointer (the
--- a/dom/svg/DOMSVGPointList.cpp
+++ b/dom/svg/DOMSVGPointList.cpp
@@ -1,21 +1,22 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DOMSVGPointList.h"
+
+#include "nsCOMPtr.h"
+#include "nsContentUtils.h"
 #include "DOMSVGPoint.h"
 #include "nsError.h"
 #include "SVGAnimatedPointList.h"
-#include "nsCOMPtr.h"
-#include "nsSVGAttrTearoffTable.h"
-#include "nsContentUtils.h"
+#include "SVGAttrTearoffTable.h"
 #include "mozilla/dom/SVGElement.h"
 #include "mozilla/dom/SVGPointListBinding.h"
 #include <algorithm>
 
 using namespace mozilla::dom;
 
 // See the comment in this file's header.
 
@@ -33,19 +34,19 @@ void UpdateListIndicesFromIndex(
     }
   }
 }
 
 }  // namespace
 
 namespace mozilla {
 
-static inline nsSVGAttrTearoffTable<void, DOMSVGPointList>&
+static inline SVGAttrTearoffTable<void, DOMSVGPointList>&
 SVGPointListTearoffTable() {
-  static nsSVGAttrTearoffTable<void, DOMSVGPointList> sSVGPointListTearoffTable;
+  static SVGAttrTearoffTable<void, DOMSVGPointList> sSVGPointListTearoffTable;
   return sSVGPointListTearoffTable;
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(DOMSVGPointList)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGPointList)
   // No unlinking of mElement, we'd need to null out the value pointer (the
   // object it points to is held by the element) and null-check it everywhere.
--- a/dom/svg/DOMSVGStringList.cpp
+++ b/dom/svg/DOMSVGStringList.cpp
@@ -3,31 +3,31 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DOMSVGStringList.h"
 
 #include "mozilla/dom/SVGStringListBinding.h"
 #include "mozilla/dom/SVGTests.h"
+#include "nsCOMPtr.h"
 #include "nsError.h"
-#include "nsCOMPtr.h"
-#include "nsSVGAttrTearoffTable.h"
 #include "nsQueryObject.h"
+#include "SVGAttrTearoffTable.h"
 #include <algorithm>
 
 // See the architecture comment in this file's header.
 
 namespace mozilla {
 
 using namespace dom;
 
-static inline nsSVGAttrTearoffTable<SVGStringList, DOMSVGStringList>&
+static inline SVGAttrTearoffTable<SVGStringList, DOMSVGStringList>&
 SVGStringListTearoffTable() {
-  static nsSVGAttrTearoffTable<SVGStringList, DOMSVGStringList>
+  static SVGAttrTearoffTable<SVGStringList, DOMSVGStringList>
       sSVGStringListTearoffTable;
   return sSVGStringListTearoffTable;
 }
 
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(DOMSVGStringList, mElement)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGStringList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGStringList)
--- a/dom/svg/DOMSVGTransform.cpp
+++ b/dom/svg/DOMSVGTransform.cpp
@@ -7,31 +7,30 @@
 #include "DOMSVGTransform.h"
 
 #include "mozilla/dom/SVGMatrix.h"
 #include "mozilla/dom/SVGTransformBinding.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/FloatingPoint.h"
 #include "nsError.h"
 #include "SVGAnimatedTransformList.h"
-#include "nsSVGAttrTearoffTable.h"
+#include "SVGAttrTearoffTable.h"
 
 namespace {
 const double kRadPerDegree = 2.0 * M_PI / 360.0;
 }  // namespace
 
 namespace mozilla {
 namespace dom {
 
 using namespace SVGTransform_Binding;
 
-static nsSVGAttrTearoffTable<DOMSVGTransform, SVGMatrix>&
+static SVGAttrTearoffTable<DOMSVGTransform, SVGMatrix>&
 SVGMatrixTearoffTable() {
-  static nsSVGAttrTearoffTable<DOMSVGTransform, SVGMatrix>
-      sSVGMatrixTearoffTable;
+  static SVGAttrTearoffTable<DOMSVGTransform, SVGMatrix> sSVGMatrixTearoffTable;
   return sSVGMatrixTearoffTable;
 }
 
 //----------------------------------------------------------------------
 
 // We could use NS_IMPL_CYCLE_COLLECTION(, except that in Unlink() we need to
 // clear our list's weak ref to us to be safe. (The other option would be to
 // not unlink and rely on the breaking of the other edges in the cycle, as
--- a/dom/svg/SVGAngle.cpp
+++ b/dom/svg/SVGAngle.cpp
@@ -2,41 +2,41 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGAngle.h"
 
 #include "mozilla/ArrayUtils.h"
+#include "mozilla/Move.h"
+#include "mozilla/SMILValue.h"
+#include "mozilla/dom/DOMSVGAngle.h"
+#include "mozilla/dom/SVGAnimatedAngle.h"
 #include "mozilla/dom/SVGMarkerElement.h"
-#include "mozilla/Move.h"
-#include "nsContentUtils.h"  // NS_ENSURE_FINITE
-#include "DOMSVGAngle.h"
-#include "nsSMILValue.h"
-#include "nsSVGAttrTearoffTable.h"
+#include "nsContentUtils.h"
+#include "SVGAttrTearoffTable.h"
+#include "SVGOrientSMILType.h"
 #include "nsTextFormatter.h"
-#include "SVGAnimatedAngle.h"
-#include "SVGOrientSMILType.h"
 
 using namespace mozilla::dom;
 using namespace mozilla::dom::SVGAngle_Binding;
 using namespace mozilla::dom::SVGMarkerElement_Binding;
 
 namespace mozilla {
 
 static const nsStaticAtom* const angleUnitMap[] = {
     nullptr, /* SVG_ANGLETYPE_UNKNOWN */
     nullptr, /* SVG_ANGLETYPE_UNSPECIFIED */
     nsGkAtoms::deg, nsGkAtoms::rad, nsGkAtoms::grad};
 
-static nsSVGAttrTearoffTable<SVGAngle, SVGAnimatedAngle>
+static SVGAttrTearoffTable<SVGAngle, SVGAnimatedAngle>
     sSVGAnimatedAngleTearoffTable;
-static nsSVGAttrTearoffTable<SVGAngle, DOMSVGAngle> sBaseSVGAngleTearoffTable;
-static nsSVGAttrTearoffTable<SVGAngle, DOMSVGAngle> sAnimSVGAngleTearoffTable;
+static SVGAttrTearoffTable<SVGAngle, DOMSVGAngle> sBaseSVGAngleTearoffTable;
+static SVGAttrTearoffTable<SVGAngle, DOMSVGAngle> sAnimSVGAngleTearoffTable;
 
 /* Helper functions */
 
 static bool IsValidAngleUnitType(uint16_t unit) {
   if (unit > SVG_ANGLETYPE_UNKNOWN && unit <= SVG_ANGLETYPE_GRAD) return true;
 
   return false;
 }
@@ -305,18 +305,18 @@ UniquePtr<nsISMILAttr> SVGAngle::ToSMILA
   // SMILOrient would not be useful for general angle attributes (also,
   // "orient" is the only animatable <angle>-valued attribute in SVG 1.1).
   MOZ_ASSERT_UNREACHABLE("Trying to animate unknown angle attribute.");
   return nullptr;
 }
 
 nsresult SVGAngle::SMILOrient::ValueFromString(
     const nsAString& aStr, const SVGAnimationElement* /*aSrcElement*/,
-    nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
-  nsSMILValue val(&SVGOrientSMILType::sSingleton);
+    SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
+  SMILValue val(&SVGOrientSMILType::sSingleton);
   if (aStr.EqualsLiteral("auto")) {
     val.mU.mOrient.mOrientType = SVG_MARKER_ORIENT_AUTO;
   } else if (aStr.EqualsLiteral("auto-start-reverse")) {
     val.mU.mOrient.mOrientType = SVG_MARKER_ORIENT_AUTO_START_REVERSE;
   } else {
     float value;
     uint16_t unitType;
     if (!GetValueFromString(aStr, value, &unitType)) {
@@ -327,35 +327,35 @@ nsresult SVGAngle::SMILOrient::ValueFrom
     val.mU.mOrient.mOrientType = SVG_MARKER_ORIENT_ANGLE;
   }
   aValue = std::move(val);
   aPreventCachingOfSandwich = false;
 
   return NS_OK;
 }
 
-nsSMILValue SVGAngle::SMILOrient::GetBaseValue() const {
-  nsSMILValue val(&SVGOrientSMILType::sSingleton);
+SMILValue SVGAngle::SMILOrient::GetBaseValue() const {
+  SMILValue val(&SVGOrientSMILType::sSingleton);
   val.mU.mOrient.mAngle = mAngle->GetBaseValInSpecifiedUnits();
   val.mU.mOrient.mUnit = mAngle->GetBaseValueUnit();
   val.mU.mOrient.mOrientType = mOrientType->GetBaseValue();
   return val;
 }
 
 void SVGAngle::SMILOrient::ClearAnimValue() {
   if (mAngle->mIsAnimated) {
     mOrientType->SetAnimValue(mOrientType->GetBaseValue());
     mAngle->mIsAnimated = false;
     mAngle->mAnimVal = mAngle->mBaseVal;
     mAngle->mAnimValUnit = mAngle->mBaseValUnit;
     mSVGElement->DidAnimateAngle(mAngle->mAttrEnum);
   }
 }
 
-nsresult SVGAngle::SMILOrient::SetAnimValue(const nsSMILValue& aValue) {
+nsresult SVGAngle::SMILOrient::SetAnimValue(const SMILValue& aValue) {
   NS_ASSERTION(aValue.mType == &SVGOrientSMILType::sSingleton,
                "Unexpected type to assign animated value");
 
   if (aValue.mType == &SVGOrientSMILType::sSingleton) {
     mOrientType->SetAnimValue(aValue.mU.mOrient.mOrientType);
     if (aValue.mU.mOrient.mOrientType == SVG_MARKER_ORIENT_AUTO ||
         aValue.mU.mOrient.mOrientType == SVG_MARKER_ORIENT_AUTO_START_REVERSE) {
       mAngle->SetAnimValue(0.0f, SVG_ANGLETYPE_UNSPECIFIED, mSVGElement);
--- a/dom/svg/SVGAngle.h
+++ b/dom/svg/SVGAngle.h
@@ -10,20 +10,21 @@
 #include "nsCOMPtr.h"
 #include "nsError.h"
 #include "nsISMILAttr.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/SVGAngleBinding.h"
 #include "mozilla/UniquePtr.h"
 
 class nsISupports;
-class nsSMILValue;
 
 namespace mozilla {
 
+class SMILValue;
+
 namespace dom {
 class nsSVGOrientType;
 class DOMSVGAngle;
 class SVGAnimatedAngle;
 class SVGAnimationElement;
 class SVGElement;
 }  // namespace dom
 
@@ -106,19 +107,19 @@ class SVGAngle {
     // die during that.
     mozilla::dom::nsSVGOrientType* mOrientType;
     SVGAngle* mAngle;
     SVGElement* mSVGElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr,
-        const mozilla::dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,
+        bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 }  // namespace mozilla
 
 #endif  //__NS_SVGANGLE_H__
--- a/dom/svg/SVGAnimatedLengthList.cpp
+++ b/dom/svg/SVGAnimatedLengthList.cpp
@@ -1,23 +1,22 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGAnimatedLengthList.h"
 
+#include "mozilla/Move.h"
+#include "mozilla/SMILValue.h"
+#include "mozilla/dom/SVGElement.h"
+#include "mozilla/dom/SVGLengthBinding.h"
 #include "DOMSVGAnimatedLengthList.h"
-#include "mozilla/Move.h"
-#include "SVGElement.h"
-#include "nsSVGAttrTearoffTable.h"
-#include "nsSMILValue.h"
 #include "SVGLengthListSMILType.h"
-#include "mozilla/dom/SVGLengthBinding.h"
 
 namespace mozilla {
 
 using namespace dom;
 
 nsresult SVGAnimatedLengthList::SetBaseValueString(const nsAString &aValue) {
   SVGLengthList newBaseValue;
   nsresult rv = newBaseValue.SetValueFromString(aValue);
@@ -118,18 +117,18 @@ UniquePtr<nsISMILAttr> SVGAnimatedLength
     SVGElement *aSVGElement, uint8_t aAttrEnum, uint8_t aAxis,
     bool aCanZeroPadList) {
   return MakeUnique<SMILAnimatedLengthList>(this, aSVGElement, aAttrEnum, aAxis,
                                             aCanZeroPadList);
 }
 
 nsresult SVGAnimatedLengthList::SMILAnimatedLengthList::ValueFromString(
     const nsAString &aStr, const dom::SVGAnimationElement * /*aSrcElement*/,
-    nsSMILValue &aValue, bool &aPreventCachingOfSandwich) const {
-  nsSMILValue val(&SVGLengthListSMILType::sSingleton);
+    SMILValue &aValue, bool &aPreventCachingOfSandwich) const {
+  SMILValue val(&SVGLengthListSMILType::sSingleton);
   SVGLengthListAndInfo *llai = static_cast<SVGLengthListAndInfo *>(val.mU.mPtr);
   nsresult rv = llai->SetValueFromString(aStr);
   if (NS_SUCCEEDED(rv)) {
     llai->SetInfo(mElement, mAxis, mCanZeroPadList);
     aValue = std::move(val);
 
     // If any of the lengths in the list depend on their context, then we must
     // prevent caching of the entire animation sandwich. This is because the
@@ -154,35 +153,34 @@ nsresult SVGAnimatedLengthList::SMILAnim
         aPreventCachingOfSandwich = true;
         break;
       }
     }
   }
   return rv;
 }
 
-nsSMILValue SVGAnimatedLengthList::SMILAnimatedLengthList::GetBaseValue()
-    const {
+SMILValue SVGAnimatedLengthList::SMILAnimatedLengthList::GetBaseValue() const {
   // To benefit from Return Value Optimization and avoid copy constructor calls
   // due to our use of return-by-value, we must return the exact same object
   // from ALL return points. This function must only return THIS variable:
-  nsSMILValue val;
+  SMILValue val;
 
-  nsSMILValue tmp(&SVGLengthListSMILType::sSingleton);
+  SMILValue tmp(&SVGLengthListSMILType::sSingleton);
   SVGLengthListAndInfo *llai = static_cast<SVGLengthListAndInfo *>(tmp.mU.mPtr);
   nsresult rv = llai->CopyFrom(mVal->mBaseVal);
   if (NS_SUCCEEDED(rv)) {
     llai->SetInfo(mElement, mAxis, mCanZeroPadList);
     val = std::move(tmp);
   }
   return val;
 }
 
 nsresult SVGAnimatedLengthList::SMILAnimatedLengthList::SetAnimValue(
-    const nsSMILValue &aValue) {
+    const SMILValue &aValue) {
   NS_ASSERTION(aValue.mType == &SVGLengthListSMILType::sSingleton,
                "Unexpected type to assign animated value");
   if (aValue.mType == &SVGLengthListSMILType::sSingleton) {
     mVal->SetAnimValue(*static_cast<SVGLengthListAndInfo *>(aValue.mU.mPtr),
                        mElement, mAttrEnum);
   }
   return NS_OK;
 }
--- a/dom/svg/SVGAnimatedLengthList.h
+++ b/dom/svg/SVGAnimatedLengthList.h
@@ -8,19 +8,19 @@
 #define MOZILLA_SVGANIMATEDLENGTHLIST_H__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/UniquePtr.h"
 #include "nsAutoPtr.h"
 #include "nsISMILAttr.h"
 #include "SVGLengthList.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
 
 namespace dom {
 class SVGAnimationElement;
 class SVGElement;
 }  // namespace dom
 
 /**
  * Class SVGAnimatedLengthList
@@ -99,18 +99,18 @@ class SVGAnimatedLengthList {
     dom::SVGElement* mElement;
     uint8_t mAttrEnum;
     uint8_t mAxis;
     bool mCanZeroPadList;  // See SVGLengthListAndInfo::CanZeroPadList
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 }  // namespace mozilla
 
 #endif  // MOZILLA_SVGANIMATEDLENGTHLIST_H__
--- a/dom/svg/SVGAnimatedNumberList.cpp
+++ b/dom/svg/SVGAnimatedNumberList.cpp
@@ -1,21 +1,20 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGAnimatedNumberList.h"
 
-#include "DOMSVGAnimatedNumberList.h"
 #include "mozilla/dom/SVGElement.h"
 #include "mozilla/Move.h"
-#include "nsSVGAttrTearoffTable.h"
-#include "nsSMILValue.h"
+#include "mozilla/SMILValue.h"
+#include "DOMSVGAnimatedNumberList.h"
 #include "SVGNumberListSMILType.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
 nsresult SVGAnimatedNumberList::SetBaseValueString(const nsAString &aValue) {
   SVGNumberList newBaseValue;
@@ -117,47 +116,46 @@ void SVGAnimatedNumberList::ClearAnimVal
 
 UniquePtr<nsISMILAttr> SVGAnimatedNumberList::ToSMILAttr(
     SVGElement *aSVGElement, uint8_t aAttrEnum) {
   return MakeUnique<SMILAnimatedNumberList>(this, aSVGElement, aAttrEnum);
 }
 
 nsresult SVGAnimatedNumberList::SMILAnimatedNumberList::ValueFromString(
     const nsAString &aStr, const dom::SVGAnimationElement * /*aSrcElement*/,
-    nsSMILValue &aValue, bool &aPreventCachingOfSandwich) const {
-  nsSMILValue val(&SVGNumberListSMILType::sSingleton);
+    SMILValue &aValue, bool &aPreventCachingOfSandwich) const {
+  SMILValue val(&SVGNumberListSMILType::sSingleton);
   SVGNumberListAndInfo *nlai = static_cast<SVGNumberListAndInfo *>(val.mU.mPtr);
   nsresult rv = nlai->SetValueFromString(aStr);
   if (NS_SUCCEEDED(rv)) {
     nlai->SetInfo(mElement);
     aValue = std::move(val);
   }
   aPreventCachingOfSandwich = false;
   return rv;
 }
 
-nsSMILValue SVGAnimatedNumberList::SMILAnimatedNumberList::GetBaseValue()
-    const {
+SMILValue SVGAnimatedNumberList::SMILAnimatedNumberList::GetBaseValue() const {
   // To benefit from Return Value Optimization and avoid copy constructor calls
   // due to our use of return-by-value, we must return the exact same object
   // from ALL return points. This function must only return THIS variable:
-  nsSMILValue val;
+  SMILValue val;
 
-  nsSMILValue tmp(&SVGNumberListSMILType::sSingleton);
+  SMILValue tmp(&SVGNumberListSMILType::sSingleton);
   SVGNumberListAndInfo *nlai = static_cast<SVGNumberListAndInfo *>(tmp.mU.mPtr);
   nsresult rv = nlai->CopyFrom(mVal->mBaseVal);
   if (NS_SUCCEEDED(rv)) {
     nlai->SetInfo(mElement);
     Swap(val, tmp);
   }
   return val;
 }
 
 nsresult SVGAnimatedNumberList::SMILAnimatedNumberList::SetAnimValue(
-    const nsSMILValue &aValue) {
+    const SMILValue &aValue) {
   NS_ASSERTION(aValue.mType == &SVGNumberListSMILType::sSingleton,
                "Unexpected type to assign animated value");
   if (aValue.mType == &SVGNumberListSMILType::sSingleton) {
     mVal->SetAnimValue(*static_cast<SVGNumberListAndInfo *>(aValue.mU.mPtr),
                        mElement, mAttrEnum);
   }
   return NS_OK;
 }
--- a/dom/svg/SVGAnimatedNumberList.h
+++ b/dom/svg/SVGAnimatedNumberList.h
@@ -8,19 +8,19 @@
 #define MOZILLA_SVGANIMATEDNUMBERLIST_H__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/UniquePtr.h"
 #include "nsAutoPtr.h"
 #include "nsISMILAttr.h"
 #include "SVGNumberList.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
 
 namespace dom {
 class SVGAnimationElement;
 class SVGElement;
 }  // namespace dom
 
 /**
  * Class SVGAnimatedNumberList
@@ -99,18 +99,18 @@ class SVGAnimatedNumberList {
     // die during that.
     SVGAnimatedNumberList* mVal;
     dom::SVGElement* mElement;
     uint8_t mAttrEnum;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 }  // namespace mozilla
 
 #endif  // MOZILLA_SVGANIMATEDNUMBERLIST_H__
--- a/dom/svg/SVGAnimatedPathSegList.cpp
+++ b/dom/svg/SVGAnimatedPathSegList.cpp
@@ -1,21 +1,20 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGAnimatedPathSegList.h"
 
+#include "mozilla/Move.h"
+#include "mozilla/SMILValue.h"
+#include "mozilla/dom/SVGElement.h"
 #include "DOMSVGPathSegList.h"
-#include "mozilla/Move.h"
-#include "SVGElement.h"
-#include "nsSVGAttrTearoffTable.h"
-#include "nsSMILValue.h"
 #include "SVGPathSegListSMILType.h"
 
 using namespace mozilla::dom;
 
 // See the comments in this file's header!
 
 namespace mozilla {
 
@@ -144,47 +143,47 @@ bool SVGAnimatedPathSegList::IsRendered(
 
 UniquePtr<nsISMILAttr> SVGAnimatedPathSegList::ToSMILAttr(
     SVGElement *aElement) {
   return MakeUnique<SMILAnimatedPathSegList>(this, aElement);
 }
 
 nsresult SVGAnimatedPathSegList::SMILAnimatedPathSegList::ValueFromString(
     const nsAString &aStr, const dom::SVGAnimationElement * /*aSrcElement*/,
-    nsSMILValue &aValue, bool &aPreventCachingOfSandwich) const {
-  nsSMILValue val(SVGPathSegListSMILType::Singleton());
+    SMILValue &aValue, bool &aPreventCachingOfSandwich) const {
+  SMILValue val(SVGPathSegListSMILType::Singleton());
   SVGPathDataAndInfo *list = static_cast<SVGPathDataAndInfo *>(val.mU.mPtr);
   nsresult rv = list->SetValueFromString(aStr);
   if (NS_SUCCEEDED(rv)) {
     list->SetElement(mElement);
     aValue = std::move(val);
   }
   aPreventCachingOfSandwich = false;
   return rv;
 }
 
-nsSMILValue SVGAnimatedPathSegList::SMILAnimatedPathSegList::GetBaseValue()
+SMILValue SVGAnimatedPathSegList::SMILAnimatedPathSegList::GetBaseValue()
     const {
   // To benefit from Return Value Optimization and avoid copy constructor calls
   // due to our use of return-by-value, we must return the exact same object
   // from ALL return points. This function must only return THIS variable:
-  nsSMILValue val;
+  SMILValue val;
 
-  nsSMILValue tmp(SVGPathSegListSMILType::Singleton());
+  SMILValue tmp(SVGPathSegListSMILType::Singleton());
   SVGPathDataAndInfo *list = static_cast<SVGPathDataAndInfo *>(tmp.mU.mPtr);
   nsresult rv = list->CopyFrom(mVal->mBaseVal);
   if (NS_SUCCEEDED(rv)) {
     list->SetElement(mElement);
     val = std::move(tmp);
   }
   return val;
 }
 
 nsresult SVGAnimatedPathSegList::SMILAnimatedPathSegList::SetAnimValue(
-    const nsSMILValue &aValue) {
+    const SMILValue &aValue) {
   NS_ASSERTION(aValue.mType == SVGPathSegListSMILType::Singleton(),
                "Unexpected type to assign animated value");
   if (aValue.mType == SVGPathSegListSMILType::Singleton()) {
     mVal->SetAnimValue(*static_cast<SVGPathDataAndInfo *>(aValue.mU.mPtr),
                        mElement);
   }
   return NS_OK;
 }
--- a/dom/svg/SVGAnimatedPathSegList.h
+++ b/dom/svg/SVGAnimatedPathSegList.h
@@ -9,19 +9,19 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/UniquePtr.h"
 #include "nsAutoPtr.h"
 #include "nsISMILAttr.h"
 #include "SVGPathData.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
 
 namespace dom {
 class SVGAnimationElement;
 class SVGElement;
 }  // namespace dom
 
 /**
  * Class SVGAnimatedPathSegList
@@ -106,18 +106,18 @@ class SVGAnimatedPathSegList final {
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
     SVGAnimatedPathSegList* mVal;
     dom::SVGElement* mElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 }  // namespace mozilla
 
 #endif  // MOZILLA_SVGANIMATEDPATHSEGLIST_H__
--- a/dom/svg/SVGAnimatedPointList.cpp
+++ b/dom/svg/SVGAnimatedPointList.cpp
@@ -1,21 +1,20 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGAnimatedPointList.h"
 
-#include "DOMSVGPointList.h"
+#include "mozilla/Move.h"
+#include "mozilla/SMILValue.h"
 #include "mozilla/dom/SVGElement.h"
-#include "mozilla/Move.h"
-#include "nsSVGAttrTearoffTable.h"
-#include "nsSMILValue.h"
+#include "DOMSVGPointList.h"
 #include "SVGPointListSMILType.h"
 
 using namespace mozilla::dom;
 
 // See the comments in this file's header!
 
 namespace mozilla {
 
@@ -142,46 +141,46 @@ void SVGAnimatedPointList::ClearAnimValu
 }
 
 UniquePtr<nsISMILAttr> SVGAnimatedPointList::ToSMILAttr(SVGElement *aElement) {
   return MakeUnique<SMILAnimatedPointList>(this, aElement);
 }
 
 nsresult SVGAnimatedPointList::SMILAnimatedPointList::ValueFromString(
     const nsAString &aStr, const dom::SVGAnimationElement * /*aSrcElement*/,
-    nsSMILValue &aValue, bool &aPreventCachingOfSandwich) const {
-  nsSMILValue val(&SVGPointListSMILType::sSingleton);
+    SMILValue &aValue, bool &aPreventCachingOfSandwich) const {
+  SMILValue val(&SVGPointListSMILType::sSingleton);
   SVGPointListAndInfo *list = static_cast<SVGPointListAndInfo *>(val.mU.mPtr);
   nsresult rv = list->SetValueFromString(aStr);
   if (NS_SUCCEEDED(rv)) {
     list->SetInfo(mElement);
     aValue = std::move(val);
   }
   aPreventCachingOfSandwich = false;
   return rv;
 }
 
-nsSMILValue SVGAnimatedPointList::SMILAnimatedPointList::GetBaseValue() const {
+SMILValue SVGAnimatedPointList::SMILAnimatedPointList::GetBaseValue() const {
   // To benefit from Return Value Optimization and avoid copy constructor calls
   // due to our use of return-by-value, we must return the exact same object
   // from ALL return points. This function must only return THIS variable:
-  nsSMILValue val;
+  SMILValue val;
 
-  nsSMILValue tmp(&SVGPointListSMILType::sSingleton);
+  SMILValue tmp(&SVGPointListSMILType::sSingleton);
   SVGPointListAndInfo *list = static_cast<SVGPointListAndInfo *>(tmp.mU.mPtr);
   nsresult rv = list->CopyFrom(mVal->mBaseVal);
   if (NS_SUCCEEDED(rv)) {
     list->SetInfo(mElement);
     Swap(val, tmp);
   }
   return val;
 }
 
 nsresult SVGAnimatedPointList::SMILAnimatedPointList::SetAnimValue(
-    const nsSMILValue &aValue) {
+    const SMILValue &aValue) {
   NS_ASSERTION(aValue.mType == &SVGPointListSMILType::sSingleton,
                "Unexpected type to assign animated value");
   if (aValue.mType == &SVGPointListSMILType::sSingleton) {
     mVal->SetAnimValue(*static_cast<SVGPointListAndInfo *>(aValue.mU.mPtr),
                        mElement);
   }
   return NS_OK;
 }
--- a/dom/svg/SVGAnimatedPointList.h
+++ b/dom/svg/SVGAnimatedPointList.h
@@ -8,19 +8,19 @@
 #define MOZILLA_SVGANIMATEDPOINTLIST_H__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/UniquePtr.h"
 #include "nsAutoPtr.h"
 #include "nsISMILAttr.h"
 #include "SVGPointList.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
 
 namespace dom {
 class SVGAnimationElement;
 class SVGElement;
 }  // namespace dom
 
 /**
  * Class SVGAnimatedPointList
@@ -97,18 +97,18 @@ class SVGAnimatedPointList {
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
     SVGAnimatedPointList* mVal;
     dom::SVGElement* mElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 }  // namespace mozilla
 
 #endif  // MOZILLA_SVGANIMATEDPOINTLIST_H__
--- a/dom/svg/SVGAnimatedPreserveAspectRatio.cpp
+++ b/dom/svg/SVGAnimatedPreserveAspectRatio.cpp
@@ -2,21 +2,21 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGAnimatedPreserveAspectRatio.h"
 
 #include "mozilla/ArrayUtils.h"
+#include "mozilla/SMILValue.h"
+#include "mozilla/SVGContentUtils.h"
 #include "mozilla/dom/SVGAnimatedPreserveAspectRatioBinding.h"
-#include "nsSMILValue.h"
-#include "nsSVGAttrTearoffTable.h"
 #include "SMILEnumType.h"
-#include "SVGContentUtils.h"
+#include "SVGAttrTearoffTable.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 ////////////////////////////////////////////////////////////////////////
 // SVGAnimatedPreserveAspectRatio class
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(
     DOMSVGAnimatedPreserveAspectRatio, mSVGElement)
@@ -31,24 +31,24 @@ NS_INTERFACE_MAP_END
 
 JSObject* DOMSVGAnimatedPreserveAspectRatio::WrapObject(
     JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
   return SVGAnimatedPreserveAspectRatio_Binding::Wrap(aCx, this, aGivenProto);
 }
 
 /* Implementation */
 
-static nsSVGAttrTearoffTable<SVGAnimatedPreserveAspectRatio,
-                             DOMSVGAnimatedPreserveAspectRatio>
+static SVGAttrTearoffTable<SVGAnimatedPreserveAspectRatio,
+                           DOMSVGAnimatedPreserveAspectRatio>
     sSVGAnimatedPAspectRatioTearoffTable;
-static nsSVGAttrTearoffTable<SVGAnimatedPreserveAspectRatio,
-                             DOMSVGPreserveAspectRatio>
+static SVGAttrTearoffTable<SVGAnimatedPreserveAspectRatio,
+                           DOMSVGPreserveAspectRatio>
     sBaseSVGPAspectRatioTearoffTable;
-static nsSVGAttrTearoffTable<SVGAnimatedPreserveAspectRatio,
-                             DOMSVGPreserveAspectRatio>
+static SVGAttrTearoffTable<SVGAnimatedPreserveAspectRatio,
+                           DOMSVGPreserveAspectRatio>
     sAnimSVGPAspectRatioTearoffTable;
 
 already_AddRefed<DOMSVGPreserveAspectRatio>
 DOMSVGAnimatedPreserveAspectRatio::BaseVal() {
   RefPtr<DOMSVGPreserveAspectRatio> domBaseVal =
       sBaseSVGPAspectRatioTearoffTable.GetTearoff(mVal);
   if (!domBaseVal) {
     domBaseVal = new DOMSVGPreserveAspectRatio(mVal, mSVGElement, true);
@@ -174,42 +174,42 @@ UniquePtr<nsISMILAttr> SVGAnimatedPreser
 }
 
 // typedef for inner class, to make function signatures shorter below:
 typedef SVGAnimatedPreserveAspectRatio::SMILPreserveAspectRatio
     SMILPreserveAspectRatio;
 
 nsresult SMILPreserveAspectRatio::ValueFromString(
     const nsAString& aStr, const SVGAnimationElement* /*aSrcElement*/,
-    nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
+    SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
   SVGPreserveAspectRatio par;
   nsresult res = SVGPreserveAspectRatio::FromString(aStr, &par);
   NS_ENSURE_SUCCESS(res, res);
 
-  nsSMILValue val(SMILEnumType::Singleton());
+  SMILValue val(SMILEnumType::Singleton());
   val.mU.mUint = PackPreserveAspectRatio(par);
   aValue = val;
   aPreventCachingOfSandwich = false;
   return NS_OK;
 }
 
-nsSMILValue SMILPreserveAspectRatio::GetBaseValue() const {
-  nsSMILValue val(SMILEnumType::Singleton());
+SMILValue SMILPreserveAspectRatio::GetBaseValue() const {
+  SMILValue val(SMILEnumType::Singleton());
   val.mU.mUint = PackPreserveAspectRatio(mVal->GetBaseValue());
   return val;
 }
 
 void SMILPreserveAspectRatio::ClearAnimValue() {
   if (mVal->mIsAnimated) {
     mVal->mIsAnimated = false;
     mVal->mAnimVal = mVal->mBaseVal;
     mSVGElement->DidAnimatePreserveAspectRatio();
   }
 }
 
-nsresult SMILPreserveAspectRatio::SetAnimValue(const nsSMILValue& aValue) {
+nsresult SMILPreserveAspectRatio::SetAnimValue(const SMILValue& aValue) {
   NS_ASSERTION(aValue.mType == SMILEnumType::Singleton(),
                "Unexpected type to assign animated value");
   if (aValue.mType == SMILEnumType::Singleton()) {
     mVal->SetAnimValue(aValue.mU.mUint, mSVGElement);
   }
   return NS_OK;
 }
--- a/dom/svg/SVGAnimatedPreserveAspectRatio.h
+++ b/dom/svg/SVGAnimatedPreserveAspectRatio.h
@@ -10,19 +10,20 @@
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
 #include "nsISMILAttr.h"
 #include "SVGElement.h"
 #include "SVGPreserveAspectRatio.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/UniquePtr.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
+
 namespace dom {
 class DOMSVGAnimatedPreserveAspectRatio;
 class SVGAnimationElement;
 }  // namespace dom
 
 class SVGAnimatedPreserveAspectRatio final {
  public:
   void Init() {
@@ -87,20 +88,20 @@ class SVGAnimatedPreserveAspectRatio fin
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
     SVGAnimatedPreserveAspectRatio* mVal;
     dom::SVGElement* mSVGElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 namespace dom {
 class DOMSVGAnimatedPreserveAspectRatio final : public nsISupports,
                                                 public nsWrapperCache {
   ~DOMSVGAnimatedPreserveAspectRatio();
 
--- a/dom/svg/SVGAnimatedTransformList.cpp
+++ b/dom/svg/SVGAnimatedTransformList.cpp
@@ -4,20 +4,20 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGAnimatedTransformList.h"
 
 #include "mozilla/dom/MutationEventBinding.h"
 #include "mozilla/dom/SVGAnimationElement.h"
 #include "mozilla/Move.h"
+#include "mozilla/SMILValue.h"
+#include "mozilla/SVGContentUtils.h"
 #include "nsCharSeparatedTokenizer.h"
 #include "DOMSVGAnimatedTransformList.h"
-#include "SVGContentUtils.h"
-#include "nsSMILValue.h"
 #include "SVGTransform.h"
 #include "SVGTransformListSMILType.h"
 
 using namespace mozilla::dom;
 using namespace mozilla::dom::SVGTransform_Binding;
 
 namespace mozilla {
 
@@ -163,17 +163,17 @@ bool SVGAnimatedTransformList::IsExplici
 
 UniquePtr<nsISMILAttr> SVGAnimatedTransformList::ToSMILAttr(
     SVGElement* aSVGElement) {
   return MakeUnique<SMILAnimatedTransformList>(this, aSVGElement);
 }
 
 nsresult SVGAnimatedTransformList::SMILAnimatedTransformList::ValueFromString(
     const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
-    nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
+    SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
   NS_ENSURE_TRUE(aSrcElement, NS_ERROR_FAILURE);
   MOZ_ASSERT(aValue.IsNull(),
              "aValue should have been cleared before calling ValueFromString");
 
   const nsAttrValue* typeAttr = aSrcElement->GetParsedAttr(nsGkAtoms::type);
   const nsAtom* transformType = nsGkAtoms::translate;  // default val
   if (typeAttr) {
     if (typeAttr->Type() != nsAttrValue::eAtom) {
@@ -186,18 +186,17 @@ nsresult SVGAnimatedTransformList::SMILA
   }
 
   ParseValue(aStr, transformType, aValue);
   aPreventCachingOfSandwich = false;
   return aValue.IsNull() ? NS_ERROR_FAILURE : NS_OK;
 }
 
 void SVGAnimatedTransformList::SMILAnimatedTransformList::ParseValue(
-    const nsAString& aSpec, const nsAtom* aTransformType,
-    nsSMILValue& aResult) {
+    const nsAString& aSpec, const nsAtom* aTransformType, SMILValue& aResult) {
   MOZ_ASSERT(aResult.IsNull(), "Unexpected type for SMIL value");
 
   static_assert(SVGTransformSMILData::NUM_SIMPLE_PARAMS == 3,
                 "nsSVGSMILTransform constructor should be expecting array "
                 "with 3 params");
 
   float params[3] = {0.f};
   int32_t numParsed = ParseParameterList(aSpec, params, 3);
@@ -225,17 +224,17 @@ void SVGAnimatedTransformList::SMILAnima
   } else if (aTransformType == nsGkAtoms::skewY) {
     // y-angle
     if (numParsed != 1) return;
     transformType = SVG_TRANSFORM_SKEWY;
   } else {
     return;
   }
 
-  nsSMILValue val(SVGTransformListSMILType::Singleton());
+  SMILValue val(SVGTransformListSMILType::Singleton());
   SVGTransformSMILData transform(transformType, params);
   if (NS_FAILED(SVGTransformListSMILType::AppendTransform(transform, val))) {
     return;  // OOM
   }
 
   // Success! Populate our outparam with parsed value.
   aResult = std::move(val);
 }
@@ -255,31 +254,31 @@ int32_t SVGAnimatedTransformList::SMILAn
     if (numArgsFound < aNVars) {
       aVars[numArgsFound] = f;
     }
     numArgsFound++;
   }
   return numArgsFound;
 }
 
-nsSMILValue SVGAnimatedTransformList::SMILAnimatedTransformList::GetBaseValue()
+SMILValue SVGAnimatedTransformList::SMILAnimatedTransformList::GetBaseValue()
     const {
   // To benefit from Return Value Optimization and avoid copy constructor calls
   // due to our use of return-by-value, we must return the exact same object
   // from ALL return points. This function must only return THIS variable:
-  nsSMILValue val(SVGTransformListSMILType::Singleton());
+  SMILValue val(SVGTransformListSMILType::Singleton());
   if (!SVGTransformListSMILType::AppendTransforms(mVal->mBaseVal, val)) {
-    val = nsSMILValue();
+    val = SMILValue();
   }
 
   return val;
 }
 
 nsresult SVGAnimatedTransformList::SMILAnimatedTransformList::SetAnimValue(
-    const nsSMILValue& aNewAnimValue) {
+    const SMILValue& aNewAnimValue) {
   MOZ_ASSERT(aNewAnimValue.mType == SVGTransformListSMILType::Singleton(),
              "Unexpected type to assign animated value");
   SVGTransformList animVal;
   if (!SVGTransformListSMILType::GetTransforms(aNewAnimValue, animVal.mItems)) {
     return NS_ERROR_FAILURE;
   }
 
   return mVal->SetAnimValue(animVal, mElement);
--- a/dom/svg/SVGAnimatedTransformList.h
+++ b/dom/svg/SVGAnimatedTransformList.h
@@ -9,20 +9,21 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/UniquePtr.h"
 #include "nsAutoPtr.h"
 #include "nsISMILAttr.h"
 #include "SVGTransformList.h"
 
 class nsAtom;
-class nsSMILValue;
 
 namespace mozilla {
 
+class SMILValue;
+
 namespace dom {
 class SVGAnimationElement;
 class SVGElement;
 class DOMSVGTransform;
 }  // namespace dom
 
 /**
  * Class SVGAnimatedTransformList
@@ -125,24 +126,24 @@ class SVGAnimatedTransformList {
    public:
     SMILAnimatedTransformList(SVGAnimatedTransformList* aVal,
                               dom::SVGElement* aSVGElement)
         : mVal(aVal), mElement(aSVGElement) {}
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
 
    protected:
     static void ParseValue(const nsAString& aSpec, const nsAtom* aTransformType,
-                           nsSMILValue& aResult);
+                           SMILValue& aResult);
     static int32_t ParseParameterList(const nsAString& aSpec, float* aVars,
                                       int32_t aNVars);
 
     // These will stay alive because a nsISMILAttr only lives as long
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
     SVGAnimatedTransformList* mVal;
     dom::SVGElement* mElement;
rename from dom/svg/nsSVGAttrTearoffTable.h
rename to dom/svg/SVGAttrTearoffTable.h
--- a/dom/svg/nsSVGAttrTearoffTable.h
+++ b/dom/svg/SVGAttrTearoffTable.h
@@ -6,29 +6,31 @@
 
 #ifndef NS_SVGATTRTEAROFFTABLE_H_
 #define NS_SVGATTRTEAROFFTABLE_H_
 
 #include "nsDataHashtable.h"
 #include "nsDebug.h"
 #include "nsHashKeys.h"
 
+namespace mozilla {
+
 /**
  * Global hashmap to associate internal SVG data types (e.g. nsSVGLength2) with
  * DOM tear-off objects (e.g. DOMSVGLength). This allows us to always return
  * the same object for subsequent requests for DOM objects.
  *
  * We don't keep an owning reference to the tear-off objects so they are
  * responsible for removing themselves from this table when they die.
  */
 template <class SimpleType, class TearoffType>
-class nsSVGAttrTearoffTable {
+class SVGAttrTearoffTable {
  public:
 #ifdef DEBUG
-  ~nsSVGAttrTearoffTable() {
+  ~SVGAttrTearoffTable() {
     MOZ_ASSERT(!mTable, "Tear-off objects remain in hashtable at shutdown.");
   }
 #endif
 
   TearoffType* GetTearoff(SimpleType* aSimple);
 
   void AddTearoff(SimpleType* aSimple, TearoffType* aTearoff);
 
@@ -37,58 +39,60 @@ class nsSVGAttrTearoffTable {
  private:
   typedef nsPtrHashKey<SimpleType> SimpleTypePtrKey;
   typedef nsDataHashtable<SimpleTypePtrKey, TearoffType*> TearoffTable;
 
   TearoffTable* mTable;
 };
 
 template <class SimpleType, class TearoffType>
-TearoffType* nsSVGAttrTearoffTable<SimpleType, TearoffType>::GetTearoff(
+TearoffType* SVGAttrTearoffTable<SimpleType, TearoffType>::GetTearoff(
     SimpleType* aSimple) {
   if (!mTable) return nullptr;
 
   TearoffType* tearoff = nullptr;
 
 #ifdef DEBUG
   bool found =
 #endif
       mTable->Get(aSimple, &tearoff);
   MOZ_ASSERT(!found || tearoff,
              "null pointer stored in attribute tear-off map");
 
   return tearoff;
 }
 
 template <class SimpleType, class TearoffType>
-void nsSVGAttrTearoffTable<SimpleType, TearoffType>::AddTearoff(
+void SVGAttrTearoffTable<SimpleType, TearoffType>::AddTearoff(
     SimpleType* aSimple, TearoffType* aTearoff) {
   if (!mTable) {
     mTable = new TearoffTable;
   }
 
   // We shouldn't be adding a tear-off if there already is one. If that happens,
   // something is wrong.
   if (mTable->Get(aSimple, nullptr)) {
     MOZ_ASSERT(false, "There is already a tear-off for this object.");
     return;
   }
 
   mTable->Put(aSimple, aTearoff);
 }
 
 template <class SimpleType, class TearoffType>
-void nsSVGAttrTearoffTable<SimpleType, TearoffType>::RemoveTearoff(
+void SVGAttrTearoffTable<SimpleType, TearoffType>::RemoveTearoff(
     SimpleType* aSimple) {
   if (!mTable) {
     // Perhaps something happened in between creating the SimpleType object and
     // registering it
     return;
   }
 
   mTable->Remove(aSimple);
   if (mTable->Count() == 0) {
     delete mTable;
     mTable = nullptr;
   }
 }
 
+}  // namespace mozilla
+
 #endif  // NS_SVGATTRTEAROFFTABLE_H_
--- a/dom/svg/SVGBoolean.cpp
+++ b/dom/svg/SVGBoolean.cpp
@@ -2,30 +2,30 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGBoolean.h"
 
 #include "nsError.h"
-#include "nsSVGAttrTearoffTable.h"
-#include "nsSMILValue.h"
 #include "SMILBoolType.h"
-#include "SVGAnimatedBoolean.h"
+#include "SVGAttrTearoffTable.h"
+#include "mozilla/SMILValue.h"
+#include "mozilla/dom/SVGAnimatedBoolean.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
 /* Implementation */
 
-static inline nsSVGAttrTearoffTable<SVGBoolean, SVGAnimatedBoolean>&
+static inline SVGAttrTearoffTable<SVGBoolean, SVGAnimatedBoolean>&
 SVGAnimatedBooleanTearoffTable() {
-  static nsSVGAttrTearoffTable<SVGBoolean, SVGAnimatedBoolean>
+  static SVGAttrTearoffTable<SVGBoolean, SVGAnimatedBoolean>
       sSVGAnimatedBooleanTearoffTable;
   return sSVGAnimatedBooleanTearoffTable;
 }
 
 static bool GetValueFromString(const nsAString& aValueAsString, bool& aValue) {
   if (aValueAsString.EqualsLiteral("true")) {
     aValue = true;
     return true;
@@ -115,45 +115,45 @@ SVGAnimatedBoolean::~SVGAnimatedBoolean(
 }
 
 UniquePtr<nsISMILAttr> SVGBoolean::ToSMILAttr(SVGElement* aSVGElement) {
   return MakeUnique<SMILBool>(this, aSVGElement);
 }
 
 nsresult SVGBoolean::SMILBool::ValueFromString(
     const nsAString& aStr, const SVGAnimationElement* /*aSrcElement*/,
-    nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
+    SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
   bool value;
   if (!GetValueFromString(aStr, value)) {
     return NS_ERROR_DOM_SYNTAX_ERR;
   }
 
-  nsSMILValue val(SMILBoolType::Singleton());
+  SMILValue val(SMILBoolType::Singleton());
   val.mU.mBool = value;
   aValue = val;
   aPreventCachingOfSandwich = false;
 
   return NS_OK;
 }
 
-nsSMILValue SVGBoolean::SMILBool::GetBaseValue() const {
-  nsSMILValue val(SMILBoolType::Singleton());
+SMILValue SVGBoolean::SMILBool::GetBaseValue() const {
+  SMILValue val(SMILBoolType::Singleton());
   val.mU.mBool = mVal->mBaseVal;
   return val;
 }
 
 void SVGBoolean::SMILBool::ClearAnimValue() {
   if (mVal->mIsAnimated) {
     mVal->mIsAnimated = false;
     mVal->mAnimVal = mVal->mBaseVal;
     mSVGElement->DidAnimateBoolean(mVal->mAttrEnum);
   }
 }
 
-nsresult SVGBoolean::SMILBool::SetAnimValue(const nsSMILValue& aValue) {
+nsresult SVGBoolean::SMILBool::SetAnimValue(const SMILValue& aValue) {
   NS_ASSERTION(aValue.mType == SMILBoolType::Singleton(),
                "Unexpected type to assign animated value");
   if (aValue.mType == SMILBoolType::Singleton()) {
     mVal->SetAnimValue(uint16_t(aValue.mU.mBool), mSVGElement);
   }
   return NS_OK;
 }
 
--- a/dom/svg/SVGBoolean.h
+++ b/dom/svg/SVGBoolean.h
@@ -9,19 +9,21 @@
 
 #include "nsCOMPtr.h"
 #include "nsError.h"
 #include "nsISMILAttr.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/UniquePtr.h"
 
 class nsAtom;
-class nsSMILValue;
 
 namespace mozilla {
+
+class SMILValue;
+
 namespace dom {
 class SVGAnimationElement;
 class SVGAnimatedBoolean;
 class SVGElement;
 }  // namespace dom
 
 class SVGBoolean {
  public:
@@ -62,19 +64,19 @@ class SVGBoolean {
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
     SVGBoolean* mVal;
     SVGElement* mSVGElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr,
-        const mozilla::dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,
+        bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 }  // namespace mozilla
 
 #endif  //__NS_SVGBOOLEAN_H__
--- a/dom/svg/SVGClass.cpp
+++ b/dom/svg/SVGClass.cpp
@@ -2,19 +2,19 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGClass.h"
 
 #include "mozilla/dom/SVGAnimatedString.h"
+#include "mozilla/dom/SVGElement.h"
 #include "mozilla/Move.h"
-#include "SVGElement.h"
-#include "nsSMILValue.h"
+#include "mozilla/SMILValue.h"
 #include "SMILStringType.h"
 
 namespace mozilla {
 namespace dom {
 
 struct DOMAnimatedString final : public SVGAnimatedString {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMAnimatedString)
@@ -102,40 +102,40 @@ void DOMAnimatedString::GetAnimVal(nsASt
 }
 
 UniquePtr<nsISMILAttr> SVGClass::ToSMILAttr(SVGElement* aSVGElement) {
   return MakeUnique<SMILString>(this, aSVGElement);
 }
 
 nsresult SVGClass::SMILString::ValueFromString(
     const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/,
-    nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
-  nsSMILValue val(SMILStringType::Singleton());
+    SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
+  SMILValue val(SMILStringType::Singleton());
 
   *static_cast<nsAString*>(val.mU.mPtr) = aStr;
   aValue = std::move(val);
   aPreventCachingOfSandwich = false;
   return NS_OK;
 }
 
-nsSMILValue SVGClass::SMILString::GetBaseValue() const {
-  nsSMILValue val(SMILStringType::Singleton());
+SMILValue SVGClass::SMILString::GetBaseValue() const {
+  SMILValue val(SMILStringType::Singleton());
   mSVGElement->GetAttr(kNameSpaceID_None, nsGkAtoms::_class,
                        *static_cast<nsAString*>(val.mU.mPtr));
   return val;
 }
 
 void SVGClass::SMILString::ClearAnimValue() {
   if (mVal->mAnimVal) {
     mVal->mAnimVal = nullptr;
     mSVGElement->DidAnimateClass();
   }
 }
 
-nsresult SVGClass::SMILString::SetAnimValue(const nsSMILValue& aValue) {
+nsresult SVGClass::SMILString::SetAnimValue(const SMILValue& aValue) {
   NS_ASSERTION(aValue.mType == SMILStringType::Singleton(),
                "Unexpected type to assign animated value");
   if (aValue.mType == SMILStringType::Singleton()) {
     mVal->SetAnimValue(*static_cast<nsAString*>(aValue.mU.mPtr), mSVGElement);
   }
   return NS_OK;
 }
 
--- a/dom/svg/SVGClass.h
+++ b/dom/svg/SVGClass.h
@@ -11,16 +11,19 @@
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
 #include "nsISMILAttr.h"
 #include "nsString.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/UniquePtr.h"
 
 namespace mozilla {
+
+class SMILValue;
+
 namespace dom {
 class SVGAnimatedString;
 class SVGElement;
 
 class SVGClass {
  public:
   typedef mozilla::dom::SVGElement SVGElement;
 
@@ -52,20 +55,20 @@ class SVGClass {
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
     SVGClass* mVal;
     SVGElement* mSVGElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr,
-        const mozilla::dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,
+        bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 }  // namespace dom
 }  // namespace mozilla
 
 #endif  //__NS_SVGCLASS_H__
--- a/dom/svg/SVGEnum.cpp
+++ b/dom/svg/SVGEnum.cpp
@@ -2,27 +2,27 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGEnum.h"
 
 #include "mozilla/dom/SVGElement.h"
+#include "mozilla/SMILValue.h"
 #include "nsAtom.h"
 #include "nsError.h"
-#include "nsSVGAttrTearoffTable.h"
 #include "SMILEnumType.h"
-#include "nsSMILValue.h"
+#include "SVGAttrTearoffTable.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
-static nsSVGAttrTearoffTable<SVGEnum, SVGEnum::DOMAnimatedEnum>
+static SVGAttrTearoffTable<SVGEnum, SVGEnum::DOMAnimatedEnum>
     sSVGAnimatedEnumTearoffTable;
 
 const SVGEnumMapping* SVGEnum::GetMapping(SVGElement* aSVGElement) {
   SVGElement::EnumAttributesInfo info = aSVGElement->GetEnumInfo();
 
   NS_ASSERTION(info.mEnumCount > 0 && mAttrEnum < info.mEnumCount,
                "mapping request for a non-attrib enum");
 
@@ -116,53 +116,53 @@ SVGEnum::DOMAnimatedEnum::~DOMAnimatedEn
 }
 
 UniquePtr<nsISMILAttr> SVGEnum::ToSMILAttr(SVGElement* aSVGElement) {
   return MakeUnique<SMILEnum>(this, aSVGElement);
 }
 
 nsresult SVGEnum::SMILEnum::ValueFromString(
     const nsAString& aStr, const SVGAnimationElement* /*aSrcElement*/,
-    nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
+    SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
   nsAtom* valAtom = NS_GetStaticAtom(aStr);
   if (valAtom) {
     const SVGEnumMapping* mapping = mVal->GetMapping(mSVGElement);
 
     while (mapping && mapping->mKey) {
       if (valAtom == mapping->mKey) {
-        nsSMILValue val(SMILEnumType::Singleton());
+        SMILValue val(SMILEnumType::Singleton());
         val.mU.mUint = mapping->mVal;
         aValue = val;
         aPreventCachingOfSandwich = false;
         return NS_OK;
       }
       mapping++;
     }
   }
 
   // only a warning since authors may mistype attribute values
   NS_WARNING("unknown enumeration key");
   return NS_ERROR_FAILURE;
 }
 
-nsSMILValue SVGEnum::SMILEnum::GetBaseValue() const {
-  nsSMILValue val(SMILEnumType::Singleton());
+SMILValue SVGEnum::SMILEnum::GetBaseValue() const {
+  SMILValue val(SMILEnumType::Singleton());
   val.mU.mUint = mVal->mBaseVal;
   return val;
 }
 
 void SVGEnum::SMILEnum::ClearAnimValue() {
   if (mVal->mIsAnimated) {
     mVal->mIsAnimated = false;
     mVal->mAnimVal = mVal->mBaseVal;
     mSVGElement->DidAnimateEnum(mVal->mAttrEnum);
   }
 }
 
-nsresult SVGEnum::SMILEnum::SetAnimValue(const nsSMILValue& aValue) {
+nsresult SVGEnum::SMILEnum::SetAnimValue(const SMILValue& aValue) {
   NS_ASSERTION(aValue.mType == SMILEnumType::Singleton(),
                "Unexpected type to assign animated value");
   if (aValue.mType == SMILEnumType::Singleton()) {
     MOZ_ASSERT(aValue.mU.mUint <= USHRT_MAX,
                "Very large enumerated value - too big for uint16_t");
     mVal->SetAnimValue(uint16_t(aValue.mU.mUint), mSVGElement);
   }
   return NS_OK;
--- a/dom/svg/SVGEnum.h
+++ b/dom/svg/SVGEnum.h
@@ -11,19 +11,21 @@
 #include "nsError.h"
 #include "nsISMILAttr.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/dom/SVGAnimatedEnumeration.h"
 #include "mozilla/dom/SVGElement.h"
 
 class nsAtom;
-class nsSMILValue;
 
 namespace mozilla {
+
+class SMILValue;
+
 namespace dom {
 class SVGAnimationElement;
 }  // namespace dom
 
 typedef uint8_t SVGEnumValue;
 
 struct SVGEnumMapping {
   nsStaticAtom* const mKey;
@@ -96,19 +98,19 @@ class SVGEnum {
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
     SVGEnum* mVal;
     SVGElement* mSVGElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr,
-        const mozilla::dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,
+        bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 }  // namespace mozilla
 
 #endif  //__NS_SVGENUM_H__
--- a/dom/svg/SVGInteger.cpp
+++ b/dom/svg/SVGInteger.cpp
@@ -2,28 +2,28 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGInteger.h"
 
 #include "nsError.h"
-#include "nsSVGAttrTearoffTable.h"
-#include "nsSMILValue.h"
 #include "SMILIntegerType.h"
-#include "SVGContentUtils.h"
+#include "SVGAttrTearoffTable.h"
+#include "mozilla/SMILValue.h"
+#include "mozilla/SVGContentUtils.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
 /* Implementation */
 
-static nsSVGAttrTearoffTable<SVGInteger, SVGInteger::DOMAnimatedInteger>
+static SVGAttrTearoffTable<SVGInteger, SVGInteger::DOMAnimatedInteger>
     sSVGAnimatedIntegerTearoffTable;
 
 nsresult SVGInteger::SetBaseValueString(const nsAString &aValueAsString,
                                         SVGElement *aSVGElement) {
   int32_t value;
 
   if (!SVGContentUtils::ParseInteger(aValueAsString, value)) {
     return NS_ERROR_DOM_SYNTAX_ERR;
@@ -89,45 +89,45 @@ SVGInteger::DOMAnimatedInteger::~DOMAnim
 }
 
 UniquePtr<nsISMILAttr> SVGInteger::ToSMILAttr(SVGElement *aSVGElement) {
   return MakeUnique<SMILInteger>(this, aSVGElement);
 }
 
 nsresult SVGInteger::SMILInteger::ValueFromString(
     const nsAString &aStr, const dom::SVGAnimationElement * /*aSrcElement*/,
-    nsSMILValue &aValue, bool &aPreventCachingOfSandwich) const {
+    SMILValue &aValue, bool &aPreventCachingOfSandwich) const {
   int32_t val;
 
   if (!SVGContentUtils::ParseInteger(aStr, val)) {
     return NS_ERROR_DOM_SYNTAX_ERR;
   }
 
-  nsSMILValue smilVal(SMILIntegerType::Singleton());
+  SMILValue smilVal(SMILIntegerType::Singleton());
   smilVal.mU.mInt = val;
   aValue = smilVal;
   aPreventCachingOfSandwich = false;
   return NS_OK;
 }
 
-nsSMILValue SVGInteger::SMILInteger::GetBaseValue() const {
-  nsSMILValue val(SMILIntegerType::Singleton());
+SMILValue SVGInteger::SMILInteger::GetBaseValue() const {
+  SMILValue val(SMILIntegerType::Singleton());
   val.mU.mInt = mVal->mBaseVal;
   return val;
 }
 
 void SVGInteger::SMILInteger::ClearAnimValue() {
   if (mVal->mIsAnimated) {
     mVal->mIsAnimated = false;
     mVal->mAnimVal = mVal->mBaseVal;
     mSVGElement->DidAnimateInteger(mVal->mAttrEnum);
   }
 }
 
-nsresult SVGInteger::SMILInteger::SetAnimValue(const nsSMILValue &aValue) {
+nsresult SVGInteger::SMILInteger::SetAnimValue(const SMILValue &aValue) {
   NS_ASSERTION(aValue.mType == SMILIntegerType::Singleton(),
                "Unexpected type to assign animated value");
   if (aValue.mType == SMILIntegerType::Singleton()) {
     mVal->SetAnimValue(int(aValue.mU.mInt), mSVGElement);
   }
   return NS_OK;
 }
 
--- a/dom/svg/SVGInteger.h
+++ b/dom/svg/SVGInteger.h
@@ -10,19 +10,20 @@
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
 #include "SVGAnimatedInteger.h"
 #include "nsISMILAttr.h"
 #include "SVGElement.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/UniquePtr.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
+
 namespace dom {
 class SVGAnimationElement;
 }  // namespace dom
 
 class SVGInteger {
  public:
   typedef mozilla::dom::SVGElement SVGElement;
 
@@ -90,19 +91,19 @@ class SVGInteger {
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
     SVGInteger* mVal;
     SVGElement* mSVGElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr,
-        const mozilla::dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,
+        bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 }  // namespace mozilla
 
 #endif  //__NS_SVGINTEGER_H__
--- a/dom/svg/SVGIntegerPair.cpp
+++ b/dom/svg/SVGIntegerPair.cpp
@@ -1,30 +1,31 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGIntegerPair.h"
-#include "nsSVGAttrTearoffTable.h"
+
 #include "nsCharSeparatedTokenizer.h"
 #include "nsError.h"
 #include "nsMathUtils.h"
-#include "nsSMILValue.h"
-#include "SVGContentUtils.h"
+#include "SVGAttrTearoffTable.h"
 #include "SVGIntegerPairSMILType.h"
+#include "mozilla/SMILValue.h"
+#include "mozilla/SVGContentUtils.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
-static nsSVGAttrTearoffTable<SVGIntegerPair, SVGIntegerPair::DOMAnimatedInteger>
+static SVGAttrTearoffTable<SVGIntegerPair, SVGIntegerPair::DOMAnimatedInteger>
     sSVGFirstAnimatedIntegerTearoffTable;
-static nsSVGAttrTearoffTable<SVGIntegerPair, SVGIntegerPair::DOMAnimatedInteger>
+static SVGAttrTearoffTable<SVGIntegerPair, SVGIntegerPair::DOMAnimatedInteger>
     sSVGSecondAnimatedIntegerTearoffTable;
 
 /* Implementation */
 
 static nsresult ParseIntegerOptionalInteger(const nsAString& aValue,
                                             int32_t aValues[2]) {
   nsCharSeparatedTokenizerTemplate<nsContentUtils::IsHTMLWhitespace> tokenizer(
       aValue, ',', nsCharSeparatedTokenizer::SEPARATOR_OPTIONAL);
@@ -162,51 +163,51 @@ SVGIntegerPair::DOMAnimatedInteger::~DOM
 }
 
 UniquePtr<nsISMILAttr> SVGIntegerPair::ToSMILAttr(SVGElement* aSVGElement) {
   return MakeUnique<SMILIntegerPair>(this, aSVGElement);
 }
 
 nsresult SVGIntegerPair::SMILIntegerPair::ValueFromString(
     const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/,
-    nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
+    SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
   int32_t values[2];
 
   nsresult rv = ParseIntegerOptionalInteger(aStr, values);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
-  nsSMILValue val(SVGIntegerPairSMILType::Singleton());
+  SMILValue val(SVGIntegerPairSMILType::Singleton());
   val.mU.mIntPair[0] = values[0];
   val.mU.mIntPair[1] = values[1];
   aValue = val;
   aPreventCachingOfSandwich = false;
 
   return NS_OK;
 }
 
-nsSMILValue SVGIntegerPair::SMILIntegerPair::GetBaseValue() const {
-  nsSMILValue val(SVGIntegerPairSMILType::Singleton());
+SMILValue SVGIntegerPair::SMILIntegerPair::GetBaseValue() const {
+  SMILValue val(SVGIntegerPairSMILType::Singleton());
   val.mU.mIntPair[0] = mVal->mBaseVal[0];
   val.mU.mIntPair[1] = mVal->mBaseVal[1];
   return val;
 }
 
 void SVGIntegerPair::SMILIntegerPair::ClearAnimValue() {
   if (mVal->mIsAnimated) {
     mVal->mIsAnimated = false;
     mVal->mAnimVal[0] = mVal->mBaseVal[0];
     mVal->mAnimVal[1] = mVal->mBaseVal[1];
     mSVGElement->DidAnimateIntegerPair(mVal->mAttrEnum);
   }
 }
 
 nsresult SVGIntegerPair::SMILIntegerPair::SetAnimValue(
-    const nsSMILValue& aValue) {
+    const SMILValue& aValue) {
   NS_ASSERTION(aValue.mType == SVGIntegerPairSMILType::Singleton(),
                "Unexpected type to assign animated value");
   if (aValue.mType == SVGIntegerPairSMILType::Singleton()) {
     mVal->SetAnimValue(aValue.mU.mIntPair, mSVGElement);
   }
   return NS_OK;
 }
 
--- a/dom/svg/SVGIntegerPair.h
+++ b/dom/svg/SVGIntegerPair.h
@@ -9,19 +9,20 @@
 
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
 #include "nsISMILAttr.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/dom/SVGAnimatedInteger.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
+
 namespace dom {
 class SVGAnimationElement;
 class SVGElement;
 }  // namespace dom
 
 class SVGIntegerPair {
  public:
   typedef mozilla::dom::SVGElement SVGElement;
@@ -102,19 +103,19 @@ class SVGIntegerPair {
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
     SVGIntegerPair* mVal;
     SVGElement* mSVGElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr,
-        const mozilla::dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,
+        bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 }  // namespace mozilla
 
 #endif  //__NS_SVGINTEGERPAIR_H__
--- a/dom/svg/SVGIntegerPairSMILType.cpp
+++ b/dom/svg/SVGIntegerPairSMILType.cpp
@@ -1,85 +1,86 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGIntegerPairSMILType.h"
-#include "nsSMILValue.h"
+
+#include "mozilla/SMILValue.h"
 #include "nsMathUtils.h"
 #include "nsDebug.h"
 
 namespace mozilla {
 
-void SVGIntegerPairSMILType::Init(nsSMILValue& aValue) const {
+void SVGIntegerPairSMILType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
 
   aValue.mU.mIntPair[0] = 0;
   aValue.mU.mIntPair[1] = 0;
   aValue.mType = this;
 }
 
-void SVGIntegerPairSMILType::Destroy(nsSMILValue& aValue) const {
+void SVGIntegerPairSMILType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value");
   aValue.mU.mIntPair[0] = 0;
   aValue.mU.mIntPair[1] = 0;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SVGIntegerPairSMILType::Assign(nsSMILValue& aDest,
-                                        const nsSMILValue& aSrc) const {
+nsresult SVGIntegerPairSMILType::Assign(SMILValue& aDest,
+                                        const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
 
   aDest.mU.mIntPair[0] = aSrc.mU.mIntPair[0];
   aDest.mU.mIntPair[1] = aSrc.mU.mIntPair[1];
   return NS_OK;
 }
 
-bool SVGIntegerPairSMILType::IsEqual(const nsSMILValue& aLeft,
-                                     const nsSMILValue& aRight) const {
+bool SVGIntegerPairSMILType::IsEqual(const SMILValue& aLeft,
+                                     const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
   return aLeft.mU.mIntPair[0] == aRight.mU.mIntPair[0] &&
          aLeft.mU.mIntPair[1] == aRight.mU.mIntPair[1];
 }
 
-nsresult SVGIntegerPairSMILType::Add(nsSMILValue& aDest,
-                                     const nsSMILValue& aValueToAdd,
+nsresult SVGIntegerPairSMILType::Add(SMILValue& aDest,
+                                     const SMILValue& aValueToAdd,
                                      uint32_t aCount) const {
   MOZ_ASSERT(aValueToAdd.mType == aDest.mType, "Trying to add invalid types");
   MOZ_ASSERT(aValueToAdd.mType == this, "Unexpected source type");
 
   aDest.mU.mIntPair[0] += aValueToAdd.mU.mIntPair[0] * aCount;
   aDest.mU.mIntPair[1] += aValueToAdd.mU.mIntPair[1] * aCount;
 
   return NS_OK;
 }
 
-nsresult SVGIntegerPairSMILType::ComputeDistance(const nsSMILValue& aFrom,
-                                                 const nsSMILValue& aTo,
+nsresult SVGIntegerPairSMILType::ComputeDistance(const SMILValue& aFrom,
+                                                 const SMILValue& aTo,
                                                  double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == aTo.mType, "Trying to compare different types");
   MOZ_ASSERT(aFrom.mType == this, "Unexpected source type");
 
   double delta[2];
   delta[0] = aTo.mU.mIntPair[0] - aFrom.mU.mIntPair[0];
   delta[1] = aTo.mU.mIntPair[1] - aFrom.mU.mIntPair[1];
 
   aDistance = NS_hypot(delta[0], delta[1]);
   return NS_OK;
 }
 
-nsresult SVGIntegerPairSMILType::Interpolate(const nsSMILValue& aStartVal,
-                                             const nsSMILValue& aEndVal,
+nsresult SVGIntegerPairSMILType::Interpolate(const SMILValue& aStartVal,
+                                             const SMILValue& aEndVal,
                                              double aUnitDistance,
-                                             nsSMILValue& aResult) const {
+                                             SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
 
   double currentVal[2];
   currentVal[0] =
       aStartVal.mU.mIntPair[0] +
--- a/dom/svg/SVGIntegerPairSMILType.h
+++ b/dom/svg/SVGIntegerPairSMILType.h
@@ -5,45 +5,44 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZILLA_SVGINTEGERPAIRSMILTYPE_H_
 #define MOZILLA_SVGINTEGERPAIRSMILTYPE_H_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
 
 class SVGIntegerPairSMILType : public SMILType {
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SVGIntegerPairSMILType* Singleton() {
     static SVGIntegerPairSMILType sSingleton;
     return &sSingleton;
   }
 
  protected:
   // SMILType Methods
   // -------------------
-  virtual void Init(nsSMILValue& aValue) const override;
-  virtual void Destroy(nsSMILValue&) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Init(SMILValue& aValue) const override;
+  virtual void Destroy(SMILValue&) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SVGIntegerPairSMILType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/svg/SVGLengthList.h
+++ b/dom/svg/SVGLengthList.h
@@ -261,17 +261,17 @@ class SVGLengthListAndInfo : public SVGL
     return SVGLengthList::operator[](aIndex);
   }
   bool SetLength(uint32_t aNumberOfItems) {
     return SVGLengthList::SetLength(aNumberOfItems);
   }
 
  private:
   // We must keep a weak reference to our element because we may belong to a
-  // cached baseVal nsSMILValue. See the comments starting at:
+  // cached baseVal SMILValue. See the comments starting at:
   // https://bugzilla.mozilla.org/show_bug.cgi?id=515116#c15
   // See also https://bugzilla.mozilla.org/show_bug.cgi?id=653497
   nsWeakPtr mElement;
   uint8_t mAxis;
   bool mCanZeroPadList;
 };
 
 /**
--- a/dom/svg/SVGLengthListSMILType.cpp
+++ b/dom/svg/SVGLengthListSMILType.cpp
@@ -1,72 +1,73 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGLengthListSMILType.h"
-#include "nsSMILValue.h"
+
+#include "mozilla/FloatingPoint.h"
+#include "mozilla/SMILValue.h"
+#include "nsMathUtils.h"
 #include "SVGLengthList.h"
-#include "nsMathUtils.h"
-#include "mozilla/FloatingPoint.h"
 #include <math.h>
 #include <algorithm>
 
 namespace mozilla {
 
 /*static*/ SVGLengthListSMILType SVGLengthListSMILType::sSingleton;
 
 //----------------------------------------------------------------------
 // nsISMILType implementation
 
-void SVGLengthListSMILType::Init(nsSMILValue& aValue) const {
+void SVGLengthListSMILType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
 
   SVGLengthListAndInfo* lengthList = new SVGLengthListAndInfo();
 
   // See the comment documenting Init() in our header file:
   lengthList->SetCanZeroPadList(true);
 
   aValue.mU.mPtr = lengthList;
   aValue.mType = this;
 }
 
-void SVGLengthListSMILType::Destroy(nsSMILValue& aValue) const {
+void SVGLengthListSMILType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value type");
   delete static_cast<SVGLengthListAndInfo*>(aValue.mU.mPtr);
   aValue.mU.mPtr = nullptr;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SVGLengthListSMILType::Assign(nsSMILValue& aDest,
-                                       const nsSMILValue& aSrc) const {
+nsresult SVGLengthListSMILType::Assign(SMILValue& aDest,
+                                       const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
 
   const SVGLengthListAndInfo* src =
       static_cast<const SVGLengthListAndInfo*>(aSrc.mU.mPtr);
   SVGLengthListAndInfo* dest =
       static_cast<SVGLengthListAndInfo*>(aDest.mU.mPtr);
 
   return dest->CopyFrom(*src);
 }
 
-bool SVGLengthListSMILType::IsEqual(const nsSMILValue& aLeft,
-                                    const nsSMILValue& aRight) const {
+bool SVGLengthListSMILType::IsEqual(const SMILValue& aLeft,
+                                    const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
   return *static_cast<const SVGLengthListAndInfo*>(aLeft.mU.mPtr) ==
          *static_cast<const SVGLengthListAndInfo*>(aRight.mU.mPtr);
 }
 
-nsresult SVGLengthListSMILType::Add(nsSMILValue& aDest,
-                                    const nsSMILValue& aValueToAdd,
+nsresult SVGLengthListSMILType::Add(SMILValue& aDest,
+                                    const SMILValue& aValueToAdd,
                                     uint32_t aCount) const {
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL type");
   MOZ_ASSERT(aValueToAdd.mType == this, "Incompatible SMIL type");
 
   SVGLengthListAndInfo& dest =
       *static_cast<SVGLengthListAndInfo*>(aDest.mU.mPtr);
   const SVGLengthListAndInfo& valueToAdd =
       *static_cast<const SVGLengthListAndInfo*>(aValueToAdd.mU.mPtr);
@@ -141,34 +142,34 @@ nsresult SVGLengthListSMILType::Add(nsSM
 
   // propagate target element info!
   dest.SetInfo(valueToAdd.Element(), valueToAdd.Axis(),
                dest.CanZeroPadList() && valueToAdd.CanZeroPadList());
 
   return NS_OK;
 }
 
-nsresult SVGLengthListSMILType::ComputeDistance(const nsSMILValue& aFrom,
-                                                const nsSMILValue& aTo,
+nsresult SVGLengthListSMILType::ComputeDistance(const SMILValue& aFrom,
+                                                const SMILValue& aTo,
                                                 double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == this, "Unexpected SMIL type");
   MOZ_ASSERT(aTo.mType == this, "Incompatible SMIL type");
 
   const SVGLengthListAndInfo& from =
       *static_cast<const SVGLengthListAndInfo*>(aFrom.mU.mPtr);
   const SVGLengthListAndInfo& to =
       *static_cast<const SVGLengthListAndInfo*>(aTo.mU.mPtr);
 
   // To understand this code, see the comments documenting our Init() method,
   // and documenting SVGLengthListAndInfo::CanZeroPadList().
 
   NS_ASSERTION((from.CanZeroPadList() == to.CanZeroPadList()) ||
                    (from.CanZeroPadList() && from.IsEmpty()) ||
                    (to.CanZeroPadList() && to.IsEmpty()),
-               "Only \"zero\" nsSMILValues from the SMIL engine should "
+               "Only \"zero\" SMILValues from the SMIL engine should "
                "return true for CanZeroPadList() when the attribute "
                "being animated can't be zero padded");
 
   if ((from.Length() < to.Length() && !from.CanZeroPadList()) ||
       (to.Length() < from.Length() && !to.CanZeroPadList())) {
     // SVGContentUtils::ReportToConsole
     return NS_ERROR_FAILURE;
   }
@@ -208,20 +209,20 @@ nsresult SVGLengthListSMILType::ComputeD
   float distance = sqrt(total);
   if (!IsFinite(distance)) {
     return NS_ERROR_FAILURE;
   }
   aDistance = distance;
   return NS_OK;
 }
 
-nsresult SVGLengthListSMILType::Interpolate(const nsSMILValue& aStartVal,
-                                            const nsSMILValue& aEndVal,
+nsresult SVGLengthListSMILType::Interpolate(const SMILValue& aStartVal,
+                                            const SMILValue& aEndVal,
                                             double aUnitDistance,
-                                            nsSMILValue& aResult) const {
+                                            SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
 
   const SVGLengthListAndInfo& start =
       *static_cast<const SVGLengthListAndInfo*>(aStartVal.mU.mPtr);
   const SVGLengthListAndInfo& end =
@@ -230,17 +231,17 @@ nsresult SVGLengthListSMILType::Interpol
       *static_cast<SVGLengthListAndInfo*>(aResult.mU.mPtr);
 
   // To understand this code, see the comments documenting our Init() method,
   // and documenting SVGLengthListAndInfo::CanZeroPadList().
 
   NS_ASSERTION((start.CanZeroPadList() == end.CanZeroPadList()) ||
                    (start.CanZeroPadList() && start.IsEmpty()) ||
                    (end.CanZeroPadList() && end.IsEmpty()),
-               "Only \"zero\" nsSMILValues from the SMIL engine should "
+               "Only \"zero\" SMILValues from the SMIL engine should "
                "return true for CanZeroPadList() when the attribute "
                "being animated can't be zero padded");
 
   if ((start.Length() < end.Length() && !start.CanZeroPadList()) ||
       (end.Length() < start.Length() && !end.CanZeroPadList())) {
     // SVGContentUtils::ReportToConsole
     return NS_ERROR_FAILURE;
   }
--- a/dom/svg/SVGLengthListSMILType.h
+++ b/dom/svg/SVGLengthListSMILType.h
@@ -5,95 +5,94 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZILLA_SVGLENGTHLISTSMILTYPE_H_
 #define MOZILLA_SVGLENGTHLISTSMILTYPE_H_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
 
 ////////////////////////////////////////////////////////////////////////
 // SVGLengthListSMILType
 //
 // Operations for animating an SVGLengthList.
 //
 class SVGLengthListSMILType : public SMILType {
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SVGLengthListSMILType sSingleton;
 
  protected:
   // SMILType Methods
   // -------------------
 
   /**
-   * When this method initializes the SVGLengthListAndInfo for its nsSMILValue
+   * When this method initializes the SVGLengthListAndInfo for its SMILValue
    * argument, it has to blindly set its mCanZeroPadList to true despite
    * the fact that some attributes can't be zero-padded. (See the explaination
    * that follows.) SVGAnimatedLengthList::SMILAnimatedLengthList's
    * GetBaseValue() and ValueFromString() methods then override this for the
-   * nsSMILValue objects that they create to set this flag to the appropriate
+   * SMILValue objects that they create to set this flag to the appropriate
    * value for the attribute in question.
    *
    * The reason that we default to setting the mCanZeroPadList to true is
-   * because the SMIL engine creates "zero" valued nsSMILValue objects for
-   * intermediary calculations, and may pass such an nsSMILValue (along with an
-   * nsSMILValue from an animation element - that is an nsSMILValue created by
+   * because the SMIL engine creates "zero" valued SMILValue objects for
+   * intermediary calculations, and may pass such a SMILValue (along with a
+   * SMILValue from an animation element - that is a SMILValue created by
    * SVGAnimatedLengthList::SMILAnimatedLengthList's GetBaseValue() or
    * ValueFromString() methods) into the Add(), ComputeDistance() or
    * Interpolate() methods below. Even in the case of animation of list
    * attributes that may *not* be padded with zeros (such as 'x' and 'y' on the
    * <text> element), we need to allow zero-padding of these "zero" valued
-   * nsSMILValue's lists. One reason for this is illustrated by the following
+   * SMILValue's lists. One reason for this is illustrated by the following
    * example:
    *
    *   <text x="2 4">foo
    *      <animate by="2 2" .../>
    *   </text>
    *
    * In this example there are two SMIL animation layers to be sandwiched: the
    * base layer, and the layer created for the <animate> element. The SMIL
    * engine calculates the result of each layer *independently*, before
    * compositing the results together. Thus for the <animate> sandwich layer
-   * the SMIL engine interpolates between a "zero" nsSMILValue that it creates
+   * the SMIL engine interpolates between a "zero" SMILValue that it creates
    * (since there is no explicit "from") and the "2 2", before the result of
    * that interpolation is added to the "2 4" from the base layer. Clearly for
-   * the interpolation between the "zero" nsSMILValue and "2 2" to work, the
-   * "zero" nsSMILValue's SVGLengthListAndInfo must be zero paddable - hence
+   * the interpolation between the "zero" SMILValue and "2 2" to work, the
+   * "zero" SMILValue's SVGLengthListAndInfo must be zero paddable - hence
    * why this method always sets mCanZeroPadList to true.
    *
    * (Since the Add(), ComputeDistance() and Interpolate() methods may be
-   * passed two input nsSMILValue objects for which CanZeroPadList() returns
+   * passed two input SMILValue objects for which CanZeroPadList() returns
    * opposite values, these methods must be careful what they set the flag to
-   * on the nsSMILValue that they output. If *either* of the input nsSMILValues
+   * on the SMILValue that they output. If *either* of the input SMILValues
    * has an SVGLengthListAndInfo for which CanZeroPadList() returns false,
-   * then they must set the flag to false on the output nsSMILValue too. If
-   * the methods failed to do that, then when the result nsSMILValue objects
+   * then they must set the flag to false on the output SMILValue too. If
+   * the methods failed to do that, then when the result SMILValue objects
    * from each sandwich layer are composited together, we could end up allowing
    * animation between lists of different length when we should not!)
    */
-  virtual void Init(nsSMILValue& aValue) const override;
+  virtual void Init(SMILValue& aValue) const override;
 
-  virtual void Destroy(nsSMILValue& aValue) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Destroy(SMILValue& aValue) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SVGLengthListSMILType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/svg/SVGMotionSMILAnimationFunction.cpp
+++ b/dom/svg/SVGMotionSMILAnimationFunction.cpp
@@ -2,26 +2,26 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGMotionSMILAnimationFunction.h"
 
 #include "mozilla/dom/SVGAnimationElement.h"
-#include "mozilla/dom/SVGPathElement.h"  // for nsSVGPathList
+#include "mozilla/dom/SVGPathElement.h"
 #include "mozilla/dom/SVGMPathElement.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/SMILParserUtils.h"
 #include "nsAttrValue.h"
 #include "nsAttrValueInlines.h"
 #include "SVGAngle.h"
-#include "SVGPathDataParser.h"
+#include "SVGMotionSMILPathUtils.h"
 #include "SVGMotionSMILType.h"
-#include "SVGMotionSMILPathUtils.h"
+#include "SVGPathDataParser.h"
 
 using namespace mozilla::dom;
 using namespace mozilla::dom::SVGAngle_Binding;
 using namespace mozilla::gfx;
 
 namespace mozilla {
 
 SVGMotionSMILAnimationFunction::SVGMotionSMILAnimationFunction()
@@ -269,17 +269,17 @@ void SVGMotionSMILAnimationFunction::Reb
     RebuildPathAndVerticesFromBasicAttrs(aTargetElement);
     mValueNeedsReparsingEverySample = true;
   }
   mIsPathStale = false;
 }
 
 bool SVGMotionSMILAnimationFunction::GenerateValuesForPathAndPoints(
     Path* aPath, bool aIsKeyPoints, FallibleTArray<double>& aPointDistances,
-    nsSMILValueArray& aResult) {
+    SMILValueArray& aResult) {
   MOZ_ASSERT(aResult.IsEmpty(), "outparam is non-empty");
 
   // If we're using "keyPoints" as our list of input distances, then we need
   // to de-normalize from the [0, 1] scale to the [0, totalPathLen] scale.
   double distanceMultiplier = aIsKeyPoints ? aPath->ComputeLength() : 1.0;
   const uint32_t numPoints = aPointDistances.Length();
   for (uint32_t i = 0; i < numPoints; ++i) {
     double curDist = aPointDistances[i] * distanceMultiplier;
@@ -288,30 +288,30 @@ bool SVGMotionSMILAnimationFunction::Gen
                                fallible)) {
       return false;
     }
   }
   return true;
 }
 
 nsresult SVGMotionSMILAnimationFunction::GetValues(const nsISMILAttr& aSMILAttr,
-                                                   nsSMILValueArray& aResult) {
+                                                   SMILValueArray& aResult) {
   if (mIsPathStale) {
     RebuildPathAndVertices(aSMILAttr.GetTargetNode());
   }
   MOZ_ASSERT(!mIsPathStale, "Forgot to clear 'is path stale' state");
 
   if (!mPath) {
     // This could be due to e.g. a parse error.
     MOZ_ASSERT(mPathVertices.IsEmpty(), "have vertices but no path");
     return NS_ERROR_FAILURE;
   }
   MOZ_ASSERT(!mPathVertices.IsEmpty(), "have a path but no vertices");
 
-  // Now: Make the actual list of nsSMILValues (using keyPoints, if set)
+  // Now: Make the actual list of SMILValues (using keyPoints, if set)
   bool isUsingKeyPoints = !mKeyPoints.IsEmpty();
   bool success = GenerateValuesForPathAndPoints(
       mPath, isUsingKeyPoints, isUsingKeyPoints ? mKeyPoints : mPathVertices,
       aResult);
   if (!success) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
--- a/dom/svg/SVGMotionSMILAnimationFunction.h
+++ b/dom/svg/SVGMotionSMILAnimationFunction.h
@@ -12,20 +12,21 @@
 #include "mozilla/SMILAnimationFunction.h"
 #include "nsTArray.h"
 #include "SVGMotionSMILType.h"  // for RotateType
 
 class nsAttrValue;
 class nsAtom;
 class nsIContent;
 class nsISMILAttr;
-class nsSMILValue;
 
 namespace mozilla {
 
+class SMILValue;
+
 namespace dom {
 class SVGMPathElement;
 }  // namespace dom
 
 //----------------------------------------------------------------------
 // SVGMotionSMILAnimationFunction
 //
 // Subclass of SMILAnimationFunction to support a few extra features offered
@@ -57,17 +58,17 @@ class SVGMotionSMILAnimationFunction fin
     ePathSourceType_ToAttr,  // to or from-to animation
     ePathSourceType_ValuesAttr,
     ePathSourceType_PathAttr,
     ePathSourceType_Mpath
   };
 
   virtual nsSMILCalcMode GetCalcMode() const override;
   virtual nsresult GetValues(const nsISMILAttr& aSMILAttr,
-                             nsSMILValueArray& aResult) override;
+                             SMILValueArray& aResult) override;
   virtual void CheckValueListDependentAttrs(uint32_t aNumValues) override;
 
   virtual bool IsToAnimation() const override;
 
   void CheckKeyPoints();
   nsresult SetKeyPoints(const nsAString& aKeyPoints, nsAttrValue& aResult);
   void UnsetKeyPoints();
   nsresult SetRotate(const nsAString& aRotate, nsAttrValue& aResult);
@@ -76,17 +77,17 @@ class SVGMotionSMILAnimationFunction fin
   // Helpers for GetValues
   void MarkStaleIfAttributeAffectsPath(nsAtom* aAttribute);
   void RebuildPathAndVertices(const nsIContent* aContextElem);
   void RebuildPathAndVerticesFromMpathElem(dom::SVGMPathElement* aMpathElem);
   void RebuildPathAndVerticesFromPathAttr();
   void RebuildPathAndVerticesFromBasicAttrs(const nsIContent* aContextElem);
   bool GenerateValuesForPathAndPoints(Path* aPath, bool aIsKeyPoints,
                                       FallibleTArray<double>& aPointDistances,
-                                      nsSMILValueArray& aResult);
+                                      SMILValueArray& aResult);
 
   // Members
   // -------
   FallibleTArray<double> mKeyPoints;  // parsed from "keyPoints" attribute.
 
   RotateType mRotateType;  // auto, auto-reverse, or explicit.
   float mRotateAngle;      // the angle value, if explicit.
 
--- a/dom/svg/SVGMotionSMILAttr.cpp
+++ b/dom/svg/SVGMotionSMILAttr.cpp
@@ -2,43 +2,44 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* representation of a dummy attribute targeted by <animateMotion> element */
 
 #include "SVGMotionSMILAttr.h"
-#include "SVGMotionSMILType.h"
+
 #include "mozilla/dom/SVGAnimationElement.h"
-#include "nsSMILValue.h"
+#include "mozilla/dom/SVGElement.h"
+#include "mozilla/SMILValue.h"
+#include "SVGMotionSMILType.h"
 #include "nsDebug.h"
-#include "SVGElement.h"
 #include "gfx2DGlue.h"
 
 namespace mozilla {
 
 nsresult SVGMotionSMILAttr::ValueFromString(
     const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
-    nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
+    SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
   MOZ_ASSERT_UNREACHABLE(
       "Shouldn't using nsISMILAttr::ValueFromString for "
       "parsing animateMotion's SMIL values.");
   return NS_ERROR_FAILURE;
 }
 
-nsSMILValue SVGMotionSMILAttr::GetBaseValue() const {
-  return nsSMILValue(&SVGMotionSMILType::sSingleton);
+SMILValue SVGMotionSMILAttr::GetBaseValue() const {
+  return SMILValue(&SVGMotionSMILType::sSingleton);
 }
 
 void SVGMotionSMILAttr::ClearAnimValue() {
   mSVGElement->SetAnimateMotionTransform(nullptr);
 }
 
-nsresult SVGMotionSMILAttr::SetAnimValue(const nsSMILValue& aValue) {
+nsresult SVGMotionSMILAttr::SetAnimValue(const SMILValue& aValue) {
   gfx::Matrix matrix = SVGMotionSMILType::CreateMatrix(aValue);
   mSVGElement->SetAnimateMotionTransform(&matrix);
   return NS_OK;
 }
 
 const nsIContent* SVGMotionSMILAttr::GetTargetNode() const {
   return mSVGElement;
 }
--- a/dom/svg/SVGMotionSMILAttr.h
+++ b/dom/svg/SVGMotionSMILAttr.h
@@ -8,20 +8,21 @@
 
 #ifndef MOZILLA_SVGMOTIONSMILATTR_H_
 #define MOZILLA_SVGMOTIONSMILATTR_H_
 
 #include "mozilla/Attributes.h"
 #include "nsISMILAttr.h"
 
 class nsIContent;
-class nsSMILValue;
 
 namespace mozilla {
 
+class SMILValue;
+
 namespace dom {
 class SVGAnimationElement;
 class SVGElement;
 }  // namespace dom
 
 /**
  * SVGMotionSMILAttr: Implements the nsISMILAttr interface for SMIL animations
  * from <animateMotion>.
@@ -32,19 +33,19 @@ class SVGElement;
 class SVGMotionSMILAttr : public nsISMILAttr {
  public:
   explicit SVGMotionSMILAttr(dom::SVGElement* aSVGElement)
       : mSVGElement(aSVGElement) {}
 
   // nsISMILAttr methods
   virtual nsresult ValueFromString(
       const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
-      nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-  virtual nsSMILValue GetBaseValue() const override;
-  virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+      SMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
+  virtual SMILValue GetBaseValue() const override;
+  virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   virtual void ClearAnimValue() override;
   virtual const nsIContent* GetTargetNode() const override;
 
  protected:
   // Raw pointers are OK here because this SVGMotionSMILAttr is both
   // created & destroyed during a SMIL sample-step, during which time the DOM
   // isn't modified.
   dom::SVGElement* mSVGElement;
--- a/dom/svg/SVGMotionSMILType.cpp
+++ b/dom/svg/SVGMotionSMILType.cpp
@@ -3,19 +3,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* implementation of nsISMILType for use by <animateMotion> element */
 
 #include "SVGMotionSMILType.h"
 
-#include "gfx2DGlue.h"
+#include "mozilla/SMILValue.h"
 #include "mozilla/gfx/Point.h"
-#include "nsSMILValue.h"
+#include "gfx2DGlue.h"
 #include "nsDebug.h"
 #include "nsMathUtils.h"
 #include "nsISupportsUtils.h"
 #include "nsTArray.h"
 #include <math.h>
 
 using namespace mozilla::gfx;
 
@@ -39,17 +39,17 @@ struct PathPointParams {  // Point along
   float mDistToPoint;  // Distance from path start to the point on the path that
                        // we're interested in.
 };
 
 /**
  * Helper Struct: MotionSegment
  *
  * Instances of this class represent the points that we move between during
- * <animateMotion>.  Each nsSMILValue will get a nsTArray of these (generally
+ * <animateMotion>.  Each SMILValue will get a nsTArray of these (generally
  * with at most 1 entry in the array, except for in SandwichAdd).  (This
  * matches our behavior in SVGTransformListSMILType.)
  *
  * NOTE: In general, MotionSegments are represented as points on a path
  * (eSegmentType_PathPoint), so that we can easily interpolate and compute
  * distance *along their path*.  However, Add() outputs MotionSegments as
  * simple translations (eSegmentType_Translation), because adding two points
  * from a path (e.g. when accumulating a repeated animation) will generally
@@ -141,62 +141,62 @@ struct MotionSegment {
   union {  // Union to let us hold the params for either segment-type.
     TranslationParams mTranslationParams;
     PathPointParams mPathPointParams;
   } mU;
 };
 
 typedef FallibleTArray<MotionSegment> MotionSegmentArray;
 
-// Helper methods to cast nsSMILValue.mU.mPtr to the right pointer-type
-static MotionSegmentArray& ExtractMotionSegmentArray(nsSMILValue& aValue) {
+// Helper methods to cast SMILValue.mU.mPtr to the right pointer-type
+static MotionSegmentArray& ExtractMotionSegmentArray(SMILValue& aValue) {
   return *static_cast<MotionSegmentArray*>(aValue.mU.mPtr);
 }
 
 static const MotionSegmentArray& ExtractMotionSegmentArray(
-    const nsSMILValue& aValue) {
+    const SMILValue& aValue) {
   return *static_cast<const MotionSegmentArray*>(aValue.mU.mPtr);
 }
 
 // nsISMILType Methods
 // -------------------
 
-void SVGMotionSMILType::Init(nsSMILValue& aValue) const {
+void SVGMotionSMILType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected SMIL type");
 
   aValue.mType = this;
   aValue.mU.mPtr = new MotionSegmentArray(1);
 }
 
-void SVGMotionSMILType::Destroy(nsSMILValue& aValue) const {
+void SVGMotionSMILType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL type");
 
   MotionSegmentArray* arr = static_cast<MotionSegmentArray*>(aValue.mU.mPtr);
   delete arr;
 
   aValue.mU.mPtr = nullptr;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SVGMotionSMILType::Assign(nsSMILValue& aDest,
-                                   const nsSMILValue& aSrc) const {
+nsresult SVGMotionSMILType::Assign(SMILValue& aDest,
+                                   const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL type");
 
   const MotionSegmentArray& srcArr = ExtractMotionSegmentArray(aSrc);
   MotionSegmentArray& dstArr = ExtractMotionSegmentArray(aDest);
   if (!dstArr.Assign(srcArr, fallible)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   return NS_OK;
 }
 
-bool SVGMotionSMILType::IsEqual(const nsSMILValue& aLeft,
-                                const nsSMILValue& aRight) const {
+bool SVGMotionSMILType::IsEqual(const SMILValue& aLeft,
+                                const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected SMIL type");
 
   const MotionSegmentArray& leftArr = ExtractMotionSegmentArray(aLeft);
   const MotionSegmentArray& rightArr = ExtractMotionSegmentArray(aRight);
 
   // If array-lengths don't match, we're trivially non-equal.
   if (leftArr.Length() != rightArr.Length()) {
@@ -231,18 +231,17 @@ inline static void GetAngleAndPointAtDis
       aRotateAngle = tangentAngle;
     } else {
       MOZ_ASSERT(aRotateType == eRotateType_AutoReverse);
       aRotateAngle = M_PI + tangentAngle;
     }
   }
 }
 
-nsresult SVGMotionSMILType::Add(nsSMILValue& aDest,
-                                const nsSMILValue& aValueToAdd,
+nsresult SVGMotionSMILType::Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                                 uint32_t aCount) const {
   MOZ_ASSERT(aDest.mType == aValueToAdd.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL type");
 
   MotionSegmentArray& dstArr = ExtractMotionSegmentArray(aDest);
   const MotionSegmentArray& srcArr = ExtractMotionSegmentArray(aValueToAdd);
 
   // We're doing a simple add here (as opposed to a sandwich add below).  We
@@ -283,36 +282,36 @@ nsresult SVGMotionSMILType::Add(nsSMILVa
   float newY = dstPt.y + srcPt.y * aCount;
 
   // Replace destination's current value -- a point-on-a-path -- with the
   // translation that results from our addition.
   dstArr.ReplaceElementAt(0, MotionSegment(newX, newY, rotateAngle));
   return NS_OK;
 }
 
-nsresult SVGMotionSMILType::SandwichAdd(nsSMILValue& aDest,
-                                        const nsSMILValue& aValueToAdd) const {
+nsresult SVGMotionSMILType::SandwichAdd(SMILValue& aDest,
+                                        const SMILValue& aValueToAdd) const {
   MOZ_ASSERT(aDest.mType == aValueToAdd.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL type");
   MotionSegmentArray& dstArr = ExtractMotionSegmentArray(aDest);
   const MotionSegmentArray& srcArr = ExtractMotionSegmentArray(aValueToAdd);
 
   // We're only expecting to be adding 1 segment on to the list
   MOZ_ASSERT(srcArr.Length() == 1,
              "Trying to do sandwich add of more than one value");
 
   if (!dstArr.AppendElement(srcArr[0], fallible)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   return NS_OK;
 }
 
-nsresult SVGMotionSMILType::ComputeDistance(const nsSMILValue& aFrom,
-                                            const nsSMILValue& aTo,
+nsresult SVGMotionSMILType::ComputeDistance(const SMILValue& aFrom,
+                                            const SMILValue& aTo,
                                             double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == aTo.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aFrom.mType == this, "Unexpected SMIL type");
   const MotionSegmentArray& fromArr = ExtractMotionSegmentArray(aFrom);
   const MotionSegmentArray& toArr = ExtractMotionSegmentArray(aTo);
 
   // ComputeDistance is only used for calculating distances between single
   // values in a values array. So we should only have one entry in each array.
@@ -345,20 +344,20 @@ nsresult SVGMotionSMILType::ComputeDista
 
 // Helper method for Interpolate()
 static inline float InterpolateFloat(const float& aStartFlt,
                                      const float& aEndFlt,
                                      const double& aUnitDistance) {
   return aStartFlt + aUnitDistance * (aEndFlt - aStartFlt);
 }
 
-nsresult SVGMotionSMILType::Interpolate(const nsSMILValue& aStartVal,
-                                        const nsSMILValue& aEndVal,
+nsresult SVGMotionSMILType::Interpolate(const SMILValue& aStartVal,
+                                        const SMILValue& aEndVal,
                                         double aUnitDistance,
-                                        nsSMILValue& aResult) const {
+                                        SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
   MOZ_ASSERT(aUnitDistance >= 0.0 && aUnitDistance <= 1.0,
              "unit distance value out of bounds");
 
   const MotionSegmentArray& startArr = ExtractMotionSegmentArray(aStartVal);
@@ -407,17 +406,17 @@ nsresult SVGMotionSMILType::Interpolate(
   // Construct the intermediate result segment, and put it in our outparam.
   // AppendElement has guaranteed success here, since Init() allocates 1 slot.
   MOZ_ALWAYS_TRUE(resultArr.AppendElement(
       MotionSegment(path, resultDist, rotateType, rotateAngle), fallible));
   return NS_OK;
 }
 
 /* static */ gfx::Matrix SVGMotionSMILType::CreateMatrix(
-    const nsSMILValue& aSMILVal) {
+    const SMILValue& aSMILVal) {
   const MotionSegmentArray& arr = ExtractMotionSegmentArray(aSMILVal);
 
   gfx::Matrix matrix;
   uint32_t length = arr.Length();
   for (uint32_t i = 0; i < length; i++) {
     Point point;                              // initialized below
     float rotateAngle = arr[i].mRotateAngle;  // might get updated below
     if (arr[i].mSegmentType == eSegmentType_Translation) {
@@ -432,19 +431,19 @@ nsresult SVGMotionSMILType::Interpolate(
                                  arr[i].mRotateType, rotateAngle, point);
     }
     matrix.PreTranslate(point.x, point.y);
     matrix.PreRotate(rotateAngle);
   }
   return matrix;
 }
 
-/* static */ nsSMILValue SVGMotionSMILType::ConstructSMILValue(
+/* static */ SMILValue SVGMotionSMILType::ConstructSMILValue(
     Path* aPath, float aDist, RotateType aRotateType, float aRotateAngle) {
-  nsSMILValue smilVal(&SVGMotionSMILType::sSingleton);
+  SMILValue smilVal(&SVGMotionSMILType::sSingleton);
   MotionSegmentArray& arr = ExtractMotionSegmentArray(smilVal);
 
   // AppendElement has guaranteed success here, since Init() allocates 1 slot.
   MOZ_ALWAYS_TRUE(arr.AppendElement(
       MotionSegment(aPath, aDist, aRotateType, aRotateAngle), fallible));
   return smilVal;
 }
 
--- a/dom/svg/SVGMotionSMILType.h
+++ b/dom/svg/SVGMotionSMILType.h
@@ -8,19 +8,19 @@
 
 #ifndef MOZILLA_SVGMOTIONSMILTYPE_H_
 #define MOZILLA_SVGMOTIONSMILTYPE_H_
 
 #include "mozilla/gfx/2D.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
 
 /**
  * MotionRotateType: Enum to indicate the type of our "rotate" attribute.
  */
 enum RotateType {
   eRotateType_Explicit,    // for e.g. rotate="45"/"45deg"/"0.785rad"
   eRotateType_Auto,        // for rotate="auto"
   eRotateType_AutoReverse  // for rotate="auto-reverse"
@@ -32,48 +32,47 @@ enum RotateType {
  *
  * NOTE: Even though there's technically no "motion" attribute, we behave in
  * many ways as if there were, for simplicity.
  */
 class SVGMotionSMILType : public SMILType {
   typedef mozilla::gfx::Path Path;
 
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SVGMotionSMILType sSingleton;
 
  protected:
   // SMILType Methods
   // -------------------
-  virtual void Init(nsSMILValue& aValue) const override;
-  virtual void Destroy(nsSMILValue& aValue) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Init(SMILValue& aValue) const override;
+  virtual void Destroy(SMILValue& aValue) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult SandwichAdd(nsSMILValue& aDest,
-                               const nsSMILValue& aValueToAdd) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult SandwichAdd(SMILValue& aDest,
+                               const SMILValue& aValueToAdd) const override;
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  public:
-  // Used to generate a transform matrix from an <animateMotion> nsSMILValue.
-  static gfx::Matrix CreateMatrix(const nsSMILValue& aSMILVal);
+  // Used to generate a transform matrix from an <animateMotion> SMILValue.
+  static gfx::Matrix CreateMatrix(const SMILValue& aSMILVal);
 
-  // Used to generate a nsSMILValue for the point at the given distance along
+  // Used to generate a SMILValue for the point at the given distance along
   // the given path.
-  static nsSMILValue ConstructSMILValue(Path* aPath, float aDist,
-                                        RotateType aRotateType,
-                                        float aRotateAngle);
+  static SMILValue ConstructSMILValue(Path* aPath, float aDist,
+                                      RotateType aRotateType,
+                                      float aRotateAngle);
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SVGMotionSMILType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/svg/SVGNumberList.h
+++ b/dom/svg/SVGNumberList.h
@@ -122,17 +122,17 @@ class SVGNumberList {
   /* See SVGLengthList for the rationale for using FallibleTArray<float> instead
    * of FallibleTArray<float, 1>.
    */
   FallibleTArray<float> mNumbers;
 };
 
 /**
  * This SVGNumberList subclass is used by the SMIL code when a number list
- * is to be stored in an nsISMILValue instance. Since nsISMILValue objects may
+ * is to be stored in a SMILValue instance. Since SMILValue objects may
  * be cached, it is necessary for us to hold a strong reference to our element
  * so that it doesn't disappear out from under us if, say, the element is
  * removed from the DOM tree.
  */
 class SVGNumberListAndInfo : public SVGNumberList {
  public:
   SVGNumberListAndInfo() : mElement(nullptr) {}
 
@@ -172,17 +172,17 @@ class SVGNumberListAndInfo : public SVGN
     return SVGNumberList::operator[](aIndex);
   }
   bool SetLength(uint32_t aNumberOfItems) {
     return SVGNumberList::SetLength(aNumberOfItems);
   }
 
  private:
   // We must keep a weak reference to our element because we may belong to a
-  // cached baseVal nsSMILValue. See the comments starting at:
+  // cached baseVal SMILValue. See the comments starting at:
   // https://bugzilla.mozilla.org/show_bug.cgi?id=515116#c15
   // See also https://bugzilla.mozilla.org/show_bug.cgi?id=653497
   nsWeakPtr mElement;
 };
 
 }  // namespace mozilla
 
 #endif  // MOZILLA_SVGNUMBERLIST_H__
--- a/dom/svg/SVGNumberListSMILType.cpp
+++ b/dom/svg/SVGNumberListSMILType.cpp
@@ -1,87 +1,88 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGNumberListSMILType.h"
-#include "nsSMILValue.h"
+
+#include "mozilla/FloatingPoint.h"
+#include "mozilla/SMILValue.h"
+#include "nsMathUtils.h"
 #include "SVGNumberList.h"
-#include "nsMathUtils.h"
-#include "mozilla/FloatingPoint.h"
 #include <math.h>
 
 /* The "identity" number list for a given number list attribute (the effective
  * number list that is used if an attribute value is not specified) varies
  * widely for different number list attributes, and can depend on the value of
  * other attributes on the same element:
  *
  * http://www.w3.org/TR/SVG11/filters.html#feColorMatrixValuesAttribute
  *
  http://www.w3.org/TR/SVG11/filters.html#feComponentTransferTableValuesAttribute
  *
  http://www.w3.org/TR/SVG11/filters.html#feConvolveMatrixElementKernelMatrixAttribute
  * http://www.w3.org/TR/SVG11/text.html#TextElementRotateAttribute
  *
  * Note that we don't need to worry about that variation here, however. The way
  * that the SMIL engine creates and composites sandwich layers together allows
- * us to treat "identity" nsSMILValue objects as a number list of zeros. Such
- * identity nsSMILValues are identified by the fact that their
+ * us to treat "identity" SMILValue objects as a number list of zeros. Such
+ * identity SMILValues are identified by the fact that their
  # SVGNumberListAndInfo has not been given an element yet.
  */
 
 namespace mozilla {
 
 /*static*/ SVGNumberListSMILType SVGNumberListSMILType::sSingleton;
 
 //----------------------------------------------------------------------
 // nsISMILType implementation
 
-void SVGNumberListSMILType::Init(nsSMILValue& aValue) const {
+void SVGNumberListSMILType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
 
   SVGNumberListAndInfo* numberList = new SVGNumberListAndInfo();
 
   aValue.mU.mPtr = numberList;
   aValue.mType = this;
 }
 
-void SVGNumberListSMILType::Destroy(nsSMILValue& aValue) const {
+void SVGNumberListSMILType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value type");
   delete static_cast<SVGNumberListAndInfo*>(aValue.mU.mPtr);
   aValue.mU.mPtr = nullptr;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SVGNumberListSMILType::Assign(nsSMILValue& aDest,
-                                       const nsSMILValue& aSrc) const {
+nsresult SVGNumberListSMILType::Assign(SMILValue& aDest,
+                                       const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
 
   const SVGNumberListAndInfo* src =
       static_cast<const SVGNumberListAndInfo*>(aSrc.mU.mPtr);
   SVGNumberListAndInfo* dest =
       static_cast<SVGNumberListAndInfo*>(aDest.mU.mPtr);
 
   return dest->CopyFrom(*src);
 }
 
-bool SVGNumberListSMILType::IsEqual(const nsSMILValue& aLeft,
-                                    const nsSMILValue& aRight) const {
+bool SVGNumberListSMILType::IsEqual(const SMILValue& aLeft,
+                                    const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
   return *static_cast<const SVGNumberListAndInfo*>(aLeft.mU.mPtr) ==
          *static_cast<const SVGNumberListAndInfo*>(aRight.mU.mPtr);
 }
 
-nsresult SVGNumberListSMILType::Add(nsSMILValue& aDest,
-                                    const nsSMILValue& aValueToAdd,
+nsresult SVGNumberListSMILType::Add(SMILValue& aDest,
+                                    const SMILValue& aValueToAdd,
                                     uint32_t aCount) const {
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL type");
   MOZ_ASSERT(aValueToAdd.mType == this, "Incompatible SMIL type");
 
   SVGNumberListAndInfo& dest =
       *static_cast<SVGNumberListAndInfo*>(aDest.mU.mPtr);
   const SVGNumberListAndInfo& valueToAdd =
       *static_cast<const SVGNumberListAndInfo*>(aValueToAdd.mU.mPtr);
@@ -115,18 +116,18 @@ nsresult SVGNumberListSMILType::Add(nsSM
   }
   for (uint32_t i = 0; i < dest.Length(); ++i) {
     dest[i] += aCount * valueToAdd[i];
   }
   dest.SetInfo(valueToAdd.Element());  // propagate target element info!
   return NS_OK;
 }
 
-nsresult SVGNumberListSMILType::ComputeDistance(const nsSMILValue& aFrom,
-                                                const nsSMILValue& aTo,
+nsresult SVGNumberListSMILType::ComputeDistance(const SMILValue& aFrom,
+                                                const SMILValue& aTo,
                                                 double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == this, "Unexpected SMIL type");
   MOZ_ASSERT(aTo.mType == this, "Incompatible SMIL type");
 
   const SVGNumberListAndInfo& from =
       *static_cast<const SVGNumberListAndInfo*>(aFrom.mU.mPtr);
   const SVGNumberListAndInfo& to =
       *static_cast<const SVGNumberListAndInfo*>(aTo.mU.mPtr);
@@ -150,20 +151,20 @@ nsresult SVGNumberListSMILType::ComputeD
   if (!IsFinite(distance)) {
     return NS_ERROR_FAILURE;
   }
   aDistance = distance;
 
   return NS_OK;
 }
 
-nsresult SVGNumberListSMILType::Interpolate(const nsSMILValue& aStartVal,
-                                            const nsSMILValue& aEndVal,
+nsresult SVGNumberListSMILType::Interpolate(const SMILValue& aStartVal,
+                                            const SMILValue& aEndVal,
                                             double aUnitDistance,
-                                            nsSMILValue& aResult) const {
+                                            SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
 
   const SVGNumberListAndInfo& start =
       *static_cast<const SVGNumberListAndInfo*>(aStartVal.mU.mPtr);
   const SVGNumberListAndInfo& end =
--- a/dom/svg/SVGNumberListSMILType.h
+++ b/dom/svg/SVGNumberListSMILType.h
@@ -5,49 +5,48 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZILLA_SVGNUMBERLISTSMILTYPE_H_
 #define MOZILLA_SVGNUMBERLISTSMILTYPE_H_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
 
 ////////////////////////////////////////////////////////////////////////
 // SVGNumberListSMILType
 //
 // Operations for animating an SVGNumberList.
 //
 class SVGNumberListSMILType : public SMILType {
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SVGNumberListSMILType sSingleton;
 
  protected:
   // SMILType Methods
   // -------------------
 
-  virtual void Init(nsSMILValue& aValue) const override;
+  virtual void Init(SMILValue& aValue) const override;
 
-  virtual void Destroy(nsSMILValue& aValue) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Destroy(SMILValue& aValue) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SVGNumberListSMILType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/svg/SVGNumberPair.cpp
+++ b/dom/svg/SVGNumberPair.cpp
@@ -1,28 +1,29 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGNumberPair.h"
-#include "nsSVGAttrTearoffTable.h"
+
 #include "nsCharSeparatedTokenizer.h"
-#include "nsSMILValue.h"
-#include "SVGContentUtils.h"
+#include "SVGAttrTearoffTable.h"
 #include "SVGNumberPairSMILType.h"
+#include "mozilla/SMILValue.h"
+#include "mozilla/SVGContentUtils.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
-static nsSVGAttrTearoffTable<SVGNumberPair, SVGNumberPair::DOMAnimatedNumber>
+static SVGAttrTearoffTable<SVGNumberPair, SVGNumberPair::DOMAnimatedNumber>
     sSVGFirstAnimatedNumberTearoffTable;
-static nsSVGAttrTearoffTable<SVGNumberPair, SVGNumberPair::DOMAnimatedNumber>
+static SVGAttrTearoffTable<SVGNumberPair, SVGNumberPair::DOMAnimatedNumber>
     sSVGSecondAnimatedNumberTearoffTable;
 
 static nsresult ParseNumberOptionalNumber(const nsAString& aValue,
                                           float aValues[2]) {
   nsCharSeparatedTokenizerTemplate<nsContentUtils::IsHTMLWhitespace> tokenizer(
       aValue, ',', nsCharSeparatedTokenizer::SEPARATOR_OPTIONAL);
   if (tokenizer.whitespaceBeforeFirstToken()) {
     return NS_ERROR_DOM_SYNTAX_ERR;
@@ -154,51 +155,50 @@ SVGNumberPair::DOMAnimatedNumber::~DOMAn
 }
 
 UniquePtr<nsISMILAttr> SVGNumberPair::ToSMILAttr(SVGElement* aSVGElement) {
   return MakeUnique<SMILNumberPair>(this, aSVGElement);
 }
 
 nsresult SVGNumberPair::SMILNumberPair::ValueFromString(
     const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/,
-    nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
+    SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
   float values[2];
 
   nsresult rv = ParseNumberOptionalNumber(aStr, values);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
-  nsSMILValue val(&SVGNumberPairSMILType::sSingleton);
+  SMILValue val(&SVGNumberPairSMILType::sSingleton);
   val.mU.mNumberPair[0] = values[0];
   val.mU.mNumberPair[1] = values[1];
   aValue = val;
   aPreventCachingOfSandwich = false;
 
   return NS_OK;
 }
 
-nsSMILValue SVGNumberPair::SMILNumberPair::GetBaseValue() const {
-  nsSMILValue val(&SVGNumberPairSMILType::sSingleton);
+SMILValue SVGNumberPair::SMILNumberPair::GetBaseValue() const {
+  SMILValue val(&SVGNumberPairSMILType::sSingleton);
   val.mU.mNumberPair[0] = mVal->mBaseVal[0];
   val.mU.mNumberPair[1] = mVal->mBaseVal[1];
   return val;
 }
 
 void SVGNumberPair::SMILNumberPair::ClearAnimValue() {
   if (mVal->mIsAnimated) {
     mVal->mIsAnimated = false;
     mVal->mAnimVal[0] = mVal->mBaseVal[0];
     mVal->mAnimVal[1] = mVal->mBaseVal[1];
     mSVGElement->DidAnimateNumberPair(mVal->mAttrEnum);
   }
 }
 
-nsresult SVGNumberPair::SMILNumberPair::SetAnimValue(
-    const nsSMILValue& aValue) {
+nsresult SVGNumberPair::SMILNumberPair::SetAnimValue(const SMILValue& aValue) {
   NS_ASSERTION(aValue.mType == &SVGNumberPairSMILType::sSingleton,
                "Unexpected type to assign animated value");
   if (aValue.mType == &SVGNumberPairSMILType::sSingleton) {
     mVal->SetAnimValue(aValue.mU.mNumberPair, mSVGElement);
   }
   return NS_OK;
 }
 
--- a/dom/svg/SVGNumberPair.h
+++ b/dom/svg/SVGNumberPair.h
@@ -11,19 +11,20 @@
 #include "nsError.h"
 #include "nsISMILAttr.h"
 #include "nsMathUtils.h"
 #include "mozilla/dom/SVGAnimatedNumber.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/UniquePtr.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
+
 namespace dom {
 class SVGAnimationElement;
 class SVGElement;
 }  // namespace dom
 
 class SVGNumberPair {
  public:
   typedef mozilla::dom::SVGElement SVGElement;
@@ -104,19 +105,19 @@ class SVGNumberPair {
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
     SVGNumberPair* mVal;
     SVGElement* mSVGElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr,
-        const mozilla::dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,
+        bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 }  // namespace mozilla
 
 #endif  //__NS_SVGNUMBERPAIR_H__
--- a/dom/svg/SVGNumberPairSMILType.cpp
+++ b/dom/svg/SVGNumberPairSMILType.cpp
@@ -1,87 +1,88 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGNumberPairSMILType.h"
-#include "nsSMILValue.h"
+
+#include "mozilla/SMILValue.h"
 #include "nsMathUtils.h"
 #include "nsDebug.h"
 
 namespace mozilla {
 
 /*static*/ SVGNumberPairSMILType SVGNumberPairSMILType::sSingleton;
 
-void SVGNumberPairSMILType::Init(nsSMILValue& aValue) const {
+void SVGNumberPairSMILType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
 
   aValue.mU.mNumberPair[0] = 0;
   aValue.mU.mNumberPair[1] = 0;
   aValue.mType = this;
 }
 
-void SVGNumberPairSMILType::Destroy(nsSMILValue& aValue) const {
+void SVGNumberPairSMILType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value");
   aValue.mU.mNumberPair[0] = 0;
   aValue.mU.mNumberPair[1] = 0;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SVGNumberPairSMILType::Assign(nsSMILValue& aDest,
-                                       const nsSMILValue& aSrc) const {
+nsresult SVGNumberPairSMILType::Assign(SMILValue& aDest,
+                                       const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
 
   aDest.mU.mNumberPair[0] = aSrc.mU.mNumberPair[0];
   aDest.mU.mNumberPair[1] = aSrc.mU.mNumberPair[1];
   return NS_OK;
 }
 
-bool SVGNumberPairSMILType::IsEqual(const nsSMILValue& aLeft,
-                                    const nsSMILValue& aRight) const {
+bool SVGNumberPairSMILType::IsEqual(const SMILValue& aLeft,
+                                    const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
   return aLeft.mU.mNumberPair[0] == aRight.mU.mNumberPair[0] &&
          aLeft.mU.mNumberPair[1] == aRight.mU.mNumberPair[1];
 }
 
-nsresult SVGNumberPairSMILType::Add(nsSMILValue& aDest,
-                                    const nsSMILValue& aValueToAdd,
+nsresult SVGNumberPairSMILType::Add(SMILValue& aDest,
+                                    const SMILValue& aValueToAdd,
                                     uint32_t aCount) const {
   MOZ_ASSERT(aValueToAdd.mType == aDest.mType, "Trying to add invalid types");
   MOZ_ASSERT(aValueToAdd.mType == this, "Unexpected source type");
 
   aDest.mU.mNumberPair[0] += aValueToAdd.mU.mNumberPair[0] * aCount;
   aDest.mU.mNumberPair[1] += aValueToAdd.mU.mNumberPair[1] * aCount;
 
   return NS_OK;
 }
 
-nsresult SVGNumberPairSMILType::ComputeDistance(const nsSMILValue& aFrom,
-                                                const nsSMILValue& aTo,
+nsresult SVGNumberPairSMILType::ComputeDistance(const SMILValue& aFrom,
+                                                const SMILValue& aTo,
                                                 double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == aTo.mType, "Trying to compare different types");
   MOZ_ASSERT(aFrom.mType == this, "Unexpected source type");
 
   double delta[2];
   delta[0] = aTo.mU.mNumberPair[0] - aFrom.mU.mNumberPair[0];
   delta[1] = aTo.mU.mNumberPair[1] - aFrom.mU.mNumberPair[1];
 
   aDistance = NS_hypot(delta[0], delta[1]);
   return NS_OK;
 }
 
-nsresult SVGNumberPairSMILType::Interpolate(const nsSMILValue& aStartVal,
-                                            const nsSMILValue& aEndVal,
+nsresult SVGNumberPairSMILType::Interpolate(const SMILValue& aStartVal,
+                                            const SMILValue& aEndVal,
                                             double aUnitDistance,
-                                            nsSMILValue& aResult) const {
+                                            SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
 
   aResult.mU.mNumberPair[0] =
       float(aStartVal.mU.mNumberPair[0] +
             (aEndVal.mU.mNumberPair[0] - aStartVal.mU.mNumberPair[0]) *
--- a/dom/svg/SVGNumberPairSMILType.h
+++ b/dom/svg/SVGNumberPairSMILType.h
@@ -5,42 +5,41 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZILLA_SVGNUMBERPAIRSMILTYPE_H_
 #define MOZILLA_SVGNUMBERPAIRSMILTYPE_H_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
 
 class SVGNumberPairSMILType : public SMILType {
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SVGNumberPairSMILType sSingleton;
 
  protected:
   // SMILType Methods
   // -------------------
-  virtual void Init(nsSMILValue& aValue) const override;
-  virtual void Destroy(nsSMILValue&) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Init(SMILValue& aValue) const override;
+  virtual void Destroy(SMILValue&) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SVGNumberPairSMILType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/svg/SVGOrientSMILType.cpp
+++ b/dom/svg/SVGOrientSMILType.cpp
@@ -1,66 +1,66 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGOrientSMILType.h"
-#include "nsSMILValue.h"
+
+#include "mozilla/SMILValue.h"
+#include "mozilla/dom/SVGMarkerElement.h"
+#include "nsDebug.h"
 #include "SVGAngle.h"
-#include "nsDebug.h"
-#include "mozilla/dom/SVGMarkerElement.h"
 #include <math.h>
 
 namespace mozilla {
 
 using namespace dom::SVGAngle_Binding;
 using namespace dom::SVGMarkerElement_Binding;
 
 /*static*/ SVGOrientSMILType SVGOrientSMILType::sSingleton;
 
-void SVGOrientSMILType::Init(nsSMILValue& aValue) const {
+void SVGOrientSMILType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
 
   aValue.mU.mOrient.mAngle = 0.0f;
   aValue.mU.mOrient.mUnit = SVG_ANGLETYPE_UNSPECIFIED;
   aValue.mU.mOrient.mOrientType = SVG_MARKER_ORIENT_ANGLE;
   aValue.mType = this;
 }
 
-void SVGOrientSMILType::Destroy(nsSMILValue& aValue) const {
+void SVGOrientSMILType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value.");
   aValue.mU.mPtr = nullptr;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SVGOrientSMILType::Assign(nsSMILValue& aDest,
-                                   const nsSMILValue& aSrc) const {
+nsresult SVGOrientSMILType::Assign(SMILValue& aDest,
+                                   const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types.");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value.");
 
   aDest.mU.mOrient.mAngle = aSrc.mU.mOrient.mAngle;
   aDest.mU.mOrient.mUnit = aSrc.mU.mOrient.mUnit;
   aDest.mU.mOrient.mOrientType = aSrc.mU.mOrient.mOrientType;
   return NS_OK;
 }
 
-bool SVGOrientSMILType::IsEqual(const nsSMILValue& aLeft,
-                                const nsSMILValue& aRight) const {
+bool SVGOrientSMILType::IsEqual(const SMILValue& aLeft,
+                                const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
   return aLeft.mU.mOrient.mAngle == aRight.mU.mOrient.mAngle &&
          aLeft.mU.mOrient.mUnit == aRight.mU.mOrient.mUnit &&
          aLeft.mU.mOrient.mOrientType == aRight.mU.mOrient.mOrientType;
 }
 
-nsresult SVGOrientSMILType::Add(nsSMILValue& aDest,
-                                const nsSMILValue& aValueToAdd,
+nsresult SVGOrientSMILType::Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                                 uint32_t aCount) const {
   MOZ_ASSERT(aValueToAdd.mType == aDest.mType, "Trying to add invalid types");
   MOZ_ASSERT(aValueToAdd.mType == this, "Unexpected source type");
 
   if (aDest.mU.mOrient.mOrientType != SVG_MARKER_ORIENT_ANGLE ||
       aValueToAdd.mU.mOrient.mOrientType != SVG_MARKER_ORIENT_ANGLE) {
     // TODO: it would be nice to be able to add to auto angles
     return NS_ERROR_FAILURE;
@@ -79,18 +79,18 @@ nsresult SVGOrientSMILType::Add(nsSMILVa
   aDest.mU.mOrient.mAngle =
       (currentAngle + angleToAdd) /
       SVGAngle::GetDegreesPerUnit(aValueToAdd.mU.mOrient.mUnit);
   aDest.mU.mOrient.mUnit = aValueToAdd.mU.mOrient.mUnit;
 
   return NS_OK;
 }
 
-nsresult SVGOrientSMILType::ComputeDistance(const nsSMILValue& aFrom,
-                                            const nsSMILValue& aTo,
+nsresult SVGOrientSMILType::ComputeDistance(const SMILValue& aFrom,
+                                            const SMILValue& aTo,
                                             double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == aTo.mType, "Trying to compare different types");
   MOZ_ASSERT(aFrom.mType == this, "Unexpected source type");
 
   if (aFrom.mU.mOrient.mOrientType != SVG_MARKER_ORIENT_ANGLE ||
       aTo.mU.mOrient.mOrientType != SVG_MARKER_ORIENT_ANGLE) {
     // TODO: it would be nice to be able to compute distance with auto angles
     return NS_ERROR_FAILURE;
@@ -102,20 +102,20 @@ nsresult SVGOrientSMILType::ComputeDista
   double to =
       aTo.mU.mOrient.mAngle * SVGAngle::GetDegreesPerUnit(aTo.mU.mOrient.mUnit);
 
   aDistance = fabs(to - from);
 
   return NS_OK;
 }
 
-nsresult SVGOrientSMILType::Interpolate(const nsSMILValue& aStartVal,
-                                        const nsSMILValue& aEndVal,
+nsresult SVGOrientSMILType::Interpolate(const SMILValue& aStartVal,
+                                        const SMILValue& aEndVal,
                                         double aUnitDistance,
-                                        nsSMILValue& aResult) const {
+                                        SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation.");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type.");
 
   if (aStartVal.mU.mOrient.mOrientType != SVG_MARKER_ORIENT_ANGLE ||
       aEndVal.mU.mOrient.mOrientType != SVG_MARKER_ORIENT_ANGLE) {
     // TODO: it would be nice to be able to handle auto angles too.
--- a/dom/svg/SVGOrientSMILType.h
+++ b/dom/svg/SVGOrientSMILType.h
@@ -5,18 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZILLA_SVGORIENTSMILTYPE_H_
 #define MOZILLA_SVGORIENTSMILTYPE_H_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
-class nsSMILValue;
-
 /**
  * This SMILType class is a special case for the 'orient' attribute on SVG's
  * 'marker' element.
  *
  *   orient = "auto | auto-start-reverse | <angle>"
  *
  * Unusually, this attribute doesn't have just a single corresponding DOM
  * property, but rather is split into two properties: 'orientType' (of type
@@ -29,38 +27,39 @@ class nsSMILValue;
  * SVG_MARKER_ORIENT_AUTO_START_REVERSE constant value for orientType to use;
  * instead, if the attribute is set to "auto-start-reverse",
  * SVG_MARKER_ORIENT_UNKNOWN is used.  Internally, however, we do use a
  * constant with this name.
  */
 
 namespace mozilla {
 
+class SMILValue;
+
 class SVGOrientSMILType : public SMILType {
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SVGOrientSMILType sSingleton;
 
  protected:
   // SMILType Methods
   // -------------------
-  virtual void Init(nsSMILValue& aValue) const override;
-  virtual void Destroy(nsSMILValue&) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Init(SMILValue& aValue) const override;
+  virtual void Destroy(SMILValue&) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SVGOrientSMILType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/svg/SVGPathData.h
+++ b/dom/svg/SVGPathData.h
@@ -7,21 +7,21 @@
 #ifndef MOZILLA_SVGPATHDATA_H__
 #define MOZILLA_SVGPATHDATA_H__
 
 #include "nsCOMPtr.h"
 #include "nsDebug.h"
 #include "nsIContent.h"
 #include "nsINode.h"
 #include "nsIWeakReferenceUtils.h"
+#include "mozilla/dom/SVGElement.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/Types.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/RefPtr.h"
-#include "SVGElement.h"
 #include "nsTArray.h"
 
 #include <string.h>
 
 struct nsSVGMark;
 
 namespace mozilla {
 
@@ -272,17 +272,17 @@ class SVGPathDataAndInfo final : public 
   using SVGPathData::iterator;
   using SVGPathData::operator[];
   using SVGPathData::begin;
   using SVGPathData::end;
   using SVGPathData::SetLength;
 
  private:
   // We must keep a weak reference to our element because we may belong to a
-  // cached baseVal nsSMILValue. See the comments starting at:
+  // cached baseVal SMILValue. See the comments starting at:
   // https://bugzilla.mozilla.org/show_bug.cgi?id=515116#c15
   // See also https://bugzilla.mozilla.org/show_bug.cgi?id=653497
   nsWeakPtr mElement;
 };
 
 }  // namespace mozilla
 
 #endif  // MOZILLA_SVGPATHDATA_H__
--- a/dom/svg/SVGPathSegListSMILType.cpp
+++ b/dom/svg/SVGPathSegListSMILType.cpp
@@ -2,59 +2,59 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGPathSegListSMILType.h"
 
 #include "mozilla/DebugOnly.h"
-#include "nsSMILValue.h"
+#include "mozilla/SMILValue.h"
+#include "SVGPathData.h"
 #include "SVGPathSegUtils.h"
-#include "SVGPathData.h"
 
 using namespace mozilla::dom::SVGPathSeg_Binding;
 
 // Indices of boolean flags within 'arc' segment chunks in path-data arrays
 // (where '0' would correspond to the index of the encoded segment type):
 #define LARGE_ARC_FLAG_IDX 4
 #define SWEEP_FLAG_IDX 5
 
 namespace mozilla {
 
 //----------------------------------------------------------------------
 // nsISMILType implementation
 
-void SVGPathSegListSMILType::Init(nsSMILValue& aValue) const {
+void SVGPathSegListSMILType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
   aValue.mU.mPtr = new SVGPathDataAndInfo();
   aValue.mType = this;
 }
 
-void SVGPathSegListSMILType::Destroy(nsSMILValue& aValue) const {
+void SVGPathSegListSMILType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value type");
   delete static_cast<SVGPathDataAndInfo*>(aValue.mU.mPtr);
   aValue.mU.mPtr = nullptr;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SVGPathSegListSMILType::Assign(nsSMILValue& aDest,
-                                        const nsSMILValue& aSrc) const {
+nsresult SVGPathSegListSMILType::Assign(SMILValue& aDest,
+                                        const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
 
   const SVGPathDataAndInfo* src =
       static_cast<const SVGPathDataAndInfo*>(aSrc.mU.mPtr);
   SVGPathDataAndInfo* dest = static_cast<SVGPathDataAndInfo*>(aDest.mU.mPtr);
 
   return dest->CopyFrom(*src);
 }
 
-bool SVGPathSegListSMILType::IsEqual(const nsSMILValue& aLeft,
-                                     const nsSMILValue& aRight) const {
+bool SVGPathSegListSMILType::IsEqual(const SMILValue& aLeft,
+                                     const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
   return *static_cast<const SVGPathDataAndInfo*>(aLeft.mU.mPtr) ==
          *static_cast<const SVGPathDataAndInfo*>(aRight.mU.mPtr);
 }
 
 static bool ArcFlagsDiffer(SVGPathDataAndInfo::const_iterator aPathData1,
@@ -365,18 +365,18 @@ static void ConvertAllPathSegmentData(
   state.mode = SVGPathTraversalState::eUpdateOnlyStartAndCurrentPos;
   while (aStart < aStartDataEnd && aEnd < aEndDataEnd) {
     ConvertPathSegmentData(aStart, aEnd, aResult, state);
   }
   MOZ_ASSERT(aStart == aStartDataEnd && aEnd == aEndDataEnd,
              "Failed to convert all path segment data! (Corrupt?)");
 }
 
-nsresult SVGPathSegListSMILType::Add(nsSMILValue& aDest,
-                                     const nsSMILValue& aValueToAdd,
+nsresult SVGPathSegListSMILType::Add(SMILValue& aDest,
+                                     const SMILValue& aValueToAdd,
                                      uint32_t aCount) const {
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL type");
   MOZ_ASSERT(aValueToAdd.mType == this, "Incompatible SMIL type");
 
   SVGPathDataAndInfo& dest = *static_cast<SVGPathDataAndInfo*>(aDest.mU.mPtr);
   const SVGPathDataAndInfo& valueToAdd =
       *static_cast<const SVGPathDataAndInfo*>(aValueToAdd.mU.mPtr);
 
@@ -401,32 +401,32 @@ nsresult SVGPathSegListSMILType::Add(nsS
       ConvertAllPathSegmentData(dest.begin(), dest.end(), valueToAdd.begin(),
                                 valueToAdd.end(), dest.begin());
     }
   }
 
   return AddWeightedPathSegLists(1.0, dest, aCount, valueToAdd, dest);
 }
 
-nsresult SVGPathSegListSMILType::ComputeDistance(const nsSMILValue& aFrom,
-                                                 const nsSMILValue& aTo,
+nsresult SVGPathSegListSMILType::ComputeDistance(const SMILValue& aFrom,
+                                                 const SMILValue& aTo,
                                                  double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == this, "Unexpected SMIL type");
   MOZ_ASSERT(aTo.mType == this, "Incompatible SMIL type");
 
   // See https://bugzilla.mozilla.org/show_bug.cgi?id=522306#c18
 
   // SVGContentUtils::ReportToConsole
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-nsresult SVGPathSegListSMILType::Interpolate(const nsSMILValue& aStartVal,
-                                             const nsSMILValue& aEndVal,
+nsresult SVGPathSegListSMILType::Interpolate(const SMILValue& aStartVal,
+                                             const SMILValue& aEndVal,
                                              double aUnitDistance,
-                                             nsSMILValue& aResult) const {
+                                             SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
 
   const SVGPathDataAndInfo& start =
       *static_cast<const SVGPathDataAndInfo*>(aStartVal.mU.mPtr);
   const SVGPathDataAndInfo& end =
--- a/dom/svg/SVGPathSegListSMILType.h
+++ b/dom/svg/SVGPathSegListSMILType.h
@@ -5,52 +5,51 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZILLA_SVGPATHSEGLISTSMILTYPE_H_
 #define MOZILLA_SVGPATHSEGLISTSMILTYPE_H_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
 
 ////////////////////////////////////////////////////////////////////////
 // SVGPathSegListSMILType
 //
 // Operations for animating an SVGPathData.
 //
 class SVGPathSegListSMILType : public SMILType {
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SVGPathSegListSMILType* Singleton() {
     static SVGPathSegListSMILType sSingleton;
     return &sSingleton;
   }
 
  protected:
   // SMILType Methods
   // -------------------
 
-  virtual void Init(nsSMILValue& aValue) const override;
+  virtual void Init(SMILValue& aValue) const override;
 
-  virtual void Destroy(nsSMILValue& aValue) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Destroy(SMILValue& aValue) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SVGPathSegListSMILType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/svg/SVGPointList.h
+++ b/dom/svg/SVGPointList.h
@@ -131,17 +131,17 @@ class SVGPointList {
 /**
  * This SVGPointList subclass is for SVGPointListSMILType which needs a
  * mutable version of SVGPointList. Instances of this class do not have
  * DOM wrappers that need to be kept in sync, so we can safely expose any
  * protected base class methods required by the SMIL code.
  *
  * This class contains a strong reference to the element that instances of
  * this class are being used to animate. This is because the SMIL code stores
- * instances of this class in nsSMILValue objects, some of which are cached.
+ * instances of this class in SMILValue objects, some of which are cached.
  * Holding a strong reference to the element here prevents the element from
  * disappearing out from under the SMIL code unexpectedly.
  */
 class SVGPointListAndInfo : public SVGPointList {
  public:
   explicit SVGPointListAndInfo(dom::SVGElement* aElement = nullptr)
       : mElement(do_GetWeakReference(static_cast<nsINode*>(aElement))) {}
 
@@ -187,17 +187,17 @@ class SVGPointListAndInfo : public SVGPo
     return SVGPointList::operator[](aIndex);
   }
   bool SetLength(uint32_t aNumberOfItems) {
     return SVGPointList::SetLength(aNumberOfItems);
   }
 
  private:
   // We must keep a weak reference to our element because we may belong to a
-  // cached baseVal nsSMILValue. See the comments starting at:
+  // cached baseVal SMILValue. See the comments starting at:
   // https://bugzilla.mozilla.org/show_bug.cgi?id=515116#c15
   // See also https://bugzilla.mozilla.org/show_bug.cgi?id=653497
   nsWeakPtr mElement;
 };
 
 }  // namespace mozilla
 
 #endif  // MOZILLA_SVGPOINTLIST_H__
--- a/dom/svg/SVGPointListSMILType.cpp
+++ b/dom/svg/SVGPointListSMILType.cpp
@@ -1,67 +1,68 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGPointListSMILType.h"
-#include "nsSMILValue.h"
+
+#include "mozilla/FloatingPoint.h"
+#include "mozilla/SMILValue.h"
+#include "nsMathUtils.h"
 #include "SVGPointList.h"
-#include "nsMathUtils.h"
-#include "mozilla/FloatingPoint.h"
 #include <math.h>
 
 namespace mozilla {
 
 /*static*/ SVGPointListSMILType SVGPointListSMILType::sSingleton;
 
 //----------------------------------------------------------------------
 // nsISMILType implementation
 
-void SVGPointListSMILType::Init(nsSMILValue& aValue) const {
+void SVGPointListSMILType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
 
   SVGPointListAndInfo* pointList = new SVGPointListAndInfo();
 
   aValue.mU.mPtr = pointList;
   aValue.mType = this;
 }
 
-void SVGPointListSMILType::Destroy(nsSMILValue& aValue) const {
+void SVGPointListSMILType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value type");
   delete static_cast<SVGPointListAndInfo*>(aValue.mU.mPtr);
   aValue.mU.mPtr = nullptr;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SVGPointListSMILType::Assign(nsSMILValue& aDest,
-                                      const nsSMILValue& aSrc) const {
+nsresult SVGPointListSMILType::Assign(SMILValue& aDest,
+                                      const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
 
   const SVGPointListAndInfo* src =
       static_cast<const SVGPointListAndInfo*>(aSrc.mU.mPtr);
   SVGPointListAndInfo* dest = static_cast<SVGPointListAndInfo*>(aDest.mU.mPtr);
 
   return dest->CopyFrom(*src);
 }
 
-bool SVGPointListSMILType::IsEqual(const nsSMILValue& aLeft,
-                                   const nsSMILValue& aRight) const {
+bool SVGPointListSMILType::IsEqual(const SMILValue& aLeft,
+                                   const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
   return *static_cast<const SVGPointListAndInfo*>(aLeft.mU.mPtr) ==
          *static_cast<const SVGPointListAndInfo*>(aRight.mU.mPtr);
 }
 
-nsresult SVGPointListSMILType::Add(nsSMILValue& aDest,
-                                   const nsSMILValue& aValueToAdd,
+nsresult SVGPointListSMILType::Add(SMILValue& aDest,
+                                   const SMILValue& aValueToAdd,
                                    uint32_t aCount) const {
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL type");
   MOZ_ASSERT(aValueToAdd.mType == this, "Incompatible SMIL type");
 
   SVGPointListAndInfo& dest = *static_cast<SVGPointListAndInfo*>(aDest.mU.mPtr);
   const SVGPointListAndInfo& valueToAdd =
       *static_cast<const SVGPointListAndInfo*>(aValueToAdd.mU.mPtr);
 
@@ -90,18 +91,18 @@ nsresult SVGPointListSMILType::Add(nsSMI
   }
   for (uint32_t i = 0; i < dest.Length(); ++i) {
     dest[i] += aCount * valueToAdd[i];
   }
   dest.SetInfo(valueToAdd.Element());  // propagate target element info!
   return NS_OK;
 }
 
-nsresult SVGPointListSMILType::ComputeDistance(const nsSMILValue& aFrom,
-                                               const nsSMILValue& aTo,
+nsresult SVGPointListSMILType::ComputeDistance(const SMILValue& aFrom,
+                                               const SMILValue& aTo,
                                                double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == this, "Unexpected SMIL type");
   MOZ_ASSERT(aTo.mType == this, "Incompatible SMIL type");
 
   const SVGPointListAndInfo& from =
       *static_cast<const SVGPointListAndInfo*>(aFrom.mU.mPtr);
   const SVGPointListAndInfo& to =
       *static_cast<const SVGPointListAndInfo*>(aTo.mU.mPtr);
@@ -126,20 +127,20 @@ nsresult SVGPointListSMILType::ComputeDi
   if (!IsFinite(distance)) {
     return NS_ERROR_FAILURE;
   }
   aDistance = distance;
 
   return NS_OK;
 }
 
-nsresult SVGPointListSMILType::Interpolate(const nsSMILValue& aStartVal,
-                                           const nsSMILValue& aEndVal,
+nsresult SVGPointListSMILType::Interpolate(const SMILValue& aStartVal,
+                                           const SMILValue& aEndVal,
                                            double aUnitDistance,
-                                           nsSMILValue& aResult) const {
+                                           SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
 
   const SVGPointListAndInfo& start =
       *static_cast<const SVGPointListAndInfo*>(aStartVal.mU.mPtr);
   const SVGPointListAndInfo& end =
--- a/dom/svg/SVGPointListSMILType.h
+++ b/dom/svg/SVGPointListSMILType.h
@@ -5,49 +5,48 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZILLA_SVGPOINTLISTSMILTYPE_H_
 #define MOZILLA_SVGPOINTLISTSMILTYPE_H_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
 
 ////////////////////////////////////////////////////////////////////////
 // SVGPointListSMILType
 //
 // Operations for animating an SVGPointList.
 //
 class SVGPointListSMILType : public SMILType {
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SVGPointListSMILType sSingleton;
 
  protected:
   // SMILType Methods
   // -------------------
 
-  virtual void Init(nsSMILValue& aValue) const override;
+  virtual void Init(SMILValue& aValue) const override;
 
-  virtual void Destroy(nsSMILValue& aValue) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Destroy(SMILValue& aValue) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SVGPointListSMILType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/svg/SVGString.cpp
+++ b/dom/svg/SVGString.cpp
@@ -2,38 +2,38 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGString.h"
 
 #include "mozilla/Move.h"
-#include "nsSVGAttrTearoffTable.h"
-#include "nsSMILValue.h"
+#include "mozilla/SMILValue.h"
 #include "SMILStringType.h"
+#include "SVGAttrTearoffTable.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGString::DOMAnimatedString,
                                                mSVGElement)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGString::DOMAnimatedString)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGString::DOMAnimatedString)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGString::DOMAnimatedString)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
-static inline nsSVGAttrTearoffTable<SVGString, SVGString::DOMAnimatedString>&
+static inline SVGAttrTearoffTable<SVGString, SVGString::DOMAnimatedString>&
 SVGAnimatedStringTearoffTable() {
-  static nsSVGAttrTearoffTable<SVGString, SVGString::DOMAnimatedString>
+  static SVGAttrTearoffTable<SVGString, SVGString::DOMAnimatedString>
       sSVGAnimatedStringTearoffTable;
   return sSVGAnimatedStringTearoffTable;
 }
 
 /* Implementation */
 
 void SVGString::SetBaseValue(const nsAString& aValue, SVGElement* aSVGElement,
                              bool aDoSetAttr) {
@@ -90,40 +90,40 @@ SVGString::DOMAnimatedString::~DOMAnimat
 }
 
 UniquePtr<nsISMILAttr> SVGString::ToSMILAttr(SVGElement* aSVGElement) {
   return MakeUnique<SMILString>(this, aSVGElement);
 }
 
 nsresult SVGString::SMILString::ValueFromString(
     const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/,
-    nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
-  nsSMILValue val(SMILStringType::Singleton());
+    SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
+  SMILValue val(SMILStringType::Singleton());
 
   *static_cast<nsAString*>(val.mU.mPtr) = aStr;
   aValue = std::move(val);
   aPreventCachingOfSandwich = false;
   return NS_OK;
 }
 
-nsSMILValue SVGString::SMILString::GetBaseValue() const {
-  nsSMILValue val(SMILStringType::Singleton());
+SMILValue SVGString::SMILString::GetBaseValue() const {
+  SMILValue val(SMILStringType::Singleton());
   mSVGElement->GetStringBaseValue(mVal->mAttrEnum,
                                   *static_cast<nsAString*>(val.mU.mPtr));
   return val;
 }
 
 void SVGString::SMILString::ClearAnimValue() {
   if (mVal->mAnimVal) {
     mVal->mAnimVal = nullptr;
     mSVGElement->DidAnimateString(mVal->mAttrEnum);
   }
 }
 
-nsresult SVGString::SMILString::SetAnimValue(const nsSMILValue& aValue) {
+nsresult SVGString::SMILString::SetAnimValue(const SMILValue& aValue) {
   NS_ASSERTION(aValue.mType == SMILStringType::Singleton(),
                "Unexpected type to assign animated value");
   if (aValue.mType == SMILStringType::Singleton()) {
     mVal->SetAnimValue(*static_cast<nsAString*>(aValue.mU.mPtr), mSVGElement);
   }
   return NS_OK;
 }
 
--- a/dom/svg/SVGString.h
+++ b/dom/svg/SVGString.h
@@ -9,16 +9,19 @@
 
 #include "nsAutoPtr.h"
 #include "nsError.h"
 #include "mozilla/dom/SVGAnimatedString.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/UniquePtr.h"
 
 namespace mozilla {
+
+class SMILValue;
+
 namespace dom {
 class SVGElement;
 }
 
 class SVGString {
  public:
   typedef mozilla::dom::SVGElement SVGElement;
 
@@ -89,19 +92,19 @@ class SVGString {
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
     SVGString* mVal;
     SVGElement* mSVGElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr,
-        const mozilla::dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,
+        bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 }  // namespace mozilla
 
 #endif  //__NS_SVGSTRING_H__
--- a/dom/svg/SVGTransformListSMILType.cpp
+++ b/dom/svg/SVGTransformListSMILType.cpp
@@ -1,62 +1,63 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGTransformListSMILType.h"
+
+#include "mozilla/SMILValue.h"
+#include "nsCRT.h"
 #include "SVGTransformList.h"
 #include "SVGTransform.h"
-#include "nsSMILValue.h"
-#include "nsCRT.h"
 #include <math.h>
 
 using namespace mozilla;
 using namespace dom::SVGTransform_Binding;
 
 typedef FallibleTArray<SVGTransformSMILData> TransformArray;
 
 //----------------------------------------------------------------------
 // nsISMILType implementation
 
-void SVGTransformListSMILType::Init(nsSMILValue& aValue) const {
+void SVGTransformListSMILType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
 
   TransformArray* transforms = new TransformArray(1);
   aValue.mU.mPtr = transforms;
   aValue.mType = this;
 }
 
-void SVGTransformListSMILType::Destroy(nsSMILValue& aValue) const {
+void SVGTransformListSMILType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value type");
   TransformArray* params = static_cast<TransformArray*>(aValue.mU.mPtr);
   delete params;
   aValue.mU.mPtr = nullptr;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SVGTransformListSMILType::Assign(nsSMILValue& aDest,
-                                          const nsSMILValue& aSrc) const {
+nsresult SVGTransformListSMILType::Assign(SMILValue& aDest,
+                                          const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
 
   const TransformArray* srcTransforms =
       static_cast<const TransformArray*>(aSrc.mU.mPtr);
   TransformArray* dstTransforms = static_cast<TransformArray*>(aDest.mU.mPtr);
   if (!dstTransforms->Assign(*srcTransforms, fallible)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   return NS_OK;
 }
 
-bool SVGTransformListSMILType::IsEqual(const nsSMILValue& aLeft,
-                                       const nsSMILValue& aRight) const {
+bool SVGTransformListSMILType::IsEqual(const SMILValue& aLeft,
+                                       const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected SMIL type");
 
   const TransformArray& leftArr(
       *static_cast<const TransformArray*>(aLeft.mU.mPtr));
   const TransformArray& rightArr(
       *static_cast<const TransformArray*>(aRight.mU.mPtr));
 
@@ -72,18 +73,18 @@ bool SVGTransformListSMILType::IsEqual(c
       return false;
     }
   }
 
   // Found no differences.
   return true;
 }
 
-nsresult SVGTransformListSMILType::Add(nsSMILValue& aDest,
-                                       const nsSMILValue& aValueToAdd,
+nsresult SVGTransformListSMILType::Add(SMILValue& aDest,
+                                       const SMILValue& aValueToAdd,
                                        uint32_t aCount) const {
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL type");
   MOZ_ASSERT(aDest.mType == aValueToAdd.mType, "Incompatible SMIL types");
 
   TransformArray& dstTransforms(*static_cast<TransformArray*>(aDest.mU.mPtr));
   const TransformArray& srcTransforms(
       *static_cast<const TransformArray*>(aValueToAdd.mU.mPtr));
 
@@ -92,18 +93,18 @@ nsresult SVGTransformListSMILType::Add(n
   // a by-animation value.
   //
   // In either case we should have 1 transform in the source array.
   NS_ASSERTION(srcTransforms.Length() == 1,
                "Invalid source transform list to add");
 
   // And we should have 0 or 1 transforms in the dest array.
   // (We can have 0 transforms in the case of by-animation when we are
-  // calculating the by-value as "0 + by". Zero being represented by an
-  // nsSMILValue with an empty transform array.)
+  // calculating the by-value as "0 + by". Zero being represented by a
+  // SMILValue with an empty transform array.)
   NS_ASSERTION(dstTransforms.Length() < 2,
                "Invalid dest transform list to add to");
 
   // Get the individual transforms to add
   const SVGTransformSMILData& srcTransform = srcTransforms[0];
   if (dstTransforms.IsEmpty()) {
     SVGTransformSMILData* result = dstTransforms.AppendElement(
         SVGTransformSMILData(srcTransform.mTransformType), fallible);
@@ -123,17 +124,17 @@ nsresult SVGTransformListSMILType::Add(n
   for (int i = 0; i <= 2; ++i) {
     dstTransform.mParams[i] += srcTransform.mParams[i] * aCount;
   }
 
   return NS_OK;
 }
 
 nsresult SVGTransformListSMILType::SandwichAdd(
-    nsSMILValue& aDest, const nsSMILValue& aValueToAdd) const {
+    SMILValue& aDest, const SMILValue& aValueToAdd) const {
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL type");
   MOZ_ASSERT(aDest.mType == aValueToAdd.mType, "Incompatible SMIL types");
 
   // For <animateTransform> a sandwich add means a matrix post-multiplication
   // which just means to put the additional transform on the end of the array
 
   TransformArray& dstTransforms(*static_cast<TransformArray*>(aDest.mU.mPtr));
   const TransformArray& srcTransforms(
@@ -156,18 +157,18 @@ nsresult SVGTransformListSMILType::Sandw
   const SVGTransformSMILData& srcTransform = srcTransforms[0];
   SVGTransformSMILData* result =
       dstTransforms.AppendElement(srcTransform, fallible);
   NS_ENSURE_TRUE(result, NS_ERROR_OUT_OF_MEMORY);
 
   return NS_OK;
 }
 
-nsresult SVGTransformListSMILType::ComputeDistance(const nsSMILValue& aFrom,
-                                                   const nsSMILValue& aTo,
+nsresult SVGTransformListSMILType::ComputeDistance(const SMILValue& aFrom,
+                                                   const SMILValue& aTo,
                                                    double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == aTo.mType,
              "Can't compute difference between different SMIL types");
   MOZ_ASSERT(aFrom.mType == this, "Unexpected SMIL type");
 
   const TransformArray* fromTransforms =
       static_cast<const TransformArray*>(aFrom.mU.mPtr);
   const TransformArray* toTransforms =
@@ -213,20 +214,20 @@ nsresult SVGTransformListSMILType::Compu
       NS_ERROR("Got bad transform types for calculating distances");
       aDistance = 1.0;
       return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
-nsresult SVGTransformListSMILType::Interpolate(const nsSMILValue& aStartVal,
-                                               const nsSMILValue& aEndVal,
+nsresult SVGTransformListSMILType::Interpolate(const SMILValue& aStartVal,
+                                               const SMILValue& aEndVal,
                                                double aUnitDistance,
-                                               nsSMILValue& aResult) const {
+                                               SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Can't interpolate between different SMIL types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected type for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
 
   const TransformArray& startTransforms =
       (*static_cast<const TransformArray*>(aStartVal.mU.mPtr));
   const TransformArray& endTransforms(
@@ -285,28 +286,28 @@ nsresult SVGTransformListSMILType::Inter
   return NS_OK;
 }
 
 //----------------------------------------------------------------------
 // Transform array accessors
 
 // static
 nsresult SVGTransformListSMILType::AppendTransform(
-    const SVGTransformSMILData& aTransform, nsSMILValue& aValue) {
+    const SVGTransformSMILData& aTransform, SMILValue& aValue) {
   MOZ_ASSERT(aValue.mType == Singleton(), "Unexpected SMIL value type");
 
   TransformArray& transforms = *static_cast<TransformArray*>(aValue.mU.mPtr);
   return transforms.AppendElement(aTransform, fallible)
              ? NS_OK
              : NS_ERROR_OUT_OF_MEMORY;
 }
 
 // static
 bool SVGTransformListSMILType::AppendTransforms(const SVGTransformList& aList,
-                                                nsSMILValue& aValue) {
+                                                SMILValue& aValue) {
   MOZ_ASSERT(aValue.mType == Singleton(), "Unexpected SMIL value type");
 
   TransformArray& transforms = *static_cast<TransformArray*>(aValue.mU.mPtr);
 
   if (!transforms.SetCapacity(transforms.Length() + aList.Length(), fallible))
     return false;
 
   for (uint32_t i = 0; i < aList.Length(); ++i) {
@@ -315,17 +316,17 @@ bool SVGTransformListSMILType::AppendTra
     MOZ_ALWAYS_TRUE(
         transforms.AppendElement(SVGTransformSMILData(aList[i]), fallible));
   }
   return true;
 }
 
 // static
 bool SVGTransformListSMILType::GetTransforms(
-    const nsSMILValue& aValue, FallibleTArray<SVGTransform>& aTransforms) {
+    const SMILValue& aValue, FallibleTArray<SVGTransform>& aTransforms) {
   MOZ_ASSERT(aValue.mType == Singleton(), "Unexpected SMIL value type");
 
   const TransformArray& smilTransforms =
       *static_cast<const TransformArray*>(aValue.mU.mPtr);
 
   aTransforms.Clear();
   if (!aTransforms.SetCapacity(smilTransforms.Length(), fallible)) return false;
 
--- a/dom/svg/SVGTransformListSMILType.h
+++ b/dom/svg/SVGTransformListSMILType.h
@@ -6,20 +6,19 @@
 
 #ifndef SVGTRANSFORMLISTSMILTYPE_H_
 #define SVGTRANSFORMLISTSMILTYPE_H_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 #include "nsTArray.h"
 
-class nsSMILValue;
-
 namespace mozilla {
 
+class SMILValue;
 class SVGTransform;
 class SVGTransformList;
 class SVGTransformSMILData;
 
 ////////////////////////////////////////////////////////////////////////
 // SVGTransformListSMILType
 //
 // Operations for animating an SVGTransformList.
@@ -75,50 +74,49 @@ class SVGTransformSMILData;
 //
 // Similar conditions hold for Interpolate() which in cases such as to-animation
 // may have use a start-value the base value of the target attribute (which as
 // we have seen above can contain 0..n elements) whilst the end-value comes from
 // the <animateTransform> and so can only hold 1 transform.
 //
 class SVGTransformListSMILType : public SMILType {
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SVGTransformListSMILType* Singleton() {
     static SVGTransformListSMILType sSingleton;
     return &sSingleton;
   }
 
  protected:
   // SMILType Methods
   // -------------------
-  virtual void Init(nsSMILValue& aValue) const override;
-  virtual void Destroy(nsSMILValue& aValue) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Init(SMILValue& aValue) const override;
+  virtual void Destroy(SMILValue& aValue) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult SandwichAdd(nsSMILValue& aDest,
-                               const nsSMILValue& aValueToAdd) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult SandwichAdd(SMILValue& aDest,
+                               const SMILValue& aValueToAdd) const override;
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  public:
   // Transform array accessors
   // -------------------------
   static nsresult AppendTransform(const SVGTransformSMILData& aTransform,
-                                  nsSMILValue& aValue);
+                                  SMILValue& aValue);
   static bool AppendTransforms(const SVGTransformList& aList,
-                               nsSMILValue& aValue);
-  static bool GetTransforms(const nsSMILValue& aValue,
+                               SMILValue& aValue);
+  static bool GetTransforms(const SMILValue& aValue,
                             FallibleTArray<SVGTransform>& aTransforms);
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SVGTransformListSMILType() {}
 };
 
 }  // end namespace mozilla
--- a/dom/svg/SVGViewBox.cpp
+++ b/dom/svg/SVGViewBox.cpp
@@ -2,21 +2,21 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGViewBox.h"
 
 #include "mozilla/Move.h"
+#include "mozilla/SMILValue.h"
+#include "mozilla/SVGContentUtils.h"
 #include "nsCharSeparatedTokenizer.h"
-#include "nsSMILValue.h"
+#include "SVGViewBoxSMILType.h"
 #include "nsTextFormatter.h"
-#include "SVGContentUtils.h"
-#include "SVGViewBoxSMILType.h"
 
 namespace mozilla {
 
 #define NUM_VIEWBOX_COMPONENTS 4
 
 /* Implementation of SVGViewBoxRect methods */
 
 bool SVGViewBoxRect::operator==(const SVGViewBoxRect& aOther) const {
@@ -77,21 +77,21 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGViewBox::DOMAnimVal)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
-static nsSVGAttrTearoffTable<SVGViewBox, SVGViewBox::DOMBaseVal>
+static SVGAttrTearoffTable<SVGViewBox, SVGViewBox::DOMBaseVal>
     sBaseSVGViewBoxTearoffTable;
-static nsSVGAttrTearoffTable<SVGViewBox, SVGViewBox::DOMAnimVal>
+static SVGAttrTearoffTable<SVGViewBox, SVGViewBox::DOMAnimVal>
     sAnimSVGViewBoxTearoffTable;
-nsSVGAttrTearoffTable<SVGViewBox, dom::SVGAnimatedRect>
+SVGAttrTearoffTable<SVGViewBox, dom::SVGAnimatedRect>
     SVGViewBox::sSVGAnimatedRectTearoffTable;
 
 /* Implementation of SVGViewBox methods */
 
 void SVGViewBox::Init() {
   mHasBaseVal = false;
   // We shouldn't use mBaseVal for rendering (its usages should be guarded with
   // "mHasBaseVal" checks), but just in case we do by accident, this will
@@ -268,44 +268,44 @@ void SVGViewBox::DOMBaseVal::SetHeight(f
 }
 
 UniquePtr<nsISMILAttr> SVGViewBox::ToSMILAttr(SVGElement* aSVGElement) {
   return MakeUnique<SMILViewBox>(this, aSVGElement);
 }
 
 nsresult SVGViewBox::SMILViewBox ::ValueFromString(
     const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/,
-    nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
+    SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
   SVGViewBoxRect viewBox;
   nsresult res = SVGViewBoxRect::FromString(aStr, &viewBox);
   if (NS_FAILED(res)) {
     return res;
   }
-  nsSMILValue val(&SVGViewBoxSMILType::sSingleton);
+  SMILValue val(&SVGViewBoxSMILType::sSingleton);
   *static_cast<SVGViewBoxRect*>(val.mU.mPtr) = viewBox;
   aValue = std::move(val);
   aPreventCachingOfSandwich = false;
 
   return NS_OK;
 }
 
-nsSMILValue SVGViewBox::SMILViewBox::GetBaseValue() const {
-  nsSMILValue val(&SVGViewBoxSMILType::sSingleton);
+SMILValue SVGViewBox::SMILViewBox::GetBaseValue() const {
+  SMILValue val(&SVGViewBoxSMILType::sSingleton);
   *static_cast<SVGViewBoxRect*>(val.mU.mPtr) = mVal->mBaseVal;
   return val;
 }
 
 void SVGViewBox::SMILViewBox::ClearAnimValue() {
   if (mVal->mAnimVal) {
     mVal->mAnimVal = nullptr;
     mSVGElement->DidAnimateViewBox();
   }
 }
 
-nsresult SVGViewBox::SMILViewBox::SetAnimValue(const nsSMILValue& aValue) {
+nsresult SVGViewBox::SMILViewBox::SetAnimValue(const SMILValue& aValue) {
   NS_ASSERTION(aValue.mType == &SVGViewBoxSMILType::sSingleton,
                "Unexpected type to assign animated value");
   if (aValue.mType == &SVGViewBoxSMILType::sSingleton) {
     SVGViewBoxRect& vb = *static_cast<SVGViewBoxRect*>(aValue.mU.mPtr);
     mVal->SetAnimValue(vb, mSVGElement);
   }
   return NS_OK;
 }
--- a/dom/svg/SVGViewBox.h
+++ b/dom/svg/SVGViewBox.h
@@ -5,26 +5,27 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __NS_SVGVIEWBOX_H__
 #define __NS_SVGVIEWBOX_H__
 
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
+#include "SVGAttrTearoffTable.h"
 #include "mozilla/Attributes.h"
 #include "nsISMILAttr.h"
-#include "nsSVGAttrTearoffTable.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/dom/SVGAnimatedRect.h"
 #include "mozilla/dom/SVGIRect.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
+
 namespace dom {
 class SVGAnimationElement;
 class SVGElement;
 }  // namespace dom
 
 struct SVGViewBoxRect {
   float x, y;
   float width, height;
@@ -191,22 +192,22 @@ class SVGViewBox {
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
     SVGViewBox* mVal;
     SVGElement* mSVGElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr,
-        const mozilla::dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,
+        bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 
-  static nsSVGAttrTearoffTable<SVGViewBox, mozilla::dom::SVGAnimatedRect>
+  static SVGAttrTearoffTable<SVGViewBox, mozilla::dom::SVGAnimatedRect>
       sSVGAnimatedRectTearoffTable;
 };
 
 }  // namespace mozilla
 
 #endif  // __NS_SVGVIEWBOX_H__
--- a/dom/svg/SVGViewBoxSMILType.cpp
+++ b/dom/svg/SVGViewBoxSMILType.cpp
@@ -1,75 +1,75 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SVGViewBoxSMILType.h"
-#include "nsSMILValue.h"
+
+#include "mozilla/SMILValue.h"
+#include "nsDebug.h"
 #include "SVGViewBox.h"
-#include "nsDebug.h"
 #include <math.h>
 
 namespace mozilla {
 
 /*static*/ SVGViewBoxSMILType SVGViewBoxSMILType::sSingleton;
 
-void SVGViewBoxSMILType::Init(nsSMILValue& aValue) const {
+void SVGViewBoxSMILType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
 
   aValue.mU.mPtr = new SVGViewBoxRect();
   aValue.mType = this;
 }
 
-void SVGViewBoxSMILType::Destroy(nsSMILValue& aValue) const {
+void SVGViewBoxSMILType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value");
   delete static_cast<SVGViewBoxRect*>(aValue.mU.mPtr);
   aValue.mU.mPtr = nullptr;
   aValue.mType = SMILNullType::Singleton();
 }
 
-nsresult SVGViewBoxSMILType::Assign(nsSMILValue& aDest,
-                                    const nsSMILValue& aSrc) const {
+nsresult SVGViewBoxSMILType::Assign(SMILValue& aDest,
+                                    const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
 
   const SVGViewBoxRect* src = static_cast<const SVGViewBoxRect*>(aSrc.mU.mPtr);
   SVGViewBoxRect* dst = static_cast<SVGViewBoxRect*>(aDest.mU.mPtr);
   *dst = *src;
   return NS_OK;
 }
 
-bool SVGViewBoxSMILType::IsEqual(const nsSMILValue& aLeft,
-                                 const nsSMILValue& aRight) const {
+bool SVGViewBoxSMILType::IsEqual(const SMILValue& aLeft,
+                                 const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
   const SVGViewBoxRect* leftBox =
       static_cast<const SVGViewBoxRect*>(aLeft.mU.mPtr);
   const SVGViewBoxRect* rightBox = static_cast<SVGViewBoxRect*>(aRight.mU.mPtr);
   return *leftBox == *rightBox;
 }
 
-nsresult SVGViewBoxSMILType::Add(nsSMILValue& aDest,
-                                 const nsSMILValue& aValueToAdd,
+nsresult SVGViewBoxSMILType::Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                                  uint32_t aCount) const {
   MOZ_ASSERT(aValueToAdd.mType == aDest.mType, "Trying to add invalid types");
   MOZ_ASSERT(aValueToAdd.mType == this, "Unexpected source type");
 
   // See https://bugzilla.mozilla.org/show_bug.cgi?id=541884#c3 and the two
   // comments that follow that one for arguments for and against allowing
   // viewBox to be additive.
 
   return NS_ERROR_FAILURE;
 }
 
-nsresult SVGViewBoxSMILType::ComputeDistance(const nsSMILValue& aFrom,
-                                             const nsSMILValue& aTo,
+nsresult SVGViewBoxSMILType::ComputeDistance(const SMILValue& aFrom,
+                                             const SMILValue& aTo,
                                              double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == aTo.mType, "Trying to compare different types");
   MOZ_ASSERT(aFrom.mType == this, "Unexpected source type");
 
   const SVGViewBoxRect* from =
       static_cast<const SVGViewBoxRect*>(aFrom.mU.mPtr);
   const SVGViewBoxRect* to = static_cast<const SVGViewBoxRect*>(aTo.mU.mPtr);
 
@@ -89,20 +89,20 @@ nsresult SVGViewBoxSMILType::ComputeDist
   float dBottom = (to->y + to->height) - (from->y + from->height);
 
   aDistance =
       sqrt(dLeft * dLeft + dTop * dTop + dRight * dRight + dBottom * dBottom);
 
   return NS_OK;
 }
 
-nsresult SVGViewBoxSMILType::Interpolate(const nsSMILValue& aStartVal,
-                                         const nsSMILValue& aEndVal,
+nsresult SVGViewBoxSMILType::Interpolate(const SMILValue& aStartVal,
+                                         const SMILValue& aEndVal,
                                          double aUnitDistance,
-                                         nsSMILValue& aResult) const {
+                                         SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
 
   const SVGViewBoxRect* start =
       static_cast<const SVGViewBoxRect*>(aStartVal.mU.mPtr);
   const SVGViewBoxRect* end =
--- a/dom/svg/SVGViewBoxSMILType.h
+++ b/dom/svg/SVGViewBoxSMILType.h
@@ -5,42 +5,41 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZILLA_SVGVIEWBOXSMILTYPE_H_
 #define MOZILLA_SVGVIEWBOXSMILTYPE_H_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/SMILType.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
 
 class SVGViewBoxSMILType : public SMILType {
  public:
-  // Singleton for nsSMILValue objects to hold onto.
+  // Singleton for SMILValue objects to hold onto.
   static SVGViewBoxSMILType sSingleton;
 
  protected:
   // SMILType Methods
   // -------------------
-  virtual void Init(nsSMILValue& aValue) const override;
-  virtual void Destroy(nsSMILValue&) const override;
-  virtual nsresult Assign(nsSMILValue& aDest,
-                          const nsSMILValue& aSrc) const override;
-  virtual bool IsEqual(const nsSMILValue& aLeft,
-                       const nsSMILValue& aRight) const override;
-  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
+  virtual void Init(SMILValue& aValue) const override;
+  virtual void Destroy(SMILValue&) const override;
+  virtual nsresult Assign(SMILValue& aDest,
+                          const SMILValue& aSrc) const override;
+  virtual bool IsEqual(const SMILValue& aLeft,
+                       const SMILValue& aRight) const override;
+  virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                        uint32_t aCount) const override;
-  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
-                                   const nsSMILValue& aTo,
+  virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
                                    double& aDistance) const override;
-  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
-                               const nsSMILValue& aEndVal, double aUnitDistance,
-                               nsSMILValue& aResult) const override;
+  virtual nsresult Interpolate(const SMILValue& aStartVal,
+                               const SMILValue& aEndVal, double aUnitDistance,
+                               SMILValue& aResult) const override;
 
  private:
   // Private constructor: prevent instances beyond my singleton.
   constexpr SVGViewBoxSMILType() {}
 };
 
 }  // namespace mozilla
 
--- a/dom/svg/SVGViewportElement.cpp
+++ b/dom/svg/SVGViewportElement.cpp
@@ -6,35 +6,35 @@
 
 #include "mozilla/dom/SVGViewportElement.h"
 
 #include <stdint.h>
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/ContentEvents.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/Likely.h"
+#include "mozilla/SMILTypes.h"
+#include "mozilla/SVGContentUtils.h"
+#include "mozilla/dom/Document.h"
 #include "mozilla/dom/SVGLengthBinding.h"
 #include "mozilla/dom/SVGMatrix.h"
 #include "mozilla/dom/SVGViewElement.h"
 
 #include "DOMSVGLength.h"
 #include "DOMSVGPoint.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nsFrameSelection.h"
 #include "nsError.h"
 #include "nsGkAtoms.h"
-#include "mozilla/dom/Document.h"
 #include "nsIFrame.h"
 #include "nsIPresShell.h"
-#include "nsISVGSVGFrame.h"  //XXX
+#include "nsISVGSVGFrame.h"
 #include "nsLayoutUtils.h"
 #include "nsStyleUtil.h"
-#include "nsSMILTypes.h"
-#include "SVGContentUtils.h"
 
 #include <algorithm>
 #include "prtime.h"
 
 using namespace mozilla::gfx;
 
 namespace mozilla {
 namespace dom {
--- a/dom/svg/nsSVGLength2.cpp
+++ b/dom/svg/nsSVGLength2.cpp
@@ -2,27 +2,27 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsSVGLength2.h"
 
 #include "mozilla/ArrayUtils.h"
+#include "mozilla/SMILValue.h"
 #include "mozilla/dom/SVGAnimatedLength.h"
 #include "mozilla/dom/SVGViewportElement.h"
-#include "nsContentUtils.h"  // NS_ENSURE_FINITE
+#include "nsContentUtils.h"
+#include "DOMSVGLength.h"
 #include "nsIFrame.h"
+#include "LayoutLogging.h"
 #include "SMILFloatType.h"
-#include "nsSMILValue.h"
-#include "nsSVGAttrTearoffTable.h"
+#include "SVGAttrTearoffTable.h"
 #include "nsSVGIntegrationUtils.h"
 #include "nsTextFormatter.h"
-#include "DOMSVGLength.h"
-#include "LayoutLogging.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 static const nsStaticAtom* const unitMap[] = {
     nullptr, /* SVG_LENGTHTYPE_UNKNOWN */
     nullptr, /* SVG_LENGTHTYPE_NUMBER */
     nsGkAtoms::percentage,
@@ -30,17 +30,17 @@ static const nsStaticAtom* const unitMap
     nsGkAtoms::ex,
     nsGkAtoms::px,
     nsGkAtoms::cm,
     nsGkAtoms::mm,
     nsGkAtoms::in,
     nsGkAtoms::pt,
     nsGkAtoms::pc};
 
-static nsSVGAttrTearoffTable<nsSVGLength2, SVGAnimatedLength>
+static SVGAttrTearoffTable<nsSVGLength2, SVGAnimatedLength>
     sSVGAnimatedLengthTearoffTable;
 
 /* Helper functions */
 
 static bool IsValidUnitType(uint16_t unit) {
   if (unit > SVGLength_Binding::SVG_LENGTHTYPE_UNKNOWN &&
       unit <= SVGLength_Binding::SVG_LENGTHTYPE_PC)
     return true;
@@ -415,49 +415,49 @@ SVGAnimatedLength::~SVGAnimatedLength() 
 }
 
 UniquePtr<nsISMILAttr> nsSVGLength2::ToSMILAttr(SVGElement* aSVGElement) {
   return MakeUnique<SMILLength>(this, aSVGElement);
 }
 
 nsresult nsSVGLength2::SMILLength::ValueFromString(
     const nsAString& aStr, const SVGAnimationElement* /*aSrcElement*/,
-    nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
+    SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
   float value;
   uint16_t unitType;
 
   if (!GetValueFromString(aStr, value, &unitType)) {
     return NS_ERROR_DOM_SYNTAX_ERR;
   }
 
-  nsSMILValue val(SMILFloatType::Singleton());
+  SMILValue val(SMILFloatType::Singleton());
   val.mU.mDouble = value * mVal->GetPixelsPerUnit(mSVGElement, unitType);
   aValue = val;
   aPreventCachingOfSandwich =
       (unitType == SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE ||
        unitType == SVGLength_Binding::SVG_LENGTHTYPE_EMS ||
        unitType == SVGLength_Binding::SVG_LENGTHTYPE_EXS);
 
   return NS_OK;
 }
 
-nsSMILValue nsSVGLength2::SMILLength::GetBaseValue() const {
-  nsSMILValue val(SMILFloatType::Singleton());
+SMILValue nsSVGLength2::SMILLength::GetBaseValue() const {
+  SMILValue val(SMILFloatType::Singleton());
   val.mU.mDouble = mVal->GetBaseValue(mSVGElement);
   return val;
 }
 
 void nsSVGLength2::SMILLength::ClearAnimValue() {
   if (mVal->mIsAnimated) {
     mVal->mIsAnimated = false;
     mVal->mAnimVal = mVal->mBaseVal;
     mSVGElement->DidAnimateLength(mVal->mAttrEnum);
   }
 }
 
-nsresult nsSVGLength2::SMILLength::SetAnimValue(const nsSMILValue& aValue) {
+nsresult nsSVGLength2::SMILLength::SetAnimValue(const SMILValue& aValue) {
   NS_ASSERTION(aValue.mType == SMILFloatType::Singleton(),
                "Unexpected type to assign animated value");
   if (aValue.mType == SMILFloatType::Singleton()) {
     return mVal->SetAnimValue(float(aValue.mU.mDouble), mSVGElement);
   }
   return NS_OK;
 }
--- a/dom/svg/nsSVGLength2.h
+++ b/dom/svg/nsSVGLength2.h
@@ -3,31 +3,33 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __NS_SVGLENGTH2_H__
 #define __NS_SVGLENGTH2_H__
 
 #include "mozilla/Attributes.h"
+#include "mozilla/SVGContentUtils.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/dom/SVGLengthBinding.h"
+#include "mozilla/dom/SVGElement.h"
+#include "mozilla/gfx/Rect.h"
 #include "nsCoord.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
 #include "nsISMILAttr.h"
 #include "nsMathUtils.h"
-#include "SVGElement.h"
-#include "SVGContentUtils.h"
-#include "mozilla/gfx/Rect.h"
 
 class nsIFrame;
-class nsSMILValue;
 
 namespace mozilla {
+
+class SMILValue;
+
 namespace dom {
 class DOMSVGLength;
 class SVGAnimatedLength;
 class SVGAnimationElement;
 class SVGViewportElement;
 }  // namespace dom
 }  // namespace mozilla
 
@@ -205,17 +207,17 @@ class nsSVGLength2 {
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
     nsSVGLength2* mVal;
     SVGElement* mSVGElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr,
-        const mozilla::dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,
+        bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 #endif  //  __NS_SVGLENGTH2_H__
--- a/dom/svg/nsSVGNumber2.cpp
+++ b/dom/svg/nsSVGNumber2.cpp
@@ -1,28 +1,29 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsSVGNumber2.h"
+
 #include "mozilla/Attributes.h"
-#include "nsContentUtils.h"  // NS_ENSURE_FINITE
+#include "mozilla/SMILValue.h"
+#include "mozilla/SVGContentUtils.h"
+#include "nsContentUtils.h"
 #include "SMILFloatType.h"
-#include "nsSMILValue.h"
-#include "nsSVGAttrTearoffTable.h"
-#include "SVGContentUtils.h"
+#include "SVGAttrTearoffTable.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 /* Implementation */
 
-static nsSVGAttrTearoffTable<nsSVGNumber2, nsSVGNumber2::DOMAnimatedNumber>
+static SVGAttrTearoffTable<nsSVGNumber2, nsSVGNumber2::DOMAnimatedNumber>
     sSVGAnimatedNumberTearoffTable;
 
 static bool GetValueFromString(const nsAString& aString,
                                bool aPercentagesAllowed, float& aValue) {
   RangedPtr<const char16_t> iter = SVGContentUtils::GetStartRangedPtr(aString);
   const RangedPtr<const char16_t> end =
       SVGContentUtils::GetEndRangedPtr(aString);
 
@@ -111,48 +112,48 @@ nsSVGNumber2::DOMAnimatedNumber::~DOMAni
 }
 
 UniquePtr<nsISMILAttr> nsSVGNumber2::ToSMILAttr(SVGElement* aSVGElement) {
   return MakeUnique<SMILNumber>(this, aSVGElement);
 }
 
 nsresult nsSVGNumber2::SMILNumber::ValueFromString(
     const nsAString& aStr,
-    const mozilla::dom::SVGAnimationElement* /*aSrcElement*/,
-    nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
+    const mozilla::dom::SVGAnimationElement* /*aSrcElement*/, SMILValue& aValue,
+    bool& aPreventCachingOfSandwich) const {
   float value;
 
   if (!GetValueFromString(
           aStr, mSVGElement->NumberAttrAllowsPercentage(mVal->mAttrEnum),
           value)) {
     return NS_ERROR_DOM_SYNTAX_ERR;
   }
 
-  nsSMILValue val(SMILFloatType::Singleton());
+  SMILValue val(SMILFloatType::Singleton());
   val.mU.mDouble = value;
   aValue = val;
   aPreventCachingOfSandwich = false;
 
   return NS_OK;
 }
 
-nsSMILValue nsSVGNumber2::SMILNumber::GetBaseValue() const {
-  nsSMILValue val(SMILFloatType::Singleton());
+SMILValue nsSVGNumber2::SMILNumber::GetBaseValue() const {
+  SMILValue val(SMILFloatType::Singleton());
   val.mU.mDouble = mVal->mBaseVal;
   return val;
 }
 
 void nsSVGNumber2::SMILNumber::ClearAnimValue() {
   if (mVal->mIsAnimated) {
     mVal->mIsAnimated = false;
     mVal->mAnimVal = mVal->mBaseVal;
     mSVGElement->DidAnimateNumber(mVal->mAttrEnum);
   }
 }
 
-nsresult nsSVGNumber2::SMILNumber::SetAnimValue(const nsSMILValue& aValue) {
+nsresult nsSVGNumber2::SMILNumber::SetAnimValue(const SMILValue& aValue) {
   NS_ASSERTION(aValue.mType == SMILFloatType::Singleton(),
                "Unexpected type to assign animated value");
   if (aValue.mType == SMILFloatType::Singleton()) {
     mVal->SetAnimValue(float(aValue.mU.mDouble), mSVGElement);
   }
   return NS_OK;
 }
--- a/dom/svg/nsSVGNumber2.h
+++ b/dom/svg/nsSVGNumber2.h
@@ -12,19 +12,20 @@
 #include "nsISMILAttr.h"
 #include "nsMathUtils.h"
 #include "SVGElement.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/dom/SVGAnimatedNumber.h"
 #include "mozilla/UniquePtr.h"
 
-class nsSMILValue;
+namespace mozilla {
 
-namespace mozilla {
+class SMILValue;
+
 namespace dom {
 class SVGAnimationElement;
 }  // namespace dom
 }  // namespace mozilla
 
 class nsSVGNumber2 {
  public:
   typedef mozilla::dom::SVGElement SVGElement;
@@ -93,17 +94,17 @@ class nsSVGNumber2 {
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
     nsSVGNumber2* mVal;
     SVGElement* mSVGElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(
         const nsAString& aStr,
-        const mozilla::dom::SVGAnimationElement* aSrcElement,
-        nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
-    virtual nsSMILValue GetBaseValue() const override;
+        const mozilla::dom::SVGAnimationElement* aSrcElement, SMILValue& aValue,
+        bool& aPreventCachingOfSandwich) const override;
+    virtual SMILValue GetBaseValue() const override;
     virtual void ClearAnimValue() override;
-    virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
+    virtual nsresult SetAnimValue(const SMILValue& aValue) override;
   };
 };
 
 #endif  //__NS_SVGNUMBER2_H__
--- a/dom/tests/mochitest/localstorage/mochitest.ini
+++ b/dom/tests/mochitest/localstorage/mochitest.ini
@@ -45,9 +45,8 @@ skip-if = toolkit == 'android' #TIMED_OU
 [test_localStorageQuotaSessionOnly.html]
 skip-if = toolkit == 'android' || (verify && (os == 'linux' || os == 'mac' || os == 'win')) #TIMED_OUT
 [test_localStorageQuotaSessionOnly2.html]
 skip-if = true # bug 1347690
 [test_localStorageReplace.html]
 skip-if = toolkit == 'android'
 [test_storageConstructor.html]
 [test_localStorageSessionPrefOverride.html]
-[test_firstPartyOnlyPermission.html]
deleted file mode 100644
--- a/dom/tests/mochitest/localstorage/test_firstPartyOnlyPermission.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title>first party storage permission test</title>
-
-<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
-<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-
-<script type="text/javascript">
-  TRY_ACCESS_SESSION_STORAGE =
-    'http://example.com/tests/dom/tests/mochitest/localstorage/file_tryAccessSessionStorage.html';
-
-  add_task(async function() {
-    await SpecialPowers.pushPrefEnv({
-      set: [['network.cookie.cookieBehavior', SpecialPowers.Ci.nsICookieService.BEHAVIOR_REJECT]],
-    });
-
-    try {
-      sessionStorage.setItem("blocked", "blocked");
-      ok(false, "Shouldn't be available yet");
-    } catch (ex) {
-      ok(true, "Shouldn't be available yet");
-    }
-
-    await new Promise(resolve => SpecialPowers.pushPermissions([{
-      type: 'cookie',
-      allow: SpecialPowers.Ci.nsICookiePermission.ACCESS_ALLOW_FIRST_PARTY_ONLY,
-      context: document,
-    }], resolve));
-
-    // With the permission set to ACCESS_ALLOW_FIRST_PARTY_ONLY, we should be
-    // able to run it from this iframe (as we are first party with the test
-    // runner parent document).
-    try {
-      sessionStorage.setItem("blocked", "blocked");
-      ok(true, "Should be available");
-    } catch (ex) {
-      ok(false, "Should be available");
-    }
-
-    // A third party iframe should not have access however.
-    await new Promise(resolve => {
-      window.onmessage = evt => {
-        window.onmessage = null;
-        is(evt.data, "sessionStorage=false");
-        resolve();
-      };
-
-      let iframe = document.createElement('iframe');
-      iframe.setAttribute('src', TRY_ACCESS_SESSION_STORAGE);
-      document.body.appendChild(iframe);
-    });
-  });
-
-</script>
-
-</head>
-
-<body>
-
-</body>
-</html>
--- a/extensions/cookie/nsCookiePermission.cpp
+++ b/extensions/cookie/nsCookiePermission.cpp
@@ -153,60 +153,31 @@ nsCookiePermission::CanSetCookie(nsIURI 
 
   *aResult = kDefaultPolicy;
 
   // Lazily initialize ourselves
   if (!EnsureInitialized()) return NS_ERROR_UNEXPECTED;
 
   uint32_t perm;
   mPermMgr->TestPermission(aURI, kPermissionType, &perm);
-  bool isThirdParty = false;
   switch (perm) {
     case nsICookiePermission::ACCESS_SESSION:
       *aIsSession = true;
       MOZ_FALLTHROUGH;
 
     case nsICookiePermission::ACCESS_ALLOW:
       *aResult = true;
       break;
 
     case nsICookiePermission::ACCESS_DENY:
       *aResult = false;
       break;
 
-    case nsICookiePermission::ACCESS_ALLOW_FIRST_PARTY_ONLY:
-      mThirdPartyUtil->IsThirdPartyChannel(aChannel, aURI, &isThirdParty);
-      // If it's third party, we can't set the cookie
-      if (isThirdParty) *aResult = false;
-      break;
-
-    case nsICookiePermission::ACCESS_LIMIT_THIRD_PARTY:
-      mThirdPartyUtil->IsThirdPartyChannel(aChannel, aURI, &isThirdParty);
-      // If it's third party, check whether cookies are already set
-      if (isThirdParty) {
-        nsresult rv;
-        nsCOMPtr<nsICookieManager> cookieManager =
-            do_GetService(NS_COOKIEMANAGER_CONTRACTID, &rv);
-        if (NS_FAILED(rv)) {
-          *aResult = false;
-          break;
-        }
-        uint32_t priorCookieCount = 0;
-        nsAutoCString hostFromURI;
-        aURI->GetHost(hostFromURI);
-        cookieManager->CountCookiesFromHost(hostFromURI, &priorCookieCount);
-        *aResult = priorCookieCount != 0;
-      }
-      break;
-
     default:
-      // the permission manager has nothing to say about this cookie -
-      // so, we apply the default prefs to it.
-      NS_ASSERTION(perm == nsIPermissionManager::UNKNOWN_ACTION,
-                   "unknown permission");
+      // Here we can have any legacy permission value.
 
       // now we need to figure out what type of accept policy we're dealing with
       // if we accept cookies normally, just bail and return
       if (mCookiesLifetimePolicy == ACCEPT_NORMALLY) {
         *aResult = true;
         return NS_OK;
       }
 
--- a/extensions/cookie/test/unit/test_cookies_thirdparty.js
+++ b/extensions/cookie/test/unit/test_cookies_thirdparty.js
@@ -54,94 +54,9 @@ function run_test() {
   Services.prefs.setIntPref("network.cookie.cookieBehavior", 3);
   do_set_cookies(uri1, channel1, true, [0, 1, 2, 3]);
   Services.cookies.removeAll();
   do_set_cookies(uri1, channel2, true, [0, 0, 0, 0]);
   Services.cookies.removeAll();
   do_set_single_http_cookie(uri1, channel1, 1);
   do_set_cookies(uri1, channel2, true, [2, 3, 4, 5]);
   Services.cookies.removeAll();
-
-  // Test per-site 3rd party cookie blocking with cookies enabled
-  Services.prefs.setIntPref("network.cookie.cookieBehavior", 0);
-  var kPermissionType = "cookie";
-  var ALLOW_FIRST_PARTY_ONLY = 9;
-  // ALLOW_FIRST_PARTY_ONLY overrides
-  Services.perms.add(uri1, kPermissionType, ALLOW_FIRST_PARTY_ONLY);
-  do_set_cookies(uri1, channel1, true, [0, 1, 1, 2]);
-  Services.cookies.removeAll();
-  do_set_cookies(uri1, channel2, true, [0, 0, 0, 0]);
-  Services.cookies.removeAll();
-
-  // Test per-site 3rd party cookie blocking with 3rd party cookies disabled
-  Services.prefs.setIntPref("network.cookie.cookieBehavior", 1);
-  do_set_cookies(uri1, channel1, true, [0, 1, 1, 2]);
-  Services.cookies.removeAll();
-  // No preference has been set for uri2, but it should act as if
-  // ALLOW_FIRST_PARTY_ONLY has been set
-  do_set_cookies(uri2, channel2, true, [0, 1, 1, 2]);
-  Services.cookies.removeAll();
-  do_set_cookies(uri1, channel2, true, [0, 0, 0, 0]);
-  Services.cookies.removeAll();
-
-  // Test per-site 3rd party cookie blocking with 3rd party cookies limited
-  Services.prefs.setIntPref("network.cookie.cookieBehavior", 3);
-  do_set_cookies(uri1, channel1, true, [0, 1, 1, 2]);
-  Services.cookies.removeAll();
-  // No preference has been set for uri2, but it should act as if
-  // LIMIT_THIRD_PARTY has been set
-  do_set_cookies(uri2, channel2, true, [0, 1, 2, 3]);
-  Services.cookies.removeAll();
-  do_set_single_http_cookie(uri2, channel2, 1);
-  do_set_cookies(uri2, channel2, true, [2, 3, 4, 5]);
-  Services.cookies.removeAll();
-  do_set_cookies(uri1, channel2, true, [0, 0, 0, 0]);
-  Services.cookies.removeAll();
-  do_set_single_http_cookie(uri1, channel1, 1);
-  do_set_cookies(uri1, channel2, true, [1, 1, 1, 1]);
-  Services.cookies.removeAll();
-
-  // Test per-site 3rd party cookie limiting with cookies enabled
-  Services.prefs.setIntPref("network.cookie.cookieBehavior", 0);
-  var kPermissionType = "cookie";
-  var LIMIT_THIRD_PARTY = 10;
-  // LIMIT_THIRD_PARTY overrides
-  Services.perms.add(uri1, kPermissionType, LIMIT_THIRD_PARTY);
-  do_set_cookies(uri1, channel1, true, [0, 1, 2, 3]);
-  Services.cookies.removeAll();
-  do_set_cookies(uri1, channel2, true, [0, 0, 0, 0]);
-  Services.cookies.removeAll();
-  do_set_single_http_cookie(uri1, channel1, 1);
-  do_set_cookies(uri1, channel2, true, [2, 3, 4, 5]);
-  Services.cookies.removeAll();
-
-  // Test per-site 3rd party cookie limiting with 3rd party cookies disabled
-  Services.prefs.setIntPref("network.cookie.cookieBehavior", 1);
-  do_set_cookies(uri1, channel1, true, [0, 1, 2, 3]);
-  Services.cookies.removeAll();
-  // No preference has been set for uri2, but it should act as if
-  // ALLOW_FIRST_PARTY_ONLY has been set
-  do_set_cookies(uri2, channel2, true, [0, 1, 1, 2]);
-  Services.cookies.removeAll();
-  do_set_cookies(uri1, channel2, true, [0, 0, 0, 0]);
-  Services.cookies.removeAll();
-  do_set_single_http_cookie(uri1, channel1, 1);
-  do_set_cookies(uri1, channel2, true, [2, 3, 4, 5]);
-  Services.cookies.removeAll();
-
-  // Test per-site 3rd party cookie limiting with 3rd party cookies limited
-  Services.prefs.setIntPref("network.cookie.cookieBehavior", 3);
-  do_set_cookies(uri1, channel1, true, [0, 1, 2, 3]);
-  Services.cookies.removeAll();
-  // No preference has been set for uri2, but it should act as if
-  // LIMIT_THIRD_PARTY has been set
-  do_set_cookies(uri2, channel2, true, [0, 1, 2, 3]);
-  Services.cookies.removeAll();
-  do_set_single_http_cookie(uri2, channel2, 1);
-  do_set_cookies(uri2, channel2, true, [2, 3, 4, 5]);
-  Services.cookies.removeAll();
-  do_set_cookies(uri1, channel2, true, [0, 0, 0, 0]);
-  Services.cookies.removeAll();
-  do_set_single_http_cookie(uri1, channel1, 1);
-  do_set_cookies(uri1, channel2, true, [2, 3, 4, 5]);
-  Services.cookies.removeAll();
 }
-
--- a/extensions/spellcheck/locales/en-US/hunspell/en-US.dic
+++ b/extensions/spellcheck/locales/en-US/hunspell/en-US.dic
@@ -1,9 +1,9 @@
-52975
+52987
 0/nm
 0th/pt
 1/n1
 1st/p
 1th/tc
 2/nm
 2nd/p
 2th/tc
@@ -1985,16 +1985,17 @@ Byronic/M
 Byzantine/MS
 Byzantium/M
 C/SMD
 CA
 CAD/M
 CAI
 CAM
 CAP
+CAPTCHA
 CARE
 CATV
 CB
 CBC/M
 CBS/M
 CCTV
 CCU
 CD/SM
@@ -17305,16 +17306,17 @@ bombardier/MS
 bombardment/SM
 bombast/M
 bombastic
 bombastically
 bomber/M
 bombproof
 bombshell/SM
 bombsite/S
+bona
 bonanza/MS
 bonbon/MS
 bonce/S
 bond/SGMD
 bondage/M
 bondholder/MS
 bonding/M
 bondman/M
@@ -18498,16 +18500,17 @@ capsize/DSG
 capstan/SM
 capstone/MS
 capsular
 capsule/DSMG
 capsulize/DSG
 capt
 captain/SMDG
 captaincy/SM
+captcha
 caption/SMDG
 captious/YP
 captiousness/M
 captivate/DSGN
 captivation/M
 captivator/SM
 captive/SM
 captivity/SM
@@ -22457,16 +22460,17 @@ deficit/SM
 defilement/M
 definable/IU
 define/AGDS
 defined/U
 definer/MS
 definite/IYVP
 definiteness/IM
 definition/AM
+definitional/Y
 definitions
 definitive/Y
 deflate/GNDS
 deflation/M
 deflationary
 deflect/DGVS
 deflection/MS
 deflector/SM
@@ -24297,16 +24301,18 @@ economizer/M
 economy/SM
 ecosystem/MS
 ecotourism/M
 ecotourist/MS
 ecru/M
 ecstasy/SM
 ecstatic
 ecstatically
+ectopic
+ectopically
 ecu/S
 ecumenical/Y
 ecumenicism/M
 ecumenism/M
 eczema/M
 ed/ACSM
 edamame
 eddy/DSMG
@@ -25708,16 +25714,17 @@ extant
 extemporaneous/PY
 extemporaneousness/M
 extempore
 extemporization/M
 extemporize/GDS
 extend/SZGDRB
 extender/M
 extendible
+extensibility
 extensible
 extension/SM
 extensional
 extensive/YP
 extensiveness/M
 extent/SM
 extenuate/DSGN
 extenuation/M
@@ -26290,16 +26297,17 @@ fictionalize/DSG
 fictitious/Y
 fictive
 ficus/M
 fiddle/DRSMZG
 fiddler/M
 fiddlesticks
 fiddly/TR
 fidelity/IM
+fides
 fidget/SGMD
 fidgety
 fiduciary/SM
 fie
 fief/MS
 fiefdom/MS
 field/ISMRZ
 fielded
@@ -27217,16 +27225,17 @@ fragrant/Y
 frail/RYTP
 frailness/M
 frailty/SM
 frame/DRSMZG
 framed/U
 framer/M
 framework/SM
 franc/SM
+franca
 franchise's
 franchise/EDSG
 franchisee/SM
 franchiser/SM
 franchisor/SM
 francium/M
 francophone
 frangibility/M
@@ -33452,16 +33461,17 @@ linesmen
 lineup/MS
 ling/M
 linger/ZGJDRS
 lingerer/M
 lingerie/M
 lingering/Y
 lingo/M
 lingoes
+lingua
 lingual
 linguine/M
 linguini/SM
 linguist/SM
 linguistic/S
 linguistical/Y
 linguistics/M
 liniment/SM
@@ -38301,16 +38311,18 @@ oxidize/ZGDRS
 oxidizer/M
 oxtail/S
 oxyacetylene/M
 oxygen/M
 oxygenate/DSGN
 oxygenation/M
 oxymora
 oxymoron/M
+oxymoronic
+oxymoronically
 oy
 oyes
 oyez
 oyster/SM
 oz
 ozone/M
 p/NRXTGJ
 pH
@@ -41930,17 +41942,17 @@ rambunctiousness/M
 rambutan/S
 ramekin/SM
 ramie/M
 ramification/M
 ramify/DSXNG
 ramjet/SM
 rammed
 ramming
-ramp/GMS
+ramp/GMSD
 rampage/DSMG
 rampancy/M
 rampant/Y
 rampart/SM
 ramrod/SM
 ramrodded
 ramrodding
 ramshackle
--- a/gfx/2d/ScaledFontDWrite.cpp
+++ b/gfx/2d/ScaledFontDWrite.cpp
@@ -313,176 +313,91 @@ bool UnscaledFontDWrite::GetFontFileData
   aDataCallback((uint8_t*)fragmentStart, fileSize, mFontFace->GetIndex(),
                 aBaton);
 
   stream->ReleaseFileFragment(context);
 
   return true;
 }
 
-static bool GetDWriteName(RefPtr<IDWriteLocalizedStrings> aNames,
-                          std::vector<WCHAR>& aOutName) {
-  BOOL exists = false;
-  UINT32 index = 0;
-  HRESULT hr = aNames->FindLocaleName(L"en-us", &index, &exists);
-  if (FAILED(hr)) {
-    return false;
-  }
-  if (!exists) {
-    // No english found, use whatever is first in the list.
-    index = 0;
-  }
-
-  UINT32 length;
-  hr = aNames->GetStringLength(index, &length);
-  if (FAILED(hr)) {
-    return false;
-  }
-  aOutName.resize(length + 1);
-  hr = aNames->GetString(index, aOutName.data(), length + 1);
-  return SUCCEEDED(hr);
-}
-
-static bool GetDWriteFamilyName(const RefPtr<IDWriteFontFamily>& aFamily,
-                                std::vector<WCHAR>& aOutName) {
-  RefPtr<IDWriteLocalizedStrings> names;
-  HRESULT hr = aFamily->GetFamilyNames(getter_AddRefs(names));
-  if (FAILED(hr)) {
-    return false;
-  }
-  return GetDWriteName(names, aOutName);
-}
-
-static void GetFontFileNames(RefPtr<IDWriteFontFace> aFontFace,
-                             std::vector<WCHAR>& aFamilyName,
-                             std::vector<WCHAR>& aFileNames) {
-  MOZ_ASSERT(aFamilyName.size() >= 1 && aFamilyName.back() == 0);
-
+static bool GetFontFileName(RefPtr<IDWriteFontFace> aFontFace,
+                            std::vector<WCHAR>& aFileName) {
   UINT32 numFiles;
   HRESULT hr = aFontFace->GetFiles(&numFiles, nullptr);
   if (FAILED(hr)) {
-    gfxCriticalNote << "Failed getting file count for font \""
-                    << &aFamilyName[0] << "\"";
-    return;
-  } else if (!numFiles) {
-    gfxCriticalNote << "No files found for font \"" << &aFamilyName[0] << "\"";
-    return;
+    gfxDebug() << "Failed getting file count for WR font";
+    return false;
+  } else if (numFiles != 1) {
+    gfxDebug() << "Invalid file count " << numFiles << " for WR font";
+    return false;
   }
-  std::vector<RefPtr<IDWriteFontFile>> files;
-  files.resize(numFiles);
-  hr = aFontFace->GetFiles(&numFiles, getter_AddRefs(files[0]));
+
+  RefPtr<IDWriteFontFile> file;
+  hr = aFontFace->GetFiles(&numFiles, getter_AddRefs(file));
   if (FAILED(hr)) {
-    gfxCriticalNote << "Failed getting files for font \"" << &aFamilyName[0]
-                    << "\"";
-    return;
+    gfxDebug() << "Failed getting file for WR font";
+    return false;
   }
 
-  for (auto& file : files) {
-    const void* key;
-    UINT32 keySize;
-    hr = file->GetReferenceKey(&key, &keySize);
-    if (FAILED(hr)) {
-      gfxCriticalNote << "Failed getting file ref key for font \""
-                      << &aFamilyName[0] << "\"";
-      return;
-    }
-    RefPtr<IDWriteFontFileLoader> loader;
-    hr = file->GetLoader(getter_AddRefs(loader));
-    if (FAILED(hr)) {
-      gfxCriticalNote << "Failed getting file loader for font \""
-                      << &aFamilyName[0] << "\"";
-      return;
-    }
-    RefPtr<IDWriteLocalFontFileLoader> localLoader;
-    loader->QueryInterface(__uuidof(IDWriteLocalFontFileLoader),
-                           (void**)getter_AddRefs(localLoader));
-    if (!localLoader) {
-      gfxCriticalNote << "Failed querying loader interface for font \""
-                      << &aFamilyName[0] << "\"";
-      return;
-    }
-    UINT32 pathLen;
-    hr = localLoader->GetFilePathLengthFromKey(key, keySize, &pathLen);
-    if (FAILED(hr)) {
-      gfxCriticalNote << "Failed getting path length for font \""
-                      << &aFamilyName[0] << "\"";
-      return;
-    }
-    size_t offset = aFileNames.size();
-    aFileNames.resize(offset + pathLen + 1);
-    hr = localLoader->GetFilePathFromKey(key, keySize, &aFileNames[offset],
-                                         pathLen + 1);
-    if (FAILED(hr)) {
-      aFileNames.resize(offset);
-      gfxCriticalNote << "Failed getting path for font \"" << &aFamilyName[0]
-                      << "\"";
-      return;
-    }
-    MOZ_ASSERT(aFileNames.back() == 0);
-    DWORD attribs = GetFileAttributesW(&aFileNames[offset]);
-    if (attribs == INVALID_FILE_ATTRIBUTES) {
-      gfxCriticalNote << "sending font family \"" << &aFamilyName[0]
-                      << "\" with invalid file \"" << &aFileNames[offset]
-                      << "\"";
-    }
+  const void* key;
+  UINT32 keySize;
+  hr = file->GetReferenceKey(&key, &keySize);
+  if (FAILED(hr)) {
+    gfxDebug() << "Failed getting file ref key for WR font";
+    return false;
+  }
+  RefPtr<IDWriteFontFileLoader> loader;
+  hr = file->GetLoader(getter_AddRefs(loader));
+  if (FAILED(hr)) {
+    gfxDebug() << "Failed getting file loader for WR font";
+    return false;
+  }
+  RefPtr<IDWriteLocalFontFileLoader> localLoader;
+  loader->QueryInterface(__uuidof(IDWriteLocalFontFileLoader),
+                         (void**)getter_AddRefs(localLoader));
+  if (!localLoader) {
+    gfxDebug() << "Failed querying loader interface for WR font";
+    return false;
   }
+  UINT32 pathLen;
+  hr = localLoader->GetFilePathLengthFromKey(key, keySize, &pathLen);
+  if (FAILED(hr)) {
+    gfxDebug() << "Failed getting path length for WR font";
+    return false;
+  }
+  aFileName.resize(pathLen + 1);
+  hr = localLoader->GetFilePathFromKey(key, keySize, aFileName.data(),
+                                       pathLen + 1);
+  if (FAILED(hr) || aFileName.back() != 0) {
+    gfxDebug() << "Failed getting path for WR font";
+    return false;
+  }
+  DWORD attribs = GetFileAttributesW(aFileName.data());
+  if (attribs == INVALID_FILE_ATTRIBUTES) {
+    gfxDebug() << "Invalid file \"" << aFileName.data() << "\" for WR font";
+    return false;
+  }
+  aFileName.pop_back();
+  return true;
 }
 
 bool UnscaledFontDWrite::GetWRFontDescriptor(WRFontDescriptorOutput aCb,
                                              void* aBaton) {
   if (!mFont) {
     return false;
   }
 
-  RefPtr<IDWriteFontFamily> family;
-  HRESULT hr = mFont->GetFontFamily(getter_AddRefs(family));
-  if (FAILED(hr)) {
-    return false;
-  }
-
-  DWRITE_FONT_WEIGHT weight = mFont->GetWeight();
-  DWRITE_FONT_STRETCH stretch = mFont->GetStretch();
-  DWRITE_FONT_STYLE style = mFont->GetStyle();
-
-  RefPtr<IDWriteFont> match;
-  hr = family->GetFirstMatchingFont(weight, stretch, style,
-                                    getter_AddRefs(match));
-  if (FAILED(hr) || match->GetWeight() != weight ||
-      match->GetStretch() != stretch || match->GetStyle() != style) {
-    return false;
-  }
-
-  std::vector<WCHAR> familyName;
-  if (!GetDWriteFamilyName(family, familyName)) {
+  std::vector<WCHAR> fileName;
+  if (!GetFontFileName(mFontFace, fileName)) {
     return false;
   }
-
-  RefPtr<IDWriteFontCollection> systemFonts = Factory::GetDWriteSystemFonts();
-  if (!systemFonts) {
-    return false;
-  }
+  uint32_t index = mFontFace->GetIndex();
 
-  UINT32 idx;
-  BOOL exists;
-  hr = systemFonts->FindFamilyName(familyName.data(), &idx, &exists);
-  if (FAILED(hr) || !exists) {
-    return false;
-  }
-
-  // FIXME: Debugging kluge for bug 1455848. Remove once debugged!
-  GetFontFileNames(mFontFace, familyName, familyName);
-
-  // The style information that identifies the font can be encoded easily in
-  // less than 32 bits. Since the index is needed for font descriptors, only
-  // the family name and style information, pass along the style in the index
-  // data to avoid requiring a more complicated structure packing for it in
-  // the data payload.
-  uint32_t index = weight | (stretch << 16) | (style << 24);
-  aCb(reinterpret_cast<const uint8_t*>(familyName.data()),
-      familyName.size() * sizeof(WCHAR), index, aBaton);
+  aCb(reinterpret_cast<const uint8_t*>(fileName.data()),
+      fileName.size() * sizeof(WCHAR), index, aBaton);
   return true;
 }
 
 ScaledFontDWrite::InstanceData::InstanceData(
     const wr::FontInstanceOptions* aOptions,
     const wr::FontInstancePlatformOptions* aPlatformOptions)
     : mUseEmbeddedBitmap(false),
       mForceGDIMode(false),
--- a/gfx/layers/ipc/PWebRenderBridge.ipdl
+++ b/gfx/layers/ipc/PWebRenderBridge.ipdl
@@ -77,19 +77,16 @@ parent:
   sync SetTestSampleTime(TimeStamp sampleTime);
   sync LeaveTestMode();
   sync GetAnimationValue(uint64_t aCompositorAnimationsId) returns (OMTAValue value);
   sync SetAsyncScrollOffset(ViewID scrollId, float x, float y);
   sync SetAsyncZoom(ViewID scrollId, float zoom);
   async FlushApzRepaints();
   sync GetAPZTestData() returns (APZTestData data);
 
-  // Debugging routine for bug 1455848.
-  async ValidateFontDescriptor(uint8_t[] desc);
-
   async Shutdown();
   sync ShutdownSync();
 child:
   async WrUpdated(IdNamespace aNewIdNamespace, TextureFactoryIdentifier textureFactoryIdentifier);
   async WrReleasedImages(ExternalImageKeyPair[] pairs);
   async __delete__();
 };
 
--- a/gfx/layers/wr/WebRenderBridgeChild.cpp
+++ b/gfx/layers/wr/WebRenderBridgeChild.cpp
@@ -221,26 +221,16 @@ static void WriteFontFileData(const uint
 }
 
 static void WriteFontDescriptor(const uint8_t* aData, uint32_t aLength,
                                 uint32_t aIndex, void* aBaton) {
   FontFileDataSink* sink = static_cast<FontFileDataSink*>(aBaton);
 
   *sink->mFontKey = sink->mWrBridge->GetNextFontKey();
 
-#ifdef XP_WIN
-  // FIXME: Debugging kluge for bug 1455848. Remove once debugged!
-  nsTArray<uint8_t> data;
-  data.AppendElements(aData, aLength);
-  sink->mWrBridge->SendValidateFontDescriptor(data);
-  aLength =
-      uint32_t(wcsnlen_s((const wchar_t*)aData, aLength / sizeof(wchar_t)) *
-               sizeof(wchar_t));
-#endif
-
   sink->mResources->AddFontDescriptor(
       *sink->mFontKey, Range<uint8_t>(const_cast<uint8_t*>(aData), aLength),
       aIndex);
 }
 
 void WebRenderBridgeChild::PushGlyphs(
     wr::DisplayListBuilder& aBuilder, Range<const wr::GlyphInstance> aGlyphs,
     gfx::ScaledFont* aFont, const wr::ColorF& aColor,
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -31,20 +31,16 @@
 #include "mozilla/layers/WebRenderImageHost.h"
 #include "mozilla/layers/WebRenderTextureHost.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Unused.h"
 #include "mozilla/webrender/RenderThread.h"
 #include "mozilla/widget/CompositorWidget.h"
 
-#ifdef XP_WIN
-#  include "dwrite.h"
-#endif
-
 #ifdef MOZ_GECKO_PROFILER
 #  include "ProfilerMarkerPayload.h"
 #endif
 
 bool is_in_main_thread() { return NS_IsMainThread(); }
 
 bool is_in_compositor_thread() {
   return mozilla::layers::CompositorThreadHolder::IsInCompositorThread();
@@ -701,59 +697,16 @@ void WebRenderBridgeParent::ObserveShare
   if (!mDestroyed) {
     Unused << SendWrReleasedImages(aPairs);
   }
   for (const auto& pair : aPairs) {
     SharedSurfacesParent::Release(pair.id);
   }
 }
 
-// Debugging kluge for bug 1455848. Remove once debugged!
-mozilla::ipc::IPCResult WebRenderBridgeParent::RecvValidateFontDescriptor(
-    nsTArray<uint8_t>&& aData) {
-  if (mDestroyed) {
-    return IPC_OK();
-  }
-#ifdef XP_WIN
-  nsTArray<uint8_t> data(aData);
-  wchar_t* family = (wchar_t*)data.Elements();
-  size_t remaining = data.Length() / sizeof(wchar_t);
-  size_t familyLength = wcsnlen_s(family, remaining);
-  MOZ_ASSERT(familyLength < remaining && family[familyLength] == 0);
-  remaining -= familyLength + 1;
-  wchar_t* files = family + familyLength + 1;
-  BOOL exists = FALSE;
-  if (RefPtr<IDWriteFontCollection> systemFonts =
-          Factory::GetDWriteSystemFonts()) {
-    UINT32 idx;
-    systemFonts->FindFamilyName(family, &idx, &exists);
-  }
-  if (!remaining) {
-    gfxCriticalNote << (exists ? "found" : "MISSING") << " font family \""
-                    << family << "\" has no files!";
-  }
-  while (remaining > 0) {
-    size_t fileLength = wcsnlen_s(files, remaining);
-    MOZ_ASSERT(fileLength < remaining && files[fileLength] == 0);
-    DWORD attribs = GetFileAttributesW(files);
-    if (!exists || attribs == INVALID_FILE_ATTRIBUTES) {
-      gfxCriticalNote << (exists ? "found" : "MISSING") << " font family \""
-                      << family << "\" has "
-                      << (attribs == INVALID_FILE_ATTRIBUTES ? "INVALID"
-                                                             : "valid")
-                      << "(" << hexa(attribs) << ")"
-                      << " file \"" << files << "\"";
-    }
-    remaining -= fileLength + 1;
-    files += fileLength + 1;
-  }
-#endif
-  return IPC_OK();
-}
-
 mozilla::ipc::IPCResult WebRenderBridgeParent::RecvUpdateResources(
     nsTArray<OpUpdateResource>&& aResourceUpdates,
     nsTArray<RefCountedShmem>&& aSmallShmems,
     nsTArray<ipc::Shmem>&& aLargeShmems) {
   if (mDestroyed) {
     wr::IpcResourceUpdateQueue::ReleaseShmems(this, aSmallShmems);
     wr::IpcResourceUpdateQueue::ReleaseShmems(this, aLargeShmems);
     return IPC_OK();
--- a/gfx/layers/wr/WebRenderBridgeParent.h
+++ b/gfx/layers/wr/WebRenderBridgeParent.h
@@ -120,19 +120,16 @@ class WebRenderBridgeParent final : publ
       const TimeStamp& aRefreshStartTime, const TimeStamp& aTxnStartTime,
       const nsCString& aTxnURL, const TimeStamp& aFwdTime) override;
   mozilla::ipc::IPCResult RecvSetFocusTarget(
       const FocusTarget& aFocusTarget) override;
   mozilla::ipc::IPCResult RecvParentCommands(
       nsTArray<WebRenderParentCommand>&& commands) override;
   mozilla::ipc::IPCResult RecvGetSnapshot(PTextureParent* aTexture) override;
 
-  mozilla::ipc::IPCResult RecvValidateFontDescriptor(
-      nsTArray<uint8_t>&& aData) override;
-
   mozilla::ipc::IPCResult RecvSetLayersObserverEpoch(
       const LayersObserverEpoch& aChildEpoch) override;
 
   mozilla::ipc::IPCResult RecvClearCachedResources() override;
   mozilla::ipc::IPCResult RecvScheduleComposite() override;
   mozilla::ipc::IPCResult RecvCapture() override;
   mozilla::ipc::IPCResult RecvSyncWithCompositor() override;
 
new file mode 100644
--- /dev/null
+++ b/gfx/tests/reftest/1501195-ref.html
@@ -0,0 +1,30 @@
+<html reftest-zoom="1.1">
+<head>
+<style type="text/css">
+.parent {
+display: flex;
+overflow: hidden;
+}
+
+.bg {
+background-color: lime;
+width: 200px;
+height: 200px;
+transform: scale(1.05);
+}
+
+.bg_overlay {
+background-color: red;
+width: 100px;
+height: 100px;
+position: absolute;
+}
+</style>
+</head>
+<body>
+<div class="parent">
+	<div class="bg"></div>
+	<div class="bg_overlay"></div>
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/gfx/tests/reftest/1501195.html
@@ -0,0 +1,31 @@
+<html reftest-zoom="1.1">
+<head>
+<style type="text/css">
+.parent {
+display: flex;
+transform: translate3d(0px, 0px, 0px);
+overflow: hidden;
+}
+
+.bg {
+background-color: lime;
+width: 200px;
+height: 200px;
+transform: scale(1.05);
+}
+
+.bg_overlay {
+background-color: red;
+width: 100px;
+height: 100px;
+position: absolute;
+}
+</style>
+</head>
+<body>
+<div class="parent">
+	<div class="bg"></div>
+	<div class="bg_overlay"></div>
+</div>
+</body>
+</html>
--- a/gfx/tests/reftest/reftest.list
+++ b/gfx/tests/reftest/reftest.list
@@ -11,9 +11,10 @@ fuzzy(0-100,0-30) == 1149923.html 114992
 == 1424673.html 1424673-ref.html
 == 1429411.html 1429411-ref.html
 == 1435143.html 1435143-ref.html
 == 1444904.html 1444904-ref.html
 == 1451168.html 1451168-ref.html
 == 1461313.html 1461313-ref.html
 fuzzy(5-32,21908-26621) fuzzy-if(webrender,0-1,0-3) == 1463802.html 1463802-ref.html
 fuzzy(0-11,0-4) == 1474722.html 1474722-ref.html
+== 1501195.html 1501195-ref.html
 == 1519754.html 1519754-ref.html
--- a/gfx/webrender_bindings/Cargo.toml
+++ b/gfx/webrender_bindings/Cargo.toml
@@ -18,15 +18,15 @@ fxhash = "0.2.1"
 
 [dependencies.webrender]
 path = "../wr/webrender"
 version = "0.59.0"
 default-features = false
 features = ["capture", "serialize_program"]
 
 [target.'cfg(target_os = "windows")'.dependencies]
-dwrote = "0.7"
+dwrote = "0.8"
 
 [target.'cfg(target_os = "macos")'.dependencies]
 core-foundation = "0.6"
 core-graphics = "0.17.1"
 foreign-types = "0.3.0"
 
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -1,9 +1,15 @@
 use std::ffi::{CStr, CString};
+#[cfg(not(target_os = "macos"))]
+use std::ffi::OsString;
+#[cfg(target_os = "windows")]
+use std::os::windows::ffi::OsStringExt;
+#[cfg(not(any(target_os = "macos", target_os = "windows")))]
+use std::os::unix::ffi::OsStringExt;
 use std::io::Cursor;
 use std::{mem, slice, ptr, env};
 use std::path::PathBuf;
 use std::rc::Rc;
 use std::cell::RefCell;
 use std::sync::Arc;
 use std::sync::atomic::{AtomicUsize, Ordering};
 use std::ops::Range;
@@ -23,19 +29,16 @@ use webrender::{Device, Shaders, WrShade
 use thread_profiler::register_thread_with_profiler;
 use moz2d_renderer::Moz2dBlobImageHandler;
 use program_cache::{WrProgramCache, remove_disk_cache};
 use app_units::Au;
 use rayon;
 use euclid::SideOffsets2D;
 use nsstring::nsAString;
 
-#[cfg(target_os = "windows")]
-use dwrote::{FontDescriptor, FontWeight, FontStretch, FontStyle};
-
 #[cfg(target_os = "macos")]
 use core_foundation::string::CFString;
 #[cfg(target_os = "macos")]
 use core_graphics::font::CGFont;
 
 extern "C" {
     #[cfg(target_os = "android")]
     fn __android_log_write(prio: c_int, tag: *const c_char, text: *const c_char) -> c_int;
@@ -1708,21 +1711,19 @@ pub extern "C" fn wr_api_capture(
 }
 
 #[cfg(target_os = "windows")]
 fn read_font_descriptor(
     bytes: &mut WrVecU8,
     index: u32
 ) -> NativeFontHandle {
     let wchars = bytes.convert_into_vec::<u16>();
-    FontDescriptor {
-        family_name: String::from_utf16(&wchars).unwrap(),
-        weight: FontWeight::from_u32(index & 0xffff),
-        stretch: FontStretch::from_u32((index >> 16) & 0xff),
-        style: FontStyle::from_u32((index >> 24) & 0xff),
+    NativeFontHandle {
+        path: PathBuf::from(OsString::from_wide(&wchars)),
+        index,
     }
 }
 
 #[cfg(target_os = "macos")]
 fn read_font_descriptor(
     bytes: &mut WrVecU8,
     _index: u32
 ) -> NativeFontHandle {
@@ -1732,19 +1733,19 @@ fn read_font_descriptor(
     NativeFontHandle(font)
 }
 
 #[cfg(not(any(target_os = "macos", target_os = "windows")))]
 fn read_font_descriptor(
     bytes: &mut WrVecU8,
     index: u32
 ) -> NativeFontHandle {
-    let cstr = CString::new(bytes.flush_into_vec()).unwrap();
+    let chars = bytes.flush_into_vec();
     NativeFontHandle {
-        pathname: String::from(cstr.to_str().unwrap()),
+        path: PathBuf::from(OsString::from_vec(chars)),
         index,
     }
 }
 
 #[no_mangle]
 pub extern "C" fn wr_resource_updates_add_font_descriptor(
     txn: &mut Transaction,
     key: WrFontKey,
--- a/gfx/webrender_bindings/src/moz2d_renderer.rs
+++ b/gfx/webrender_bindings/src/moz2d_renderer.rs
@@ -25,16 +25,18 @@ use std;
 #[cfg(target_os = "windows")]
 use dwrote;
 
 #[cfg(target_os = "macos")]
 use foreign_types::ForeignType;
 
 #[cfg(not(any(target_os = "macos", target_os = "windows")))]
 use std::ffi::CString;
+#[cfg(not(any(target_os = "macos", target_os = "windows")))]
+use std::os::unix::ffi::OsStrExt;
 
 /// Local print-debugging utility
 macro_rules! dlog {
     ($($e:expr),*) => { {$(let _ = $e;)*} }
     //($($t:tt)*) => { println!($($t)*) }
 }
 
 /// Debug prints a blob's item bounds, indicating whether the bounds are dirty or not.
@@ -650,30 +652,29 @@ impl Moz2dBlobImageHandler {
     }
 
     /// Does early preprocessing of a blob's resources.
     ///
     /// Currently just sets up fonts found in the blob.
     fn prepare_request(&self, blob: &[u8], resources: &BlobImageResources) {
         #[cfg(target_os = "windows")]
         fn process_native_font_handle(key: FontKey, handle: &NativeFontHandle) {
-            let system_fc = dwrote::FontCollection::system();
-            let font = system_fc.get_font_from_descriptor(handle).unwrap();
-            let face = font.create_font_face();
+            let file = dwrote::FontFile::new_from_path(&handle.path).unwrap();
+            let face = file.create_face(handle.index, dwrote::DWRITE_FONT_SIMULATIONS_NONE).unwrap();
             unsafe { AddNativeFontHandle(key, face.as_ptr() as *mut c_void, 0) };
         }
 
         #[cfg(target_os = "macos")]
         fn process_native_font_handle(key: FontKey, handle: &NativeFontHandle) {
             unsafe { AddNativeFontHandle(key, handle.0.as_ptr() as *mut c_void, 0) };
         }
 
         #[cfg(not(any(target_os = "macos", target_os = "windows")))]
         fn process_native_font_handle(key: FontKey, handle: &NativeFontHandle) {
-            let cstr = CString::new(handle.pathname.clone()).unwrap();
+            let cstr = CString::new(handle.path.as_os_str().as_bytes()).unwrap();
             unsafe { AddNativeFontHandle(key, cstr.as_ptr() as *mut c_void, handle.index) };
         }
 
         fn process_fonts(
             mut extra_data: BufReader,
             resources: &BlobImageResources,
             unscaled_fonts: &mut Vec<FontKey>,
             scaled_fonts: &mut Vec<FontInstanceKey>,
--- a/gfx/wr/Cargo.lock
+++ b/gfx/wr/Cargo.lock
@@ -372,17 +372,17 @@ source = "registry+https://github.com/ru
 
 [[package]]
 name = "dtoa"
 version = "0.4.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "dwrote"
-version = "0.7.0"
+version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_derive 1.0.80 (git+https://github.com/servo/serde?branch=deserialize_from_enums9)",
  "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -1599,17 +1599,17 @@ dependencies = [
  "base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-text 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "dwrote 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "dwrote 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "freetype 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "gleam 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "image 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "malloc_size_of_derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1656,17 +1656,16 @@ version = "0.58.0"
 dependencies = [
  "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "derive_more 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "dwrote 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "ipc-channel 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "malloc_size_of_derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_bytes 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_derive 1.0.80 (git+https://github.com/servo/serde?branch=deserialize_from_enums9)",
  "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
  "wr_malloc_size_of 0.0.1",
@@ -1753,17 +1752,17 @@ dependencies = [
  "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "dwrote 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "dwrote 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "font-loader 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "gleam 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "glutin 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "image 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1882,17 +1881,17 @@ dependencies = [
 "checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9"
 "checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015"
 "checksum deflate 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)" = "32c8120d981901a9970a3a1c97cf8b630e0fa8c3ca31e75b6fd6fd5f9f427b31"
 "checksum derive_more 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3f57d78cf3bd45270dad4e70c21ec77a960b36c7a841ff9db76aaa775a8fb871"
 "checksum digest 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05f47366984d3ad862010e22c7ce81a7dbcaebbdfb37241a620f8b6596ee135c"
 "checksum dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a"
 "checksum downcast-rs 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "18df8ce4470c189d18aa926022da57544f31e154631eb4cfe796aea97051fe6c"
 "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab"
-"checksum dwrote 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d2ea0fd88d96838ce5ed30326338cc04a0eb4cff10e3e15d188d74112777103"
+"checksum dwrote 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c31c624339dab99c223a4b26c2e803b7c248adaca91549ce654c76f39a03f5c8"
 "checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0"
 "checksum env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0e6e40ebb0e66918a37b38c7acab4e10d299e0463fe2af5d29b9cc86710cfd2a"
 "checksum euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)" = "dbbf962bb6f877239a34491f2e0a12c6b824f389bc789eb90f1d70d4780b0727"
 "checksum expat-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c470ccb972f2088549b023db8029ed9da9426f5affbf9b62efff7009ab8ed5b1"
 "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
 "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
 "checksum font-loader 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fd330f40acb3016432cbfa4c54b3d6e6e893a538df79d8df8fd8c26e21c36aaa"
 "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
--- a/gfx/wr/webrender/Cargo.toml
+++ b/gfx/wr/webrender/Cargo.toml
@@ -76,14 +76,14 @@ optional = true
 mozangle = "0.1"
 rand = "0.4"
 
 [target.'cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))'.dependencies]
 freetype = { version = "0.4", default-features = false }
 libc = "0.2"
 
 [target.'cfg(target_os = "windows")'.dependencies]
-dwrote = "0.7"
+dwrote = "0.8"
 
 [target.'cfg(target_os = "macos")'.dependencies]
 core-foundation = "0.6"
 core-graphics = "0.17.1"
 core-text = { version = "13", default-features = false }
--- a/gfx/wr/webrender/src/platform/unix/font.rs
+++ b/gfx/wr/webrender/src/platform/unix/font.rs
@@ -314,17 +314,18 @@ impl FontContext {
             if let Some(face) = new_ft_face(font_key, self.lib, &file, index) {
                 self.faces.insert(*font_key, FontFace { file, index, face, mm_var: ptr::null_mut() });
             }
         }
     }
 
     pub fn add_native_font(&mut self, font_key: &FontKey, native_font_handle: NativeFontHandle) {
         if !self.faces.contains_key(&font_key) {
-            let file = FontFile::Pathname(CString::new(native_font_handle.pathname).unwrap());
+            let cstr = CString::new(native_font_handle.path.as_os_str().to_str().unwrap()).unwrap();
+            let file = FontFile::Pathname(cstr);
             let index = native_font_handle.index;
             if let Some(face) = new_ft_face(font_key, self.lib, &file, index) {
                 self.faces.insert(*font_key, FontFace { file, index, face, mm_var: ptr::null_mut() });
             }
         }
     }
 
     pub fn delete_font(&mut self, font_key: &FontKey) {
@@ -960,11 +961,12 @@ impl Drop for FontContext {
         }
     }
 }
 
 #[cfg(feature = "pathfinder")]
 impl<'a> Into<pf_freetype::FontDescriptor> for NativeFontHandleWrapper<'a> {
     fn into(self) -> pf_freetype::FontDescriptor {
         let NativeFontHandleWrapper(font_handle) = self;
-        pf_freetype::FontDescriptor::new(font_handle.pathname.clone().into(), font_handle.index)
+        let str = font_handle.path.as_os_str().to_str().unwrap();
+        pf_freetype::FontDescriptor::new(str.into(), font_handle.index)
     }
 }
--- a/gfx/wr/webrender/src/platform/windows/font.rs
+++ b/gfx/wr/webrender/src/platform/windows/font.rs
@@ -1,20 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::{FontInstan