Merge inbound to mozilla-central r=merge a=merge
authorNoemi Erli <nerli@mozilla.com>
Thu, 11 Jan 2018 23:54:07 +0200
changeset 398858 8142a68bf0a7b44c2502888ba6b2a930edf428fd
parent 398785 185d2695bf96910c4ecd84870352b7594c23be9d (current diff)
parent 398857 6705010893cd6d0a72f6adbcb81a92f052a041c2 (diff)
child 398859 f7f5ba2214d2ce7b1ce9647b0e2540490a6098a8
child 398889 cffe5dc9ba5096afc059ef6e87e158df58528b09
child 398939 6375ac1de3900b02bd873d29533060b3f447cd2f
push id33233
push usernerli@mozilla.com
push dateThu, 11 Jan 2018 21:54:41 +0000
treeherdermozilla-central@8142a68bf0a7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge, merge
milestone59.0a1
first release with
nightly linux32
8142a68bf0a7 / 59.0a1 / 20180111220102 / files
nightly linux64
8142a68bf0a7 / 59.0a1 / 20180111220102 / files
nightly mac
8142a68bf0a7 / 59.0a1 / 20180111220102 / files
nightly win32
8142a68bf0a7 / 59.0a1 / 20180111220102 / files
nightly win64
8142a68bf0a7 / 59.0a1 / 20180111220102 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge inbound to mozilla-central r=merge a=merge
dom/interfaces/css/moz.build
dom/interfaces/css/nsIDOMCSSConditionRule.idl
dom/interfaces/css/nsIDOMCSSCounterStyleRule.idl
dom/interfaces/css/nsIDOMCSSFontFaceRule.idl
dom/interfaces/css/nsIDOMCSSFontFeatureValuesRule.idl
dom/interfaces/css/nsIDOMCSSGroupingRule.idl
dom/interfaces/css/nsIDOMCSSImportRule.idl
dom/interfaces/css/nsIDOMCSSKeyframeRule.idl
dom/interfaces/css/nsIDOMCSSKeyframesRule.idl
dom/interfaces/css/nsIDOMCSSMediaRule.idl
dom/interfaces/css/nsIDOMCSSMozDocumentRule.idl
dom/interfaces/css/nsIDOMCSSPageRule.idl
dom/interfaces/css/nsIDOMCSSPrimitiveValue.idl
dom/interfaces/css/nsIDOMCSSRule.idl
dom/interfaces/css/nsIDOMCSSRuleList.idl
dom/interfaces/css/nsIDOMCSSStyleDeclaration.idl
dom/interfaces/css/nsIDOMCSSStyleRule.idl
dom/interfaces/css/nsIDOMCSSStyleSheet.idl
dom/interfaces/css/nsIDOMCSSSupportsRule.idl
dom/interfaces/css/nsIDOMCSSUnknownRule.idl
dom/interfaces/css/nsIDOMCSSValue.idl
dom/interfaces/css/nsIDOMCSSValueList.idl
dom/interfaces/css/nsIDOMCounter.idl
dom/interfaces/css/nsIDOMRect.idl
dom/interfaces/stylesheets/moz.build
dom/interfaces/stylesheets/nsIDOMMediaList.idl
dom/interfaces/stylesheets/nsIDOMStyleSheet.idl
dom/interfaces/stylesheets/nsIDOMStyleSheetList.idl
dom/moz.build
dom/tests/mochitest/chrome/test_bug830396.xul
layout/style/nsICSSStyleRuleDOMWrapper.h
testing/web-platform/meta/css/CSS2/linebox/vertical-align-baseline-004a.xht.ini
testing/web-platform/meta/css/CSS2/linebox/vertical-align-baseline-005a.xht.ini
toolkit/xre/nsAppRunner.cpp
xpcom/build/nsXULAppAPI.h
--- a/accessible/interfaces/nsIAccessible.idl
+++ b/accessible/interfaces/nsIAccessible.idl
@@ -2,17 +2,16 @@
 /* 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 "nsISupports.idl"
 #include "nsIArray.idl"
 
 interface nsIPersistentProperties;
-interface nsIDOMCSSPrimitiveValue;
 interface nsIDOMNode;
 interface nsIAccessibleDocument;
 interface nsIAccessibleRelation;
 
 %{C++
 namespace mozilla {
 namespace a11y {
 class Accessible;
--- a/accessible/windows/msaa/nsWinUtils.cpp
+++ b/accessible/windows/msaa/nsWinUtils.cpp
@@ -34,35 +34,34 @@ const wchar_t* kPropNameTabContent = L"A
 /**
  * WindowProc to process WM_GETOBJECT messages, used in windows emulation mode.
  */
 static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg,
                                    WPARAM wParam, LPARAM lParam);
 
 bool nsWinUtils::sWindowEmulationStarted = false;
 
-already_AddRefed<nsIDOMCSSStyleDeclaration>
+already_AddRefed<nsICSSDeclaration>
 nsWinUtils::GetComputedStyleDeclaration(nsIContent* aContent)
 {
   nsIContent* elm = nsCoreUtils::GetDOMElementFor(aContent);
   if (!elm)
     return nullptr;
 
   // Returns number of items in style declaration
   nsCOMPtr<nsPIDOMWindowInner> window = elm->OwnerDoc()->GetInnerWindow();
   if (!window)
     return nullptr;
 
   ErrorResult dummy;
-  nsCOMPtr<nsICSSDeclaration> cssDecl;
   nsCOMPtr<Element> domElement(do_QueryInterface(elm));
-  cssDecl = window->GetComputedStyle(*domElement, EmptyString(), dummy);
-  nsCOMPtr<nsIDOMCSSStyleDeclaration> domDecl = do_QueryInterface(cssDecl);
+  nsCOMPtr<nsICSSDeclaration> cssDecl =
+     window->GetComputedStyle(*domElement, EmptyString(), dummy);
   dummy.SuppressException();
-  return domDecl.forget();
+  return cssDecl.forget();
 }
 
 bool
 nsWinUtils::MaybeStartWindowEmulation()
 {
   // Register window class that'll be used for document accessibles associated
   // with tabs.
   if (IPCAccessibilityActive())
--- a/accessible/windows/msaa/nsWinUtils.h
+++ b/accessible/windows/msaa/nsWinUtils.h
@@ -6,17 +6,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsWinUtils_h_
 #define nsWinUtils_h_
 
 #include <functional>
 #include <windows.h>
 
-#include "nsIDOMCSSStyleDeclaration.h"
+#include "nsICSSDeclaration.h"
 #include "nsCOMPtr.h"
 
 class nsIContent;
 
 namespace mozilla {
 namespace a11y {
 
 class DocAccessible;
@@ -30,17 +30,17 @@ class nsWinUtils
 {
 public:
   /**
    * Return computed styles declaration for the given node.
    *
    * @note Please use it carefully since it can shutdown the accessible tree
    *       you operate on.
    */
-  static already_AddRefed<nsIDOMCSSStyleDeclaration>
+  static already_AddRefed<nsICSSDeclaration>
     GetComputedStyleDeclaration(nsIContent* aContent);
 
   /**
    * Start window emulation if presence of specific AT is detected.
    */
   static bool MaybeStartWindowEmulation();
 
   /**
--- a/accessible/windows/sdn/sdnAccessible.cpp
+++ b/accessible/windows/sdn/sdnAccessible.cpp
@@ -8,17 +8,17 @@
 #include "ISimpleDOM_i.c"
 
 #include "DocAccessibleWrap.h"
 
 #include "nsAttrName.h"
 #include "nsCoreUtils.h"
 #include "nsIAccessibleTypes.h"
 #include "nsIDOMHTMLElement.h"
-#include "nsIDOMCSSStyleDeclaration.h"
+#include "nsICSSDeclaration.h"
 #include "nsNameSpaceManager.h"
 #include "nsServiceManagerUtils.h"
 #include "nsWinUtils.h"
 #include "nsRange.h"
 
 #include "mozilla/dom/BorrowedAttrInfo.h"
 #include "mozilla/dom/Element.h"
 
@@ -226,30 +226,31 @@ sdnAccessible::get_computedStyle(unsigne
   if (IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   *aNumStyleProperties = 0;
 
   if (mNode->IsNodeOfType(nsINode::eDOCUMENT))
     return S_FALSE;
 
-  nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl =
+  nsCOMPtr<nsICSSDeclaration> cssDecl =
     nsWinUtils::GetComputedStyleDeclaration(mNode->AsContent());
   NS_ENSURE_TRUE(cssDecl, E_FAIL);
 
   uint32_t length = 0;
   cssDecl->GetLength(&length);
 
   uint32_t index = 0, realIndex = 0;
   for (index = realIndex = 0; index < length && realIndex < aMaxStyleProperties;
        index ++) {
     nsAutoString property, value;
 
     // Ignore -moz-* properties.
-    if (NS_SUCCEEDED(cssDecl->Item(index, property)) && property.CharAt(0) != '-')
+    cssDecl->Item(index, property);
+    if (property.CharAt(0) != '-')
       cssDecl->GetPropertyValue(property, value);  // Get property value
 
     if (!value.IsEmpty()) {
       aStyleProperties[realIndex] = ::SysAllocString(property.get());
       aStyleValues[realIndex] = ::SysAllocString(value.get());
       ++realIndex;
     }
   }
@@ -269,17 +270,17 @@ sdnAccessible::get_computedStyleForPrope
     return E_INVALIDARG;
 
   if (IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (mNode->IsNodeOfType(nsINode::eDOCUMENT))
     return S_FALSE;
 
-  nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl =
+  nsCOMPtr<nsICSSDeclaration> cssDecl =
     nsWinUtils::GetComputedStyleDeclaration(mNode->AsContent());
   NS_ENSURE_TRUE(cssDecl, E_FAIL);
 
   uint32_t index = 0;
   for (index = 0; index < aNumStyleProperties; index++) {
     nsAutoString value;
     if (aStyleProperties[index])
       cssDecl->GetPropertyValue(nsDependentString(aStyleProperties[index]), value);  // Get property value
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -194,33 +194,31 @@
 @RESPATH@/components/dom_bindings.xpt
 #ifdef MOZ_DEBUG
 @RESPATH@/components/dom_bindings_test.xpt
 #endif
 @RESPATH@/components/dom_file.xpt
 @RESPATH@/components/dom_system.xpt
 @RESPATH@/components/dom_canvas.xpt
 @RESPATH@/components/dom_core.xpt
-@RESPATH@/components/dom_css.xpt
 @RESPATH@/components/dom_events.xpt
 @RESPATH@/components/dom_geolocation.xpt
 @RESPATH@/components/dom_media.xpt
 @RESPATH@/components/dom_network.xpt
 @RESPATH@/components/dom_notification.xpt
 @RESPATH@/components/dom_html.xpt
 @RESPATH@/components/dom_offline.xpt
 @RESPATH@/components/dom_payments.xpt
 @RESPATH@/components/dom_power.xpt
 @RESPATH@/components/dom_push.xpt
 @RESPATH@/components/dom_quota.xpt
 @RESPATH@/components/dom_range.xpt
 @RESPATH@/components/dom_security.xpt
 @RESPATH@/components/dom_sidebar.xpt
 @RESPATH@/components/dom_storage.xpt
-@RESPATH@/components/dom_stylesheets.xpt
 @RESPATH@/components/dom_traversal.xpt
 #ifdef MOZ_WEBSPEECH
 @RESPATH@/components/dom_webspeechrecognition.xpt
 #endif
 @RESPATH@/components/dom_workers.xpt
 @RESPATH@/components/dom_xbl.xpt
 @RESPATH@/components/dom_xhr.xpt
 @RESPATH@/components/dom_xpath.xpt
--- a/devtools/client/aboutdebugging/test/browser_service_workers.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers.js
@@ -8,17 +8,17 @@
 const SERVICE_WORKER = URL_ROOT + "service-workers/empty-sw.js";
 const TAB_URL = URL_ROOT + "service-workers/empty-sw.html";
 
 add_task(function* () {
   yield enableServiceWorkerDebugging();
 
   let { tab, document } = yield openAboutDebugging("workers");
 
-  let swTab = yield addTab(TAB_URL, { background: true });
+  let swTab = yield addTab(TAB_URL);
 
   let serviceWorkersElement = getServiceWorkerList(document);
 
   yield waitUntil(() => {
     // Check that the service worker appears in the UI
     let names = [...document.querySelectorAll("#service-workers .target-name")];
     names = names.map(element => element.textContent);
     return names.includes(SERVICE_WORKER);
--- a/devtools/client/aboutdebugging/test/browser_service_workers_fetch_flag.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers_fetch_flag.js
@@ -7,17 +7,17 @@
 // but http:// is ok with dom.serviceWorkers.testing.enabled turned on.
 const EMPTY_SW_TAB_URL = URL_ROOT + "service-workers/empty-sw.html";
 const FETCH_SW_TAB_URL = URL_ROOT + "service-workers/fetch-sw.html";
 
 function* testBody(url, expecting) {
   yield enableServiceWorkerDebugging();
   let { tab, document } = yield openAboutDebugging("workers");
 
-  let swTab = yield addTab(url, {background: true});
+  let swTab = yield addTab(url);
 
   let serviceWorkersElement = getServiceWorkerList(document);
 
   info("Wait for fetch flag.");
   yield waitUntil(() => {
     let fetchFlags =
       [...document.querySelectorAll("#service-workers .service-worker-fetch-flag")];
     fetchFlags = fetchFlags.map(element => element.textContent);
--- a/devtools/client/aboutdebugging/test/browser_service_workers_push.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers_push.js
@@ -17,17 +17,17 @@ const TAB_URL = URL_ROOT + "service-work
 add_task(function* () {
   yield enableServiceWorkerDebugging();
   let { tab, document } = yield openAboutDebugging("workers");
 
   // Listen for mutations in the service-workers list.
   let serviceWorkersElement = getServiceWorkerList(document);
 
   // Open a tab that registers a push service worker.
-  let swTab = yield addTab(TAB_URL, { background: true });
+  let swTab = yield addTab(TAB_URL);
 
   info("Make the test page notify us when the service worker sends a message.");
 
   yield ContentTask.spawn(swTab.linkedBrowser, {}, function () {
     let win = content.wrappedJSObject;
     win.navigator.serviceWorker.addEventListener("message", function (event) {
       sendAsyncMessage(event.data);
     });
--- a/devtools/client/aboutdebugging/test/browser_service_workers_push_service.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers_push_service.js
@@ -53,17 +53,17 @@ add_task(function* () {
   };
 
   let { tab, document } = yield openAboutDebugging("workers");
 
   // Listen for mutations in the service-workers list.
   let serviceWorkersElement = document.getElementById("service-workers");
 
   // Open a tab that registers a push service worker.
-  let swTab = yield addTab(TAB_URL, { background: true });
+  let swTab = yield addTab(TAB_URL);
 
   info("Wait until the service worker appears in about:debugging");
   yield waitUntilServiceWorkerContainer(SERVICE_WORKER, document);
 
   yield waitForServiceWorkerActivation(SERVICE_WORKER, document);
 
   // Wait for the service worker details to update.
   let names = [...document.querySelectorAll("#service-workers .target-name")];
--- a/devtools/client/aboutdebugging/test/browser_service_workers_start.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers_start.js
@@ -20,17 +20,17 @@ add_task(function* () {
   yield pushPref("dom.serviceWorkers.idle_extended_timeout", SW_TIMEOUT);
 
   let { tab, document } = yield openAboutDebugging("workers");
 
   // Listen for mutations in the service-workers list.
   let serviceWorkersElement = getServiceWorkerList(document);
 
   // Open a tab that registers an empty service worker.
-  let swTab = yield addTab(TAB_URL, { background: true });
+  let swTab = yield addTab(TAB_URL);
 
   // Wait for the service-workers list to update.
   info("Wait until the service worker appears in about:debugging");
   yield waitUntilServiceWorkerContainer(SERVICE_WORKER, document);
 
   info("Ensure that the registration resolved before trying to interact with " +
     "the service worker.");
   yield waitForServiceWorkerRegistered(swTab);
--- a/devtools/client/aboutdebugging/test/browser_service_workers_status.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers_status.js
@@ -16,17 +16,17 @@ add_task(function* () {
   yield pushPref("dom.serviceWorkers.idle_timeout", SW_TIMEOUT);
   yield pushPref("dom.serviceWorkers.idle_extended_timeout", SW_TIMEOUT);
 
   let { tab, document } = yield openAboutDebugging("workers");
 
   // Listen for mutations in the service-workers list.
   let serviceWorkersElement = getServiceWorkerList(document);
 
-  let swTab = yield addTab(TAB_URL, { background: true });
+  let swTab = yield addTab(TAB_URL);
 
   info("Wait until the service worker appears in about:debugging");
   let container = yield waitUntilServiceWorkerContainer(SERVICE_WORKER, document);
 
   // We should ideally check that the service worker registration goes through the
   // "registering" and "running" steps, but it is difficult to workaround race conditions
   // for a test running on a wide variety of platforms. Due to intermittent failures, we
   // simply check that the registration transitions to "stopped".
--- a/devtools/client/aboutdebugging/test/browser_service_workers_timeout.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers_timeout.js
@@ -15,17 +15,17 @@ add_task(function* () {
   yield enableServiceWorkerDebugging();
   yield pushPref("dom.serviceWorkers.idle_timeout", SW_TIMEOUT);
   yield pushPref("dom.serviceWorkers.idle_extended_timeout", SW_TIMEOUT);
 
   let { tab, document } = yield openAboutDebugging("workers");
 
   let serviceWorkersElement = getServiceWorkerList(document);
 
-  let swTab = yield addTab(TAB_URL, { background: true });
+  let swTab = yield addTab(TAB_URL);
 
   info("Wait until the service worker appears in about:debugging");
   yield waitUntilServiceWorkerContainer(SERVICE_WORKER, document);
 
   // Ensure that the registration resolved before trying to connect to the sw
   yield waitForServiceWorkerRegistered(swTab);
   ok(true, "Service worker registration resolved");
 
--- a/devtools/client/aboutdebugging/test/browser_service_workers_unregister.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers_unregister.js
@@ -15,17 +15,17 @@ const SERVICE_WORKER = SCOPE + "empty-sw
 const TAB_URL = SCOPE + "empty-sw.html";
 
 add_task(function* () {
   yield enableServiceWorkerDebugging();
 
   let { tab, document } = yield openAboutDebugging("workers");
 
   // Open a tab that registers an empty service worker.
-  let swTab = yield addTab(TAB_URL, { background: true });
+  let swTab = yield addTab(TAB_URL);
 
   info("Wait until the service worker appears in about:debugging");
   yield waitUntilServiceWorkerContainer(SERVICE_WORKER, document);
 
   yield waitForServiceWorkerActivation(SERVICE_WORKER, document);
 
   info("Ensure that the registration resolved before trying to interact with " +
     "the service worker.");
--- a/devtools/client/debugger/new/README.mozilla
+++ b/devtools/client/debugger/new/README.mozilla
@@ -1,13 +1,13 @@
 This is the debugger.html project output.
 See https://github.com/devtools-html/debugger.html
 
-Version 7.0
-Comparison - https://github.com/devtools-html/debugger.html/compare/release-6...release-7
-Commit: https://github.com/devtools-html/debugger.html/commit/fb10a431822a1a1eb22e02613cb09cf12a10e67a
+Version 8.0
+commit https://github.com/devtools-html/debugger.html/commit/9be8e9d9e7a70730bc02e50ae019028f1f06b14e
+comparison https://github.com/devtools-html/debugger.html/compare/release-7...release-8
 
 Packages:
 - babel-plugin-transform-es2015-modules-commonjs @6.26.0
 - babel-preset-react @6.24.1
 - react @15.6.2
 - react-dom @15.6.2
 - webpack @3.10.0
--- a/devtools/client/debugger/new/debugger.js
+++ b/devtools/client/debugger/new/debugger.js
@@ -29960,16 +29960,20 @@ function setBreakpointCondition(breakpoi
   delete bpClients[breakpointId];
 
   return bpClient.setCondition(threadClient, condition, noSliding).then(_bpClient => {
     bpClients[breakpointId] = _bpClient;
     return { id: breakpointId };
   });
 }
 
+function evaluateInFrame(frameId, script) {
+  return evaluate(script, { frameId });
+}
+
 function evaluate(script, { frameId }) {
   const params = frameId ? { frameActor: frameId } : {};
   if (!tabTarget || !tabTarget.activeConsole) {
     return Promise.resolve();
   }
 
   return new Promise(resolve => {
     tabTarget.activeConsole.evaluateJS(script, result => resolve(result), params);
@@ -30085,16 +30089,17 @@ const clientCommands = {
   stepOver,
   breakOnNext,
   sourceContents,
   getBreakpointByLocation,
   setBreakpoint,
   removeBreakpoint,
   setBreakpointCondition,
   evaluate,
+  evaluateInFrame,
   debuggeeCommand,
   navigate,
   reload,
   getProperties,
   getFrameScopes,
   pauseOnExceptions,
   prettyPrint,
   disablePrettyPrint,
@@ -31254,17 +31259,17 @@ exports.default = async function addBrea
     return { breakpoint: newBreakpoint };
   }
 
   const { id, hitCount, actualLocation } = await client.setBreakpoint(generatedLocation, breakpoint.condition, sourceMaps.isOriginalId(location.sourceId));
 
   const newGeneratedLocation = actualLocation || generatedLocation;
   const newLocation = await sourceMaps.getOriginalLocation(newGeneratedLocation);
 
-  const astLocation = await (0, _breakpoint.getASTLocation)(sourceRecord, location);
+  const astLocation = await (0, _breakpoint.getASTLocation)(sourceRecord, newLocation);
 
   const newBreakpoint = {
     id,
     disabled: false,
     hidden: breakpoint.hidden,
     loading: false,
     condition: breakpoint.condition,
     location: newLocation,
@@ -31712,30 +31717,31 @@ Object.defineProperty(exports, "__esModu
 });
 exports.fetchEventListeners = fetchEventListeners;
 exports.updateEventBreakpoints = updateEventBreakpoints;
 
 var _DevToolsUtils = __webpack_require__(1432);
 
 var _selectors = __webpack_require__(1352);
 
+var _waitService = __webpack_require__(1659);
+
 // delay is in ms
-/* 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/. */
-
-/* global window gThreadClient setNamedTimeout services EVENTS */
+const FETCH_EVENT_LISTENERS_DELAY = 200; /* 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/. */
+
+/* global window gThreadClient setNamedTimeout EVENTS */
 /* eslint no-shadow: 0  */
 
 /**
  * Redux actions for the event listeners state
  * @module actions/event-listeners
  */
 
-const FETCH_EVENT_LISTENERS_DELAY = 200;
 let fetchListenersTimerID;
 
 /**
  * @memberof utils/utils
  * @static
  */
 async function asPaused(state, client, func) {
   if (!(0, _selectors.isPaused)(state)) {
@@ -31771,17 +31777,17 @@ function fetchEventListeners() {
     }
 
     fetchListenersTimerID = setTimeout(() => {
       // In case there is still a request of listeners going on (it
       // takes several RDP round trips right now), make sure we wait
       // on a currently running request
       if (getState().eventListeners.fetchingListeners) {
         dispatch({
-          type: services.WAIT_UNTIL,
+          type: _waitService.NAME,
           predicate: action => action.type === "FETCH_EVENT_LISTENERS" && action.status === "done",
           run: dispatch => dispatch(fetchEventListeners())
         });
         return;
       }
 
       dispatch({
         type: "FETCH_EVENT_LISTENERS",
@@ -33120,28 +33126,29 @@ const svg = {
   express: __webpack_require__(1003),
   pug: __webpack_require__(1004),
   extjs: __webpack_require__(1043),
   mobx: __webpack_require__(1733),
   marko: __webpack_require__(1649),
   nextjs: __webpack_require__(1650),
   showSources: __webpack_require__(1044),
   showOutline: __webpack_require__(1045),
-  nuxtjs: __webpack_require__(1651)
+  nuxtjs: __webpack_require__(1651),
+  rxjs: __webpack_require__(1808)
 };
 
 function Svg({ name, className, onClick, "aria-label": ariaLabel }) {
   if (!svg[name]) {
     const error = `Unknown SVG: ${name}`;
     if (isDevelopment()) {
       throw new Error(error);
     }
 
     console.warn(error);
-    return;
+    return null;
   }
 
   className = `${name} ${className || ""}`;
   if (name === "subSettings") {
     className = "";
   }
 
   const props = {
@@ -36106,35 +36113,33 @@ var _Popover = __webpack_require__(1586)
 var _Popover2 = _interopRequireDefault(_Popover);
 
 var _PreviewFunction = __webpack_require__(1446);
 
 var _PreviewFunction2 = _interopRequireDefault(_PreviewFunction);
 
 var _editor = __webpack_require__(1358);
 
+var _preview = __webpack_require__(1807);
+
 var _Svg = __webpack_require__(1359);
 
 var _Svg2 = _interopRequireDefault(_Svg);
 
 __webpack_require__(1328);
 
 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 const { REPS: { Rep }, MODE, ObjectInspectorUtils } = _devtoolsReps2.default; /* 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/>. */
 
 const { ObjectInspector } = _devtoolsReps2.default;
 const { getChildren } = ObjectInspectorUtils;
 
-function isReactComponent(roots) {
-  return roots.some(root => root.name === "_reactInternalInstance");
-}
-
 class Popup extends _react.Component {
 
   componentDidMount() {
     const {
       loadObjectProperties,
       loadedObjects,
       value,
       editor,
@@ -36183,70 +36188,87 @@ class Popup extends _react.Component {
       {
         className: "preview-popup",
         onClick: () => selectSourceURL(location.url, { line: location.line })
       },
       _react2.default.createElement(_PreviewFunction2.default, { func: value })
     );
   }
 
+  renderReact(react, roots) {
+    const reactHeader = react.displayName || "React Component";
+
+    const header = _react2.default.createElement(
+      "div",
+      { className: "header-container" },
+      _react2.default.createElement(
+        "h3",
+        null,
+        reactHeader
+      )
+    );
+
+    roots = roots.filter(r => ["state", "props"].includes(r.name));
+    return _react2.default.createElement(
+      "div",
+      { className: "preview-popup" },
+      header,
+      this.renderObjectInspector(roots)
+    );
+  }
+
+  renderImmutable(immutable, roots) {
+    const immutableHeader = immutable.type || "Immutable";
+
+    const header = _react2.default.createElement(
+      "div",
+      { className: "header-container" },
+      _react2.default.createElement(_Svg2.default, { name: "immutable", className: "immutable-logo" }),
+      _react2.default.createElement(
+        "h3",
+        null,
+        immutableHeader
+      )
+    );
+
+    roots = [{
+      path: "entries",
+      contents: { value: immutable.entries }
+    }];
+
+    return _react2.default.createElement(
+      "div",
+      { className: "preview-popup" },
+      header,
+      this.renderObjectInspector(roots)
+    );
+  }
+
   renderObjectPreview(expression, root, extra) {
-    let header = null;
     const { loadedObjects } = this.props;
     const { extra: { react, immutable } } = this.props;
     const getObjectProperties = id => loadedObjects[id];
-    let roots = this.getChildren(root, getObjectProperties);
+    const roots = this.getChildren(root, getObjectProperties);
+    const grip = root.contents.value;
 
     if (!roots) {
       return null;
     }
 
-    if (isReactComponent(roots)) {
-      const reactHeader = react.displayName || "React Component";
-
-      header = _react2.default.createElement(
-        "div",
-        { className: "header-container" },
-        _react2.default.createElement(
-          "h3",
-          null,
-          reactHeader
-        )
-      );
-
-      roots = roots.filter(r => ["state", "props"].includes(r.name));
-    }
-
-    if (immutable.isImmutable) {
-      const immutableHeader = immutable.type || "Immutable";
-
-      header = _react2.default.createElement(
-        "div",
-        { className: "header-container" },
-        _react2.default.createElement(_Svg2.default, { name: "immutable", className: "immutable-logo" }),
-        _react2.default.createElement(
-          "h3",
-          null,
-          immutableHeader
-        )
-      );
-
-      roots = roots.filter(r => ["size"].includes(r.name));
-
-      roots.push({
-        name: "entries",
-        contents: { value: immutable.entries },
-        path: "entries"
-      });
+    if ((0, _preview.isReactComponent)(grip)) {
+      return this.renderReact(react, roots);
+    }
+
+    if ((0, _preview.isImmutable)(grip)) {
+      return this.renderImmutable(immutable, roots);
     }
 
     return _react2.default.createElement(
       "div",
       { className: "preview-popup" },
-      header,
       this.renderObjectInspector(roots)
     );
   }
 
   renderSimplePreview(value) {
     const { openLink } = this.props;
     return _react2.default.createElement(
       "div",
@@ -41458,16 +41480,20 @@ var _pause = __webpack_require__(1400);
 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 function renderExceptionSummary(exception) {
   if (typeof exception === "string") {
     return exception;
   }
 
   const preview = exception.preview;
+  if (!preview) {
+    return;
+  }
+
   return `${preview.name}: ${preview.message}`;
 } /* 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/>. */
 
 function renderMessage(why) {
   if (why.type == "exception" && why.exception) {
     return _react2.default.createElement(
@@ -47790,44 +47816,71 @@ module.exports = {
 
 "use strict";
 
 
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
 
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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/>. */
 
 exports.updatePreview = updatePreview;
 exports.setPreview = setPreview;
 exports.clearPreview = clearPreview;
 
 var _ast = __webpack_require__(1638);
 
 var _editor = __webpack_require__(1358);
 
+var _preview = __webpack_require__(1807);
+
 var _devtoolsSourceMap = __webpack_require__(1360);
 
 var _promise = __webpack_require__(1653);
 
 var _selectors = __webpack_require__(1352);
 
 var _expressions = __webpack_require__(1398);
 
 var _lodash = __webpack_require__(2);
 
-const extraProps = {
-  react: { displayName: "this._reactInternalInstance.getName()" },
-  immutable: {
-    isImmutable: exp => `Immutable.Iterable.isIterable(${exp})`,
-    entries: exp => `${exp}.toJS()`,
-    type: exp => `${exp}.constructor.name`
-  }
-};
+async function getReactProps(evaluate) {
+  const reactDisplayName = await evaluate("this._reactInternalInstance.getName()");
+
+  return {
+    displayName: reactDisplayName.result
+  };
+}
+
+async function getImmutableProps(expression, evaluate) {
+  const immutableEntries = await evaluate((exp => `${exp}.toJS()`)(expression));
+
+  const immutableType = await evaluate((exp => `${exp}.constructor.name`)(expression));
+
+  return {
+    type: immutableType.result,
+    entries: immutableEntries.result
+  };
+}
+
+async function getExtraProps(expression, result, evaluate) {
+  const props = {};
+  if ((0, _preview.isReactComponent)(result)) {
+    props.react = await getReactProps(evaluate);
+  }
+
+  if ((0, _preview.isImmutable)(result)) {
+    props.immutable = await getImmutableProps(expression, evaluate);
+  }
+
+  return props;
+}
 
 function updatePreview(target, editor) {
   return ({ dispatch, getState, client, sourceMaps }) => {
     const location = (0, _editor.getTokenLocation)(editor.codeMirror, target);
     const tokenText = target.innerText ? target.innerText.trim() : "";
     const cursorPos = target.getBoundingClientRect();
     const preview = (0, _selectors.getPreview)(getState());
 
@@ -47874,23 +47927,20 @@ function setPreview(token, tokenPos, cur
     const currentSelection = (0, _selectors.getPreview)(getState());
     if (currentSelection && currentSelection.updating) {
       return;
     }
 
     await dispatch({
       type: "SET_PREVIEW",
       [_promise.PROMISE]: async function () {
-        let immutableType = null;
-        let immutableEntries = null;
-
         const source = (0, _selectors.getSelectedSource)(getState());
         const symbols = (0, _selectors.getSymbols)(getState(), source.toJS());
-
         const found = (0, _ast.findBestMatchExpression)(symbols, tokenPos, token);
+
         if (!found) {
           return;
         }
 
         let { expression, location } = found;
 
         if (!expression) {
           return;
@@ -47899,53 +47949,24 @@ function setPreview(token, tokenPos, cur
         const sourceId = source.get("id");
         if (location && !(0, _devtoolsSourceMap.isGeneratedId)(sourceId)) {
           const generatedLocation = await sourceMaps.getGeneratedLocation(_extends({}, location.start, { sourceId }), source.toJS());
 
           expression = await (0, _expressions.getMappedExpression)({ sourceMaps }, generatedLocation, expression);
         }
 
         const selectedFrame = (0, _selectors.getSelectedFrame)(getState());
-        const { result } = await client.evaluate(expression, {
-          frameId: selectedFrame.id
-        });
-
-        const reactDisplayName = await client.evaluate(extraProps.react.displayName, {
-          frameId: selectedFrame.id
-        });
-
-        const immutable = await client.evaluate(extraProps.immutable.isImmutable(expression), {
-          frameId: selectedFrame.id
-        });
-
-        if (immutable.result === true) {
-          immutableEntries = await client.evaluate(extraProps.immutable.entries(expression), {
-            frameId: selectedFrame.id
-          });
-
-          immutableType = await client.evaluate(extraProps.immutable.type(expression), {
-            frameId: selectedFrame.id
-          });
-        }
-
-        const extra = {
-          react: {
-            displayName: reactDisplayName.result
-          },
-          immutable: {
-            isImmutable: immutable.result && immutable.result.type !== "undefined",
-            type: immutableType && immutableType.result,
-            entries: immutableEntries && immutableEntries.result
-          }
-        };
+        const { result } = await client.evaluateInFrame(selectedFrame.id, expression);
 
         if (result === undefined) {
           return;
         }
 
+        const extra = await getExtraProps(expression, result, expr => client.evaluateInFrame(selectedFrame.id, expr));
+
         return {
           expression,
           result,
           location,
           tokenPos,
           cursorPos,
           extra
         };
@@ -49716,11 +49737,61 @@ function createEditor() {
       // Override code mirror keymap to avoid conflicts with split console.
       Esc: false,
       "Cmd-F": false,
       "Cmd-G": false
     }
   });
 }
 
+/***/ }),
+/* 1807 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.isImmutable = isImmutable;
+exports.isReactComponent = isReactComponent;
+
+
+const IMMUTABLE_FIELDS = ["_root", "__ownerID", "__altered", "__hash"]; /* 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/>. */
+
+function isImmutable(result) {
+  if (!result || !result.preview) {
+    return;
+  }
+
+  const ownProperties = result.preview.ownProperties;
+  if (!ownProperties) {
+    return;
+  }
+
+  return IMMUTABLE_FIELDS.every(field => Object.keys(ownProperties).includes(field));
+}
+
+function isReactComponent(result) {
+  if (!result || !result.preview) {
+    return;
+  }
+
+  const ownProperties = result.preview.ownProperties;
+  if (!ownProperties) {
+    return;
+  }
+
+  return Object.keys(ownProperties).includes("_reactInternalInstance");
+}
+
+/***/ }),
+/* 1808 */
+/***/ (function(module, exports) {
+
+module.exports = "<!-- 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/. --><svg viewBox=\"0 0 256 247\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid\"><defs><radialGradient cx=\"78.7636112%\" cy=\"37.8476394%\" fx=\"78.7636112%\" fy=\"37.8476394%\" r=\"89.8725577%\" id=\"radialGradient-1\"><stop stop-color=\"#F80090\" offset=\"0%\"></stop><stop stop-color=\"#4D008E\" offset=\"100%\"></stop></radialGradient><radialGradient cx=\"68.7389016%\" cy=\"4.39833672%\" fx=\"68.7389016%\" fy=\"4.39833672%\" r=\"81.7284786%\" id=\"radialGradient-2\"><stop stop-color=\"#57008E\" offset=\"0%\"></stop><stop stop-color=\"#5C008E\" offset=\"29.1746283%\"></stop><stop stop-color=\"#F80090\" offset=\"100%\"></stop></radialGradient><linearGradient x1=\"18.2386532%\" y1=\"0%\" x2=\"81.1591125%\" y2=\"84.3374763%\" id=\"linearGradient-3\"><stop stop-color=\"#F70090\" offset=\"0%\"></stop><stop stop-color=\"#E50090\" offset=\"66.9712865%\"></stop><stop stop-color=\"#D6008F\" stop-opacity=\"0.2\" offset=\"82.7147533%\"></stop><stop stop-color=\"#C10090\" stop-opacity=\"0\" offset=\"100%\"></stop></linearGradient><linearGradient x1=\"64.9060589%\" y1=\"71.5585538%\" x2=\"44.2897699%\" y2=\"50%\" id=\"linearGradient-4\"><stop stop-color=\"#B2008F\" stop-opacity=\"0.151340138\" offset=\"0%\"></stop><stop stop-color=\"#F70090\" stop-opacity=\"0.4\" offset=\"40.0350765%\"></stop><stop stop-color=\"#F60090\" stop-opacity=\"0.891668\" offset=\"64.8995536%\"></stop><stop stop-color=\"#FF0090\" offset=\"100%\"></stop></linearGradient></defs><g><path d=\"M16.6852208,157.125328 C3.56690702,87.3798324 38.2363025,20.1145078 117.808706,11.1662199 C106.835616,-0.558801732 91.8452087,-0.646905628 84.9481697,0.779380087 C72.770288,4.66044372 73.1525932,12.540855 59.3390152,22.7199675 C45.6064437,30.5634307 38.7094156,24.5568182 28.7057455,32.6879515 C18.7234849,40.7583874 25.6888528,59.2851732 21.5022823,62.8870857 C17.3464381,70.0905489 4.45500952,76.5077264 2.10834286,85.6062545 C0.168948918,97.2420641 7.37241212,105.553752 7.09535584,115.527778 C7.92652468,123.839467 -1.17920693,128.539449 0.129052814,135.275796 C4.0477368,146.281025 11.600845,152.904887 15.1615723,155.958047 C15.9781085,156.533531 16.8404881,157.95083 16.6852208,157.125328 L16.6852208,157.125328 Z\" fill=\"#FF0090\"></path><path d=\"M158.275491,60.578542 C155.368486,60.578542 153.011422,58.2214776 153.011422,55.3144727 C153.011422,52.4074679 155.368486,50.0504035 158.275491,50.0504035 C161.182496,50.0504035 163.53956,52.4074679 163.53956,55.3144727 C163.53956,58.2214776 161.182496,60.578542 158.275491,60.578542 L158.275491,60.578542 Z M19.7566405,164.732808 C7.1500258,104.116773 46.1602355,53.4676156 121.704062,78.4026805 C166.031404,104.334594 221.793282,102.646102 224.307422,85.8832 C230.514061,65.7878769 196.047681,24.3767065 144.515214,13.5715117 C42.2814476,-6.37654026 -12.8335943,104.116774 19.7566405,164.732808 L19.7566405,164.732808 Z\" fill=\"url(#radialGradient-1)\"></path><path d=\"M187.458604,171.493257 C202.639072,173.137863 217.048769,169.494573 230.402327,158.61014 C210.228197,181.112651 185.002777,192.426521 156.059262,195.505171 C169.878829,207.254019 183.20579,212.546348 195.955366,210.281136 C160.528734,220.05679 130.847947,209.296529 94.7424273,173.340673 C92.8517347,183.020022 103.074741,198.100667 113.611745,207.727264 C52.4742909,181.221845 47.1143627,98.6544556 121.66531,78.3442237 C44.3844415,41.214641 0.686373501,113.357693 22.1558444,172.485931 C43.1623368,218.026693 99.1402667,253.085223 160.492163,245.3753 C190.292928,241.7251 234.79401,221.178935 252.973664,172.485931 C240.160919,183.983766 217.257941,193.997836 207.037617,194.765984 C241.628648,177.478781 260.301586,148.103896 255.060336,107.955387 C247.895106,125.013742 238.441392,138.114625 226.616076,147.112305 C251.735653,107.955387 247.425219,87.716426 228.832526,65.4732398 C242.131228,102.044668 224.928249,142.633967 187.458604,171.493257 L187.458604,171.493257 Z\" fill=\"url(#radialGradient-2)\"></path><path d=\"M169.707072,213.625541 C167.082407,213.13513 175.656929,217.098842 159.079366,212.710316 C142.501804,208.32179 125.622502,204.092744 94.7424273,173.340673 C92.8517347,183.020022 103.074741,198.100667 113.611745,207.727264 C142.056275,227.564927 122.711866,218.286797 166.051946,233.269481 C169.52976,226.346862 169.707072,220.195346 169.707072,213.625541 L169.707072,213.625541 Z\" fill=\"url(#linearGradient-3)\"></path><path d=\"M114.601372,57.8510108 C114.601372,57.8510108 118.369452,52.2893628 119.836219,49.7810251 C121.633641,46.7072319 124.393939,41.104618 124.393939,41.104618 C124.393939,41.104618 95.389611,31.6417749 88.2716448,30.4871665 C66.1450215,36.2308801 66.0645022,45.5009559 78.435065,59.690116 C79.8114806,61.2693368 114.601372,57.8510108 114.601372,57.8510108 L114.601372,57.8510108 Z\" fill=\"url(#linearGradient-4)\"></path></g></svg>"
+
 /***/ })
 /******/ ]);
 });
\ No newline at end of file
--- a/devtools/client/debugger/new/parser-worker.js
+++ b/devtools/client/debugger/new/parser-worker.js
@@ -20121,17 +20121,17 @@ var _defaults2 = _interopRequireDefault(
 var _babelMessages = __webpack_require__(612);
 
 var messages = _interopRequireWildcard(_babelMessages);
 
 var _binding2 = __webpack_require__(608);
 
 var _binding3 = _interopRequireDefault(_binding2);
 
-var _globals = __webpack_require__(1807);
+var _globals = __webpack_require__(1809);
 
 var _globals2 = _interopRequireDefault(_globals);
 
 var _babelTypes = __webpack_require__(493);
 
 var t = _interopRequireWildcard(_babelTypes);
 
 var _cache = __webpack_require__(618);
@@ -36311,17 +36311,17 @@ function hasSource(sourceId) {
 }
 
 function setSource(source) {
   cachedSources.set(source.id, source);
 }
 
 function getSource(sourceId) {
   if (!cachedSources.has(sourceId)) {
-    throw new Error(`${sourceId} was not provided.`);
+    throw new Error(`Parser: ${sourceId} was not provided.`);
   }
   return cachedSources.get(sourceId);
 }
 
 function clearSources() {
   cachedSources = new Map();
 }
 
@@ -42000,23 +42000,25 @@ module.exports = baseToPairs;
 /* 1799 */,
 /* 1800 */,
 /* 1801 */,
 /* 1802 */,
 /* 1803 */,
 /* 1804 */,
 /* 1805 */,
 /* 1806 */,
-/* 1807 */
-/***/ (function(module, exports, __webpack_require__) {
-
-module.exports = __webpack_require__(1808);
-
-
-/***/ }),
-/* 1808 */
+/* 1807 */,
+/* 1808 */,
+/* 1809 */
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = __webpack_require__(1810);
+
+
+/***/ }),
+/* 1810 */
 /***/ (function(module, exports) {
 
 module.exports = {"builtin":{"Array":false,"ArrayBuffer":false,"Boolean":false,"constructor":false,"DataView":false,"Date":false,"decodeURI":false,"decodeURIComponent":false,"encodeURI":false,"encodeURIComponent":false,"Error":false,"escape":false,"eval":false,"EvalError":false,"Float32Array":false,"Float64Array":false,"Function":false,"hasOwnProperty":false,"Infinity":false,"Int16Array":false,"Int32Array":false,"Int8Array":false,"isFinite":false,"isNaN":false,"isPrototypeOf":false,"JSON":false,"Map":false,"Math":false,"NaN":false,"Number":false,"Object":false,"parseFloat":false,"parseInt":false,"Promise":false,"propertyIsEnumerable":false,"Proxy":false,"RangeError":false,"ReferenceError":false,"Reflect":false,"RegExp":false,"Set":false,"String":false,"Symbol":false,"SyntaxError":false,"System":false,"toLocaleString":false,"toString":false,"TypeError":false,"Uint16Array":false,"Uint32Array":false,"Uint8Array":false,"Uint8ClampedArray":false,"undefined":false,"unescape":false,"URIError":false,"valueOf":false,"WeakMap":false,"WeakSet":false},"es5":{"Array":false,"Boolean":false,"constructor":false,"Date":false,"decodeURI":false,"decodeURIComponent":false,"encodeURI":false,"encodeURIComponent":false,"Error":false,"escape":false,"eval":false,"EvalError":false,"Function":false,"hasOwnProperty":false,"Infinity":false,"isFinite":false,"isNaN":false,"isPrototypeOf":false,"JSON":false,"Math":false,"NaN":false,"Number":false,"Object":false,"parseFloat":false,"parseInt":false,"propertyIsEnumerable":false,"RangeError":false,"ReferenceError":false,"RegExp":false,"String":false,"SyntaxError":false,"toLocaleString":false,"toString":false,"TypeError":false,"undefined":false,"unescape":false,"URIError":false,"valueOf":false},"es6":{"Array":false,"ArrayBuffer":false,"Boolean":false,"constructor":false,"DataView":false,"Date":false,"decodeURI":false,"decodeURIComponent":false,"encodeURI":false,"encodeURIComponent":false,"Error":false,"escape":false,"eval":false,"EvalError":false,"Float32Array":false,"Float64Array":false,"Function":false,"hasOwnProperty":false,"Infinity":false,"Int16Array":false,"Int32Array":false,"Int8Array":false,"isFinite":false,"isNaN":false,"isPrototypeOf":false,"JSON":false,"Map":false,"Math":false,"NaN":false,"Number":false,"Object":false,"parseFloat":false,"parseInt":false,"Promise":false,"propertyIsEnumerable":false,"Proxy":false,"RangeError":false,"ReferenceError":false,"Reflect":false,"RegExp":false,"Set":false,"String":false,"Symbol":false,"SyntaxError":false,"System":false,"toLocaleString":false,"toString":false,"TypeError":false,"Uint16Array":false,"Uint32Array":false,"Uint8Array":false,"Uint8ClampedArray":false,"undefined":false,"unescape":false,"URIError":false,"valueOf":false,"WeakMap":false,"WeakSet":false},"browser":{"addEventListener":false,"alert":false,"AnalyserNode":false,"Animation":false,"AnimationEffectReadOnly":false,"AnimationEffectTiming":false,"AnimationEffectTimingReadOnly":false,"AnimationEvent":false,"AnimationPlaybackEvent":false,"AnimationTimeline":false,"applicationCache":false,"ApplicationCache":false,"ApplicationCacheErrorEvent":false,"atob":false,"Attr":false,"Audio":false,"AudioBuffer":false,"AudioBufferSourceNode":false,"AudioContext":false,"AudioDestinationNode":false,"AudioListener":false,"AudioNode":false,"AudioParam":false,"AudioProcessingEvent":false,"AutocompleteErrorEvent":false,"BarProp":false,"BatteryManager":false,"BeforeUnloadEvent":false,"BiquadFilterNode":false,"Blob":false,"blur":false,"btoa":false,"Cache":false,"caches":false,"CacheStorage":false,"cancelAnimationFrame":false,"cancelIdleCallback":false,"CanvasGradient":false,"CanvasPattern":false,"CanvasRenderingContext2D":false,"CDATASection":false,"ChannelMergerNode":false,"ChannelSplitterNode":false,"CharacterData":false,"clearInterval":false,"clearTimeout":false,"clientInformation":false,"ClientRect":false,"ClientRectList":false,"ClipboardEvent":false,"close":false,"closed":false,"CloseEvent":false,"Comment":false,"CompositionEvent":false,"confirm":false,"console":false,"ConvolverNode":false,"createImageBitmap":false,"Credential":false,"CredentialsContainer":false,"crypto":false,"Crypto":false,"CryptoKey":false,"CSS":false,"CSSAnimation":false,"CSSFontFaceRule":false,"CSSImportRule":false,"CSSKeyframeRule":false,"CSSKeyframesRule":false,"CSSMediaRule":false,"CSSPageRule":false,"CSSRule":false,"CSSRuleList":false,"CSSStyleDeclaration":false,"CSSStyleRule":false,"CSSStyleSheet":false,"CSSSupportsRule":false,"CSSTransition":false,"CSSUnknownRule":false,"CSSViewportRule":false,"customElements":false,"CustomEvent":false,"DataTransfer":false,"DataTransferItem":false,"DataTransferItemList":false,"Debug":false,"defaultStatus":false,"defaultstatus":false,"DelayNode":false,"DeviceMotionEvent":false,"DeviceOrientationEvent":false,"devicePixelRatio":false,"dispatchEvent":false,"document":false,"Document":false,"DocumentFragment":false,"DocumentTimeline":false,"DocumentType":false,"DOMError":false,"DOMException":false,"DOMImplementation":false,"DOMParser":false,"DOMSettableTokenList":false,"DOMStringList":false,"DOMStringMap":false,"DOMTokenList":false,"DragEvent":false,"DynamicsCompressorNode":false,"Element":false,"ElementTimeControl":false,"ErrorEvent":false,"event":false,"Event":false,"EventSource":false,"EventTarget":false,"external":false,"FederatedCredential":false,"fetch":false,"File":false,"FileError":false,"FileList":false,"FileReader":false,"find":false,"focus":false,"FocusEvent":false,"FontFace":false,"FormData":false,"frameElement":false,"frames":false,"GainNode":false,"Gamepad":false,"GamepadButton":false,"GamepadEvent":false,"getComputedStyle":false,"getSelection":false,"HashChangeEvent":false,"Headers":false,"history":false,"History":false,"HTMLAllCollection":false,"HTMLAnchorElement":false,"HTMLAppletElement":false,"HTMLAreaElement":false,"HTMLAudioElement":false,"HTMLBaseElement":false,"HTMLBlockquoteElement":false,"HTMLBodyElement":false,"HTMLBRElement":false,"HTMLButtonElement":false,"HTMLCanvasElement":false,"HTMLCollection":false,"HTMLContentElement":false,"HTMLDataListElement":false,"HTMLDetailsElement":false,"HTMLDialogElement":false,"HTMLDirectoryElement":false,"HTMLDivElement":false,"HTMLDListElement":false,"HTMLDocument":false,"HTMLElement":false,"HTMLEmbedElement":false,"HTMLFieldSetElement":false,"HTMLFontElement":false,"HTMLFormControlsCollection":false,"HTMLFormElement":false,"HTMLFrameElement":false,"HTMLFrameSetElement":false,"HTMLHeadElement":false,"HTMLHeadingElement":false,"HTMLHRElement":false,"HTMLHtmlElement":false,"HTMLIFrameElement":false,"HTMLImageElement":false,"HTMLInputElement":false,"HTMLIsIndexElement":false,"HTMLKeygenElement":false,"HTMLLabelElement":false,"HTMLLayerElement":false,"HTMLLegendElement":false,"HTMLLIElement":false,"HTMLLinkElement":false,"HTMLMapElement":false,"HTMLMarqueeElement":false,"HTMLMediaElement":false,"HTMLMenuElement":false,"HTMLMetaElement":false,"HTMLMeterElement":false,"HTMLModElement":false,"HTMLObjectElement":false,"HTMLOListElement":false,"HTMLOptGroupElement":false,"HTMLOptionElement":false,"HTMLOptionsCollection":false,"HTMLOutputElement":false,"HTMLParagraphElement":false,"HTMLParamElement":false,"HTMLPictureElement":false,"HTMLPreElement":false,"HTMLProgressElement":false,"HTMLQuoteElement":false,"HTMLScriptElement":false,"HTMLSelectElement":false,"HTMLShadowElement":false,"HTMLSourceElement":false,"HTMLSpanElement":false,"HTMLStyleElement":false,"HTMLTableCaptionElement":false,"HTMLTableCellElement":false,"HTMLTableColElement":false,"HTMLTableElement":false,"HTMLTableRowElement":false,"HTMLTableSectionElement":false,"HTMLTemplateElement":false,"HTMLTextAreaElement":false,"HTMLTitleElement":false,"HTMLTrackElement":false,"HTMLUListElement":false,"HTMLUnknownElement":false,"HTMLVideoElement":false,"IDBCursor":false,"IDBCursorWithValue":false,"IDBDatabase":false,"IDBEnvironment":false,"IDBFactory":false,"IDBIndex":false,"IDBKeyRange":false,"IDBObjectStore":false,"IDBOpenDBRequest":false,"IDBRequest":false,"IDBTransaction":false,"IDBVersionChangeEvent":false,"Image":false,"ImageBitmap":false,"ImageData":false,"indexedDB":false,"innerHeight":false,"innerWidth":false,"InputEvent":false,"InputMethodContext":false,"IntersectionObserver":false,"IntersectionObserverEntry":false,"Intl":false,"KeyboardEvent":false,"KeyframeEffect":false,"KeyframeEffectReadOnly":false,"length":false,"localStorage":false,"location":false,"Location":false,"locationbar":false,"matchMedia":false,"MediaElementAudioSourceNode":false,"MediaEncryptedEvent":false,"MediaError":false,"MediaKeyError":false,"MediaKeyEvent":false,"MediaKeyMessageEvent":false,"MediaKeys":false,"MediaKeySession":false,"MediaKeyStatusMap":false,"MediaKeySystemAccess":false,"MediaList":false,"MediaQueryList":false,"MediaQueryListEvent":false,"MediaSource":false,"MediaRecorder":false,"MediaStream":false,"MediaStreamAudioDestinationNode":false,"MediaStreamAudioSourceNode":false,"MediaStreamEvent":false,"MediaStreamTrack":false,"menubar":false,"MessageChannel":false,"MessageEvent":false,"MessagePort":false,"MIDIAccess":false,"MIDIConnectionEvent":false,"MIDIInput":false,"MIDIInputMap":false,"MIDIMessageEvent":false,"MIDIOutput":false,"MIDIOutputMap":false,"MIDIPort":false,"MimeType":false,"MimeTypeArray":false,"MouseEvent":false,"moveBy":false,"moveTo":false,"MutationEvent":false,"MutationObserver":false,"MutationRecord":false,"name":false,"NamedNodeMap":false,"navigator":false,"Navigator":false,"Node":false,"NodeFilter":false,"NodeIterator":false,"NodeList":false,"Notification":false,"OfflineAudioCompletionEvent":false,"OfflineAudioContext":false,"offscreenBuffering":false,"onbeforeunload":true,"onblur":true,"onerror":true,"onfocus":true,"onload":true,"onresize":true,"onunload":true,"open":false,"openDatabase":false,"opener":false,"opera":false,"Option":false,"OscillatorNode":false,"outerHeight":false,"outerWidth":false,"PageTransitionEvent":false,"pageXOffset":false,"pageYOffset":false,"parent":false,"PasswordCredential":false,"Path2D":false,"performance":false,"Performance":false,"PerformanceEntry":false,"PerformanceMark":false,"PerformanceMeasure":false,"PerformanceNavigation":false,"PerformanceResourceTiming":false,"PerformanceTiming":false,"PeriodicWave":false,"Permissions":false,"PermissionStatus":false,"personalbar":false,"Plugin":false,"PluginArray":false,"PopStateEvent":false,"postMessage":false,"print":false,"ProcessingInstruction":false,"ProgressEvent":false,"PromiseRejectionEvent":false,"prompt":false,"PushManager":false,"PushSubscription":false,"RadioNodeList":false,"Range":false,"ReadableByteStream":false,"ReadableStream":false,"removeEventListener":false,"Request":false,"requestAnimationFrame":false,"requestIdleCallback":false,"resizeBy":false,"resizeTo":false,"Response":false,"RTCIceCandidate":false,"RTCSessionDescription":false,"RTCPeerConnection":false,"screen":false,"Screen":false,"screenLeft":false,"ScreenOrientation":false,"screenTop":false,"screenX":false,"screenY":false,"ScriptProcessorNode":false,"scroll":false,"scrollbars":false,"scrollBy":false,"scrollTo":false,"scrollX":false,"scrollY":false,"SecurityPolicyViolationEvent":false,"Selection":false,"self":false,"ServiceWorker":false,"ServiceWorkerContainer":false,"ServiceWorkerRegistration":false,"sessionStorage":false,"setInterval":false,"setTimeout":false,"ShadowRoot":false,"SharedKeyframeList":false,"SharedWorker":false,"showModalDialog":false,"SiteBoundCredential":false,"speechSynthesis":false,"SpeechSynthesisEvent":false,"SpeechSynthesisUtterance":false,"status":false,"statusbar":false,"stop":false,"Storage":false,"StorageEvent":false,"styleMedia":false,"StyleSheet":false,"StyleSheetList":false,"SubtleCrypto":false,"SVGAElement":false,"SVGAltGlyphDefElement":false,"SVGAltGlyphElement":false,"SVGAltGlyphItemElement":false,"SVGAngle":false,"SVGAnimateColorElement":false,"SVGAnimatedAngle":false,"SVGAnimatedBoolean":false,"SVGAnimatedEnumeration":false,"SVGAnimatedInteger":false,"SVGAnimatedLength":false,"SVGAnimatedLengthList":false,"SVGAnimatedNumber":false,"SVGAnimatedNumberList":false,"SVGAnimatedPathData":false,"SVGAnimatedPoints":false,"SVGAnimatedPreserveAspectRatio":false,"SVGAnimatedRect":false,"SVGAnimatedString":false,"SVGAnimatedTransformList":false,"SVGAnimateElement":false,"SVGAnimateMotionElement":false,"SVGAnimateTransformElement":false,"SVGAnimationElement":false,"SVGCircleElement":false,"SVGClipPathElement":false,"SVGColor":false,"SVGColorProfileElement":false,"SVGColorProfileRule":false,"SVGComponentTransferFunctionElement":false,"SVGCSSRule":false,"SVGCursorElement":false,"SVGDefsElement":false,"SVGDescElement":false,"SVGDiscardElement":false,"SVGDocument":false,"SVGElement":false,"SVGElementInstance":false,"SVGElementInstanceList":false,"SVGEllipseElement":false,"SVGEvent":false,"SVGExternalResourcesRequired":false,"SVGFEBlendElement":false,"SVGFEColorMatrixElement":false,"SVGFEComponentTransferElement":false,"SVGFECompositeElement":false,"SVGFEConvolveMatrixElement":false,"SVGFEDiffuseLightingElement":false,"SVGFEDisplacementMapElement":false,"SVGFEDistantLightElement":false,"SVGFEDropShadowElement":false,"SVGFEFloodElement":false,"SVGFEFuncAElement":false,"SVGFEFuncBElement":false,"SVGFEFuncGElement":false,"SVGFEFuncRElement":false,"SVGFEGaussianBlurElement":false,"SVGFEImageElement":false,"SVGFEMergeElement":false,"SVGFEMergeNodeElement":false,"SVGFEMorphologyElement":false,"SVGFEOffsetElement":false,"SVGFEPointLightElement":false,"SVGFESpecularLightingElement":false,"SVGFESpotLightElement":false,"SVGFETileElement":false,"SVGFETurbulenceElement":false,"SVGFilterElement":false,"SVGFilterPrimitiveStandardAttributes":false,"SVGFitToViewBox":false,"SVGFontElement":false,"SVGFontFaceElement":false,"SVGFontFaceFormatElement":false,"SVGFontFaceNameElement":false,"SVGFontFaceSrcElement":false,"SVGFontFaceUriElement":false,"SVGForeignObjectElement":false,"SVGGElement":false,"SVGGeometryElement":false,"SVGGlyphElement":false,"SVGGlyphRefElement":false,"SVGGradientElement":false,"SVGGraphicsElement":false,"SVGHKernElement":false,"SVGICCColor":false,"SVGImageElement":false,"SVGLangSpace":false,"SVGLength":false,"SVGLengthList":false,"SVGLinearGradientElement":false,"SVGLineElement":false,"SVGLocatable":false,"SVGMarkerElement":false,"SVGMaskElement":false,"SVGMatrix":false,"SVGMetadataElement":false,"SVGMissingGlyphElement":false,"SVGMPathElement":false,"SVGNumber":false,"SVGNumberList":false,"SVGPaint":false,"SVGPathElement":false,"SVGPathSeg":false,"SVGPathSegArcAbs":false,"SVGPathSegArcRel":false,"SVGPathSegClosePath":false,"SVGPathSegCurvetoCubicAbs":false,"SVGPathSegCurvetoCubicRel":false,"SVGPathSegCurvetoCubicSmoothAbs":false,"SVGPathSegCurvetoCubicSmoothRel":false,"SVGPathSegCurvetoQuadraticAbs":false,"SVGPathSegCurvetoQuadraticRel":false,"SVGPathSegCurvetoQuadraticSmoothAbs":false,"SVGPathSegCurvetoQuadraticSmoothRel":false,"SVGPathSegLinetoAbs":false,"SVGPathSegLinetoHorizontalAbs":false,"SVGPathSegLinetoHorizontalRel":false,"SVGPathSegLinetoRel":false,"SVGPathSegLinetoVerticalAbs":false,"SVGPathSegLinetoVerticalRel":false,"SVGPathSegList":false,"SVGPathSegMovetoAbs":false,"SVGPathSegMovetoRel":false,"SVGPatternElement":false,"SVGPoint":false,"SVGPointList":false,"SVGPolygonElement":false,"SVGPolylineElement":false,"SVGPreserveAspectRatio":false,"SVGRadialGradientElement":false,"SVGRect":false,"SVGRectElement":false,"SVGRenderingIntent":false,"SVGScriptElement":false,"SVGSetElement":false,"SVGStopElement":false,"SVGStringList":false,"SVGStylable":false,"SVGStyleElement":false,"SVGSVGElement":false,"SVGSwitchElement":false,"SVGSymbolElement":false,"SVGTests":false,"SVGTextContentElement":false,"SVGTextElement":false,"SVGTextPathElement":false,"SVGTextPositioningElement":false,"SVGTitleElement":false,"SVGTransform":false,"SVGTransformable":false,"SVGTransformList":false,"SVGTRefElement":false,"SVGTSpanElement":false,"SVGUnitTypes":false,"SVGURIReference":false,"SVGUseElement":false,"SVGViewElement":false,"SVGViewSpec":false,"SVGVKernElement":false,"SVGZoomAndPan":false,"SVGZoomEvent":false,"Text":false,"TextDecoder":false,"TextEncoder":false,"TextEvent":false,"TextMetrics":false,"TextTrack":false,"TextTrackCue":false,"TextTrackCueList":false,"TextTrackList":false,"TimeEvent":false,"TimeRanges":false,"toolbar":false,"top":false,"Touch":false,"TouchEvent":false,"TouchList":false,"TrackEvent":false,"TransitionEvent":false,"TreeWalker":false,"UIEvent":false,"URL":false,"URLSearchParams":false,"ValidityState":false,"VTTCue":false,"WaveShaperNode":false,"WebGLActiveInfo":false,"WebGLBuffer":false,"WebGLContextEvent":false,"WebGLFramebuffer":false,"WebGLProgram":false,"WebGLRenderbuffer":false,"WebGLRenderingContext":false,"WebGLShader":false,"WebGLShaderPrecisionFormat":false,"WebGLTexture":false,"WebGLUniformLocation":false,"WebSocket":false,"WheelEvent":false,"window":false,"Window":false,"Worker":false,"XDomainRequest":false,"XMLDocument":false,"XMLHttpRequest":false,"XMLHttpRequestEventTarget":false,"XMLHttpRequestProgressEvent":false,"XMLHttpRequestUpload":false,"XMLSerializer":false,"XPathEvaluator":false,"XPathException":false,"XPathExpression":false,"XPathNamespace":false,"XPathNSResolver":false,"XPathResult":false,"XSLTProcessor":false},"worker":{"applicationCache":false,"atob":false,"Blob":false,"BroadcastChannel":false,"btoa":false,"Cache":false,"caches":false,"clearInterval":false,"clearTimeout":false,"close":true,"console":false,"fetch":false,"FileReaderSync":false,"FormData":false,"Headers":false,"IDBCursor":false,"IDBCursorWithValue":false,"IDBDatabase":false,"IDBFactory":false,"IDBIndex":false,"IDBKeyRange":false,"IDBObjectStore":false,"IDBOpenDBRequest":false,"IDBRequest":false,"IDBTransaction":false,"IDBVersionChangeEvent":false,"ImageData":false,"importScripts":true,"indexedDB":false,"location":false,"MessageChannel":false,"MessagePort":false,"name":false,"navigator":false,"Notification":false,"onclose":true,"onconnect":true,"onerror":true,"onlanguagechange":true,"onmessage":true,"onoffline":true,"ononline":true,"onrejectionhandled":true,"onunhandledrejection":true,"performance":false,"Performance":false,"PerformanceEntry":false,"PerformanceMark":false,"PerformanceMeasure":false,"PerformanceNavigation":false,"PerformanceResourceTiming":false,"PerformanceTiming":false,"postMessage":true,"Promise":false,"Request":false,"Response":false,"self":true,"ServiceWorkerRegistration":false,"setInterval":false,"setTimeout":false,"TextDecoder":false,"TextEncoder":false,"URL":false,"URLSearchParams":false,"WebSocket":false,"Worker":false,"XMLHttpRequest":false},"node":{"__dirname":false,"__filename":false,"arguments":false,"Buffer":false,"clearImmediate":false,"clearInterval":false,"clearTimeout":false,"console":false,"exports":true,"GLOBAL":false,"global":false,"Intl":false,"module":false,"process":false,"require":false,"root":false,"setImmediate":false,"setInterval":false,"setTimeout":false},"commonjs":{"exports":true,"module":false,"require":false,"global":false},"amd":{"define":false,"require":false},"mocha":{"after":false,"afterEach":false,"before":false,"beforeEach":false,"context":false,"describe":false,"it":false,"mocha":false,"run":false,"setup":false,"specify":false,"suite":false,"suiteSetup":false,"suiteTeardown":false,"teardown":false,"test":false,"xcontext":false,"xdescribe":false,"xit":false,"xspecify":false},"jasmine":{"afterAll":false,"afterEach":false,"beforeAll":false,"beforeEach":false,"describe":false,"expect":false,"fail":false,"fdescribe":false,"fit":false,"it":false,"jasmine":false,"pending":false,"runs":false,"spyOn":false,"spyOnProperty":false,"waits":false,"waitsFor":false,"xdescribe":false,"xit":false},"jest":{"afterAll":false,"afterEach":false,"beforeAll":false,"beforeEach":false,"check":false,"describe":false,"expect":false,"gen":false,"it":false,"fdescribe":false,"fit":false,"jest":false,"pit":false,"require":false,"test":false,"xdescribe":false,"xit":false,"xtest":false},"qunit":{"asyncTest":false,"deepEqual":false,"equal":false,"expect":false,"module":false,"notDeepEqual":false,"notEqual":false,"notOk":false,"notPropEqual":false,"notStrictEqual":false,"ok":false,"propEqual":false,"QUnit":false,"raises":false,"start":false,"stop":false,"strictEqual":false,"test":false,"throws":false},"phantomjs":{"console":true,"exports":true,"phantom":true,"require":true,"WebPage":true},"couch":{"emit":false,"exports":false,"getRow":false,"log":false,"module":false,"provides":false,"require":false,"respond":false,"send":false,"start":false,"sum":false},"rhino":{"defineClass":false,"deserialize":false,"gc":false,"help":false,"importClass":false,"importPackage":false,"java":false,"load":false,"loadClass":false,"Packages":false,"print":false,"quit":false,"readFile":false,"readUrl":false,"runCommand":false,"seal":false,"serialize":false,"spawn":false,"sync":false,"toint32":false,"version":false},"nashorn":{"__DIR__":false,"__FILE__":false,"__LINE__":false,"com":false,"edu":false,"exit":false,"Java":false,"java":false,"javafx":false,"JavaImporter":false,"javax":false,"JSAdapter":false,"load":false,"loadWithNewGlobal":false,"org":false,"Packages":false,"print":false,"quit":false},"wsh":{"ActiveXObject":true,"Enumerator":true,"GetObject":true,"ScriptEngine":true,"ScriptEngineBuildVersion":true,"ScriptEngineMajorVersion":true,"ScriptEngineMinorVersion":true,"VBArray":true,"WScript":true,"WSH":true,"XDomainRequest":true},"jquery":{"$":false,"jQuery":false},"yui":{"Y":false,"YUI":false,"YUI_config":false},"shelljs":{"cat":false,"cd":false,"chmod":false,"config":false,"cp":false,"dirs":false,"echo":false,"env":false,"error":false,"exec":false,"exit":false,"find":false,"grep":false,"ls":false,"ln":false,"mkdir":false,"mv":false,"popd":false,"pushd":false,"pwd":false,"rm":false,"sed":false,"set":false,"target":false,"tempdir":false,"test":false,"touch":false,"which":false},"prototypejs":{"$":false,"$$":false,"$A":false,"$break":false,"$continue":false,"$F":false,"$H":false,"$R":false,"$w":false,"Abstract":false,"Ajax":false,"Autocompleter":false,"Builder":false,"Class":false,"Control":false,"Draggable":false,"Draggables":false,"Droppables":false,"Effect":false,"Element":false,"Enumerable":false,"Event":false,"Field":false,"Form":false,"Hash":false,"Insertion":false,"ObjectRange":false,"PeriodicalExecuter":false,"Position":false,"Prototype":false,"Scriptaculous":false,"Selector":false,"Sortable":false,"SortableObserver":false,"Sound":false,"Template":false,"Toggle":false,"Try":false},"meteor":{"$":false,"_":false,"Accounts":false,"AccountsClient":false,"AccountsServer":false,"AccountsCommon":false,"App":false,"Assets":false,"Blaze":false,"check":false,"Cordova":false,"DDP":false,"DDPServer":false,"DDPRateLimiter":false,"Deps":false,"EJSON":false,"Email":false,"HTTP":false,"Log":false,"Match":false,"Meteor":false,"Mongo":false,"MongoInternals":false,"Npm":false,"Package":false,"Plugin":false,"process":false,"Random":false,"ReactiveDict":false,"ReactiveVar":false,"Router":false,"ServiceConfiguration":false,"Session":false,"share":false,"Spacebars":false,"Template":false,"Tinytest":false,"Tracker":false,"UI":false,"Utils":false,"WebApp":false,"WebAppInternals":false},"mongo":{"_isWindows":false,"_rand":false,"BulkWriteResult":false,"cat":false,"cd":false,"connect":false,"db":false,"getHostName":false,"getMemInfo":false,"hostname":false,"ISODate":false,"listFiles":false,"load":false,"ls":false,"md5sumFile":false,"mkdir":false,"Mongo":false,"NumberInt":false,"NumberLong":false,"ObjectId":false,"PlanCache":false,"print":false,"printjson":false,"pwd":false,"quit":false,"removeFile":false,"rs":false,"sh":false,"UUID":false,"version":false,"WriteResult":false},"applescript":{"$":false,"Application":false,"Automation":false,"console":false,"delay":false,"Library":false,"ObjC":false,"ObjectSpecifier":false,"Path":false,"Progress":false,"Ref":false},"serviceworker":{"caches":false,"Cache":false,"CacheStorage":false,"Client":false,"clients":false,"Clients":false,"ExtendableEvent":false,"ExtendableMessageEvent":false,"FetchEvent":false,"importScripts":false,"registration":false,"self":false,"ServiceWorker":false,"ServiceWorkerContainer":false,"ServiceWorkerGlobalScope":false,"ServiceWorkerMessageEvent":false,"ServiceWorkerRegistration":false,"skipWaiting":false,"WindowClient":false},"atomtest":{"advanceClock":false,"fakeClearInterval":false,"fakeClearTimeout":false,"fakeSetInterval":false,"fakeSetTimeout":false,"resetTimeouts":false,"waitsForPromise":false},"embertest":{"andThen":false,"click":false,"currentPath":false,"currentRouteName":false,"currentURL":false,"fillIn":false,"find":false,"findWithAssert":false,"keyEvent":false,"pauseTest":false,"resumeTest":false,"triggerEvent":false,"visit":false},"protractor":{"$":false,"$$":false,"browser":false,"By":false,"by":false,"DartObject":false,"element":false,"protractor":false},"shared-node-browser":{"clearInterval":false,"clearTimeout":false,"console":false,"setInterval":false,"setTimeout":false},"webextensions":{"browser":false,"chrome":false,"opr":false},"greasemonkey":{"GM_addStyle":false,"GM_deleteValue":false,"GM_getResourceText":false,"GM_getResourceURL":false,"GM_getValue":false,"GM_info":false,"GM_listValues":false,"GM_log":false,"GM_openInTab":false,"GM_registerMenuCommand":false,"GM_setClipboard":false,"GM_setValue":false,"GM_xmlhttpRequest":false,"unsafeWindow":false}}
 
 /***/ })
 /******/ ]);
 });
\ No newline at end of file
--- a/devtools/client/debugger/new/test/mochitest/head.js
+++ b/devtools/client/debugger/new/test/mochitest/head.js
@@ -295,19 +295,17 @@ function assertPausedLocation(dbg) {
 function assertDebugLine(dbg, line) {
   // Check the debug line
   const lineInfo = getCM(dbg).lineInfo(line - 1);
   const source = dbg.selectors.getSelectedSource(dbg.getState());
   if (source && source.get("loadedState") == "loading") {
     const url = source.get("url");
     ok(
       false,
-      `Looks like the source ${
-        url
-      } is still loading. Try adding waitForLoadedSource in the test.`
+      `Looks like the source ${url} is still loading. Try adding waitForLoadedSource in the test.`
     );
     return;
   }
 
   ok(
     lineInfo.wrapClass.includes("new-debug-line"),
     "Line is highlighted as paused"
   );
@@ -912,19 +910,17 @@ function isVisible(outerEl, innerEl) {
 }
 
 const selectors = {
   callStackHeader: ".call-stack-pane ._header",
   callStackBody: ".call-stack-pane .pane",
   expressionNode: i =>
     `.expressions-list .expression-container:nth-child(${i}) .object-label`,
   expressionValue: i =>
-    `.expressions-list .expression-container:nth-child(${
-      i
-    }) .object-delimiter + *`,
+    `.expressions-list .expression-container:nth-child(${i}) .object-delimiter + *`,
   expressionClose: i =>
     `.expressions-list .expression-container:nth-child(${i}) .close`,
   expressionNodes: ".expressions-list .tree-node",
   scopesHeader: ".scopes-pane ._header",
   breakpointItem: i => `.breakpoints-list .breakpoint:nth-child(${i})`,
   scopeNode: i => `.scopes-list .tree-node:nth-child(${i}) .object-label`,
   scopeValue: i =>
     `.scopes-list .tree-node:nth-child(${i}) .object-delimiter + *`,
--- a/devtools/server/actors/csscoverage.js
+++ b/devtools/server/actors/csscoverage.js
@@ -11,18 +11,16 @@ const Services = require("Services");
 const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
 
 const protocol = require("devtools/shared/protocol");
 const { cssUsageSpec } = require("devtools/shared/specs/csscoverage");
 
 loader.lazyRequireGetter(this, "stylesheets", "devtools/server/actors/stylesheets");
 loader.lazyRequireGetter(this, "prettifyCSS", "devtools/shared/inspector/css-logic", true);
 
-const CSSRule = Ci.nsIDOMCSSRule;
-
 const MAX_UNUSED_RULES = 10000;
 
 /**
  * Allow: let foo = l10n.lookup("csscoverageFoo");
  */
 const l10n = exports.l10n = {
   _URI: "chrome://devtools-shared/locale/csscoverage.properties",
   lookup: function (msg) {
--- a/devtools/server/actors/object.js
+++ b/devtools/server/actors/object.js
@@ -1711,40 +1711,40 @@ DebuggerServer.ObjectActorPreviewers.Obj
         };
         return true;
       default:
         return false;
     }
   },
 
   function CSSMediaRule({obj, hooks}, grip, rawObj) {
-    if (isWorker || !rawObj || !(rawObj instanceof Ci.nsIDOMCSSMediaRule)) {
+    if (isWorker || !rawObj || obj.class != "CSSMediaRule") {
       return false;
     }
     grip.preview = {
       kind: "ObjectWithText",
       text: hooks.createValueGrip(rawObj.conditionText),
     };
     return true;
   },
 
   function CSSStyleRule({obj, hooks}, grip, rawObj) {
-    if (isWorker || !rawObj || !(rawObj instanceof Ci.nsIDOMCSSStyleRule)) {
+    if (isWorker || !rawObj || obj.class != "CSSStyleRule") {
       return false;
     }
     grip.preview = {
       kind: "ObjectWithText",
       text: hooks.createValueGrip(rawObj.selectorText),
     };
     return true;
   },
 
   function ObjectWithURL({obj, hooks}, grip, rawObj) {
-    if (isWorker || !rawObj || !(rawObj instanceof Ci.nsIDOMCSSImportRule ||
-                                 rawObj instanceof Ci.nsIDOMCSSStyleSheet ||
+    if (isWorker || !rawObj || !(obj.class == "CSSImportRule" ||
+                                 obj.class == "CSSStyleSheet" ||
                                  obj.class == "Location" ||
                                  rawObj instanceof Ci.nsIDOMWindow)) {
       return false;
     }
 
     let url;
     if (rawObj instanceof Ci.nsIDOMWindow && rawObj.location) {
       url = rawObj.location.href;
@@ -1761,23 +1761,23 @@ DebuggerServer.ObjectActorPreviewers.Obj
 
     return true;
   },
 
   function ArrayLike({obj, hooks}, grip, rawObj) {
     if (isWorker || !rawObj ||
         obj.class != "DOMStringList" &&
         obj.class != "DOMTokenList" &&
+        obj.class != "CSSRuleList" &&
+        obj.class != "MediaList" &&
+        obj.class != "StyleSheetList" &&
+        obj.class != "CSSValueList" &&
         !(rawObj instanceof Ci.nsIDOMMozNamedAttrMap ||
-          rawObj instanceof Ci.nsIDOMCSSRuleList ||
-          rawObj instanceof Ci.nsIDOMCSSValueList ||
           rawObj instanceof Ci.nsIDOMFileList ||
-          rawObj instanceof Ci.nsIDOMMediaList ||
-          rawObj instanceof Ci.nsIDOMNodeList ||
-          rawObj instanceof Ci.nsIDOMStyleSheetList)) {
+          rawObj instanceof Ci.nsIDOMNodeList)) {
       return false;
     }
 
     if (typeof rawObj.length != "number") {
       return false;
     }
 
     grip.preview = {
@@ -1797,17 +1797,18 @@ DebuggerServer.ObjectActorPreviewers.Obj
       items.push(hooks.createValueGrip(value));
     }
 
     return true;
   },
 
   function CSSStyleDeclaration({obj, hooks}, grip, rawObj) {
     if (isWorker || !rawObj ||
-        !(rawObj instanceof Ci.nsIDOMCSSStyleDeclaration)) {
+        (obj.class != "CSSStyleDeclaration" &&
+         obj.class != "CSS2Properties")) {
       return false;
     }
 
     grip.preview = {
       kind: "MapLike",
       size: rawObj.length,
     };
 
--- a/devtools/server/actors/styles.js
+++ b/devtools/server/actors/styles.js
@@ -160,18 +160,18 @@ var PageStyleActor = protocol.ActorClass
    * @param actor a StyleRuleActor
    */
   updateStyleRef: function (oldItem, item, actor) {
     this.refMap.delete(oldItem);
     this.refMap.set(item, actor);
   },
 
   /**
-   * Return or create a StyleSheetActor for the given nsIDOMCSSStyleSheet.
-   * @param  {DOMStyleSheet} sheet
+   * Return or create a StyleSheetActor for the given CSSStyleSheet.
+   * @param  {CSSStyleSheet} sheet
    *         The style sheet to create an actor for.
    * @return {StyleSheetActor}
    *         The actor for this style sheet
    */
   _sheetRef: function (sheet) {
     let tabActor = this.inspector.tabActor;
     let actor = tabActor.createStyleSheetActor(sheet);
     return actor;
@@ -942,21 +942,21 @@ exports.PageStyleActor = PageStyleActor;
 var StyleRuleActor = protocol.ActorClassWithSpec(styleRuleSpec, {
   initialize: function (pageStyle, item) {
     protocol.Actor.prototype.initialize.call(this, null);
     this.pageStyle = pageStyle;
     this.rawStyle = item.style;
     this._parentSheet = null;
     this._onStyleApplied = this._onStyleApplied.bind(this);
 
-    if (item instanceof (Ci.nsIDOMCSSRule)) {
+    if (CSSRule.isInstance(item)) {
       this.type = item.type;
       this.rawRule = item;
-      if ((this.type === Ci.nsIDOMCSSRule.STYLE_RULE ||
-           this.type === Ci.nsIDOMCSSRule.KEYFRAME_RULE) &&
+      if ((this.type === CSSRule.STYLE_RULE ||
+           this.type === CSSRule.KEYFRAME_RULE) &&
           this.rawRule.parentStyleSheet) {
         this.line = InspectorUtils.getRelativeRuleLine(this.rawRule);
         this.column = InspectorUtils.getRuleColumn(this.rawRule);
         this._parentSheet = this.rawRule.parentStyleSheet;
         this._computeRuleIndex();
         this.sheetActor = this.pageStyle._sheetRef(this._parentSheet);
         this.sheetActor.on("style-applied", this._onStyleApplied);
       }
@@ -1049,17 +1049,17 @@ var StyleRuleActor = protocol.ActorClass
     if (this.rawRule.parentRule) {
       form.parentRule =
         this.pageStyle._styleRef(this.rawRule.parentRule).actorID;
 
       // CSS rules that we call media rules are STYLE_RULES that are children
       // of MEDIA_RULEs. We need to check the parentRule to check if a rule is
       // a media rule so we do this here instead of in the switch statement
       // below.
-      if (this.rawRule.parentRule.type === Ci.nsIDOMCSSRule.MEDIA_RULE) {
+      if (this.rawRule.parentRule.type === CSSRule.MEDIA_RULE) {
         form.media = [];
         for (let i = 0, n = this.rawRule.parentRule.media.length; i < n; i++) {
           form.media.push(this.rawRule.parentRule.media.item(i));
         }
       }
     }
     if (this._parentSheet) {
       form.parentStyleSheet =
@@ -1069,40 +1069,40 @@ var StyleRuleActor = protocol.ActorClass
     // One tricky thing here is that other methods in this actor must
     // ensure that authoredText has been set before |form| is called.
     // This has to be treated specially, for now, because we cannot
     // synchronously compute the authored text, but |form| also cannot
     // return a promise.  See bug 1205868.
     form.authoredText = this.authoredText;
 
     switch (this.type) {
-      case Ci.nsIDOMCSSRule.STYLE_RULE:
+      case CSSRule.STYLE_RULE:
         form.selectors = CssLogic.getSelectors(this.rawRule);
         form.cssText = this.rawStyle.cssText || "";
         break;
       case ELEMENT_STYLE:
         // Elements don't have a parent stylesheet, and therefore
         // don't have an associated URI.  Provide a URI for
         // those.
         let doc = this.rawNode.ownerDocument;
         form.href = doc.location ? doc.location.href : "";
         form.cssText = this.rawStyle.cssText || "";
         form.authoredText = this.rawNode.getAttribute("style");
         break;
-      case Ci.nsIDOMCSSRule.CHARSET_RULE:
+      case CSSRule.CHARSET_RULE:
         form.encoding = this.rawRule.encoding;
         break;
-      case Ci.nsIDOMCSSRule.IMPORT_RULE:
+      case CSSRule.IMPORT_RULE:
         form.href = this.rawRule.href;
         break;
-      case Ci.nsIDOMCSSRule.KEYFRAMES_RULE:
+      case CSSRule.KEYFRAMES_RULE:
         form.cssText = this.rawRule.cssText;
         form.name = this.rawRule.name;
         break;
-      case Ci.nsIDOMCSSRule.KEYFRAME_RULE:
+      case CSSRule.KEYFRAME_RULE:
         form.cssText = this.rawStyle.cssText || "";
         form.keyText = this.rawRule.keyText || "";
         break;
     }
 
     // Parse the text into a list of declarations so the client doesn't have to
     // and so that we can safely determine if a declaration is valid rather than
     // have the client guess it.
@@ -1230,18 +1230,18 @@ var StyleRuleActor = protocol.ActorClass
    * text, if available.  If the authored form is not available, the
    * returned promise simply resolves to the empty string.  If the
    * authored form is available, this also sets |this.authoredText|.
    * The authored text will include invalid and otherwise ignored
    * properties.
    */
   getAuthoredCssText: function () {
     if (!this.canSetRuleText ||
-        (this.type !== Ci.nsIDOMCSSRule.STYLE_RULE &&
-         this.type !== Ci.nsIDOMCSSRule.KEYFRAME_RULE)) {
+        (this.type !== CSSRule.STYLE_RULE &&
+         this.type !== CSSRule.KEYFRAME_RULE)) {
       return promise.resolve("");
     }
 
     if (typeof this.authoredText === "string") {
       return promise.resolve(this.authoredText);
     }
 
     let parentStyleSheet =
@@ -1309,18 +1309,17 @@ var StyleRuleActor = protocol.ActorClass
     // effects that pop up based on property values that were already set on the
     // element.
 
     let document;
     if (this.rawNode) {
       document = this.rawNode.ownerDocument;
     } else {
       let parentStyleSheet = this._parentSheet;
-      while (parentStyleSheet.ownerRule &&
-          parentStyleSheet.ownerRule instanceof Ci.nsIDOMCSSImportRule) {
+      while (parentStyleSheet.ownerRule) {
         parentStyleSheet = parentStyleSheet.ownerRule.parentStyleSheet;
       }
 
       document = this.getDocument(parentStyleSheet);
     }
 
     let tempElement = document.createElementNS(XHTML_NS, "div");
 
--- a/devtools/server/actors/stylesheets.js
+++ b/devtools/server/actors/stylesheets.js
@@ -524,17 +524,17 @@ var StyleSheetActor = protocol.ActorClas
    * @return {promise}
    *         A promise that resolves with an array of MediaRuleActors.
    */
   _getMediaRules: function () {
     return this.getCSSRules().then((rules) => {
       let mediaRules = [];
       for (let i = 0; i < rules.length; i++) {
         let rule = rules[i];
-        if (rule.type != Ci.nsIDOMCSSRule.MEDIA_RULE) {
+        if (rule.type != CSSRule.MEDIA_RULE) {
           continue;
         }
         let actor = new MediaRuleActor(rule, this);
         this.manage(actor);
 
         mediaRules.push(actor);
       }
       return mediaRules;
@@ -549,33 +549,33 @@ var StyleSheetActor = protocol.ActorClas
   _getCSSCharset: function () {
     let sheet = this.rawSheet;
     if (sheet) {
       // Do we have a @charset rule in the stylesheet?
       // step 2 of syndata.html (without the BOM check).
       if (sheet.cssRules) {
         let rules = sheet.cssRules;
         if (rules.length
-            && rules.item(0).type == Ci.nsIDOMCSSRule.CHARSET_RULE) {
+            && rules.item(0).type == CSSRule.CHARSET_RULE) {
           return rules.item(0).encoding;
         }
       }
 
       // step 3: charset attribute of <link> or <style> element, if it exists
       if (sheet.ownerNode && sheet.ownerNode.getAttribute) {
         let linkCharset = sheet.ownerNode.getAttribute("charset");
         if (linkCharset != null) {
           return linkCharset;
         }
       }
 
       // step 4 (1 of 2): charset of referring stylesheet.
       let parentSheet = sheet.parentStyleSheet;
       if (parentSheet && parentSheet.cssRules &&
-          parentSheet.cssRules[0].type == Ci.nsIDOMCSSRule.CHARSET_RULE) {
+          parentSheet.cssRules[0].type == CSSRule.CHARSET_RULE) {
         return parentSheet.cssRules[0].encoding;
       }
 
       // step 4 (2 of 2): charset of referring document.
       if (sheet.ownerNode && sheet.ownerNode.ownerDocument.characterSet) {
         return sheet.ownerNode.ownerDocument.characterSet;
       }
     }
@@ -836,34 +836,34 @@ var StyleSheetsActor = protocol.ActorCla
    */
   _getImported: function (doc, styleSheet) {
     return Task.spawn(function* () {
       let rules = yield styleSheet.getCSSRules();
       let imported = [];
 
       for (let i = 0; i < rules.length; i++) {
         let rule = rules[i];
-        if (rule.type == Ci.nsIDOMCSSRule.IMPORT_RULE) {
+        if (rule.type == CSSRule.IMPORT_RULE) {
           // With the Gecko style system, the associated styleSheet may be null
           // if it has already been seen because an import cycle for the same
           // URL.  With Stylo, the styleSheet will exist (which is correct per
           // the latest CSSOM spec), so we also need to check ancestors for the
           // same URL to avoid cycles.
           let sheet = rule.styleSheet;
           if (!sheet || this._haveAncestorWithSameURL(sheet) ||
               !this._shouldListSheet(sheet)) {
             continue;
           }
           let actor = this.parentActor.createStyleSheetActor(rule.styleSheet);
           imported.push(actor);
 
           // recurse imports in this stylesheet as well
           let children = yield this._getImported(doc, actor);
           imported = imported.concat(children);
-        } else if (rule.type != Ci.nsIDOMCSSRule.CHARSET_RULE) {
+        } else if (rule.type != CSSRule.CHARSET_RULE) {
           // @import rules must precede all others except @charset
           break;
         }
       }
 
       return imported;
     }.bind(this));
   },
--- a/devtools/server/css-logic.js
+++ b/devtools/server/css-logic.js
@@ -10,17 +10,17 @@
  *   access to 2 sets of objects: Css[Sheet|Rule|Selector] provide access to
  *   information that does not change when the selected element changes while
  *   Css[Property|Selector]Info provide information that is dependent on the
  *   selected element.
  *   Its key methods are highlight(), getPropertyInfo() and forEachSheet(), etc
  *
  * - CssSheet provides a more useful API to a DOM CSSSheet for our purposes,
  *   including shortSource and href.
- * - CssRule a more useful API to a nsIDOMCSSRule including access to the group
+ * - CssRule a more useful API to a DOM CSSRule including access to the group
  *   of CssSelectors that the rule provides properties for
  * - CssSelector A single selector - i.e. not a selector group. In other words
  *   a CssSelector does not contain ','. This terminology is different from the
  *   standard DOM API, but more inline with the definition in the spec.
  *
  * - CssPropertyInfo contains style information for a single property for the
  *   highlighted element.
  * - CssSelectorInfo is a wrapper around CssSelector, which adds sorting with
@@ -379,25 +379,25 @@ CssLogic.prototype = {
         }
       }
     }
   },
 
   /**
 
   /**
-   * Get the number nsIDOMCSSRule objects in the document, counted from all of
+   * Get the number CSSRule objects in the document, counted from all of
    * the stylesheets. System sheets are excluded. If a filter is active, this
-   * tells only the number of nsIDOMCSSRule objects inside the selected
+   * tells only the number of CSSRule objects inside the selected
    * CSSStyleSheet.
    *
    * WARNING: This only provides an estimate of the rule count, and the results
    * could change at a later date. Todo remove this
    *
-   * @return {number} the number of nsIDOMCSSRule (all rules).
+   * @return {number} the number of CSSRule (all rules).
    */
   get ruleCount() {
     if (!this._sheetsCached) {
       this._cacheSheets();
     }
 
     return this._ruleCount;
   },
@@ -801,17 +801,17 @@ CssSheet.prototype = {
     }
 
     return this._sheetAllowed;
   },
 
   /**
    * Retrieve the number of rules in this stylesheet.
    *
-   * @return {number} the number of nsIDOMCSSRule objects in this stylesheet.
+   * @return {number} the number of CSSRule objects in this stylesheet.
    */
   get ruleCount() {
     try {
       return this._ruleCount > -1 ?
         this._ruleCount :
         this.getCssRules().length;
     } catch (e) {
       return 0;
--- a/devtools/shared/builtin-modules.js
+++ b/devtools/shared/builtin-modules.js
@@ -18,19 +18,21 @@ const promise = Cu.import("resource://gr
 const jsmScope = Cu.import("resource://gre/modules/Services.jsm", {});
 const { Services } = jsmScope;
 // Steal various globals only available in JSM scope (and not Sandbox one)
 const { PromiseDebugging, ChromeUtils, HeapSnapshot,
         atob, btoa, TextEncoder, TextDecoder } = Cu.getGlobalForObject(jsmScope);
 
 // Create a single Sandbox to access global properties needed in this module.
 // Sandbox are memory expensive, so we should create as little as possible.
-const { CSS, FileReader, indexedDB, InspectorUtils, URL } =
+const { CSS, CSSRule, FileReader, indexedDB, InspectorUtils, URL } =
     Cu.Sandbox(CC("@mozilla.org/systemprincipal;1", "nsIPrincipal")(), {
-      wantGlobalProperties: ["CSS", "FileReader", "indexedDB", "InspectorUtils", "URL"]
+      wantGlobalProperties: [
+        "CSS", "CSSRule", "FileReader", "indexedDB", "InspectorUtils", "URL",
+      ]
     });
 
 /**
  * Defines a getter on a specified object that will be created upon first use.
  *
  * @param object
  *        The object to define the lazy getter on.
  * @param name
@@ -215,16 +217,17 @@ exports.globals = {
   isWorker: false,
   reportError: Cu.reportError,
   atob: atob,
   btoa: btoa,
   TextEncoder: TextEncoder,
   TextDecoder: TextDecoder,
   URL,
   CSS,
+  CSSRule,
   loader: {
     lazyGetter: defineLazyGetter,
     lazyImporter: defineLazyModuleGetter,
     lazyServiceGetter: defineLazyServiceGetter,
     lazyRequireGetter: lazyRequireGetter,
     // Defined by Loader.jsm
     id: null
   },
@@ -285,17 +288,16 @@ lazyGlobal("setTimeout", () => {
   return Cu.import("resource://gre/modules/Timer.jsm", {}).setTimeout;
 });
 lazyGlobal("clearInterval", () => {
   return Cu.import("resource://gre/modules/Timer.jsm", {}).clearInterval;
 });
 lazyGlobal("setInterval", () => {
   return Cu.import("resource://gre/modules/Timer.jsm", {}).setInterval;
 });
-lazyGlobal("CSSRule", () => Ci.nsIDOMCSSRule);
 lazyGlobal("DOMParser", () => {
   return CC("@mozilla.org/xmlextras/domparser;1", "nsIDOMParser");
 });
 lazyGlobal("WebSocket", () => {
   return Services.appShell.hiddenDOMWindow.WebSocket;
 });
 lazyGlobal("indexedDB", () => {
   return require("devtools/shared/indexed-db").createDevToolsIndexedDB(indexedDB);
--- a/devtools/shared/inspector/css-logic.js
+++ b/devtools/shared/inspector/css-logic.js
@@ -19,17 +19,17 @@ const MAX_DATA_URL_LENGTH = 40;
  *   information that does not change when the selected element changes while
  *   Css[Property|Selector]Info provide information that is dependent on the
  *   selected element.
  *   Its key methods are highlight(), getPropertyInfo() and forEachSheet(), etc
  *   It also contains a number of static methods for l10n, naming, etc
  *
  * - CssSheet provides a more useful API to a DOM CSSSheet for our purposes,
  *   including shortSource and href.
- * - CssRule a more useful API to a nsIDOMCSSRule including access to the group
+ * - CssRule a more useful API to a DOM CSSRule including access to the group
  *   of CssSelectors that the rule provides properties for
  * - CssSelector A single selector - i.e. not a selector group. In other words
  *   a CssSelector does not contain ','. This terminology is different from the
  *   standard DOM API, but more inline with the definition in the spec.
  *
  * - CssPropertyInfo contains style information for a single property for the
  *   highlighted element.
  * - CssSelectorInfo is a wrapper around CssSelector, which adds sorting with
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -39,17 +39,16 @@
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
 #include "nsStyleConsts.h"
 #include "nsString.h"
 #include "nsUnicharUtils.h"
 #include "nsIDOMEvent.h"
 #include "nsDOMCID.h"
 #include "nsIServiceManager.h"
-#include "nsIDOMCSSStyleDeclaration.h"
 #include "nsDOMCSSAttrDeclaration.h"
 #include "nsNameSpaceManager.h"
 #include "nsContentList.h"
 #include "nsVariant.h"
 #include "nsDOMTokenList.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsError.h"
 #include "nsDOMString.h"
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -46,17 +46,16 @@
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
 #include "nsStyleConsts.h"
 #include "nsString.h"
 #include "nsUnicharUtils.h"
 #include "nsIDOMEvent.h"
 #include "nsDOMCID.h"
 #include "nsIServiceManager.h"
-#include "nsIDOMCSSStyleDeclaration.h"
 #include "nsDOMCSSAttrDeclaration.h"
 #include "nsNameSpaceManager.h"
 #include "nsContentList.h"
 #include "nsDOMTokenList.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsError.h"
 #include "nsDOMString.h"
 #include "nsIScriptSecurityManager.h"
--- a/dom/base/StyleSheetList.cpp
+++ b/dom/base/StyleSheetList.cpp
@@ -3,53 +3,37 @@
 /* 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 "mozilla/dom/StyleSheetList.h"
 
 #include "mozilla/CSSStyleSheet.h"
 #include "mozilla/dom/StyleSheetListBinding.h"
-#include "nsStubDocumentObserver.h"
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(StyleSheetList)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(StyleSheetList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsIDOMStyleSheetList)
   NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMStyleSheetList)
+  NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(StyleSheetList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(StyleSheetList)
 
 /* virtual */ JSObject*
 StyleSheetList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return StyleSheetListBinding::Wrap(aCx, this, aGivenProto);
 }
 
-NS_IMETHODIMP
-StyleSheetList::GetLength(uint32_t* aLength)
-{
-  *aLength = Length();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-StyleSheetList::SlowItem(uint32_t aIndex, nsIDOMStyleSheet** aItem)
-{
-  NS_IF_ADDREF(*aItem = Item(aIndex));
-  return NS_OK;
-}
-
 void
 StyleSheetList::NodeWillBeDestroyed(const nsINode* aNode)
 {
   mDocumentOrShadowRoot = nullptr;
 }
 
 StyleSheetList::StyleSheetList(DocumentOrShadowRoot& aScope)
   : mDocumentOrShadowRoot(&aScope)
--- a/dom/base/StyleSheetList.h
+++ b/dom/base/StyleSheetList.h
@@ -3,36 +3,32 @@
 /* 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 mozilla_dom_StyleSheetList_h
 #define mozilla_dom_StyleSheetList_h
 
 #include "mozilla/dom/DocumentOrShadowRoot.h"
-#include "nsIDOMStyleSheetList.h"
+#include "nsStubMutationObserver.h"
 #include "nsWrapperCache.h"
-#include "nsStubDocumentObserver.h"
 
 class nsINode;
 
 namespace mozilla {
 class StyleSheet;
 
 namespace dom {
 
-class StyleSheetList final : public nsIDOMStyleSheetList
+class StyleSheetList final : public nsStubMutationObserver
                            , public nsWrapperCache
-                           , public nsStubDocumentObserver
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(StyleSheetList, nsIDOMStyleSheetList)
-
-  NS_DECL_NSIDOMSTYLESHEETLIST
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StyleSheetList)
 
   NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
 
   explicit StyleSheetList(DocumentOrShadowRoot& aScope);
 
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override final;
 
   nsINode* GetParentObject() const
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -63,17 +63,16 @@
 #include "nsError.h"
 #include "nsIDOMXULButtonElement.h"
 #include "nsIDOMXULCheckboxElement.h"
 
 // Event related includes
 #include "nsIDOMEventTarget.h"
 
 // CSS related includes
-#include "nsIDOMCSSRule.h"
 #include "nsMemory.h"
 
 // includes needed for the prototype chain interfaces
 
 #include "nsIEventListenerService.h"
 #include "nsIMessageManager.h"
 
 #include "mozilla/dom/TouchEvent.h"
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -93,17 +93,16 @@
 #include "nsDisplayList.h"
 #include "nsROCSSPrimitiveValue.h"
 #include "nsIBaseWindow.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "GeckoProfiler.h"
 #include "mozilla/Preferences.h"
 #include "nsIContentIterator.h"
-#include "nsIDOMStyleSheet.h"
 #include "nsIStyleSheetService.h"
 #include "nsContentPermissionHelper.h"
 #include "nsCSSPseudoElements.h"            // for CSSPseudoElementType
 #include "nsNetUtil.h"
 #include "nsDocument.h"
 #include "HTMLImageElement.h"
 #include "HTMLCanvasElement.h"
 #include "mozilla/css/ImageLoader.h"
@@ -1517,16 +1516,21 @@ nsDOMWindowUtils::CompareCanvases(nsISup
 
   if (!canvas1 || !canvas2) {
     return NS_ERROR_FAILURE;
   }
 
   RefPtr<DataSourceSurface> img1 = CanvasToDataSourceSurface(canvas1);
   RefPtr<DataSourceSurface> img2 = CanvasToDataSourceSurface(canvas2);
 
+  if (img1->Equals(img2)) {
+    // They point to the same underlying content.
+    return NS_OK;
+  }
+
   DataSourceSurface::ScopedMap map1(img1, DataSourceSurface::READ);
   DataSourceSurface::ScopedMap map2(img2, DataSourceSurface::READ);
 
   if (img1 == nullptr || img2 == nullptr ||
       !map1.IsMapped() || !map2.IsMapped() ||
       img1->GetSize() != img2->GetSize() ||
       map1.GetStride() != map2.GetStride()) {
     return NS_ERROR_FAILURE;
@@ -2174,17 +2178,17 @@ nsDOMWindowUtils::GetVisitedDependentCom
   aResult.Truncate();
 
   nsCOMPtr<nsPIDOMWindowOuter> window = do_QueryReferent(mWindow);
   nsCOMPtr<Element> element = do_QueryInterface(aElement);
   NS_ENSURE_STATE(window && element);
   nsCOMPtr<nsPIDOMWindowInner> innerWindow = window->GetCurrentInnerWindow();
   NS_ENSURE_STATE(window);
 
-  nsCOMPtr<nsIDOMCSSStyleDeclaration> decl;
+  nsCOMPtr<nsICSSDeclaration> decl;
   {
     ErrorResult rv;
     decl = innerWindow->GetComputedStyle(*element, aPseudoElement, rv);
     ENSURE_SUCCESS(rv, rv.StealNSResult());
   }
 
   static_cast<nsComputedDOMStyle*>(decl.get())->SetExposeVisitedStyle(true);
   nsresult rv = decl->GetPropertyValue(aPropertyName, aResult);
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -53,17 +53,16 @@
 #include "ChildIterator.h"
 
 #include "mozilla/AsyncEventDispatcher.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/EventStateManager.h"
 #include "nsIDOMNodeFilter.h"
 
-#include "nsIDOMStyleSheet.h"
 #include "mozilla/dom/Attr.h"
 #include "mozilla/dom/BindingDeclarations.h"
 #include "nsIDOMDOMImplementation.h"
 #include "nsIDOMDocumentXBL.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/FramingChecker.h"
 #include "nsGenericHTMLElement.h"
 #include "mozilla/dom/CDATASection.h"
@@ -232,17 +231,16 @@
 #include "mozilla/ExtensionPolicyService.h"
 #include "nsFrame.h"
 #include "nsDOMCaretPosition.h"
 #include "nsViewportInfo.h"
 #include "mozilla/StaticPtr.h"
 #include "nsITextControlElement.h"
 #include "nsIDOMNSEditableElement.h"
 #include "nsIEditor.h"
-#include "nsIDOMCSSStyleRule.h"
 #include "mozilla/css/StyleRule.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsISecurityConsoleMessage.h"
 #include "nsCharSeparatedTokenizer.h"
 #include "mozilla/dom/XPathEvaluator.h"
 #include "mozilla/dom/XPathNSResolverBinding.h"
 #include "mozilla/dom/XPathResult.h"
 #include "nsIDocumentEncoder.h"
@@ -6355,23 +6353,16 @@ nsDocument::GetElementsByTagNameNS(const
   }
 
   // transfer ref to aReturn
   list.forget(aReturn);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDocument::GetStyleSheets(nsIDOMStyleSheetList** aStyleSheets)
-{
-  NS_ADDREF(*aStyleSheets = StyleSheets());
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsDocument::GetMozSelectedStyleSheetSet(nsAString& aSheetSet)
 {
   nsIDocument::GetSelectedStyleSheetSet(aSheetSet);
   return NS_OK;
 }
 
 void
 nsIDocument::GetSelectedStyleSheetSet(nsAString& aSheetSet)
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -129,17 +129,16 @@
 #include "nsIPromptService.h"
 #include "nsIPromptFactory.h"
 #include "nsIAddonPolicyService.h"
 #include "nsIWritablePropertyBag2.h"
 #include "nsIWebNavigation.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsIWebBrowserFind.h"  // For window.find()
 #include "nsIWindowMediator.h"  // For window.find()
-#include "nsComputedDOMStyle.h"
 #include "nsDOMCID.h"
 #include "nsDOMWindowUtils.h"
 #include "nsIWindowWatcher.h"
 #include "nsPIWindowWatcher.h"
 #include "nsIContentViewer.h"
 #include "nsIScriptError.h"
 #include "nsIControllers.h"
 #include "nsIControllerContext.h"
@@ -164,16 +163,17 @@
 #ifdef MOZ_XUL
 #include "nsIDOMXULControlElement.h"
 #include "nsMenuPopupFrame.h"
 #endif
 #include "mozilla/dom/CustomEvent.h"
 #include "nsIJARChannel.h"
 #include "nsIScreenManager.h"
 #include "nsIEffectiveTLDService.h"
+#include "nsICSSDeclaration.h"
 
 #include "xpcprivate.h"
 
 #ifdef NS_PRINTING
 #include "nsIPrintSettings.h"
 #include "nsIPrintSettingsService.h"
 #include "nsIWebBrowserPrint.h"
 #endif
@@ -4928,30 +4928,30 @@ nsGlobalWindowInner::GetDefaultComputedS
 {
   return GetComputedStyleHelper(aElt, aPseudoElt, true, aError);
 }
 
 nsresult
 nsGlobalWindowInner::GetComputedStyleHelper(nsIDOMElement* aElt,
                                             const nsAString& aPseudoElt,
                                             bool aDefaultStylesOnly,
-                                            nsIDOMCSSStyleDeclaration** aReturn)
+                                            nsICSSDeclaration** aReturn)
 {
   NS_ENSURE_ARG_POINTER(aReturn);
   *aReturn = nullptr;
 
   nsCOMPtr<dom::Element> element = do_QueryInterface(aElt);
   if (!element) {
     return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
   }
 
   ErrorResult rv;
-  nsCOMPtr<nsIDOMCSSStyleDeclaration> declaration =
+  nsCOMPtr<nsICSSDeclaration> cs =
     GetComputedStyleHelper(*element, aPseudoElt, aDefaultStylesOnly, rv);
-  declaration.forget(aReturn);
+  cs.forget(aReturn);
 
   return rv.StealNSResult();
 }
 
 already_AddRefed<nsICSSDeclaration>
 nsGlobalWindowInner::GetComputedStyleHelper(Element& aElt,
                                             const nsAString& aPseudoElt,
                                             bool aDefaultStylesOnly,
--- a/dom/base/nsGlobalWindowInner.h
+++ b/dom/base/nsGlobalWindowInner.h
@@ -1236,17 +1236,17 @@ protected:
   already_AddRefed<nsICSSDeclaration>
     GetComputedStyleHelper(mozilla::dom::Element& aElt,
                            const nsAString& aPseudoElt,
                            bool aDefaultStylesOnly,
                            mozilla::ErrorResult& aError);
   nsresult GetComputedStyleHelper(nsIDOMElement* aElt,
                                   const nsAString& aPseudoElt,
                                   bool aDefaultStylesOnly,
-                                  nsIDOMCSSStyleDeclaration** aReturn);
+                                  nsICSSDeclaration** aReturn);
 
   nsGlobalWindowInner* InnerForSetTimeoutOrInterval(mozilla::ErrorResult& aError);
 
   void PostMessageMoz(JSContext* aCx, JS::Handle<JS::Value> aMessage,
                       const nsAString& aTargetOrigin,
                       JS::Handle<JS::Value> aTransfer,
                       nsIPrincipal& aSubjectPrincipal,
                       mozilla::ErrorResult& aError);
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -6888,17 +6888,17 @@ nsGlobalWindowOuter::GetComputedStyleHel
     }
 
     presShell = mDocShell->GetPresShell();
     if (!presShell) {
       return nullptr;
     }
   }
 
-  RefPtr<nsComputedDOMStyle> compStyle =
+  RefPtr<nsICSSDeclaration> compStyle =
     NS_NewComputedDOMStyle(&aElt, aPseudoElt, presShell,
                            aDefaultStylesOnly ? nsComputedDOMStyle::eDefaultOnly :
                                                 nsComputedDOMStyle::eAll);
 
   return compStyle.forget();
 }
 
 //*****************************************************************************
--- a/dom/base/nsStyleLinkElement.cpp
+++ b/dom/base/nsStyleLinkElement.cpp
@@ -20,17 +20,16 @@
 #include "mozilla/dom/HTMLLinkElement.h"
 #include "mozilla/dom/ShadowRoot.h"
 #include "mozilla/dom/SRILogHelper.h"
 #include "mozilla/Preferences.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsIDOMComment.h"
 #include "nsIDOMNode.h"
-#include "nsIDOMStyleSheet.h"
 #include "nsUnicharUtils.h"
 #include "nsCRT.h"
 #include "nsXPCOMCIDInternal.h"
 #include "nsUnicharInputStream.h"
 #include "nsContentUtils.h"
 #include "nsStyleUtil.h"
 #include "nsQueryObject.h"
 #include "nsIContentPolicy.h"
--- a/dom/base/nsTreeSanitizer.cpp
+++ b/dom/base/nsTreeSanitizer.cpp
@@ -13,17 +13,16 @@
 #include "mozilla/css/Declaration.h"
 #include "mozilla/css/StyleRule.h"
 #include "mozilla/css/Rule.h"
 #include "mozilla/dom/CSSRuleList.h"
 #include "mozilla/dom/SRIMetadata.h"
 #include "nsCSSParser.h"
 #include "nsCSSPropertyID.h"
 #include "nsUnicharInputStream.h"
-#include "nsIDOMCSSRule.h"
 #include "nsAttrName.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsNetUtil.h"
 #include "nsComponentManagerUtils.h"
 #include "NullPrincipal.h"
 #include "nsContentUtils.h"
 #include "nsIParserUtils.h"
 #include "nsIDocument.h"
@@ -1133,23 +1132,18 @@ nsTreeSanitizer::SanitizeStyleSheet(cons
       default:
         didSanitize = true;
         // Ignore these rule types.
         break;
       case mozilla::css::Rule::NAMESPACE_RULE:
       case mozilla::css::Rule::FONT_FACE_RULE: {
         // Append @namespace and @font-face rules verbatim.
         nsAutoString cssText;
-        nsCOMPtr<nsIDOMCSSRule> styleRule = do_QueryInterface(rule);
-        if (styleRule) {
-          rv = styleRule->GetCssText(cssText);
-          if (NS_SUCCEEDED(rv)) {
-            aSanitized.Append(cssText);
-          }
-        }
+        rule->GetCssText(cssText);
+        aSanitized.Append(cssText);
         break;
       }
       case mozilla::css::Rule::STYLE_RULE: {
         // For style rules, we will just look for and remove the
         // -moz-binding properties.
         auto styleRule = static_cast<BindingStyleRule*>(rule);
         DeclarationBlock* styleDecl = styleRule->GetDeclarationBlock();
         MOZ_ASSERT(styleDecl);
--- a/dom/base/test/test_caretPositionFromPoint.html
+++ b/dom/base/test/test_caretPositionFromPoint.html
@@ -93,17 +93,17 @@
     var test5y = test5Rect.bottom - 10;
 
     todo(false, "test5Rect: (" + test5Rect.top + ", " + test5Rect.left + ", " + test5Rect.width + ", " + test5Rect.height + ")");
     checkOffsetsFromPoint(test5x, test5y, 0, 'test5');
 
     // Check the first and last characters of the numeric input.
     var test6Element = document.getElementById("test6");
     var test6Rect = test6Element.getBoundingClientRect();
-    checkOffsetsFromPoint(Math.round(test6Rect.left + 5),
+    checkOffsetsFromPoint(Math.round(test6Rect.left + 4),
                           Math.round(test6Rect.top + (test6Rect.height / 2)),
                           0, "test6");
     checkOffsetsFromPoint(Math.round(test6Rect.left + test6Rect.width - 30),
                           Math.round(test6Rect.top + (test6Rect.height / 2)),
                           5, "test6");
 
     SimpleTest.finish();
   }
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -2494,16 +2494,47 @@ InterfaceHasInstance(JSContext* cx, int 
              "Why do we have a hasInstance hook if we don't have a prototype "
              "ID?");
 
   *bp = (domClass && domClass->mInterfaceChain[depth] == prototypeID);
   return true;
 }
 
 bool
+InterfaceIsInstance(JSContext* cx, unsigned argc, JS::Value* vp,
+                    prototypes::ID prototypeID, int depth)
+{
+  JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
+  if (MOZ_UNLIKELY(args.length() < 1)) {
+    nsPrintfCString message("%s.isInstance",
+                            NamesOfInterfacesWithProtos(prototypeID));
+    return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, message.get());
+  }
+
+  if (!args[0].isObject()) {
+    nsPrintfCString message("Argument 1 of %s.isInstance",
+                            NamesOfInterfacesWithProtos(prototypeID));
+    return ThrowErrorMessage(cx, MSG_NOT_OBJECT, message.get());
+  }
+
+  JS::Rooted<JSObject*> instance(cx, &args[0].toObject());
+
+  const DOMJSClass* domClass =
+    GetDOMClass(js::UncheckedUnwrap(instance, /* stopAtWindowProxy = */ false));
+
+  if (domClass && domClass->mInterfaceChain[depth] == prototypeID) {
+    args.rval().setBoolean(true);
+    return true;
+  }
+
+  args.rval().setBoolean(false);
+  return true;
+}
+
+bool
 ReportLenientThisUnwrappingFailure(JSContext* cx, JSObject* obj)
 {
   JS::Rooted<JSObject*> rootedObj(cx, obj);
   GlobalObject global(cx, rootedObj);
   if (global.Failed()) {
     return false;
   }
   nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(global.GetAsSupports());
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -2708,16 +2708,21 @@ ReparentWrapper(JSContext* aCx, JS::Hand
 bool
 InterfaceHasInstance(JSContext* cx, unsigned argc, JS::Value* vp);
 
 bool
 InterfaceHasInstance(JSContext* cx, int prototypeID, int depth,
                      JS::Handle<JSObject*> instance,
                      bool* bp);
 
+// Used to implement the cross-context <Interface>.isInstance static method.
+bool
+InterfaceIsInstance(JSContext* cx, unsigned argc, JS::Value* vp,
+                    prototypes::ID prototypeID, int depth);
+
 // Helper for lenient getters/setters to report to console.  If this
 // returns false, we couldn't even get a global.
 bool
 ReportLenientThisUnwrappingFailure(JSContext* cx, JSObject* obj);
 
 // Given a JSObject* that represents the chrome side of a JS-implemented WebIDL
 // interface, get the nsIGlobalObject corresponding to the content side, if any.
 // A false return means an exception was thrown.
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1719,17 +1719,16 @@ def addExternalIface(iface, nativeType=N
     if not headerFile is None:
         domInterface['headerFile'] = headerFile
     domInterface['notflattened'] = notflattened
     DOMInterfaces[iface] = domInterface
 
 addExternalIface('ApplicationCache', nativeType='nsIDOMOfflineResourceList')
 addExternalIface('Cookie', nativeType='nsICookie2',
                  headerFile='nsICookie2.h', notflattened=True)
-addExternalIface('Counter')
 addExternalIface('RTCDataChannel', nativeType='nsIDOMDataChannel')
 addExternalIface('HitRegionOptions', nativeType='nsISupports')
 addExternalIface('imgINotificationObserver', nativeType='imgINotificationObserver')
 addExternalIface('imgIRequest', nativeType='imgIRequest', notflattened=True)
 addExternalIface('LoadContext', nativeType='nsILoadContext', notflattened=True)
 addExternalIface('LoadInfo', nativeType='nsILoadInfo',
                  headerFile='nsILoadInfo.h', notflattened=True)
 addExternalIface('MenuBuilder', nativeType='nsIMenuBuilder', notflattened=True)
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -1764,16 +1764,33 @@ class CGClassObjectMovedHook(CGAbstractC
 
 
 def JSNativeArguments():
     return [Argument('JSContext*', 'cx'),
             Argument('unsigned', 'argc'),
             Argument('JS::Value*', 'vp')]
 
 
+class CGIsInstanceMethod(CGAbstractStaticMethod):
+    """
+    A class for generating the static isInstance method.
+    """
+    def __init__(self, descriptor):
+        assert descriptor.interface.hasInterfacePrototypeObject()
+        CGAbstractStaticMethod.__init__(self, descriptor, "isInstance", "bool",
+                                        JSNativeArguments())
+
+    def definition_body(self):
+        return fill(
+            """
+            return InterfaceIsInstance(cx, argc, vp, prototypes::id::${name},
+                                       PrototypeTraits<prototypes::id::${name}>::Depth);
+            """,
+            name=self.descriptor.name)
+
 class CGClassConstructor(CGAbstractStaticMethod):
     """
     JS-visible constructor for our objects
     """
     def __init__(self, descriptor, ctor, name=CONSTRUCT_HOOK_NAME):
         CGAbstractStaticMethod.__init__(self, descriptor, name, 'bool',
                                         JSNativeArguments())
         self._ctor = ctor
@@ -2411,16 +2428,28 @@ class MethodDefiner(PropertyDefiner):
             if m.isStatic():
                 method["nativeName"] = CppKeywords.checkMethodName(IDLToCIdentifier(m.identifier.name))
 
             if isChromeOnly(m):
                 self.chrome.append(method)
             else:
                 self.regular.append(method)
 
+        # Generate the isInstance static method.
+        if (static and
+            (self.descriptor.interface.hasInterfaceObject() and
+             self.descriptor.interface.hasInterfacePrototypeObject())):
+            self.chrome.append({
+                "name": "isInstance",
+                "methodInfo": False,
+                "length": 1,
+                "flags": "JSPROP_ENUMERATE",
+                "condition": MemberCondition(),
+            })
+
         # TODO: Once iterable is implemented, use tiebreak rules instead of
         # failing. Also, may be more tiebreak rules to implement once spec bug
         # is resolved.
         # https://www.w3.org/Bugs/Public/show_bug.cgi?id=28592
         def hasIterator(methods, regular):
             return (any("@@iterator" in m.aliases for m in methods) or
                     any("@@iterator" == r["name"] for r in regular))
 
@@ -2798,16 +2827,17 @@ class ConstDefiner(PropertyDefiner):
             lambda fields: '  { "%s", %s }' % fields,
             '  { 0, JS::UndefinedValue() }',
             'ConstantSpec',
             PropertyDefiner.getControllingCondition, specData)
 
 
 class PropertyArrays():
     def __init__(self, descriptor):
+        self.descriptor = descriptor
         self.staticMethods = MethodDefiner(descriptor, "StaticMethods",
                                            static=True)
         self.staticAttrs = AttrDefiner(descriptor, "StaticAttributes",
                                        static=True)
         self.methods = MethodDefiner(descriptor, "Methods", static=False)
         self.attrs = AttrDefiner(descriptor, "Attributes", static=False)
         self.unforgeableMethods = MethodDefiner(descriptor, "UnforgeableMethods",
                                                 static=False, unforgeable=True)
@@ -2816,17 +2846,21 @@ class PropertyArrays():
         self.consts = ConstDefiner(descriptor, "Constants")
 
     @staticmethod
     def arrayNames():
         return ["staticMethods", "staticAttrs", "methods", "attrs",
                 "unforgeableMethods", "unforgeableAttrs", "consts"]
 
     def hasChromeOnly(self):
-        return any(getattr(self, a).hasChromeOnly() for a in self.arrayNames())
+        # All interfaces that generate an interface object and interface
+        # prototype object have a chrome only isInstance static method.
+        return ((self.staticMethods.descriptor.interface.hasInterfaceObject() and
+                 self.staticMethods.descriptor.interface.hasInterfacePrototypeObject()) or
+                any(getattr(self, a).hasChromeOnly() for a in self.arrayNames()))
 
     def hasNonChromeOnly(self):
         return any(getattr(self, a).hasNonChromeOnly() for a in self.arrayNames())
 
     def __str__(self):
         define = ""
         for array in self.arrayNames():
             define += str(getattr(self, array))
@@ -12754,16 +12788,19 @@ class CGDescriptor(CGThing):
             hasPromiseReturningMethod, hasPromiseReturningGetter) = (
                 False, False, False, False, False, False, False)
         jsonifierMethod = None
         crossOriginMethods, crossOriginGetters, crossOriginSetters = set(), set(), set()
         unscopableNames = list()
         for n in descriptor.interface.namedConstructors:
             cgThings.append(CGClassConstructor(descriptor, n,
                                                NamedConstructorName(n)))
+        if (descriptor.interface.hasInterfaceObject() and
+            descriptor.interface.hasInterfacePrototypeObject()):
+            cgThings.append(CGIsInstanceMethod(descriptor))
         for m in descriptor.interface.members:
             if m.isMethod() and m.identifier.name == 'queryInterface':
                 continue
 
             props = memberProperties(m, descriptor)
 
             if m.isMethod():
                 if m.getExtendedAttribute("Unscopable"):
@@ -14274,19 +14311,23 @@ class CGBindingRoot(CGThing):
 
             return (any(isChromeOnly(a) or needsContainsHack(a) or
                         needsCallerType(a)
                         for a in desc.interface.members) or
                     desc.interface.getExtendedAttribute("ChromeOnly") is not None or
                     # JS-implemented interfaces with an interface object get a
                     # chromeonly _create method.  And interfaces with an
                     # interface object might have a ChromeOnly constructor.
+                    # Also interfaces whose interface prototype object is
+                    # generated (which is most of them) for the isInstance
+                    # method.
                     (desc.interface.hasInterfaceObject() and
                      (desc.interface.isJSImplemented() or
-                      (ctor and isChromeOnly(ctor)))) or
+                      (ctor and isChromeOnly(ctor)) or
+                      desc.interface.hasInterfacePrototypeObject())) or
                     # JS-implemented interfaces with clearable cached
                     # attrs have chromeonly _clearFoo methods.
                     (desc.interface.isJSImplemented() and
                      any(clearableCachedAttrs(desc))))
 
         # XXXkhuey ugly hack but this is going away soon.
         bindingHeaders['xpcprivate.h'] = webIDLFile.endswith("EventTarget.webidl")
 
--- a/dom/canvas/ImageBitmap.cpp
+++ b/dom/canvas/ImageBitmap.cpp
@@ -220,39 +220,39 @@ CreateImageFromRawData(const gfx::IntSiz
                              aBuffer, aBufferLength,
                              aCropRect);
 
   if (NS_WARN_IF(!rgbaSurface)) {
     return nullptr;
   }
 
   // Convert RGBA to BGRA
-  DataSourceSurface::MappedSurface rgbaMap;
   RefPtr<DataSourceSurface> rgbaDataSurface = rgbaSurface->GetDataSurface();
-  if (NS_WARN_IF(!rgbaDataSurface->Map(DataSourceSurface::MapType::READ, &rgbaMap))) {
+  DataSourceSurface::ScopedMap rgbaMap(rgbaDataSurface, DataSourceSurface::READ);
+  if (NS_WARN_IF(!rgbaMap.IsMapped())) {
     return nullptr;
   }
 
   RefPtr<DataSourceSurface> bgraDataSurface =
     Factory::CreateDataSourceSurfaceWithStride(rgbaDataSurface->GetSize(),
                                                SurfaceFormat::B8G8R8A8,
-                                               rgbaMap.mStride);
-
-  DataSourceSurface::MappedSurface bgraMap;
-  if (NS_WARN_IF(!bgraDataSurface->Map(DataSourceSurface::MapType::WRITE, &bgraMap))) {
+                                               rgbaMap.GetStride());
+  if (NS_WARN_IF(!bgraDataSurface)) {
     return nullptr;
   }
 
-  SwizzleData(rgbaMap.mData, rgbaMap.mStride, SurfaceFormat::R8G8B8A8,
-              bgraMap.mData, bgraMap.mStride, SurfaceFormat::B8G8R8A8,
+  DataSourceSurface::ScopedMap bgraMap(bgraDataSurface, DataSourceSurface::WRITE);
+  if (NS_WARN_IF(!bgraMap.IsMapped())) {
+    return nullptr;
+  }
+
+  SwizzleData(rgbaMap.GetData(), rgbaMap.GetStride(), SurfaceFormat::R8G8B8A8,
+              bgraMap.GetData(), bgraMap.GetStride(), SurfaceFormat::B8G8R8A8,
               bgraDataSurface->GetSize());
 
-  rgbaDataSurface->Unmap();
-  bgraDataSurface->Unmap();
-
   // Create an Image from the BGRA SourceSurface.
   RefPtr<layers::Image> image = CreateImageFromSurface(bgraDataSurface);
 
   if (NS_WARN_IF(!image)) {
     return nullptr;
   }
 
   return image.forget();
@@ -476,16 +476,19 @@ ConvertColorFormatIfNeeded(RefPtr<Source
   const int bytesPerPixel = BytesPerPixel(SurfaceFormat::B8G8R8A8);
   const IntSize dstSize = aSurface->GetSize();
   const uint32_t dstStride = dstSize.width * bytesPerPixel;
 
   RefPtr<DataSourceSurface> dstDataSurface =
     Factory::CreateDataSourceSurfaceWithStride(dstSize,
                                                SurfaceFormat::B8G8R8A8,
                                                dstStride);
+  if (NS_WARN_IF(!dstDataSurface)) {
+    return nullptr;
+  }
 
   RefPtr<DataSourceSurface> srcDataSurface = aSurface->GetDataSurface();
   if (NS_WARN_IF(!srcDataSurface)) {
     return nullptr;
   }
 
   DataSourceSurface::ScopedMap srcMap(srcDataSurface, DataSourceSurface::READ);
   DataSourceSurface::ScopedMap dstMap(dstDataSurface, DataSourceSurface::WRITE);
@@ -1424,17 +1427,19 @@ ImageBitmap::WriteStructuredClone(JSStru
     // directly, using ScopedMap to get stride.
     DataSourceSurface::ScopedMap map(snapshot, DataSourceSurface::READ);
     dstDataSurface =
       Factory::CreateDataSourceSurfaceWithStride(snapshot->GetSize(),
                                                  snapshot->GetFormat(),
                                                  map.GetStride(),
                                                  true);
   }
-  MOZ_ASSERT(dstDataSurface);
+  if (NS_WARN_IF(!dstDataSurface)) {
+    return false;
+  }
   Factory::CopyDataSourceSurface(snapshot, dstDataSurface);
   aClonedSurfaces.AppendElement(dstDataSurface);
   return true;
 }
 
 // ImageBitmap extensions.
 ImageBitmapFormat
 ImageBitmap::FindOptimalFormat(const Optional<Sequence<ImageBitmapFormat>>& aPossibleFormats,
--- a/dom/html/HTMLLinkElement.cpp
+++ b/dom/html/HTMLLinkElement.cpp
@@ -15,17 +15,16 @@
 #include "mozilla/dom/HTMLLinkElementBinding.h"
 #include "nsContentUtils.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsDOMTokenList.h"
 #include "nsIContentInlines.h"
 #include "nsIDocument.h"
 #include "nsIDOMEvent.h"
-#include "nsIDOMStyleSheet.h"
 #include "nsINode.h"
 #include "nsIStyleSheetLinkingElement.h"
 #include "nsIURL.h"
 #include "nsPIDOMWindow.h"
 #include "nsReadableUtils.h"
 #include "nsStyleConsts.h"
 #include "nsStyleLinkElement.h"
 #include "nsUnicharUtils.h"
--- a/dom/html/HTMLStyleElement.cpp
+++ b/dom/html/HTMLStyleElement.cpp
@@ -2,17 +2,16 @@
 /* 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 "mozilla/dom/HTMLStyleElement.h"
 #include "mozilla/dom/HTMLStyleElementBinding.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
-#include "nsIDOMStyleSheet.h"
 #include "nsIDocument.h"
 #include "nsUnicharUtils.h"
 #include "nsThreadUtils.h"
 #include "nsContentUtils.h"
 #include "nsStubMutationObserver.h"
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Style)
 
--- a/dom/interfaces/base/domstubs.idl
+++ b/dom/interfaces/base/domstubs.idl
@@ -35,48 +35,29 @@ interface nsIDOMClientRectList;
 %{C++
 namespace mozilla {
 namespace dom {
 class DOMException;
 }
 }
 %}
 
-// Style Sheets
-interface nsIDOMStyleSheetList;
-interface nsIDOMStyleSheet;
-interface nsIDOMMediaList;
-
 // Base
 interface nsIDOMWindow;
 interface nsIDOMWindowCollection;
 interface nsIDOMNavigator;
 interface nsIDOMScreen;
 
 // Events
 interface nsIDOMEvent;
 interface nsIDOMEventTarget;
 interface nsIDOMEventListener;
 
 // HTML
 interface nsIDOMHTMLElement;
 interface nsIDOMHTMLFormElement;
 interface nsIDOMHTMLHeadElement;
 
-// CSS
-interface nsIDOMCSSValue;
-interface nsIDOMCSSPrimitiveValue;
-interface nsIDOMCSSRule;
-interface nsIDOMCSSRuleList;
-interface nsIDOMCSSKeyframeRule;
-interface nsIDOMCSSFontFeatureValuesRule;
-interface nsIDOMCSSStyleSheet;
-interface nsIDOMCSSStyleDeclaration;
-interface nsIDOMCounter;
-interface nsIDOMRect;
-interface nsIDOMCSSStyleRule;
-interface nsIDOMCSSStyleRuleCollection;
-
 // Range
 interface nsIDOMRange;
 
 // Crypto
 interface nsIDOMCrypto;
--- a/dom/interfaces/core/nsIDOMDocument.idl
+++ b/dom/interfaces/core/nsIDOMDocument.idl
@@ -142,20 +142,16 @@ interface nsIDOMDocument : nsIDOMNode
    * space-separated string.
    *
    * @see <http://www.whatwg.org/html/#dom-document-getelementsbyclassname>
    */
   nsIDOMNodeList getElementsByClassName(in DOMString classes);
 
 
   // CSSOM
-  /**
-   * @see <http://dev.w3.org/csswg/cssom/#dom-document-stylesheets>
-   */
-  readonly attribute nsIDOMStyleSheetList   styleSheets;
 
   /**
    * This attribute must return the preferred style sheet set as set by the
    * author. It is determined from the order of style sheet declarations and
    * the Default-Style HTTP headers, as eventually defined elsewhere in the Web
    * Apps 1.0 specification. If there is no preferred style sheet set, this
    * attribute must return the empty string. The case of this attribute must
    * exactly match the case given by the author where the preferred style sheet
deleted file mode 100644
--- a/dom/interfaces/css/moz.build
+++ /dev/null
@@ -1,37 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# 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/.
-
-with Files("**"):
-    BUG_COMPONENT = ("Core", "DOM: CSS Object Model")
-
-XPIDL_SOURCES += [
-    'nsIDOMCounter.idl',
-    'nsIDOMCSSConditionRule.idl',
-    'nsIDOMCSSCounterStyleRule.idl',
-    'nsIDOMCSSFontFaceRule.idl',
-    'nsIDOMCSSFontFeatureValuesRule.idl',
-    'nsIDOMCSSGroupingRule.idl',
-    'nsIDOMCSSImportRule.idl',
-    'nsIDOMCSSKeyframeRule.idl',
-    'nsIDOMCSSKeyframesRule.idl',
-    'nsIDOMCSSMediaRule.idl',
-    'nsIDOMCSSMozDocumentRule.idl',
-    'nsIDOMCSSPageRule.idl',
-    'nsIDOMCSSPrimitiveValue.idl',
-    'nsIDOMCSSRule.idl',
-    'nsIDOMCSSRuleList.idl',
-    'nsIDOMCSSStyleDeclaration.idl',
-    'nsIDOMCSSStyleRule.idl',
-    'nsIDOMCSSStyleSheet.idl',
-    'nsIDOMCSSSupportsRule.idl',
-    'nsIDOMCSSUnknownRule.idl',
-    'nsIDOMCSSValue.idl',
-    'nsIDOMCSSValueList.idl',
-    'nsIDOMRect.idl',
-]
-
-XPIDL_MODULE = 'dom_css'
-
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSConditionRule.idl
+++ /dev/null
@@ -1,16 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsIDOMCSSGroupingRule.idl"
-
-/**
- * Interface in the CSS OM for at-rules that conditionally apply their
- * child rules.
- */
-[scriptable, uuid(44da41b2-5660-415d-8692-eae805776103)]
-interface nsIDOMCSSConditionRule : nsIDOMCSSGroupingRule
-{
-  attribute DOMString conditionText;
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSCounterStyleRule.idl
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; 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 "nsISupports.idl"
-
-[scriptable, uuid(9b5e48ce-d84c-4e31-aff5-34e9f4141313)]
-interface nsIDOMCSSCounterStyleRule : nsISupports
-{
-  attribute DOMString name;
-  attribute DOMString system;
-  attribute DOMString symbols;
-  attribute DOMString additiveSymbols;
-  attribute DOMString negative;
-  attribute DOMString prefix;
-  attribute DOMString suffix;
-  attribute DOMString range;
-  attribute DOMString pad;
-  attribute DOMString speakAs;
-  attribute DOMString fallback;
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSFontFaceRule.idl
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsISupports.idl"
-
-interface nsIDOMCSSStyleDeclaration;
-
-[scriptable, uuid(db971017-fe0c-4529-972c-8217f2fee217)]
-interface nsIDOMCSSFontFaceRule : nsISupports
-{
-  readonly attribute nsIDOMCSSStyleDeclaration  style;
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSFontFeatureValuesRule.idl
+++ /dev/null
@@ -1,16 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsISupports.idl"
-
-[scriptable, uuid(a343d27f-1da6-4fc3-9355-d4ca434f958e)]
-interface nsIDOMCSSFontFeatureValuesRule : nsISupports
-{
-  attribute DOMString fontFamily;
-                      // raises(DOMException) on setting
-
-  attribute DOMString valueText;
-                      // raises(DOMException) on setting
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSGroupingRule.idl
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsISupports.idl"
-
-interface nsIDOMCSSRuleList;
-
-/**
- * Interface for at-rules that have child rules in the CSS OM.
- */
-[scriptable, uuid(a0e3324a-f911-4baf-9591-5322c76cbb0d)]
-interface nsIDOMCSSGroupingRule : nsISupports
-{
-  readonly attribute nsIDOMCSSRuleList cssRules;
-
-  unsigned long      insertRule(in DOMString rule,
-                                in unsigned long index)
-                                        raises(DOMException);
-  void               deleteRule(in unsigned long index)
-                                        raises(DOMException);
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSImportRule.idl
+++ /dev/null
@@ -1,17 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsISupports.idl"
-
-interface nsIDOMMediaList;
-interface nsIDOMCSSStyleSheet;
-
-[scriptable, uuid(d3b2b914-01ef-4663-beda-a6475a26f491)]
-interface nsIDOMCSSImportRule : nsISupports
-{
-  readonly attribute DOMString           href;
-  readonly attribute nsIDOMMediaList     media;
-  readonly attribute nsIDOMCSSStyleSheet styleSheet;
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSKeyframeRule.idl
+++ /dev/null
@@ -1,15 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsISupports.idl"
-
-interface nsIDOMCSSStyleDeclaration;
-
-[scriptable, uuid(a281a8b4-eaa2-49a8-8b97-acc2814a57c9)]
-interface nsIDOMCSSKeyframeRule : nsISupports
-{
-           attribute DOMString                 keyText;
-  readonly attribute nsIDOMCSSStyleDeclaration style;
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSKeyframesRule.idl
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsISupports.idl"
-
-interface nsIDOMCSSRuleList;
-interface nsIDOMCSSKeyframeRule;
-
-[scriptable, uuid(400f4b70-ad0a-4047-aba4-ee8019f6b907)]
-interface nsIDOMCSSKeyframesRule : nsISupports
-{
-           attribute DOMString         name;
-  readonly attribute nsIDOMCSSRuleList cssRules;
-
-  void                     appendRule(in DOMString rule);
-  void                     deleteRule(in DOMString key);
-  nsIDOMCSSKeyframeRule    findRule(in DOMString key);
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSMediaRule.idl
+++ /dev/null
@@ -1,17 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsIDOMCSSConditionRule.idl"
-
-interface nsIDOMMediaList;
-
-/**
- * Interface for @media rules in the CSS OM.
- */
-[scriptable, uuid(6cf9c5b2-fa0f-43c0-aa50-ef85b4756e3a)]
-interface nsIDOMCSSMediaRule : nsIDOMCSSConditionRule
-{
-  readonly attribute nsIDOMMediaList   media;
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSMozDocumentRule.idl
+++ /dev/null
@@ -1,15 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsIDOMCSSConditionRule.idl"
-
-/**
- * Interface for @-moz-document rules in the CSS OM.
- */
-[scriptable, uuid(2d0cef9d-c1b2-4c6c-9003-fa83040626d1)]
-interface nsIDOMCSSMozDocumentRule : nsIDOMCSSConditionRule
-{
-  // XXX Add access to the URL list.
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSPageRule.idl
+++ /dev/null
@@ -1,17 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsISupports.idl"
-
-interface nsIDOMCSSStyleDeclaration;
-
-[scriptable, uuid(c119072b-7d2f-4aeb-a90d-e2d6b606c32a)]
-interface nsIDOMCSSPageRule : nsISupports
-{
-           //attribute DOMString        selectorText;
-                                        // raises(DOMException) on setting
-
-  readonly attribute nsIDOMCSSStyleDeclaration  style;
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSPrimitiveValue.idl
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsIDOMCSSValue.idl"
-
-/**
- * The nsIDOMCSSPrimitiveValue interface is a datatype for a primitive
- * CSS value in the Document Object Model.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/DOM-Level-2-Style
- */
-
-[uuid(f6df7293-2dc9-4cb9-9531-778caf4370e0)]
-interface nsIDOMCSSPrimitiveValue : nsIDOMCSSValue
-{
-  // UnitTypes
-  const unsigned short      CSS_UNKNOWN                    = 0;
-  const unsigned short      CSS_NUMBER                     = 1;
-  const unsigned short      CSS_PERCENTAGE                 = 2;
-  const unsigned short      CSS_EMS                        = 3;
-  const unsigned short      CSS_EXS                        = 4;
-  const unsigned short      CSS_PX                         = 5;
-  const unsigned short      CSS_CM                         = 6;
-  const unsigned short      CSS_MM                         = 7;
-  const unsigned short      CSS_IN                         = 8;
-  const unsigned short      CSS_PT                         = 9;
-  const unsigned short      CSS_PC                         = 10;
-  const unsigned short      CSS_DEG                        = 11;
-  const unsigned short      CSS_RAD                        = 12;
-  const unsigned short      CSS_GRAD                       = 13;
-  const unsigned short      CSS_MS                         = 14;
-  const unsigned short      CSS_S                          = 15;
-  const unsigned short      CSS_HZ                         = 16;
-  const unsigned short      CSS_KHZ                        = 17;
-  const unsigned short      CSS_DIMENSION                  = 18;
-  const unsigned short      CSS_STRING                     = 19;
-  const unsigned short      CSS_URI                        = 20;
-  const unsigned short      CSS_IDENT                      = 21;
-  const unsigned short      CSS_ATTR                       = 22;
-  const unsigned short      CSS_COUNTER                    = 23;
-  const unsigned short      CSS_RECT                       = 24;
-  const unsigned short      CSS_RGBCOLOR                   = 25;
-
-  readonly attribute unsigned short   primitiveType;
-  void               setFloatValue(in unsigned short unitType, 
-                                   in float floatValue)
-                                        raises(DOMException);
-  float              getFloatValue(in unsigned short unitType)
-                                        raises(DOMException);
-  void               setStringValue(in unsigned short stringType, 
-                                    in DOMString stringValue)
-                                        raises(DOMException);
-  DOMString          getStringValue()
-                                        raises(DOMException);
-  nsIDOMCounter      getCounterValue()
-                                        raises(DOMException);
-  nsIDOMRect         getRectValue()
-                                        raises(DOMException);
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSRule.idl
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "domstubs.idl"
-
-%{C++
-namespace mozilla {
-namespace css {
-class Rule;
-}
-}
-%}
-
-[ptr] native Rule(mozilla::css::Rule);
-
-/**
- * The nsIDOMCSSRule interface is a datatype for a CSS style rule in
- * the Document Object Model.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/DOM-Level-2-Style
- */
-
-[scriptable, uuid(4d6b3bad-f53c-4585-82f6-62982e27ede8)]
-interface nsIDOMCSSRule : nsISupports
-{
-  // RuleType
-  const unsigned short      UNKNOWN_RULE                   = 0;
-  const unsigned short      STYLE_RULE                     = 1;
-  const unsigned short      CHARSET_RULE                   = 2;
-  const unsigned short      IMPORT_RULE                    = 3;
-  const unsigned short      MEDIA_RULE                     = 4;
-  const unsigned short      FONT_FACE_RULE                 = 5;
-  const unsigned short      PAGE_RULE                      = 6;
-  const unsigned short      KEYFRAMES_RULE                 = 7;
-  const unsigned short      KEYFRAME_RULE                  = 8;
-  // When layout.css.prefixes.animations is disabled/removed,
-  // we should remove these two MOZ_* constants.
-  const unsigned short      MOZ_KEYFRAMES_RULE             = 7;
-  const unsigned short      MOZ_KEYFRAME_RULE              = 8;
-  const unsigned short      NAMESPACE_RULE                 = 10;
-  const unsigned short      COUNTER_STYLE_RULE             = 11;
-  const unsigned short      SUPPORTS_RULE                  = 12;
-  const unsigned short      DOCUMENT_RULE                  = 13;
-  const unsigned short      FONT_FEATURE_VALUES_RULE       = 14;
-
-  readonly attribute unsigned short      type;
-           attribute DOMString           cssText;
-                                        // raises(DOMException) on setting
-
-  readonly attribute nsIDOMCSSStyleSheet parentStyleSheet;
-  readonly attribute nsIDOMCSSRule       parentRule;
-
-  [noscript, nostdcall, notxpcom] Rule getCSSRule();
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSRuleList.idl
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "domstubs.idl"
-
-/**
- * The nsIDOMCSSRuleList interface is a datatype for a list of CSS
- * style rules in the Document Object Model.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/DOM-Level-2-Style
- */
-
-[scriptable, uuid(a6cf90c0-15b3-11d2-932e-00805f8add32)]
-interface nsIDOMCSSRuleList : nsISupports
-{
-  readonly attribute unsigned long    length;
-  nsIDOMCSSRule      item(in unsigned long index);
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSStyleDeclaration.idl
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "domstubs.idl"
-
-/**
- * The nsIDOMCSSStyleDeclaration interface is a datatype for a CSS
- * style declaration in the Document Object Model.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/DOM-Level-2-Style
- */
-
-interface nsIPrincipal;
-
-[uuid(a6cf90be-15b3-11d2-932e-00805f8add32)]
-interface nsIDOMCSSStyleDeclaration : nsISupports
-{
-  // We declare these in C++, so that we can declare default argument values,
-  // since those are unsupported by XPIDL and this is not a scriptable
-  // interface.
-  %{C++
-  NS_IMETHOD GetCssText(nsAString& aCssText) = 0;
-  NS_IMETHOD SetCssText(const nsAString& aCssText,
-                        nsIPrincipal* aSubjectPrincipal = nullptr) = 0;
-
-  NS_IMETHOD SetProperty(const nsAString& aPropertyName,
-                         const nsAString& aValue,
-                         const nsAString& aPriority,
-                         nsIPrincipal* aSubjectPrincipal = nullptr) = 0;
-  %}
-
-  DOMString          getPropertyValue(in DOMString propertyName);
-  nsIDOMCSSValue     getPropertyCSSValue(in DOMString propertyName);
-  DOMString          removeProperty(in DOMString propertyName)
-                                        raises(DOMException);
-  DOMString          getPropertyPriority(in DOMString propertyName);
-
-  readonly attribute unsigned long    length;
-  DOMString          item(in unsigned long index);
-  readonly attribute nsIDOMCSSRule    parentRule;
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSStyleRule.idl
+++ /dev/null
@@ -1,17 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsISupports.idl"
-
-interface nsIDOMCSSStyleDeclaration;
-
-[scriptable, uuid(b5e9af48-a7c2-4f88-aae3-58307af4b5a5)]
-interface nsIDOMCSSStyleRule : nsISupports
-{
-           attribute DOMString        selectorText;
-                                        // raises(DOMException) on setting
-
-  readonly attribute nsIDOMCSSStyleDeclaration  style;
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSStyleSheet.idl
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsIDOMStyleSheet.idl"
-
-/**
- * The nsIDOMCSSStyleSheet interface is a datatype for a CSS style
- * sheet in the Document Object Model.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/DOM-Level-2-Style
- */
-
-[uuid(a6cf90c2-15b3-11d2-932e-00805f8add32)]
-interface nsIDOMCSSStyleSheet : nsIDOMStyleSheet
-{
-  readonly attribute nsIDOMCSSRule     ownerRule;
-  readonly attribute nsIDOMCSSRuleList cssRules;
-
-  unsigned long      insertRule(in DOMString rule, 
-                                in unsigned long index)
-                                        raises(DOMException);
-  void               deleteRule(in unsigned long index)
-                                        raises(DOMException);
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSSupportsRule.idl
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsIDOMCSSConditionRule.idl"
-
-/**
- * Interface for @supports rules in the CSS OM.
- */
-[scriptable, uuid(0b9e63a1-1bd7-4caf-850e-148b762b14d2)]
-interface nsIDOMCSSSupportsRule : nsIDOMCSSConditionRule
-{
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSUnknownRule.idl
+++ /dev/null
@@ -1,11 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsISupports.idl"
-
-[scriptable, uuid(98f4c27b-fb35-4355-8fd9-546c4697d71a)]
-interface nsIDOMCSSUnknownRule : nsISupports
-{
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSValue.idl
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "domstubs.idl"
-
-/**
- * The nsIDOMCSSValue interface is a datatype for a CSS value in the
- * Document Object Model.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/DOM-Level-2-Style
- */
-
-[uuid(009f7ea5-9e80-41be-b008-db62f10823f2)]
-interface nsIDOMCSSValue : nsISupports
-{
-  // UnitTypes
-  const unsigned short      CSS_INHERIT                    = 0;
-  const unsigned short      CSS_PRIMITIVE_VALUE            = 1;
-  const unsigned short      CSS_VALUE_LIST                 = 2;
-  const unsigned short      CSS_CUSTOM                     = 3;
-
-           attribute DOMString        cssText;
-                                        // raises(DOMException) on setting
-
-  readonly attribute unsigned short   cssValueType;
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCSSValueList.idl
+++ /dev/null
@@ -1,12 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "domstubs.idl"
-#include "nsIDOMCSSValue.idl"
-
-[uuid(92364ed1-e364-4175-bc52-c2fe9671cbc7)]
-interface nsIDOMCSSValueList : nsIDOMCSSValue
-{
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMCounter.idl
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "domstubs.idl"
-
-[scriptable, uuid(31adb439-0055-402d-9b1d-d5ca94f3f55b)]
-interface nsIDOMCounter : nsISupports
-{
-  readonly attribute DOMString        identifier;
-  readonly attribute DOMString        listStyle;
-  readonly attribute DOMString        separator;
-};
deleted file mode 100644
--- a/dom/interfaces/css/nsIDOMRect.idl
+++ /dev/null
@@ -1,15 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "domstubs.idl"
-
-[uuid(71735f62-ac5c-4236-9a1f-5ffb280d531c)]
-interface nsIDOMRect : nsISupports
-{
-  readonly attribute nsIDOMCSSPrimitiveValue  top;
-  readonly attribute nsIDOMCSSPrimitiveValue  right;
-  readonly attribute nsIDOMCSSPrimitiveValue  bottom;
-  readonly attribute nsIDOMCSSPrimitiveValue  left;
-};
deleted file mode 100644
--- a/dom/interfaces/stylesheets/moz.build
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# 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/.
-
-with Files("**"):
-    BUG_COMPONENT = ("Core", "DOM: CSS Object Model")
-
-XPIDL_SOURCES += [
-    'nsIDOMMediaList.idl',
-    'nsIDOMStyleSheet.idl',
-    'nsIDOMStyleSheetList.idl',
-]
-
-XPIDL_MODULE = 'dom_stylesheets'
-
deleted file mode 100644
--- a/dom/interfaces/stylesheets/nsIDOMMediaList.idl
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "domstubs.idl"
-
-/**
- * The nsIDOMMediaList interface is a datatype for a list of media
- * types in the Document Object Model.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/DOM-Level-2-Style
- */
-
-[uuid(9b0c2ed7-111c-4824-adf9-ef0da6dad371)]
-interface nsIDOMMediaList : nsISupports
-{
-           attribute DOMString        mediaText;
-                                        // raises(DOMException) on setting
-
-  readonly attribute unsigned long    length;
-  DOMString          item(in unsigned long index);
-  void               deleteMedium(in DOMString oldMedium)
-                                        raises(DOMException);
-  void               appendMedium(in DOMString newMedium)
-                                        raises(DOMException);
-};
deleted file mode 100644
--- a/dom/interfaces/stylesheets/nsIDOMStyleSheet.idl
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "domstubs.idl"
-
-/**
- * The nsIDOMStyleSheet interface is a datatype for a style sheet in
- * the Document Object Model.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/DOM-Level-2-Style
- */
-
-[uuid(a6cf9080-15b3-11d2-932e-00805f8add32)]
-interface nsIDOMStyleSheet : nsISupports
-{
-  readonly attribute DOMString        type;
-           attribute boolean          disabled;
-  readonly attribute nsIDOMNode       ownerNode;
-  readonly attribute nsIDOMStyleSheet parentStyleSheet;
-  readonly attribute DOMString        href;
-  readonly attribute DOMString        title;
-  readonly attribute nsIDOMMediaList  media;
-};
deleted file mode 100644
--- a/dom/interfaces/stylesheets/nsIDOMStyleSheetList.idl
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "domstubs.idl"
-
-/**
- * The nsIDOMStyleSheetList interface is a datatype for a style sheet
- * list in the Document Object Model.
- *
- * For more information on this interface please see
- * http://www.w3.org/TR/DOM-Level-2-Style
- */
-
-[uuid(0e424250-ac2a-4fe2-bccd-a45824af090e)]
-interface nsIDOMStyleSheetList : nsISupports
-{
-  readonly attribute unsigned long    length;
-  [binaryname(SlowItem)]
-  nsIDOMStyleSheet         item(in unsigned long index);
-};
--- a/dom/interfaces/svg/nsIDOMSVGElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGElement.idl
@@ -1,22 +1,17 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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 "nsIDOMElement.idl"
 
-interface nsIDOMCSSStyleDeclaration;
-interface nsIDOMCSSValue;
-
-
 [uuid(c63517c5-8bab-4cd1-8694-bccafc32a195)]
 interface nsIDOMSVGElement : nsIDOMElement
 {
             // raises DOMException on setting
   readonly attribute nsIDOMSVGElement    ownerSVGElement;
   readonly attribute nsIDOMSVGElement    viewportElement;
 
   [binaryname(SVGClassName)]
   readonly attribute nsISupports   className;
-  readonly attribute nsIDOMCSSStyleDeclaration style;
 };
--- a/dom/moz.build
+++ b/dom/moz.build
@@ -14,19 +14,17 @@ with Files("plugins/**"):
 JAR_MANIFESTS += ['jar.mn']
 
 interfaces = [
     'base',
     'canvas',
     'core',
     'html',
     'events',
-    'stylesheets',
     'sidebar',
-    'css',
     'traversal',
     'range',
     'xbl',
     'xpath',
     'xul',
     'security',
     'storage',
     'offline',
--- a/dom/svg/nsSVGElement.cpp
+++ b/dom/svg/nsSVGElement.cpp
@@ -111,23 +111,16 @@ nsSVGElement::WrapNode(JSContext *aCx, J
 
 NS_IMETHODIMP
 nsSVGElement::GetSVGClassName(nsISupports** aClassName)
 {
   *aClassName = ClassName().take();
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsSVGElement::GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
-{
-  NS_ADDREF(*aStyle = Style());
-  return NS_OK;
-}
-
 //----------------------------------------------------------------------
 // nsSVGElement methods
 
 void
 nsSVGElement::DidAnimateClass()
 {
   // For Servo, snapshot the element before we change it.
   nsIPresShell* shell = OwnerDoc()->GetShell();
--- a/dom/tests/mochitest/chrome/chrome.ini
+++ b/dom/tests/mochitest/chrome/chrome.ini
@@ -38,17 +38,16 @@ support-files =
   !/dom/tests/mochitest/geolocation/network_geolocation.sjs
 
 [test_DOMWindowCreated.xul]
 [test_DOM_element_instanceof.xul]
 [test_activation.xul]
 tags = fullscreen
 [test_bug799299.xul]
 [test_bug800817.xul]
-[test_bug830396.xul]
 [test_bug830858.xul]
 [test_bug1224790-1.xul]
 tags = openwindow
 # synthesizeNativeOSXClick does not work on 10.6
 skip-if = os != 'mac' || os_version == '10.6'
 [test_bug1224790-2.xul]
 tags = openwindow
 # synthesizeNativeOSXClick does not work on 10.6
deleted file mode 100644
--- a/dom/tests/mochitest/chrome/test_bug830396.xul
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
-                 type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=830396
--->
-<window title="Mozilla Bug 830396"
-  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-function runTests()
-{
-  var doc = frames[0].document;
-  var cs = doc.defaultView.getComputedStyle(doc.body);
-  var nsIDOMCSSValueList = Components.interfaces.nsIDOMCSSValueList;
-  ok(cs.getPropertyCSSValue("cursor") instanceof nsIDOMCSSValueList,
-     "CSSValueList should be a nsIDOMCSSValueList");
-  SimpleTest.finish();
-}
-]]>
-</script>
-<body onload="runTests();"  xmlns="http://www.w3.org/1999/xhtml">
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=830396">Mozilla Bug 830396</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-  
-</div>
-<pre id="test">
-</pre>
-<iframe type="content"></iframe>
-</body>
-
-
-</window>
--- a/dom/webidl/CSSPrimitiveValue.webidl
+++ b/dom/webidl/CSSPrimitiveValue.webidl
@@ -1,16 +1,14 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-interface Counter;
-
 interface CSSPrimitiveValue : CSSValue {
 
   // UnitTypes
   const unsigned short      CSS_UNKNOWN                    = 0;
   const unsigned short      CSS_NUMBER                     = 1;
   const unsigned short      CSS_PERCENTAGE                 = 2;
   const unsigned short      CSS_EMS                        = 3;
   const unsigned short      CSS_EXS                        = 4;
@@ -43,14 +41,14 @@ interface CSSPrimitiveValue : CSSValue {
   [Throws]
   float              getFloatValue(unsigned short unitType);
   [Throws]
   void               setStringValue(unsigned short stringType,
                                     DOMString stringValue);
   [Throws]
   DOMString          getStringValue();
   [Throws]
-  Counter            getCounterValue();
+  void               getCounterValue();  // always throws
   [Throws]
   Rect               getRectValue();
   [Throws]
   RGBColor           getRGBColorValue();
 };
--- a/dom/webidl/CSSRule.webidl
+++ b/dom/webidl/CSSRule.webidl
@@ -41,12 +41,18 @@ partial interface CSSRule {
     const unsigned short COUNTER_STYLE_RULE = 11;
 };
 
 // https://drafts.csswg.org/css-conditional-3/#extentions-to-cssrule-interface
 partial interface CSSRule {
     const unsigned short SUPPORTS_RULE = 12;
 };
 
+// Non-standard extension for @-moz-document rules.
+partial interface CSSRule {
+    [ChromeOnly]
+    const unsigned short DOCUMENT_RULE = 13;
+};
+
 // https://drafts.csswg.org/css-fonts-3/#om-fontfeaturevalues
 partial interface CSSRule {
   const unsigned short FONT_FEATURE_VALUES_RULE = 14;
 };
--- a/dom/webidl/StyleSheet.webidl
+++ b/dom/webidl/StyleSheet.webidl
@@ -5,17 +5,17 @@
  *
  * The origin of this IDL file is
  * http://dev.w3.org/csswg/cssom/
  */
 
 interface StyleSheet {
   [Constant]
   readonly attribute DOMString type;
-  [Constant]
+  [Constant, Throws]
   readonly attribute DOMString? href;
   // Spec says "Node", but it can go null when the node gets a new
   // sheet.  That's also why it's not [Constant]
   [Pure]
   readonly attribute Node? ownerNode;
   [Pure]
   readonly attribute StyleSheet? parentStyleSheet;
   [Pure]
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -48,17 +48,16 @@
 #include "nsStyleConsts.h"
 #include "nsString.h"
 #include "nsXULControllers.h"
 #include "nsIBoxObject.h"
 #include "nsPIBoxObject.h"
 #include "XULDocument.h"
 #include "nsXULPopupListener.h"
 #include "nsRuleWalker.h"
-#include "nsIDOMCSSStyleDeclaration.h"
 #include "nsCSSParser.h"
 #include "ListBoxObject.h"
 #include "nsContentUtils.h"
 #include "nsContentList.h"
 #include "mozilla/InternalMutationEvent.h"
 #include "mozilla/MouseEvents.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsPIDOMWindow.h"
--- a/editor/libeditor/CSSEditUtils.cpp
+++ b/editor/libeditor/CSSEditUtils.cpp
@@ -18,17 +18,17 @@
 #include "nsColor.h"
 #include "nsComputedDOMStyle.h"
 #include "nsDebug.h"
 #include "nsDependentSubstring.h"
 #include "nsError.h"
 #include "nsGkAtoms.h"
 #include "nsAtom.h"
 #include "nsIContent.h"
-#include "nsIDOMCSSStyleDeclaration.h"
+#include "nsICSSDeclaration.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMWindow.h"
 #include "nsIDocument.h"
 #include "nsIEditor.h"
 #include "nsINode.h"
 #include "nsISupportsImpl.h"
 #include "nsISupportsUtils.h"
 #include "nsLiteralString.h"
@@ -1263,17 +1263,17 @@ CSSEditUtils::ElementsSameStyle(Element*
       // need to discuss this issue before any modification.
       return false;
     }
   } else if (isFirstClassSet || isSecondClassSet) {
     // one span only carries a class, early way out
     return false;
   }
 
-  nsCOMPtr<nsIDOMCSSStyleDeclaration> firstCSSDecl, secondCSSDecl;
+  nsCOMPtr<nsICSSDeclaration> firstCSSDecl, secondCSSDecl;
   uint32_t firstLength, secondLength;
   nsresult rv = GetInlineStyles(aFirstElement,  getter_AddRefs(firstCSSDecl),  &firstLength);
   if (NS_FAILED(rv) || !firstCSSDecl) {
     return false;
   }
   rv = GetInlineStyles(aSecondElement, getter_AddRefs(secondCSSDecl), &secondLength);
   if (NS_FAILED(rv) || !secondCSSDecl) {
     return false;
@@ -1308,26 +1308,25 @@ CSSEditUtils::ElementsSameStyle(Element*
     }
   }
 
   return true;
 }
 
 nsresult
 CSSEditUtils::GetInlineStyles(Element* aElement,
-                              nsIDOMCSSStyleDeclaration** aCssDecl,
+                              nsICSSDeclaration** aCssDecl,
                               uint32_t* aLength)
 {
   NS_ENSURE_TRUE(aElement && aLength, NS_ERROR_NULL_POINTER);
   *aLength = 0;
   nsCOMPtr<nsStyledElement> inlineStyles = do_QueryInterface(aElement);
   NS_ENSURE_TRUE(inlineStyles, NS_ERROR_NULL_POINTER);
 
-  nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl =
-    do_QueryInterface(inlineStyles->Style());
+  nsCOMPtr<nsICSSDeclaration> cssDecl = inlineStyles->Style();
   MOZ_ASSERT(cssDecl);
 
   cssDecl.forget(aCssDecl);
   (*aCssDecl)->GetLength(aLength);
   return NS_OK;
 }
 
 Element*
--- a/editor/libeditor/CSSEditUtils.h
+++ b/editor/libeditor/CSSEditUtils.h
@@ -10,17 +10,17 @@
 #include "nsCOMPtr.h"               // for already_AddRefed
 #include "nsStringFwd.h"
 #include "nsTArray.h"               // for nsTArray
 #include "nscore.h"                 // for nsAString, nsresult, nullptr
 
 class nsComputedDOMStyle;
 class nsAtom;
 class nsIContent;
-class nsIDOMCSSStyleDeclaration;
+class nsICSSDeclaration;
 class nsIDOMNode;
 class nsINode;
 
 namespace mozilla {
 
 class HTMLEditor;
 namespace dom {
 class Element;
@@ -319,17 +319,17 @@ public:
    * Get the specified inline styles (style attribute) for an element.
    *
    * @param aElement        [IN] The element node.
    * @param aCssDecl        [OUT] The CSS declaration corresponding to the
    *                              style attribute.
    * @param aLength         [OUT] The number of declarations in aCssDecl.
    */
   nsresult GetInlineStyles(dom::Element* aElement,
-                           nsIDOMCSSStyleDeclaration** aCssDecl,
+                           nsICSSDeclaration** aCssDecl,
                            uint32_t* aLength);
 
 public:
   /**
    * Returns aNode itself if it is an element node, or the first ancestors
    * being an element node if aNode is not one itself.
    *
    * @param aNode           [IN] A node
--- a/editor/libeditor/HTMLAbsPositionEditor.cpp
+++ b/editor/libeditor/HTMLAbsPositionEditor.cpp
@@ -8,29 +8,29 @@
 
 #include "HTMLEditorObjectResizerUtils.h"
 #include "HTMLEditRules.h"
 #include "HTMLEditUtils.h"
 #include "TextEditUtils.h"
 #include "mozilla/EditorUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/TextEditRules.h"
+#include "mozilla/dom/CSSPrimitiveValueBinding.h"
 #include "mozilla/dom/Selection.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/mozalloc.h"
 #include "nsAString.h"
 #include "nsAlgorithm.h"
 #include "nsCOMPtr.h"
 #include "nsComputedDOMStyle.h"
 #include "nsDebug.h"
 #include "nsError.h"
 #include "nsGkAtoms.h"
 #include "nsIContent.h"
 #include "nsROCSSPrimitiveValue.h"
-#include "nsIDOMCSSStyleDeclaration.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMNode.h"
 #include "nsDOMCSSRGBColor.h"
 #include "nsIDOMWindow.h"
 #include "nsIHTMLObjectResizer.h"
 #include "nsINode.h"
@@ -676,27 +676,27 @@ HTMLEditor::CheckPositionedElementBGandF
       // from these declarations, get the one we want and that one only
       ErrorResult error;
       RefPtr<dom::CSSValue> cssVal = cssDecl->GetPropertyCSSValue(NS_LITERAL_STRING("color"), error);
       NS_ENSURE_TRUE(!error.Failed(), error.StealNSResult());
 
       nsROCSSPrimitiveValue* val = cssVal->AsPrimitiveValue();
       NS_ENSURE_TRUE(val, NS_ERROR_FAILURE);
 
-      if (nsIDOMCSSPrimitiveValue::CSS_RGBCOLOR == val->PrimitiveType()) {
+      if (CSSPrimitiveValueBinding::CSS_RGBCOLOR == val->PrimitiveType()) {
         nsDOMCSSRGBColor* rgbVal = val->GetRGBColorValue(error);
         NS_ENSURE_TRUE(!error.Failed(), error.StealNSResult());
         float r = rgbVal->Red()->
-          GetFloatValue(nsIDOMCSSPrimitiveValue::CSS_NUMBER, error);
+          GetFloatValue(CSSPrimitiveValueBinding::CSS_NUMBER, error);
         NS_ENSURE_TRUE(!error.Failed(), error.StealNSResult());
         float g = rgbVal->Green()->
-          GetFloatValue(nsIDOMCSSPrimitiveValue::CSS_NUMBER, error);
+          GetFloatValue(CSSPrimitiveValueBinding::CSS_NUMBER, error);
         NS_ENSURE_TRUE(!error.Failed(), error.StealNSResult());
         float b = rgbVal->Blue()->
-          GetFloatValue(nsIDOMCSSPrimitiveValue::CSS_NUMBER, error);
+          GetFloatValue(CSSPrimitiveValueBinding::CSS_NUMBER, error);
         NS_ENSURE_TRUE(!error.Failed(), error.StealNSResult());
         if (r >= BLACK_BG_RGB_TRIGGER &&
             g >= BLACK_BG_RGB_TRIGGER &&
             b >= BLACK_BG_RGB_TRIGGER)
           aReturn.AssignLiteral("black");
         else
           aReturn.AssignLiteral("white");
         return NS_OK;
--- a/editor/libeditor/HTMLAnonymousNodeEditor.cpp
+++ b/editor/libeditor/HTMLAnonymousNodeEditor.cpp
@@ -1,29 +1,27 @@
 /* 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 "mozilla/HTMLEditor.h"
 
 #include "mozilla/Attributes.h"
+#include "mozilla/dom/CSSPrimitiveValueBinding.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/mozalloc.h"
 #include "nsAString.h"
 #include "nsCOMPtr.h"
 #include "nsComputedDOMStyle.h"
 #include "nsDebug.h"
 #include "nsError.h"
 #include "nsGkAtoms.h"
 #include "nsAtom.h"
 #include "nsIContent.h"
 #include "nsID.h"
-#include "nsIDOMCSSPrimitiveValue.h"
-#include "nsIDOMCSSStyleDeclaration.h"
-#include "nsIDOMCSSValue.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMWindow.h"
 #include "nsIDocument.h"
 #include "nsIDocumentObserver.h"
 #include "nsIHTMLAbsPosEditor.h"
@@ -37,55 +35,60 @@
 #include "nsLiteralString.h"
 #include "nsPresContext.h"
 #include "nsReadableUtils.h"
 #include "nsString.h"
 #include "nsStringFwd.h"
 #include "nsUnicharUtils.h"
 #include "nscore.h"
 #include "nsContentUtils.h" // for nsAutoScriptBlocker
+#include "nsROCSSPrimitiveValue.h"
 
 class nsIDOMEventListener;
 class nsISelection;
 
 namespace mozilla {
 
 using namespace dom;
 
 // retrieve an integer stored into a CSS computed float value
-static int32_t GetCSSFloatValue(nsIDOMCSSStyleDeclaration * aDecl,
-                                const nsAString & aProperty)
+static int32_t GetCSSFloatValue(nsComputedDOMStyle* aComputedStyle,
+                                const nsAString& aProperty)
 {
-  MOZ_ASSERT(aDecl);
+  MOZ_ASSERT(aComputedStyle);
 
-  nsCOMPtr<nsIDOMCSSValue> value;
   // get the computed CSSValue of the property
-  nsresult rv = aDecl->GetPropertyCSSValue(aProperty, getter_AddRefs(value));
-  if (NS_FAILED(rv) || !value) {
+  ErrorResult rv;
+  RefPtr<CSSValue> value = aComputedStyle->GetPropertyCSSValue(aProperty, rv);
+  if (rv.Failed() || !value) {
     return 0;
   }
 
   // check the type of the returned CSSValue; we handle here only
   // pixel and enum types
-  nsCOMPtr<nsIDOMCSSPrimitiveValue> val = do_QueryInterface(value);
-  uint16_t type;
-  val->GetPrimitiveType(&type);
+  RefPtr<nsROCSSPrimitiveValue> val = value->AsPrimitiveValue();
+  uint16_t type = val->PrimitiveType();
 
   float f = 0;
   switch (type) {
-    case nsIDOMCSSPrimitiveValue::CSS_PX:
+    case CSSPrimitiveValueBinding::CSS_PX:
       // the value is in pixels, just get it
-      rv = val->GetFloatValue(nsIDOMCSSPrimitiveValue::CSS_PX, &f);
-      NS_ENSURE_SUCCESS(rv, 0);
+      f = val->GetFloatValue(CSSPrimitiveValueBinding::CSS_PX, rv);
+      if (rv.Failed()) {
+        return 0;
+      }
       break;
-    case nsIDOMCSSPrimitiveValue::CSS_IDENT: {
+    case CSSPrimitiveValueBinding::CSS_IDENT: {
       // the value is keyword, we have to map these keywords into
       // numeric values
       nsAutoString str;
-      val->GetStringValue(str);
+      val->GetStringValue(str, rv);
+      if (rv.Failed()) {
+        return 0;
+      }
       if (str.EqualsLiteral("thin")) {
         f = 1;
       } else if (str.EqualsLiteral("medium")) {
         f = 3;
       } else if (str.EqualsLiteral("thick")) {
         f = 5;
       }
       break;
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -27,17 +27,16 @@
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsISelectionController.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsILinkHandler.h"
 #include "nsIInlineSpellChecker.h"
 
 #include "mozilla/css/Loader.h"
-#include "nsIDOMStyleSheet.h"
 
 #include "nsIContent.h"
 #include "nsIContentIterator.h"
 #include "nsIMutableArray.h"
 #include "nsContentUtils.h"
 #include "nsIDocumentEncoder.h"
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
@@ -2889,17 +2888,18 @@ HTMLEditor::EnableStyleSheet(const nsASt
 {
   RefPtr<StyleSheet> sheet = GetStyleSheetForURL(aURL);
   NS_ENSURE_TRUE(sheet, NS_OK); // Don't fail if sheet not found
 
   // Ensure the style sheet is owned by our document.
   nsCOMPtr<nsIDocument> document = GetDocument();
   sheet->SetAssociatedDocument(document, StyleSheet::NotOwnedByDocument);
 
-  return sheet->SetDisabled(!aEnable);
+  sheet->SetDisabled(!aEnable);
+  return NS_OK;
 }
 
 bool
 HTMLEditor::EnableExistingStyleSheet(const nsAString& aURL)
 {
   RefPtr<StyleSheet> sheet = GetStyleSheetForURL(aURL);
 
   // Enable sheet if already loaded.
--- a/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
@@ -7,17 +7,16 @@
 
 #include "mozilla/BinarySearch.h"
 #include "mozilla/TextEditor.h"
 #include "mozilla/dom/Element.h"
 
 #include "nsDebug.h"
 #include "nsAtom.h"
 #include "nsComponentManagerUtils.h"
-#include "nsIDOMCSSStyleDeclaration.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMRange.h"
 #include "nsIEditor.h"
 #include "nsIDOMNode.h"
 #include "nsUnicodeProperties.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIContent.h"
 #include "nsTextFragment.h"
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -374,16 +374,27 @@ public:
   /** This returns false if some event has made this source surface invalid for
    * usage with current DrawTargets. For example in the case of Direct2D this
    * could return false if we have switched devices since this surface was
    * created.
    */
   virtual bool IsValid() const { return true; }
 
   /**
+   * This returns true if it is the same underlying surface data, even if
+   * the objects are different (e.g. indirection due to
+   * DataSourceSurfaceWrapper).
+   */
+  virtual bool Equals(SourceSurface* aOther, bool aSymmetric = true)
+  {
+    return this == aOther ||
+           (aSymmetric && aOther && aOther->Equals(this, false));
+  }
+
+  /**
    * This function will return true if the surface type matches that of a
    * DataSourceSurface and if GetDataSurface will return the same object.
    */
   bool IsDataSourceSurface() const {
     SurfaceType type = GetType();
     return type == SurfaceType::DATA ||
            type == SurfaceType::DATA_SHARED;
   }
--- a/gfx/2d/DataSourceSurfaceWrapper.h
+++ b/gfx/2d/DataSourceSurfaceWrapper.h
@@ -9,32 +9,45 @@
 
 #include "2D.h"
 
 namespace mozilla {
 namespace gfx {
 
 // Wraps a DataSourceSurface and forwards all methods except for GetType(),
 // from which it always returns SurfaceType::DATA.
-class DataSourceSurfaceWrapper : public DataSourceSurface
+class DataSourceSurfaceWrapper final : public DataSourceSurface
 {
 public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceWrapper, override)
   explicit DataSourceSurfaceWrapper(DataSourceSurface *aSurface)
    : mSurface(aSurface)
   {}
 
+  bool Equals(SourceSurface* aOther, bool aSymmetric = true) override
+  {
+    return DataSourceSurface::Equals(aOther, aSymmetric) ||
+           mSurface->Equals(aOther, aSymmetric);
+  }
+
   virtual SurfaceType GetType() const override { return SurfaceType::DATA; }
 
   virtual uint8_t *GetData() override { return mSurface->GetData(); }
   virtual int32_t Stride() override { return mSurface->Stride(); }
   virtual IntSize GetSize() const override { return mSurface->GetSize(); }
   virtual SurfaceFormat GetFormat() const override { return mSurface->GetFormat(); }
   virtual bool IsValid() const override { return mSurface->IsValid(); }
 
+  bool Map(MapType aType, MappedSurface *aMappedSurface) override
+  {
+    return mSurface->Map(aType, aMappedSurface);
+  }
+
+  void Unmap() override { mSurface->Unmap(); }
+
 private:
   RefPtr<DataSourceSurface> mSurface;
 };
 
 } // namespace gfx
 } // namespace mozilla
 
 #endif /* MOZILLA_GFX_DATASOURCESURFACEWRAPPER_H_ */
--- a/gfx/2d/DrawTargetTiled.h
+++ b/gfx/2d/DrawTargetTiled.h
@@ -198,16 +198,20 @@ public:
     MOZ_ASSERT(mRect.Width() > 0 && mRect.Height() > 0);
     return IntSize(mRect.XMost(), mRect.YMost());
   }
   virtual SurfaceFormat GetFormat() const { return mSnapshots[0]->GetFormat(); }
 
   virtual already_AddRefed<DataSourceSurface> GetDataSurface()
   {
     RefPtr<DataSourceSurface> surf = Factory::CreateDataSourceSurface(GetSize(), GetFormat());
+    if (!surf) {
+      gfxCriticalError() << "DrawTargetTiled::GetDataSurface failed to allocate surface";
+      return nullptr;
+    }
 
     DataSourceSurface::MappedSurface mappedSurf;
     if (!surf->Map(DataSourceSurface::MapType::WRITE, &mappedSurf)) {
       gfxCriticalError() << "DrawTargetTiled::GetDataSurface failed to map surface";
       return nullptr;
     }
 
     {
--- a/gfx/2d/FilterProcessingSIMD-inl.h
+++ b/gfx/2d/FilterProcessingSIMD-inl.h
@@ -12,19 +12,23 @@
 namespace mozilla {
 namespace gfx {
 
 template<typename u8x16_t>
 inline already_AddRefed<DataSourceSurface>
 ConvertToB8G8R8A8_SIMD(SourceSurface* aSurface)
 {
   IntSize size = aSurface->GetSize();
-  RefPtr<DataSourceSurface> input = aSurface->GetDataSurface();
   RefPtr<DataSourceSurface> output =
     Factory::CreateDataSourceSurface(size, SurfaceFormat::B8G8R8A8);
+  if (!output) {
+    return nullptr;
+  }
+
+  RefPtr<DataSourceSurface> input = aSurface->GetDataSurface();
   DataSourceSurface::ScopedMap inputMap(input, DataSourceSurface::READ);
   DataSourceSurface::ScopedMap outputMap(output, DataSourceSurface::READ_WRITE);
   uint8_t *inputData = inputMap.GetData();
   uint8_t *outputData = outputMap.GetData();
   int32_t inputStride = inputMap.GetStride();
   int32_t outputStride = outputMap.GetStride();
   switch (input->GetFormat()) {
     case SurfaceFormat::B8G8R8A8:
@@ -282,39 +286,31 @@ ShuffleAndPackComponents(i32x4_t bbbb123
   i16x8_t brbrbrbr1234 = simd::InterleaveLo16(bbbbgggg1234, rrrraaaa1234);
   i16x8_t gagagaga1234 = simd::InterleaveHi16(bbbbgggg1234, rrrraaaa1234);
   i16x8_t bgrabgra12 = simd::InterleaveLo16(brbrbrbr1234, gagagaga1234);
   i16x8_t bgrabgra34 = simd::InterleaveHi16(brbrbrbr1234, gagagaga1234);
   return simd::PackAndSaturate16To8(bgrabgra12, bgrabgra34);
 }
 
 template<typename i32x4_t, typename i16x8_t, typename u8x16_t, BlendMode mode>
-inline already_AddRefed<DataSourceSurface>
-ApplyBlending_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2)
+inline void
+ApplyBlending_SIMD(const DataSourceSurface::ScopedMap& aInputMap1,
+                   const DataSourceSurface::ScopedMap& aInputMap2,
+                   const DataSourceSurface::ScopedMap& aOutputMap,
+                   const IntSize& aSize)
 {
-  IntSize size = aInput1->GetSize();
-  RefPtr<DataSourceSurface> target =
-    Factory::CreateDataSourceSurface(size, SurfaceFormat::B8G8R8A8);
-  if (!target) {
-    return nullptr;
-  }
+  uint8_t* source1Data = aInputMap1.GetData();
+  uint8_t* source2Data = aInputMap2.GetData();
+  uint8_t* targetData = aOutputMap.GetData();
+  int32_t targetStride = aOutputMap.GetStride();
+  int32_t source1Stride = aInputMap1.GetStride();
+  int32_t source2Stride = aInputMap2.GetStride();
 
-  DataSourceSurface::ScopedMap inputMap1(aInput1, DataSourceSurface::READ);
-  DataSourceSurface::ScopedMap inputMap2(aInput2, DataSourceSurface::READ);
-  DataSourceSurface::ScopedMap outputMap(target, DataSourceSurface::READ_WRITE);
-
-  uint8_t* source1Data = inputMap1.GetData();
-  uint8_t* source2Data = inputMap2.GetData();
-  uint8_t* targetData = outputMap.GetData();
-  int32_t targetStride = outputMap.GetStride();
-  int32_t source1Stride = inputMap1.GetStride();
-  int32_t source2Stride = inputMap2.GetStride();
-
-  for (int32_t y = 0; y < size.height; y++) {
-    for (int32_t x = 0; x < size.width; x += 4) {
+  for (int32_t y = 0; y < aSize.height; y++) {
+    for (int32_t x = 0; x < aSize.width; x += 4) {
       int32_t targetIndex = y * targetStride + 4 * x;
       int32_t source1Index = y * source1Stride + 4 * x;
       int32_t source2Index = y * source2Stride + 4 * x;
 
       u8x16_t s1234 = simd::Load8<u8x16_t>(&source2Data[source2Index]);
       u8x16_t d1234 = simd::Load8<u8x16_t>(&source1Data[source1Index]);
 
       // The blending calculation for the RGB channels all need access to the
@@ -335,16 +331,37 @@ ApplyBlending_SIMD(DataSourceSurface* aI
 
       // Throw away blendedA and overwrite it with the correct blended alpha.
       blendedA = BlendAlphaOfFourPixels<i16x8_t,i32x4_t>(s_rrrraaaa1234, d_rrrraaaa1234);
 
       u8x16_t result1234 = ShuffleAndPackComponents<i32x4_t,i16x8_t,u8x16_t>(blendedB, blendedG, blendedR, blendedA);
       simd::Store8(&targetData[targetIndex], result1234);
     }
   }
+}
+
+template<typename i32x4_t, typename i16x8_t, typename u8x16_t, BlendMode mode>
+inline already_AddRefed<DataSourceSurface>
+ApplyBlending_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2)
+{
+  IntSize size = aInput1->GetSize();
+  RefPtr<DataSourceSurface> target =
+    Factory::CreateDataSourceSurface(size, SurfaceFormat::B8G8R8A8);
+  if (!target) {
+    return nullptr;
+  }
+
+  DataSourceSurface::ScopedMap inputMap1(aInput1, DataSourceSurface::READ);
+  DataSourceSurface::ScopedMap outputMap(target, DataSourceSurface::READ_WRITE);
+  if (aInput1->Equals(aInput2)) {
+    ApplyBlending_SIMD<i32x4_t,i16x8_t,u8x16_t,mode>(inputMap1, inputMap1, outputMap, size);
+  } else {
+    DataSourceSurface::ScopedMap inputMap2(aInput2, DataSourceSurface::READ);
+    ApplyBlending_SIMD<i32x4_t,i16x8_t,u8x16_t,mode>(inputMap1, inputMap2, outputMap, size);
+  }
 
   return target.forget();
 }
 
 template<typename i32x4_t, typename i16x8_t, typename u8x16_t>
 static already_AddRefed<DataSourceSurface>
 ApplyBlending_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2,
                       BlendMode aBlendMode)
@@ -1021,37 +1038,29 @@ ArithmeticCombineTwoPixels(i16x8_t in1, 
 
   // Sum everything up and truncate the fractional part.
   i32x4_t result_1 = simd::ShiftRight32<7>(simd::Add32(inProdTimesK1PlusK4_1, inTimesK2K3_1));
   i32x4_t result_2 = simd::ShiftRight32<7>(simd::Add32(inProdTimesK1PlusK4_2, inTimesK2K3_2));
   return simd::PackAndSaturate32To16(result_1, result_2);
 }
 
 template<typename i32x4_t, typename i16x8_t, typename u8x16_t>
-static already_AddRefed<DataSourceSurface>
-ApplyArithmeticCombine_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2,
+static void
+ApplyArithmeticCombine_SIMD(const DataSourceSurface::ScopedMap& aInputMap1,
+                            const DataSourceSurface::ScopedMap& aInputMap2,
+                            const DataSourceSurface::ScopedMap& aOutputMap,
+                            const IntSize& aSize,
                             Float aK1, Float aK2, Float aK3, Float aK4)
 {
-  IntSize size = aInput1->GetSize();
-  RefPtr<DataSourceSurface> target =
-  Factory::CreateDataSourceSurface(size, SurfaceFormat::B8G8R8A8);
-  if (!target) {
-    return nullptr;
-  }
-
-  DataSourceSurface::ScopedMap inputMap1(aInput1, DataSourceSurface::READ);
-  DataSourceSurface::ScopedMap inputMap2(aInput2, DataSourceSurface::READ);
-  DataSourceSurface::ScopedMap outputMap(target, DataSourceSurface::READ_WRITE);
-
-  uint8_t* source1Data = inputMap1.GetData();
-  uint8_t* source2Data = inputMap2.GetData();
-  uint8_t* targetData = outputMap.GetData();
-  uint32_t source1Stride = inputMap1.GetStride();
-  uint32_t source2Stride = inputMap2.GetStride();
-  uint32_t targetStride = outputMap.GetStride();
+  uint8_t* source1Data = aInputMap1.GetData();
+  uint8_t* source2Data = aInputMap2.GetData();
+  uint8_t* targetData = aOutputMap.GetData();
+  uint32_t source1Stride = aInputMap1.GetStride();
+  uint32_t source2Stride = aInputMap2.GetStride();
+  uint32_t targetStride = aOutputMap.GetStride();
 
   // The arithmetic combine filter does the following calculation:
   // result = k1 * in1 * in2 + k2 * in1 + k3 * in2 + k4
   //
   // Or, with in1/2 integers between 0 and 255:
   // result = (k1 * in1 * in2) / 255 + k2 * in1 + k3 * in2 + k4 * 255
   //
   // We want the whole calculation to happen in integer, with 16-bit factors.
@@ -1063,18 +1072,18 @@ ApplyArithmeticCombine_SIMD(DataSourceSu
   i16x8_t k1 = simd::FromI16<i16x8_t>(int16_t(floorf(std::min(std::max(aK1, -255.0f), 255.0f) * 128 + 0.5f)));
   i16x8_t k2 = simd::FromI16<i16x8_t>(int16_t(floorf(std::min(std::max(aK2, -255.0f), 255.0f) * 128 + 0.5f)));
   i16x8_t k3 = simd::FromI16<i16x8_t>(int16_t(floorf(std::min(std::max(aK3, -255.0f), 255.0f) * 128 + 0.5f)));
   i16x8_t k4 = simd::FromI16<i16x8_t>(int16_t(floorf(std::min(std::max(aK4, -128.0f), 128.0f) * 255 + 0.5f)));
 
   i16x8_t k1And4 = simd::InterleaveLo16(k1, k4);
   i16x8_t k2And3 = simd::InterleaveLo16(k2, k3);
 
-  for (int32_t y = 0; y < size.height; y++) {
-    for (int32_t x = 0; x < size.width; x += 4) {
+  for (int32_t y = 0; y < aSize.height; y++) {
+    for (int32_t x = 0; x < aSize.width; x += 4) {
       uint32_t source1Index = y * source1Stride + 4 * x;
       uint32_t source2Index = y * source2Stride + 4 * x;
       uint32_t targetIndex = y * targetStride + 4 * x;
 
       // Load and unpack.
       u8x16_t in1 = simd::Load8<u8x16_t>(&source1Data[source1Index]);
       u8x16_t in2 = simd::Load8<u8x16_t>(&source2Data[source2Index]);
       i16x8_t in1_12 = simd::UnpackLo8x8ToI16x8(in1);
@@ -1085,14 +1094,39 @@ ApplyArithmeticCombine_SIMD(DataSourceSu
       // Multiply and add.
       i16x8_t result_12 = ArithmeticCombineTwoPixels<i32x4_t,i16x8_t>(in1_12, in2_12, k1And4, k2And3);
       i16x8_t result_34 = ArithmeticCombineTwoPixels<i32x4_t,i16x8_t>(in1_34, in2_34, k1And4, k2And3);
 
       // Pack and store.
       simd::Store8(&targetData[targetIndex], simd::PackAndSaturate16To8(result_12, result_34));
     }
   }
+}
+
+template<typename i32x4_t, typename i16x8_t, typename u8x16_t>
+static already_AddRefed<DataSourceSurface>
+ApplyArithmeticCombine_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2,
+                            Float aK1, Float aK2, Float aK3, Float aK4)
+{
+  IntSize size = aInput1->GetSize();
+  RefPtr<DataSourceSurface> target =
+  Factory::CreateDataSourceSurface(size, SurfaceFormat::B8G8R8A8);
+  if (!target) {
+    return nullptr;
+  }
+
+  DataSourceSurface::ScopedMap inputMap1(aInput1, DataSourceSurface::READ);
+  DataSourceSurface::ScopedMap outputMap(target, DataSourceSurface::READ_WRITE);
+
+  if (aInput1->Equals(aInput2)) {
+    ApplyArithmeticCombine_SIMD<i32x4_t, i16x8_t, u8x16_t>(inputMap1, inputMap1, outputMap,
+                                                           size, aK1, aK2, aK3, aK4);
+  } else {
+    DataSourceSurface::ScopedMap inputMap2(aInput2, DataSourceSurface::READ);
+    ApplyArithmeticCombine_SIMD<i32x4_t, i16x8_t, u8x16_t>(inputMap1, inputMap2, outputMap,
+                                                           size, aK1, aK2, aK3, aK4);
+  }
 
   return target.forget();
 }
 
 } // namespace gfx
 } // namespace mozilla
--- a/gfx/layers/AsyncCanvasRenderer.cpp
+++ b/gfx/layers/AsyncCanvasRenderer.cpp
@@ -156,16 +156,19 @@ AsyncCanvasRenderer::CopyFromTextureClie
   const gfx::SurfaceFormat format = gfx::SurfaceFormat::B8G8R8A8;
   // Avoid to create buffer every time.
   if (!mSurfaceForBasic ||
       size != mSurfaceForBasic->GetSize() ||
       format != mSurfaceForBasic->GetFormat())
   {
     uint32_t stride = gfx::GetAlignedStride<8>(size.width, BytesPerPixel(format));
     mSurfaceForBasic = gfx::Factory::CreateDataSourceSurfaceWithStride(size, format, stride);
+    if (!mSurfaceForBasic) {
+      return;
+    }
   }
 
   MappedTextureData mapped;
   if (!aTextureClient->BorrowMappedData(mapped)) {
     return;
   }
 
   const uint8_t* lockedBytes = mapped.data;
@@ -239,16 +242,19 @@ AsyncCanvasRenderer::GetSurface()
   if (mSurfaceForBasic) {
     // Since SourceSurface isn't thread-safe, we need copy to a new SourceSurface.
     gfx::DataSourceSurface::ScopedMap srcMap(mSurfaceForBasic, gfx::DataSourceSurface::READ);
 
     RefPtr<gfx::DataSourceSurface> result =
       gfx::Factory::CreateDataSourceSurfaceWithStride(mSurfaceForBasic->GetSize(),
                                                       mSurfaceForBasic->GetFormat(),
                                                       srcMap.GetStride());
+    if (NS_WARN_IF(!result)) {
+      return nullptr;
+    }
 
     gfx::DataSourceSurface::ScopedMap dstMap(result, gfx::DataSourceSurface::WRITE);
 
     if (NS_WARN_IF(!srcMap.IsMapped()) ||
         NS_WARN_IF(!dstMap.IsMapped())) {
       return nullptr;
     }
 
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -403,43 +403,43 @@ WebRenderBridgeParent::AddExternalImage(
                                   0);
       return true;
     }
   } else {
     MOZ_ASSERT(mExternalImageIds.Get(wr::AsUint64(aExtId)).get());
 
     RefPtr<WebRenderImageHost> host = mExternalImageIds.Get(wr::AsUint64(aExtId));
     if (!host) {
-      NS_ERROR("CompositableHost does not exist");
+      gfxCriticalNote << "CompositableHost does not exist for extId:" << wr::AsUint64(aExtId);
       return false;
     }
     if (!gfxEnv::EnableWebRenderRecording()) {
       TextureHost* texture = host->GetAsTextureHostForComposite();
       if (!texture) {
-        NS_ERROR("TextureHost does not exist");
+        gfxCriticalNote << "TextureHost does not exist for extId:" << wr::AsUint64(aExtId);
         return false;
       }
       WebRenderTextureHost* wrTexture = texture->AsWebRenderTextureHost();
       if (wrTexture) {
         wrTexture->PushResourceUpdates(aResources, TextureHost::ADD_IMAGE, keys,
                                        wrTexture->GetExternalImageKey());
         return true;
       }
     }
     dSurf = host->GetAsSurface();
   }
 
   if (!dSurf) {
-    NS_ERROR("TextureHost does not return DataSourceSurface");
+    gfxCriticalNote << "TextureHost does not return DataSourceSurface for extId:" << wr::AsUint64(aExtId);
     return false;
   }
 
   DataSourceSurface::MappedSurface map;
   if (!dSurf->Map(gfx::DataSourceSurface::MapType::READ, &map)) {
-    NS_ERROR("DataSourceSurface failed to map");
+    gfxCriticalNote << "DataSourceSurface failed to map for Image for extId:" << wr::AsUint64(aExtId);
     return false;
   }
 
   IntSize size = dSurf->GetSize();
   wr::ImageDescriptor descriptor(size, map.mStride, dSurf->GetFormat());
   wr::Vec<uint8_t> data;
   data.PushBytes(Range<uint8_t>(map.mData, size.height * map.mStride));
   aResources.AddImage(keys[0], descriptor, data);
--- a/gfx/layers/wr/WebRenderLayerManager.cpp
+++ b/gfx/layers/wr/WebRenderLayerManager.cpp
@@ -506,32 +506,16 @@ WebRenderLayerManager::DidComposite(uint
 
   // These observers fire whether or not we were in a transaction.
   for (size_t i = 0; i < mDidCompositeObservers.Length(); i++) {
     mDidCompositeObservers[i]->DidComposite();
   }
 }
 
 void
-WebRenderLayerManager::ClearLayer(Layer* aLayer)
-{
-  aLayer->ClearCachedResources();
-  if (aLayer->GetMaskLayer()) {
-    aLayer->GetMaskLayer()->ClearCachedResources();
-  }
-  for (size_t i = 0; i < aLayer->GetAncestorMaskLayerCount(); i++) {
-    aLayer->GetAncestorMaskLayerAt(i)->ClearCachedResources();
-  }
-  for (Layer* child = aLayer->GetFirstChild(); child;
-       child = child->GetNextSibling()) {
-    ClearLayer(child);
-  }
-}
-
-void
 WebRenderLayerManager::ClearCachedResources(Layer* aSubtree)
 {
   WrBridge()->BeginClearCachedResources();
   DiscardImages();
   WrBridge()->EndClearCachedResources();
 }
 
 void
--- a/gfx/layers/wr/WebRenderLayerManager.h
+++ b/gfx/layers/wr/WebRenderLayerManager.h
@@ -166,18 +166,16 @@ public:
 
 private:
   /**
    * Take a snapshot of the parent context, and copy
    * it into mTarget.
    */
   void MakeSnapshotIfRequired(LayoutDeviceIntSize aSize);
 
-  void ClearLayer(Layer* aLayer);
-
 private:
   nsIWidget* MOZ_NON_OWNING_REF mWidget;
   nsTArray<wr::ImageKey> mImageKeysToDelete;
   // TODO - This is needed because we have some code that creates image keys
   // and enqueues them for deletion right away which is bad not only because
   // of poor texture cache usage, but also because images end up deleted before
   // they are used. This should hopfully be temporary.
   nsTArray<wr::ImageKey> mImageKeysToDeleteLater;
--- a/gfx/thebes/gfxFT2FontBase.cpp
+++ b/gfx/thebes/gfxFT2FontBase.cpp
@@ -511,49 +511,36 @@ FT_Fixed
 gfxFT2FontBase::GetFTGlyphAdvance(uint16_t aGID)
 {
     gfxFT2LockedFace face(this);
     int32_t flags =
         gfxPlatform::GetPlatform()->FontHintingEnabled()
             ? FT_LOAD_ADVANCE_ONLY
             : FT_LOAD_ADVANCE_ONLY | FT_LOAD_NO_AUTOHINT | FT_LOAD_NO_HINTING;
     FT_Fixed advance = 0;
-    // FT_Get_Advance is not reliable with variations until FreeType 2.8.2,
-    // so fall back to calling FT_Load_Glyph and reading the glyph slot's
-    // linearHoriAdvance.
-    // See https://savannah.nongnu.org/bugs/index.php?52683.
-    static uint32_t sFTVersion = 0;
-    if (!sFTVersion) {
-        FT_Int major, minor, patch;
-        FT_Library_Version(face.get()->glyph->library, &major, &minor, &patch);
-        sFTVersion = (major << 16) | (minor << 8) | patch;
-    }
-    if (sFTVersion < 0x020802 &&
-        (face.get()->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS)) {
-        mozilla::DebugOnly<FT_Error> ftError =
-            FT_Load_Glyph(face.get(), aGID, flags);
-        MOZ_ASSERT(!ftError);
-        advance = face.get()->glyph->linearHoriAdvance;
-    } else {
-        mozilla::DebugOnly<FT_Error> ftError =
-            FT_Get_Advance(face.get(), aGID, flags, &advance);
-        MOZ_ASSERT(!ftError);
-    }
+    mozilla::DebugOnly<FT_Error> ftError =
+        FT_Load_Glyph(face.get(), aGID, flags);
+    MOZ_ASSERT(!ftError);
+    advance = face.get()->glyph->linearHoriAdvance;
 
     // If freetype emboldening is being used, and it's not a zero-width glyph,
     // adjust the advance to account for the increased width.
     if (mEmbolden && advance > 0) {
         // This is the embolden "strength" used by FT_GlyphSlot_Embolden,
         // converted from 26.6 to 16.16
         FT_Fixed strength = 1024 *
             FT_MulFix(face.get()->units_per_EM,
                       face.get()->size->metrics.y_scale) / 24;
         advance += strength;
     }
 
+    // Round the 16.16 fixed-point value to whole pixels for better consistency
+    // with how cairo renders the glyphs.
+    advance = (advance + 0x8000) & 0xffff0000u;
+
     return advance;
 }
 
 int32_t
 gfxFT2FontBase::GetGlyphWidth(DrawTarget& aDrawTarget, uint16_t aGID)
 {
     if (!mGlyphWidths) {
         mGlyphWidths =
--- a/gfx/webrender_bindings/RenderBufferTextureHost.cpp
+++ b/gfx/webrender_bindings/RenderBufferTextureHost.cpp
@@ -45,29 +45,29 @@ RenderBufferTextureHost::~RenderBufferTe
 }
 
 wr::WrExternalImage
 RenderBufferTextureHost::Lock(uint8_t aChannelIndex, gl::GLContext* aGL)
 {
   if (!mLocked) {
     if (!GetBuffer()) {
       // We hit some problems to get the shmem.
-      return RawDataToWrExternalImage(nullptr, 0);
+      return InvalidToWrExternalImage();
     }
     if (mFormat != gfx::SurfaceFormat::YUV) {
       mSurface = gfx::Factory::CreateWrappingDataSourceSurface(GetBuffer(),
                                                                layers::ImageDataSerializer::GetRGBStride(mDescriptor.get_RGBDescriptor()),
                                                                mSize,
                                                                mFormat);
       if (NS_WARN_IF(!mSurface)) {
-        return RawDataToWrExternalImage(nullptr, 0);
+        return InvalidToWrExternalImage();
       }
       if (NS_WARN_IF(!mSurface->Map(gfx::DataSourceSurface::MapType::READ_WRITE, &mMap))) {
         mSurface = nullptr;
-        return RawDataToWrExternalImage(nullptr, 0);
+        return InvalidToWrExternalImage();
       }
     } else {
       const layers::YCbCrDescriptor& desc = mDescriptor.get_YCbCrDescriptor();
 
       mYSurface = gfx::Factory::CreateWrappingDataSourceSurface(layers::ImageDataSerializer::GetYChannel(GetBuffer(), desc),
                                                                 desc.yStride(),
                                                                 desc.ySize(),
                                                                 gfx::SurfaceFormat::A8);
@@ -76,23 +76,23 @@ RenderBufferTextureHost::Lock(uint8_t aC
                                                                  desc.cbCrSize(),
                                                                  gfx::SurfaceFormat::A8);
       mCrSurface = gfx::Factory::CreateWrappingDataSourceSurface(layers::ImageDataSerializer::GetCrChannel(GetBuffer(), desc),
                                                                  desc.cbCrStride(),
                                                                  desc.cbCrSize(),
                                                                  gfx::SurfaceFormat::A8);
       if (NS_WARN_IF(!mYSurface || !mCbSurface || !mCrSurface)) {
         mYSurface = mCbSurface = mCrSurface = nullptr;
-        return RawDataToWrExternalImage(nullptr, 0);
+        return InvalidToWrExternalImage();
       }
       if (NS_WARN_IF(!mYSurface->Map(gfx::DataSourceSurface::MapType::READ_WRITE, &mYMap) ||
                      !mCbSurface->Map(gfx::DataSourceSurface::MapType::READ_WRITE, &mCbMap) ||
                      !mCrSurface->Map(gfx::DataSourceSurface::MapType::READ_WRITE, &mCrMap))) {
         mYSurface = mCbSurface = mCrSurface = nullptr;
-        return RawDataToWrExternalImage(nullptr, 0);
+        return InvalidToWrExternalImage();
       }
     }
     mLocked = true;
   }
 
   RenderBufferData data = GetBufferDataForRender(aChannelIndex);
   return RawDataToWrExternalImage(data.mData, data.mBufferSize);
 }
--- a/gfx/webrender_bindings/RenderD3D11TextureHostOGL.cpp
+++ b/gfx/webrender_bindings/RenderD3D11TextureHostOGL.cpp
@@ -154,25 +154,25 @@ RenderDXGITextureHostOGL::Lock(uint8_t a
   if (mGL.get() != aGL) {
     // Release the texture handle in the previous gl context.
     DeleteTextureHandle();
     mGL = aGL;
     mGL->MakeCurrent();
   }
 
   if (!EnsureLockable()) {
-    return NativeTextureToWrExternalImage(0, 0, 0, 0, 0);
+    return InvalidToWrExternalImage();
   }
 
   if (!mLocked) {
     if (mKeyedMutex) {
       HRESULT hr = mKeyedMutex->AcquireSync(0, 100);
       if (hr != S_OK) {
         gfxCriticalError() << "RenderDXGITextureHostOGL AcquireSync timeout, hr=" << gfx::hexa(hr);
-        return NativeTextureToWrExternalImage(0, 0, 0, 0, 0);
+        return InvalidToWrExternalImage();
       }
     }
     mLocked = true;
   }
 
   gfx::IntSize size = GetSize(aChannelIndex);
   return NativeTextureToWrExternalImage(GetGLHandle(aChannelIndex), 0, 0,
                                         size.width, size.height);
@@ -337,26 +337,26 @@ RenderDXGIYCbCrTextureHostOGL::Lock(uint
   if (mGL.get() != aGL) {
     // Release the texture handle in the previous gl context.
     DeleteTextureHandle();
     mGL = aGL;
     mGL->MakeCurrent();
   }
 
   if (!EnsureLockable()) {
-    return NativeTextureToWrExternalImage(0, 0, 0, 0, 0);
+    return InvalidToWrExternalImage();
   }
 
   if (!mLocked) {
     if (mKeyedMutexs[0]) {
       for (const auto& mutex : mKeyedMutexs) {
         HRESULT hr = mutex->AcquireSync(0, 100);
         if (hr != S_OK) {
           gfxCriticalError() << "RenderDXGIYCbCrTextureHostOGL AcquireSync timeout, hr=" << gfx::hexa(hr);
-          return NativeTextureToWrExternalImage(0, 0, 0, 0, 0);
+          return InvalidToWrExternalImage();
         }
       }
     }
     mLocked = true;
   }
 
   gfx::IntSize size = GetSize(aChannelIndex);
   return NativeTextureToWrExternalImage(GetGLHandle(aChannelIndex), 0, 0,
--- a/gfx/webrender_bindings/RenderMacIOSurfaceTextureHostOGL.cpp
+++ b/gfx/webrender_bindings/RenderMacIOSurfaceTextureHostOGL.cpp
@@ -78,17 +78,17 @@ RenderMacIOSurfaceTextureHostOGL::Lock(u
   if (mGL.get() != aGL) {
     // release the texture handle in the previous gl context
     DeleteTextureHandle();
     mGL = aGL;
     mGL->MakeCurrent();
   }
 
   if (!mSurface || !mGL || !mGL->MakeCurrent()) {
-    return NativeTextureToWrExternalImage(0, 0, 0, 0, 0);
+    return InvalidToWrExternalImage();
   }
 
   if (!mTextureHandles[0]) {
     MOZ_ASSERT(gl::GLContextCGL::Cast(mGL.get())->GetCGLContext());
 
     // The result of GetPlaneCount() is 0 for single plane format, but it will
     // be 2 if the format has 2 planar data.
     CreateTextureForPlane(0, mGL, mSurface, &(mTextureHandles[0]));
--- a/gfx/webrender_bindings/RenderSharedSurfaceTextureHost.cpp
+++ b/gfx/webrender_bindings/RenderSharedSurfaceTextureHost.cpp
@@ -26,17 +26,17 @@ RenderSharedSurfaceTextureHost::~RenderS
 }
 
 wr::WrExternalImage
 RenderSharedSurfaceTextureHost::Lock(uint8_t aChannelIndex, gl::GLContext* aGL)
 {
   if (!mLocked) {
     if (NS_WARN_IF(!mSurface->Map(gfx::DataSourceSurface::MapType::READ_WRITE,
                                   &mMap))) {
-      return RawDataToWrExternalImage(nullptr, 0);
+      return InvalidToWrExternalImage();
     }
     mLocked = true;
   }
 
   return RawDataToWrExternalImage(mMap.mData,
                                   mMap.mStride * mSurface->GetSize().height);
 }
 
--- a/gfx/webrender_bindings/RendererOGL.cpp
+++ b/gfx/webrender_bindings/RendererOGL.cpp
@@ -19,24 +19,31 @@
 namespace mozilla {
 namespace wr {
 
 wr::WrExternalImage LockExternalImage(void* aObj, wr::WrExternalImageId aId, uint8_t aChannelIndex)
 {
   RendererOGL* renderer = reinterpret_cast<RendererOGL*>(aObj);
   RenderTextureHost* texture = renderer->GetRenderTexture(aId);
   MOZ_ASSERT(texture);
+  if (!texture) {
+    gfxCriticalNote << "Failed to lock ExternalImage for extId:" << AsUint64(aId);
+    return InvalidToWrExternalImage();
+  }
   return texture->Lock(aChannelIndex, renderer->mGL);
 }
 
 void UnlockExternalImage(void* aObj, wr::WrExternalImageId aId, uint8_t aChannelIndex)
 {
   RendererOGL* renderer = reinterpret_cast<RendererOGL*>(aObj);
   RenderTextureHost* texture = renderer->GetRenderTexture(aId);
   MOZ_ASSERT(texture);
+  if (!texture) {
+    return;
+  }
   texture->Unlock();
 }
 
 RendererOGL::RendererOGL(RefPtr<RenderThread>&& aThread,
                          RefPtr<gl::GLContext>&& aGL,
                          RefPtr<widget::CompositorWidget>&& aWidget,
                          wr::WindowId aWindowId,
                          wr::Renderer* aRenderer,
--- a/gfx/webrender_bindings/WebRenderTypes.h
+++ b/gfx/webrender_bindings/WebRenderTypes.h
@@ -551,16 +551,25 @@ static inline wr::WrExternalImage Native
 {
   return wr::WrExternalImage {
     wr::WrExternalImageType::NativeTexture,
     aHandle, u0, v0, u1, v1,
     nullptr, 0
   };
 }
 
+static inline wr::WrExternalImage InvalidToWrExternalImage()
+{
+  return wr::WrExternalImage {
+    wr::WrExternalImageType::Invalid,
+    0, 0, 0, 0, 0,
+    nullptr, 0
+  };
+}
+
 inline wr::ByteSlice RangeToByteSlice(mozilla::Range<uint8_t> aRange) {
   return wr::ByteSlice { aRange.begin().get(), aRange.length() };
 }
 
 inline mozilla::Range<const uint8_t> ByteSliceToRange(wr::ByteSlice aWrSlice) {
   return mozilla::Range<const uint8_t>(aWrSlice.buffer, aWrSlice.len);
 }
 
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -263,18 +263,19 @@ impl Into<WrExternalImageId> for Externa
     fn into(self) -> WrExternalImageId {
         WrExternalImageId(self.0)
     }
 }
 
 #[repr(u32)]
 #[allow(dead_code)]
 enum WrExternalImageType {
+    RawData,
     NativeTexture,
-    RawData,
+    Invalid,
 }
 
 #[repr(C)]
 struct WrExternalImage {
     image_type: WrExternalImageType,
 
     // external texture handle
     handle: u32,
@@ -320,16 +321,25 @@ impl ExternalImageHandler for WrExternal
                 ExternalImage {
                     u0: image.u0,
                     v0: image.v0,
                     u1: image.u1,
                     v1: image.v1,
                     source: ExternalImageSource::RawData(make_slice(image.buff, image.size)),
                 }
             },
+            WrExternalImageType::Invalid => {
+                ExternalImage {
+                    u0: image.u0,
+                    v0: image.v0,
+                    u1: image.u1,
+                    v1: image.v1,
+                    source: ExternalImageSource::Invalid,
+                }
+            },
         }
     }
 
     fn unlock(&mut self,
               id: ExternalImageId,
               channel_index: u8) {
         (self.unlock_func)(self.external_image_obj, id.into(), channel_index);
     }
--- a/gfx/webrender_bindings/webrender_ffi_generated.h
+++ b/gfx/webrender_bindings/webrender_ffi_generated.h
@@ -201,18 +201,19 @@ enum class TransformStyle : uint32_t {
 enum class WrAnimationType : uint32_t {
   Transform = 0,
   Opacity = 1,
 
   Sentinel /* this must be last for serialization purposes. */
 };
 
 enum class WrExternalImageType : uint32_t {
-  NativeTexture = 0,
-  RawData = 1,
+  RawData = 0,
+  NativeTexture = 1,
+  Invalid = 2,
 
   Sentinel /* this must be last for serialization purposes. */
 };
 
 enum class WrFilterOpType : uint32_t {
   Blur = 0,
   Brightness = 1,
   Contrast = 2,
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -9826,18 +9826,22 @@ BytecodeEmitter::emitArrayLiteral(ParseN
     if (!(pn->pn_xflags & PNX_NONCONST) && pn->pn_head) {
         if (checkSingletonContext()) {
             // Bake in the object entirely if it will only be created once.
             return emitSingletonInitialiser(pn);
         }
 
         // If the array consists entirely of primitive values, make a
         // template object with copy on write elements that can be reused
-        // every time the initializer executes.
-        if (emitterMode != BytecodeEmitter::SelfHosting && pn->pn_count != 0) {
+        // every time the initializer executes. Don't do this if the array is
+        // small: copying the elements lazily is not worth it in that case.
+        static const size_t MinElementsForCopyOnWrite = 5;
+        if (emitterMode != BytecodeEmitter::SelfHosting &&
+            pn->pn_count >= MinElementsForCopyOnWrite)
+        {
             RootedValue value(cx);
             if (!pn->getConstantValue(cx, ParseNode::ForCopyOnWriteArray, &value))
                 return false;
             if (!value.isMagic(JS_GENERIC_MAGIC)) {
                 // Note: the group of the template object might not yet reflect
                 // that the object has copy on write elements. When the
                 // interpreter or JIT compiler fetches the template, it should
                 // use ObjectGroup::getOrFixupCopyOnWriteObject to make sure the
--- a/js/src/jit-test/tests/ion/recover-arrays.js
+++ b/js/src/jit-test/tests/ion/recover-arrays.js
@@ -264,17 +264,17 @@ function arrayAlloc2(i) {
     }
     assertRecoveredOnBailout(a, true);
     return 0;
 }
 
 function build(l) { var arr = []; for (var i = 0; i < l; i++) arr.push(i); return arr }
 var uceFault_arrayAlloc3 = eval(uneval(uceFault).replace('uceFault', 'uceFault_arrayAlloc3'));
 function arrayAlloc3(i) {
-    var a = [0,1,2,3];
+    var a = [0,1,2,3,4,5,6,7,8];
     if (uceFault_arrayAlloc3(i) || uceFault_arrayAlloc3(i)) {
         assertEq(a[0], 0);
         assertEq(a[3], 3);
         return a.length;
     }
     assertRecoveredOnBailout(a, true);
     return 0;
 };
--- a/js/src/jit-test/tests/ion/recover-cow-arrays.js
+++ b/js/src/jit-test/tests/ion/recover-cow-arrays.js
@@ -23,224 +23,190 @@ var uceFault = function (i) {
     return false;
 };
 
 // This function is used to ensure that we do escape the array, and thus prevent
 // any escape analysis.
 var global_arr;
 function escape(arr) { global_arr = arr; }
 
-// Check Array length defined by the literal.
-function array0Length(i) {
-    var a = [];
-    assertRecoveredOnBailout(a, true);
-    return a.length;
+function checkCOW() {
+    assertEq(hasCopyOnWriteElements([1, 2, 3, 4]), false);
+    // If this fails, we should probably update the tests below!
+    assertEq(hasCopyOnWriteElements([1, 2, 3, 4, 5, 6, 7]), true);
 }
+checkCOW();
 
-function array0LengthBail(i) {
-    var a = [];
-    resumeHere(i);
+function arrayLength(i) {
+    var a = [1, 2, 3, 4, 5, 6, 7];
     assertRecoveredOnBailout(a, true);
     return a.length;
 }
 
-function array1Length(i) {
-    var a = [1];
-    assertRecoveredOnBailout(a, true);
-    return a.length;
-}
-
-function array1LengthBail(i) {
-    var a = [1];
-    resumeHere(i);
-    assertRecoveredOnBailout(a, true);
-    return a.length;
-}
-
-function array2Length(i) {
-    var a = [1, 2];
-    assertRecoveredOnBailout(a, true);
-    return a.length;
-}
-
-function array2LengthBail(i) {
-    var a = [1, 2];
+function arrayLengthBail(i) {
+    var a = [1, 2, 3, 4, 5, 6, 7];
     resumeHere(i);
     assertRecoveredOnBailout(a, true);
     return a.length;
 }
 
-
-// Check Array content
-function array1Content(i) {
-    var a = [42];
-    assertEq(a[0], 42);
+function arrayContent(i) {
+    var a = [1, 2, 3, 4, 5, 6, 7];
+    assertEq(a[0], 1);
+    assertEq(a[1], 2);
+    assertEq(a[6], 7);
     assertRecoveredOnBailout(a, true);
     return a.length;
 }
-function array1ContentBail0(i) {
-    var a = [42];
+
+function arrayContentBail0(i) {
+    var a = [1, 2, 3, 4, 5, 6, 7];
     resumeHere(i);
-    assertEq(a[0], 42);
+    assertEq(a[0], 1);
+    assertEq(a[1], 2);
+    assertEq(a[6], 7);
     assertRecoveredOnBailout(a, true);
     return a.length;
 }
-function array1ContentBail1(i) {
-    var a = [42];
-    assertEq(a[0], 42);
+
+function arrayContentBail1(i) {
+    var a = [1, 2, 3, 4, 5, 6, 7];
+    assertEq(a[0], 1);
+    resumeHere(i);
+    assertEq(a[1], 2);
+    assertEq(a[6], 7);
+    assertRecoveredOnBailout(a, true);
+    return a.length;
+}
+
+function arrayContentBail2(i) {
+    var a = [1, 2, 3, 4, 5, 6, 7];
+    assertEq(a[0], 1);
+    assertEq(a[1], 2);
+    assertEq(a[6], 7);
     resumeHere(i);
     assertRecoveredOnBailout(a, true);
     return a.length;
 }
 
-function array2Content(i) {
-    var a = [1, 2];
-    assertEq(a[0], 1);
-    assertEq(a[1], 2);
-    assertRecoveredOnBailout(a, true);
-    return a.length;
-}
-
-function array2ContentBail0(i) {
-    var a = [1, 2];
-    resumeHere(i);
-    assertEq(a[0], 1);
-    assertEq(a[1], 2);
-    assertRecoveredOnBailout(a, true);
-    return a.length;
-}
-
-function array2ContentBail1(i) {
-    var a = [1, 2];
-    assertEq(a[0], 1);
-    resumeHere(i);
-    assertEq(a[1], 2);
-    assertRecoveredOnBailout(a, true);
-    return a.length;
-}
-
-function array2ContentBail2(i) {
-    var a = [1, 2];
-    assertEq(a[0], 1);
-    assertEq(a[1], 2);
+function arrayContentBail3(i) {
+    var a = ["a1", "a2", "a3", "a4", "a5", "a6", "a7"];
+    assertEq(a[0], "a1");
+    assertEq(a[1], "a2");
+    assertEq(a[6], "a7");
     resumeHere(i);
     assertRecoveredOnBailout(a, true);
     return a.length;
 }
 
 function arrayWrite1(i) {
-    var a = [1, 2];
+    var a = [1, 2, 3, 4, 5, 6, 7];
     a[0] = 42;
     assertEq(a[0], 42);
     assertEq(a[1], 2);
+    assertEq(a[5], 6);
     assertRecoveredOnBailout(a, true);
     return a.length;
 }
 
 // We don't handle length sets yet.
 function arrayWrite2(i) {
-    var a = [1, 2];
+    var a = [1, 2, 3, 4, 5, 6, 7];
     a.length = 1;
     assertEq(a[0], 1);
     assertEq(a[1], undefined);
     assertRecoveredOnBailout(a, false);
     return a.length;
 }
 
 function arrayWrite3(i) {
-    var a = [1, 2, 0];
+    var a = [1, 2, 0, 9, 8, 7, 6];
     if (i % 2 === 1)
 	a[0] = 2;
     assertEq(a[0], 1 + (i % 2));
     assertRecoveredOnBailout(a, true);
     if (i % 2 === 1)
 	bailout();
     assertEq(a[0], 1 + (i % 2));
     return a.length;
 }
 
 function arrayWrite4(i) {
-    var a = [1, 2, 0];
+    var a = [1, 2, 0, 9, 8, 7, 6];
     for (var x = 0; x < 2; x++) {
 	if (x % 2 === 1)
 	    bailout();
 	else
 	    a[0] = a[0] + 1;
     }
     assertEq(a[0], 2);
     assertEq(a[1], 2);
     assertRecoveredOnBailout(a, true);
     return a.length;
 }
 
 function arrayWriteDoubles(i) {
-    var a = [0, 0, 0];
+    var a = [0, 0, 0, 0, 0, 0, 0];
     a[0] = 3.14;
     // MConvertElementsToDoubles is only used for loads inside a loop.
     for (var x = 0; x < 2; x++) {
         assertEq(a[0], 3.14);
         assertEq(a[1], 0);
     }
     assertRecoveredOnBailout(a, true);
     return a.length;
 }
 
 // Check escape analysis in case of holes.
 function arrayHole0(i) {
-    var a = [1,,3];
+    var a = [1,,3,4,5,6,7];
     assertEq(a[0], 1);
     assertEq(a[1], undefined);
     assertEq(a[2], 3);
     // need to check for holes.
     assertRecoveredOnBailout(a, false);
     return a.length;
 }
 
 // Same test as the previous one, but the Array.prototype is changed to return
 // "100" when we request for the element "1".
 function arrayHole1(i) {
-    var a = [1,,3];
+    var a = [1,,3,4,5,6,7];
     assertEq(a[0], 1);
     assertEq(a[1], 100);
     assertEq(a[2], 3);
     // need to check for holes.
     assertRecoveredOnBailout(a, false);
     return a.length;
 }
 
 function build(l) { var arr = []; for (var i = 0; i < l; i++) arr.push(i); return arr }
 var uceFault_arrayAlloc3 = eval(uneval(uceFault).replace('uceFault', 'uceFault_arrayAlloc3'));
 function arrayAlloc(i) {
-    var a = [0,1,2,3];
+    var a = [0,1,2,3,4,5,6];
     if (uceFault_arrayAlloc3(i) || uceFault_arrayAlloc3(i)) {
         assertEq(a[0], 0);
         assertEq(a[3], 3);
         return a.length;
     }
     assertRecoveredOnBailout(a, true);
     return 0;
 };
 
 // Prevent compilation of the top-level
 eval(uneval(resumeHere));
 
 for (var i = 0; i < 100; i++) {
-    array0Length(i);
-    array0LengthBail(i);
-    array1Length(i);
-    array1LengthBail(i);
-    array2Length(i);
-    array2LengthBail(i);
-    array1Content(i);
-    array1ContentBail0(i);
-    array1ContentBail1(i);
-    array2Content(i);
-    array2ContentBail0(i);
-    array2ContentBail1(i);
-    array2ContentBail2(i);
+    arrayLength(i);
+    arrayLengthBail(i);
+    arrayContent(i);
+    arrayContentBail0(i);
+    arrayContentBail1(i);
+    arrayContentBail2(i);
+    arrayContentBail3(i);
     arrayWrite1(i);
     arrayWrite2(i);
     arrayWrite3(i);
     arrayWrite4(i);
     arrayWriteDoubles(i);
     arrayHole0(i);
     arrayAlloc(i);
 }
--- a/js/src/jit/ProcessExecutableMemory.cpp
+++ b/js/src/jit/ProcessExecutableMemory.cpp
@@ -244,17 +244,17 @@ ProtectionSettingToFlags(ProtectionSetti
     }
     MOZ_CRASH();
 }
 
 static void
 CommitPages(void* addr, size_t bytes, ProtectionSetting protection)
 {
     if (!VirtualAlloc(addr, bytes, MEM_COMMIT, ProtectionSettingToFlags(protection)))
-        MOZ_CRASH("CommitPages failed");
+        MOZ_CRASH_UNSAFE_PRINTF("CommitPages failed! Error code: %lu", GetLastError());
 }
 
 static void
 DecommitPages(void* addr, size_t bytes)
 {
     if (!VirtualFree(addr, bytes, MEM_DECOMMIT))
         MOZ_CRASH("DecommitPages failed");
 }
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -5557,16 +5557,26 @@ static bool
 IsUnboxedObject(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     args.rval().setBoolean(args.get(0).isObject() &&
                            args[0].toObject().is<UnboxedPlainObject>());
     return true;
 }
 
+static bool
+HasCopyOnWriteElements(JSContext* cx, unsigned argc, Value* vp)
+{
+    CallArgs args = CallArgsFromVp(argc, vp);
+    args.rval().setBoolean(args.get(0).isObject() &&
+                           args[0].toObject().isNative() &&
+                           args[0].toObject().as<NativeObject>().denseElementsAreCopyOnWrite());
+    return true;
+}
+
 // Set the profiling stack for each cooperating context in a runtime.
 static bool
 EnsureAllContextProfilingStacks(JSContext* cx)
 {
     for (const CooperatingContext& target : cx->runtime()->cooperatingContexts()) {
         ShellContext* sc = GetShellContext(target.context());
         if (!EnsureGeckoProfilingStackInstalled(target.context(), sc))
             return false;
@@ -7051,16 +7061,20 @@ JS_FN_HELP("parseBin", BinParse, 1, 0,
     JS_FN_HELP("unboxedObjectsEnabled", UnboxedObjectsEnabled, 0, 0,
 "unboxedObjectsEnabled()",
 "  Return true if unboxed objects are enabled."),
 
     JS_FN_HELP("isUnboxedObject", IsUnboxedObject, 1, 0,
 "isUnboxedObject(o)",
 "  Return true iff the object is an unboxed object."),
 
+    JS_FN_HELP("hasCopyOnWriteElements", HasCopyOnWriteElements, 1, 0,
+"hasCopyOnWriteElements(o)",
+"  Return true iff the object has copy-on-write dense elements."),
+
     JS_FN_HELP("stackPointerInfo", StackPointerInfo, 0, 0,
 "stackPointerInfo()",
 "  Return an int32 value which corresponds to the offset of the latest stack\n"
 "  pointer, such that one can take the differences of 2 to estimate a frame-size."),
 
     JS_FN_HELP("entryPoints", EntryPoints, 1, 0,
 "entryPoints(params)",
 "Carry out some JSAPI operation as directed by |params|, and return an array of\n"
--- a/js/src/vm/StructuredClone.cpp
+++ b/js/src/vm/StructuredClone.cpp
@@ -1911,16 +1911,22 @@ JSStructuredCloneReader::readTypedArray(
     } else {
         if (!startRead(&v))
             return false;
         uint64_t n;
         if (!in.read(&n))
             return false;
         byteOffset = n;
     }
+    if (!v.isObject() || !v.toObject().is<ArrayBufferObjectMaybeShared>()) {
+        JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr, JSMSG_SC_BAD_SERIALIZED_DATA,
+                                  "typed array must be backed by an ArrayBuffer");
+        return false;
+    }
+
     RootedObject buffer(context(), &v.toObject());
     RootedObject obj(context(), nullptr);
 
     switch (arrayType) {
       case Scalar::Int8:
         obj = JS_NewInt8ArrayWithBuffer(context(), buffer, byteOffset, nelems);
         break;
       case Scalar::Uint8:
@@ -1968,16 +1974,21 @@ JSStructuredCloneReader::readDataView(ui
     Value dummy = UndefinedValue();
     if (!allObjs.append(dummy))
         return false;
 
     // Read the ArrayBuffer object and its contents (but no properties).
     RootedValue v(context());
     if (!startRead(&v))
         return false;
+    if (!v.isObject() || !v.toObject().is<ArrayBufferObjectMaybeShared>()) {
+        JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr, JSMSG_SC_BAD_SERIALIZED_DATA,
+                                  "DataView must be backed by an ArrayBuffer");
+        return false;
+    }
 
     // Read byteOffset.
     uint64_t n;
     if (!in.read(&n))
         return false;
     uint32_t byteOffset = n;
 
     RootedObject buffer(context(), &v.toObject());
@@ -2023,18 +2034,21 @@ JSStructuredCloneReader::readSharedArray
 
     if (!context()->compartment()->creationOptions().getSharedMemoryAndAtomicsEnabled()) {
         JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr, JSMSG_SC_SAB_DISABLED);
         return false;
     }
 
     // We must not transfer buffer pointers cross-process.  The cloneDataPolicy
     // in the sender should guard against this; check that it does.
-
-    MOZ_RELEASE_ASSERT(storedScope <= JS::StructuredCloneScope::SameProcessDifferentThread);
+    if (storedScope > JS::StructuredCloneScope::SameProcessDifferentThread) {
+        JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr, JSMSG_SC_BAD_SERIALIZED_DATA,
+                                  "can't transfer SharedArrayBuffer cross-process");
+        return false;
+    }
 
     // The new object will have a new reference to the rawbuf.
 
     if (!rawbuf->addReference()) {
         JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr, JSMSG_SC_SAB_REFCNT_OFLO);
         return false;
     }
 
@@ -2046,24 +2060,33 @@ JSStructuredCloneReader::readSharedArray
 
     vp.setObject(*obj);
     return true;
 }
 
 bool
 JSStructuredCloneReader::readSharedWasmMemory(uint32_t nbytes, MutableHandleValue vp)
 {
-    MOZ_ASSERT(nbytes == 0);
+    if (nbytes != 0) {
+        JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr, JSMSG_SC_BAD_SERIALIZED_DATA,
+                                  "invalid shared wasm memory tag");
+        return false;
+    }
 
     JSContext* cx = context();
 
     // Read the SharedArrayBuffer object.
     RootedValue payload(cx);
     if (!startRead(&payload))
         return false;
+    if (!payload.isObject() || !payload.toObject().is<SharedArrayBufferObject>()) {
+        JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr, JSMSG_SC_BAD_SERIALIZED_DATA,
+                                  "shared wasm memory must be backed by a SharedArrayBuffer");
+        return false;
+    }
 
     Rooted<ArrayBufferObjectMaybeShared*> sab(
         cx, &payload.toObject().as<SharedArrayBufferObject>());
 
     // Construct the memory.
     RootedObject proto(cx, &cx->global()->getPrototype(JSProto_WasmMemory).toObject());
     RootedObject memory(cx, WasmMemoryObject::create(cx, sab, proto));
     if (!memory)
@@ -2076,20 +2099,33 @@ JSStructuredCloneReader::readSharedWasmM
 /*
  * Read in the data for a structured clone version 1 ArrayBuffer, performing
  * endianness-conversion while reading.
  */
 bool
 JSStructuredCloneReader::readV1ArrayBuffer(uint32_t arrayType, uint32_t nelems,
                                            MutableHandleValue vp)
 {
-    MOZ_ASSERT(arrayType <= Scalar::Uint8Clamped);
-
-    uint32_t nbytes = nelems << TypedArrayShift(static_cast<Scalar::Type>(arrayType));
-    JSObject* obj = ArrayBufferObject::create(context(), nbytes);
+    if (arrayType > Scalar::Uint8Clamped) {
+        JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr, JSMSG_SC_BAD_SERIALIZED_DATA,
+                                  "invalid TypedArray type");
+        return false;
+    }
+
+    mozilla::CheckedInt<size_t> nbytes =
+        mozilla::CheckedInt<size_t>(nelems) *
+        TypedArrayElemSize(static_cast<Scalar::Type>(arrayType));
+    if (!nbytes.isValid() || nbytes.value() > UINT32_MAX) {
+        JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr,
+                                  JSMSG_SC_BAD_SERIALIZED_DATA,
+                                  "invalid typed array size");
+        return false;
+    }
+
+    JSObject* obj = ArrayBufferObject::create(context(), nbytes.value());
     if (!obj)
         return false;
     vp.setObject(*obj);
     ArrayBufferObject& buffer = obj->as<ArrayBufferObject>();
     MOZ_ASSERT(buffer.byteLength() == nbytes);
 
     switch (arrayType) {
       case Scalar::Int8:
@@ -2339,16 +2375,24 @@ JSStructuredCloneReader::readHeader()
 
     if (tag != SCTAG_HEADER) {
         // Old structured clone buffer. We must have read it from disk or
         // somewhere, so we can assume it's scope-compatible.
         return true;
     }
 
     MOZ_ALWAYS_TRUE(in.readPair(&tag, &data));
+    if (data != uint32_t(JS::StructuredCloneScope::SameProcessSameThread) &&
+        data != uint32_t(JS::StructuredCloneScope::SameProcessDifferentThread) &&
+        data != uint32_t(JS::StructuredCloneScope::DifferentProcess))
+    {
+        JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr, JSMSG_SC_BAD_SERIALIZED_DATA,
+                                  "invalid structured clone scope");
+        return false;
+    }
     storedScope = JS::StructuredCloneScope(data);
     if (storedScope < allowedScope) {
         JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr, JSMSG_SC_BAD_SERIALIZED_DATA,
                                   "incompatible structured clone scope");
         return false;
     }
 
     return true;
--- a/js/xpconnect/src/Sandbox.cpp
+++ b/js/xpconnect/src/Sandbox.cpp
@@ -26,16 +26,17 @@
 #include "xpc_make_class.h"
 #include "XPCWrapper.h"
 #include "XrayWrapper.h"
 #include "Crypto.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/BlobBinding.h"
 #include "mozilla/dom/cache/CacheStorage.h"
 #include "mozilla/dom/CSSBinding.h"
+#include "mozilla/dom/CSSRuleBinding.h"
 #include "mozilla/dom/DirectoryBinding.h"
 #include "mozilla/dom/DOMPrefs.h"
 #include "mozilla/dom/IndexedDatabaseManager.h"
 #include "mozilla/dom/Fetch.h"
 #include "mozilla/dom/FileBinding.h"
 #include "mozilla/dom/InspectorUtilsBinding.h"
 #include "mozilla/dom/MessageChannelBinding.h"
 #include "mozilla/dom/MessagePortBinding.h"
@@ -905,16 +906,18 @@ xpc::GlobalProperties::Parse(JSContext* 
             return false;
         }
         RootedString nameStr(cx, nameValue.toString());
         JSAutoByteString name;
         if (!name.encodeUtf8(cx, nameStr))
             return false;
         if (!strcmp(name.ptr(), "CSS")) {
             CSS = true;
+        } else if (!strcmp(name.ptr(), "CSSRule")) {
+            CSSRule = true;
         } else if (!strcmp(name.ptr(), "indexedDB")) {
             indexedDB = true;
         } else if (!strcmp(name.ptr(), "XMLHttpRequest")) {
             XMLHttpRequest = true;
         } else if (!strcmp(name.ptr(), "TextEncoder")) {
             TextEncoder = true;
         } else if (!strcmp(name.ptr(), "TextDecoder")) {
             TextDecoder = true;
@@ -963,16 +966,19 @@ xpc::GlobalProperties::Define(JSContext*
     // Properties will be exposed to System automatically but not to Sandboxes
     // if |[Exposed=System]| is specified.
     // This function holds common properties not exposed automatically but able
     // to be requested either in |Cu.importGlobalProperties| or
     // |wantGlobalProperties| of a sandbox.
     if (CSS && !dom::CSSBinding::GetConstructorObject(cx))
         return false;
 
+    if (CSSRule && !dom::CSSRuleBinding::GetConstructorObject(cx))
+        return false;
+
     if (XMLHttpRequest &&
         !dom::XMLHttpRequestBinding::GetConstructorObject(cx))
         return false;
 
     if (TextEncoder &&
         !dom::TextEncoderBinding::GetConstructorObject(cx))
         return false;
 
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -2675,16 +2675,17 @@ struct GlobalProperties {
     GlobalProperties() {
       mozilla::PodZero(this);
 
     }
     bool Parse(JSContext* cx, JS::HandleObject obj);
     bool DefineInXPCComponents(JSContext* cx, JS::HandleObject obj);
     bool DefineInSandbox(JSContext* cx, JS::HandleObject obj);
     bool CSS : 1;
+    bool CSSRule : 1;
     bool indexedDB : 1;
     bool XMLHttpRequest : 1;
     bool TextDecoder : 1;
     bool TextEncoder : 1;
     bool URL : 1;
     bool URLSearchParams : 1;
     bool atob : 1;
     bool btoa : 1;
--- a/js/xpconnect/tests/mochitest/test_bug790732.html
+++ b/js/xpconnect/tests/mochitest/test_bug790732.html
@@ -18,41 +18,31 @@ https://bugzilla.mozilla.org/show_bug.cg
 
   // Check each interface that we shim. We start by checking specific
   // constants for a couple of interfaces, and then once it's pretty clear that
   // it's working as intended we just check that the objects themselves are the
   // same.
   is(Ci.nsIXMLHttpRequest.HEADERS_RECEIVED, XMLHttpRequest.HEADERS_RECEIVED);
   is(Ci.nsIDOMDOMException.DATA_CLONE_ERR, DOMException.DATA_CLONE_ERR);
   is(Ci.nsIDOMNode.DOCUMENT_NODE, Node.DOCUMENT_NODE);
-  is(Ci.nsIDOMCSSPrimitiveValue.CSS_PX, CSSPrimitiveValue.CSS_PX);
-  is(Ci.nsIDOMCSSRule.NAMESPACE_RULE, CSSRule.NAMESPACE_RULE);
-  is(Ci.nsIDOMCSSValue.CSS_PRIMITIVE_VALUE, CSSValue.CSS_PRIMITIVE_VALUE);
   is(Ci.nsIDOMEvent.FOCUS, Event.FOCUS);
   is(Ci.nsIDOMNSEvent.CLICK, Event.CLICK);
   is(Ci.nsIDOMKeyEvent, KeyEvent);
   is(Ci.nsIDOMMouseEvent, MouseEvent);
   is(Ci.nsIDOMMouseScrollEvent, MouseScrollEvent);
   is(Ci.nsIDOMMutationEvent, MutationEvent);
   // XXX We can't test this here because it's only exposed to chrome
   //is(Ci.nsIDOMSimpleGestureEvent, SimpleGestureEvent);
   is(Ci.nsIDOMUIEvent, UIEvent);
   is(Ci.nsIDOMHTMLMediaElement, HTMLMediaElement);
   is(Ci.nsIDOMOfflineResourceList, OfflineResourceList);
   is(Ci.nsIDOMRange, Range);
   is(Ci.nsIDOMSVGLength, SVGLength);
   is(Ci.nsIDOMNodeFilter, NodeFilter);
   is(Ci.nsIDOMXPathResult, XPathResult);
-
-  // Test for Bug 895231
-  for (var k of Object.keys(Components.interfaces)) {
-    ok(SpecialPowers.Ci.hasOwnProperty(k),
-       k + " should be removed from the Components shim");
-  }
-
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=790732">Mozilla Bug 790732</a>
 <p id="display"></p>
 <div id="content" style="display: none">
 
 </div>
--- a/layout/generic/ScrollbarActivity.cpp
+++ b/layout/generic/ScrollbarActivity.cpp
@@ -4,17 +4,16 @@
  * 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 "ScrollbarActivity.h"
 #include "nsIScrollbarMediator.h"
 #include "nsIContent.h"
 #include "nsICSSDeclaration.h"
 #include "nsIDOMEvent.h"
-#include "nsIDOMCSSStyleDeclaration.h"
 #include "nsIFrame.h"
 #include "nsContentUtils.h"
 #include "nsAString.h"
 #include "nsQueryFrame.h"
 #include "nsComponentManagerUtils.h"
 #include "nsStyledElement.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/LookAndFeel.h"
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -19,17 +19,16 @@
 #include "nsIDOMElement.h"
 #include "nsIDocument.h"
 #include "nsIPresShell.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMCharacterData.h"
 #include "nsRuleNode.h"
 #include "nsIStyleRule.h"
 #include "mozilla/css/StyleRule.h"
-#include "nsICSSStyleRuleDOMWrapper.h"
 #include "nsIDOMWindow.h"
 #include "nsXBLBinding.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsIMutableArray.h"
 #include "nsBindingManager.h"
 #include "ChildIterator.h"
 #include "nsComputedDOMStyle.h"
 #include "mozilla/EventStateManager.h"
--- a/layout/inspector/ServoStyleRuleMap.cpp
+++ b/layout/inspector/ServoStyleRuleMap.cpp
@@ -2,22 +2,22 @@
 /* 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 "mozilla/ServoStyleRuleMap.h"
 
 #include "mozilla/css/GroupRule.h"
+#include "mozilla/dom/CSSRuleBinding.h"
 #include "mozilla/IntegerRange.h"
 #include "mozilla/ServoStyleRule.h"
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/ServoImportRule.h"
 #include "mozilla/StyleSheetInlines.h"
-
 #include "nsDocument.h"
 #include "nsStyleSheetService.h"
 
 namespace mozilla {
 
 ServoStyleRuleMap::ServoStyleRuleMap(ServoStyleSet* aStyleSet)
   : mStyleSet(aStyleSet)
 {
@@ -73,36 +73,36 @@ void
 ServoStyleRuleMap::RuleRemoved(ServoStyleSheet& aStyleSheet,
                                css::Rule& aStyleRule)
 {
   if (IsEmpty()) {
     return;
   }
 
   switch (aStyleRule.Type()) {
-    case nsIDOMCSSRule::STYLE_RULE: {
+    case CSSRuleBinding::STYLE_RULE: {
       auto& rule = static_cast<ServoStyleRule&>(aStyleRule);
       mTable.Remove(rule.Raw());
       break;
     }
-    case nsIDOMCSSRule::IMPORT_RULE:
-    case nsIDOMCSSRule::MEDIA_RULE:
-    case nsIDOMCSSRule::SUPPORTS_RULE:
-    case nsIDOMCSSRule::DOCUMENT_RULE: {
+    case CSSRuleBinding::IMPORT_RULE:
+    case CSSRuleBinding::MEDIA_RULE:
+    case CSSRuleBinding::SUPPORTS_RULE:
+    case CSSRuleBinding::DOCUMENT_RULE: {
       // See the comment in StyleSheetRemoved.
       mTable.Clear();
       break;
     }
-    case nsIDOMCSSRule::FONT_FACE_RULE:
-    case nsIDOMCSSRule::PAGE_RULE:
-    case nsIDOMCSSRule::KEYFRAMES_RULE:
-    case nsIDOMCSSRule::KEYFRAME_RULE:
-    case nsIDOMCSSRule::NAMESPACE_RULE:
-    case nsIDOMCSSRule::COUNTER_STYLE_RULE:
-    case nsIDOMCSSRule::FONT_FEATURE_VALUES_RULE:
+    case CSSRuleBinding::FONT_FACE_RULE:
+    case CSSRuleBinding::PAGE_RULE:
+    case CSSRuleBinding::KEYFRAMES_RULE:
+    case CSSRuleBinding::KEYFRAME_RULE:
+    case CSSRuleBinding::NAMESPACE_RULE:
+    case CSSRuleBinding::COUNTER_STYLE_RULE:
+    case CSSRuleBinding::FONT_FEATURE_VALUES_RULE:
       break;
     default:
       MOZ_ASSERT_UNREACHABLE("Unhandled rule");
   }
 }
 
 size_t
 ServoStyleRuleMap::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
@@ -111,30 +111,30 @@ ServoStyleRuleMap::SizeOfIncludingThis(M
   n += mTable.ShallowSizeOfExcludingThis(aMallocSizeOf);
   return n;
 }
 
 void
 ServoStyleRuleMap::FillTableFromRule(css::Rule& aRule)
 {
   switch (aRule.Type()) {
-    case nsIDOMCSSRule::STYLE_RULE: {
+    case CSSRuleBinding::STYLE_RULE: {
       auto& rule = static_cast<ServoStyleRule&>(aRule);
       mTable.Put(rule.Raw(), &rule);
       break;
     }
-    case nsIDOMCSSRule::MEDIA_RULE:
-    case nsIDOMCSSRule::SUPPORTS_RULE:
-    case nsIDOMCSSRule::DOCUMENT_RULE: {
+    case CSSRuleBinding::MEDIA_RULE:
+    case CSSRuleBinding::SUPPORTS_RULE:
+    case CSSRuleBinding::DOCUMENT_RULE: {
       auto& rule = static_cast<css::GroupRule&>(aRule);
       auto ruleList = static_cast<ServoCSSRuleList*>(rule.CssRules());
       FillTableFromRuleList(*ruleList);
       break;
     }
-    case nsIDOMCSSRule::IMPORT_RULE: {
+    case CSSRuleBinding::IMPORT_RULE: {
       auto& rule = static_cast<ServoImportRule&>(aRule);
       MOZ_ASSERT(aRule.GetStyleSheet());
       FillTableFromStyleSheet(*rule.GetStyleSheet()->AsServo());
       break;
     }
   }
 }
 
--- a/layout/inspector/tests/test_parseStyleSheetImport.html
+++ b/layout/inspector/tests/test_parseStyleSheetImport.html
@@ -14,32 +14,32 @@
   </head>
   <body>
     <script type="application/javascript">
 const InspectorUtils = SpecialPowers.InspectorUtils;
 
 function do_test() {
   var sheet = document.styleSheets[1];
   var importRule = sheet.cssRules[0];
-  is(importRule.type, SpecialPowers.Ci.nsIDOMCSSRule.IMPORT_RULE,
+  is(importRule.type, CSSRule.IMPORT_RULE,
      "initial sheet has @import rule");
 
   var importedSheet = importRule.styleSheet;
   importedSheet.deleteRule(0);
   is(importedSheet.cssRules.length, 0, "imported sheet now has no rules");
 
   // "suffixed" refers to the "-2".
   var suffixedSheet = sheet.cssRules[1].styleSheet;
   InspectorUtils.parseStyleSheet(suffixedSheet, "");
   is(suffixedSheet.cssRules.length, 0, "second imported sheet now has no rules");
 
   // Re-parse the style sheet, preserving the imports.
   InspectorUtils.parseStyleSheet(sheet, "@import url('bug1202095.css');" +
                                         "@import url('bug1202095-2.css');");
-  is(sheet.cssRules[0].type, SpecialPowers.Ci.nsIDOMCSSRule.IMPORT_RULE,
+  is(sheet.cssRules[0].type, CSSRule.IMPORT_RULE,
      "re-parsed sheet has @import rule");
   is(sheet.cssRules[0].styleSheet, importedSheet,
      "imported sheet has not changed");
   is(sheet.cssRules[1].styleSheet, suffixedSheet,
      "second imported sheet has not changed");
 
   // Re-parse the style sheet, preserving both imports, but changing
   // the order.
@@ -52,17 +52,17 @@ function do_test() {
 
   // Re-parse the style sheet, removing the imports.
   InspectorUtils.parseStyleSheet(sheet, "");
   is(sheet.cssRules.length, 0, "style sheet now has no rules");
 
   // Re-parse the style sheet, adding one import back.  This should
   // not allow reuse.
   InspectorUtils.parseStyleSheet(sheet, "@import url('bug1202095.css');");
-  is(sheet.cssRules[0].type, SpecialPowers.Ci.nsIDOMCSSRule.IMPORT_RULE,
+  is(sheet.cssRules[0].type, CSSRule.IMPORT_RULE,
      "re-re-re-parsed sheet has @import rule");
   isnot(sheet.cssRules[0].styleSheet, importedSheet,
      "imported sheet has changed now");
 
   // Re-parse the style sheet, importing the same URL twice.
   // The style sheet should be reused once, but not two times.
   importedSheet = sheet.cssRules[0].styleSheet;
   InspectorUtils.parseStyleSheet(sheet, "@import url('bug1202095.css');" +
--- a/layout/reftests/forms/placeholder/reftest.list
+++ b/layout/reftests/forms/placeholder/reftest.list
@@ -11,17 +11,17 @@
 == placeholder-1-text.html placeholder-visible-ref.html
 == placeholder-1-password.html placeholder-visible-ref.html
 == placeholder-1-textarea.html placeholder-visible-textarea-ref.html
 == placeholder-2.html placeholder-visible-ref.html
 == placeholder-2-textarea.html placeholder-visible-textarea-ref.html
 == placeholder-3.html placeholder-overridden-ref.html
 == placeholder-4.html placeholder-overridden-ref.html
 == placeholder-5.html placeholder-visible-ref.html
-fuzzy-if(winWidget,160,10) fuzzy-if(Android,1,1) fuzzy-if(asyncPan&&!layersGPUAccelerated,146,317) fuzzy-if(OSX==1010&&browserIsRemote,1,8) fails-if(webrender) == placeholder-6.html placeholder-overflow-ref.html
+fuzzy-if(winWidget,160,10) fuzzy-if(Android,1,1) fuzzy-if(asyncPan&&!layersGPUAccelerated,146,317) fuzzy-if(OSX==1010&&browserIsRemote,1,8) == placeholder-6.html placeholder-overflow-ref.html
 skip-if(Android&&asyncPan) == placeholder-6-textarea.html placeholder-overflow-textarea-ref.html
 # needs-focus == placeholder-7.html placeholder-focus-ref.html
 # needs-focus == placeholder-8.html placeholder-focus-ref.html
 # needs-focus == placeholder-9.html placeholder-focus-ref.html
 needs-focus == placeholder-10.html placeholder-visible-ref.html
 == placeholder-11.html placeholder-visible-ref.html
 == placeholder-12.html placeholder-visible-ref.html
 == placeholder-13.html placeholder-visible-ref.html
--- a/layout/reftests/pagination/reftest.list
+++ b/layout/reftests/pagination/reftest.list
@@ -69,17 +69,17 @@ fuzzy-if(skiaContent,1,23) == resize-ref
 == table-caption-splitaftercaption-5.html table-caption-splitaftercaption-5-ref.html
 == table-caption-splitaftercaption-6.html table-caption-splitaftercaption-6-ref.html
 == table-caption-splitaftercaption-7.html table-caption-splitaftercaption-7-ref.html
 # == table-caption-splitaftercaption-8.html blank.html # bug 672654
 # == table-caption-splitaftercaption-9.html blank.html # bug 672654
 # == table-caption-splitaftercaption-10.html blank.html # bug 672654
 # == table-caption-splitaftercaption-11.html blank.html # bug 672654
 == column-balancing-break-inside-avoid-2.html column-balancing-break-inside-avoid-2-ref.html
-== combobox-page-break-inside.html combobox-page-break-inside-ref.html
+fuzzy-if(Android,1,2) == combobox-page-break-inside.html combobox-page-break-inside-ref.html
 == table-nested-1308876-1.xhtml table-nested-1308876-1-ref.html
 
 # Bugs
 == 272830-1.html 272830-1-ref.html
 == 318022-1.html 318022-1-ref.html
 == 403669-1.html 403669-1-ref.html
 == 381497-n.html 381497-f.html
 == test-async-paged.html 272830-1-ref.html
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -435,17 +435,17 @@ fuzzy-if(skiaContent,1,2600) == svg-in-f
 == svg-transform-01.svg pass.svg
 == svg-transform-02.svg pass.svg
 
 == symbol-01.svg symbol-01-ref.svg
 
 == text-font-size-01.svg pass.svg
 random-if(gtkWidget) == text-font-weight-01.svg text-font-weight-01-ref.svg # bug 386713
 == text-gradient-01.svg text-gradient-01-ref.svg
-random-if(winWidget) == text-gradient-02.svg text-gradient-02-ref.svg # see bug 590101
+random-if(winWidget) fuzzy-if(Android,10,2) == text-gradient-02.svg text-gradient-02-ref.svg # see bug 590101
 fuzzy-if(skiaContent,1,5500) == text-gradient-03.svg pass.svg
 == text-gradient-04.svg text-gradient-04-ref.svg
 == text-in-link-01.svg text-in-link-01-ref.svg
 == text-in-link-02.svg text-in-link-02-ref.svg
 == text-in-link-03.svg text-in-link-03-ref.svg
 # Tests for bug 546813: sanity-check using HTML text, then test SVG behavior.
 != text-language-00.xhtml text-language-00-ref.xhtml
 random-if(gtkWidget) != text-language-01.xhtml text-language-01-ref.xhtml # Fails on Linux tryserver due to lack of CJK fonts.
--- a/layout/reftests/svg/svg-integration/reftest.list
+++ b/layout/reftests/svg/svg-integration/reftest.list
@@ -44,9 +44,9 @@ fuzzy(1,5000) == mask-clipPath-opacity-0
 fuzzy(1,5000) == mask-clipPath-opacity-01d.xhtml mask-clipPath-opacity-01-ref.xhtml
 fuzzy(1,5000) == mask-clipPath-opacity-01e.xhtml mask-clipPath-opacity-01-ref.xhtml
 
 == transform-outer-svg-01.xhtml transform-outer-svg-01-ref.xhtml
 
 # box-decoration-break tests
 fuzzy-if(Android,4,10) == box-decoration-break-01.xhtml box-decoration-break-01-ref.xhtml
 fuzzy(62,14) == box-decoration-break-02.xhtml box-decoration-break-02-ref.xhtml
-fuzzy(67,234) == box-decoration-break-03.xhtml box-decoration-break-01-ref.xhtml
+fuzzy(67,238) == box-decoration-break-03.xhtml box-decoration-break-01-ref.xhtml
--- a/layout/reftests/svg/text/reftest.list
+++ b/layout/reftests/svg/text/reftest.list
@@ -191,15 +191,15 @@ fuzzy-if(skiaContent&&winWidget,126,336)
 # vertical text
 fuzzy-if(skiaContent,1,80) == textpath-vertical-dx.svg textpath-vertical-dx-ref.svg
 
 # selection
 needs-focus == deselectAll.svg deselectAll-ref.svg
 fuzzy-if(skiaContent,1,250) needs-focus == selectSubString.svg selectSubString-ref.svg
 fuzzy-if(skiaContent,1,600) needs-focus == selectSubString-2.svg selectSubString-2-ref.svg
 fuzzy-if(skiaContent,1,250) needs-focus == selectSubString-3.svg selectSubString-3-ref.svg
-fuzzy-if(webrender,1-1,237-237) needs-focus == simple-selection.svg simple-selection-ref.html
-fuzzy-if(skiaContent,1,100) fuzzy-if(webrender,1-1,575-575) needs-focus == simple-bidi-selection.svg simple-bidi-selection-ref.html
-fuzzy-if(skiaContent,1,50) fuzzy-if(webrender,1-1,237-237) needs-focus == simple-fill-color-selection.svg simple-fill-color-selection-ref.html
-fuzzy-if(skiaContent,1,150) fuzzy-if(webrender,1-1,222-222) needs-focus == simple-underline-selection.svg simple-underline-selection-ref.html
-fuzzy-if(skiaContent,1,300) fuzzy-if(webrender,1-1,934-934) needs-focus == multiple-text-selection.svg multiple-text-selection-ref.html
+fuzzy-if(webrender,1-1,294-294) needs-focus == simple-selection.svg simple-selection-ref.html
+fuzzy-if(skiaContent,1,100) fuzzy-if(webrender,1-1,594-594) needs-focus == simple-bidi-selection.svg simple-bidi-selection-ref.html
+fuzzy-if(skiaContent,1,50) fuzzy-if(webrender,1-1,294-294) needs-focus == simple-fill-color-selection.svg simple-fill-color-selection-ref.html
+fuzzy-if(skiaContent,1,150) fuzzy-if(webrender,1-1,276-276) needs-focus == simple-underline-selection.svg simple-underline-selection-ref.html
+fuzzy-if(skiaContent,1,300) fuzzy-if(webrender,1-1,1010-1010) needs-focus == multiple-text-selection.svg multiple-text-selection-ref.html
 needs-focus == multiple-chunks-selection.svg multiple-chunks-selection-ref.svg
 fuzzy-if(skiaContent,1,200) needs-focus == textpath-selection.svg textpath-selection-ref.svg
--- a/layout/reftests/text-decoration/reftest.list
+++ b/layout/reftests/text-decoration/reftest.list
@@ -106,10 +106,10 @@ fuzzy-if(cocoaWidget,1,5) == decoration-
 fuzzy-if(OSX==1010,1,4) == underline-button-1.html underline-button-1-ref.html
 fuzzy-if(OSX==1010,1,2) == underline-button-2.html underline-button-2-ref.html
 fuzzy-if(skiaContent,4,2) == underline-select-1.html underline-select-1-ref.html
 == underline-select-2.html underline-select-2-ref.html
 == 1133392.html 1133392-ref.html
 != 1159729-offset-adjustment.html 1159729-offset-adjustment-notref.html
 == emphasis-style-dynamic.html emphasis-style-dynamic-ref.html
 == vertical-mode-decorations-1.html vertical-mode-decorations-1-ref.html
-== vertical-mode-decorations-2.html vertical-mode-decorations-2-ref.html
+fuzzy-if(Android,238,36) == vertical-mode-decorations-2.html vertical-mode-decorations-2-ref.html
 != 1415214.html 1415214-notref.html
--- a/layout/reftests/w3c-css/failures.list
+++ b/layout/reftests/w3c-css/failures.list
@@ -57,20 +57,20 @@ fails css-writing-modes-3/float-lft-orth
 fails css-writing-modes-3/float-lft-orthog-vrl-in-htb-002.xht
 fails css-writing-modes-3/float-rgt-orthog-htb-in-vlr-003.xht
 fails css-writing-modes-3/float-rgt-orthog-htb-in-vrl-003.xht
 fails css-writing-modes-3/float-rgt-orthog-vlr-in-htb-003.xht
 fails css-writing-modes-3/float-rgt-orthog-vrl-in-htb-003.xht
 fails css-writing-modes-3/sizing-orthog-htb-in-vrl-001.xht
 fails css-writing-modes-3/sizing-orthog-htb-in-vrl-004.xht
 fails css-writing-modes-3/sizing-orthog-htb-in-vrl-013.xht
-fails-if(OSX||winWidget||Android) css-writing-modes-3/sizing-orthog-htb-in-vlr-008.xht
-fails-if(OSX||winWidget||Android) css-writing-modes-3/sizing-orthog-htb-in-vlr-020.xht
-fails-if(OSX||winWidget||Android) css-writing-modes-3/sizing-orthog-htb-in-vrl-008.xht
-fails-if(OSX||winWidget||Android) css-writing-modes-3/sizing-orthog-htb-in-vrl-020.xht
+fails-if(OSX||winWidget) css-writing-modes-3/sizing-orthog-htb-in-vlr-008.xht
+fails-if(OSX||winWidget) css-writing-modes-3/sizing-orthog-htb-in-vlr-020.xht
+fails-if(OSX||winWidget) css-writing-modes-3/sizing-orthog-htb-in-vrl-008.xht
+fails-if(OSX||winWidget) css-writing-modes-3/sizing-orthog-htb-in-vrl-020.xht
 css-writing-modes-3/sizing-orthog-vlr-in-htb-008.xht
 css-writing-modes-3/sizing-orthog-vlr-in-htb-020.xht
 css-writing-modes-3/sizing-orthog-vrl-in-htb-008.xht
 css-writing-modes-3/sizing-orthog-vrl-in-htb-020.xht
 fails-if(Android) css-writing-modes-3/sizing-orthog-htb-in-vlr-003.xht
 fails-if(Android) css-writing-modes-3/sizing-orthog-htb-in-vlr-009.xht
 fails-if(Android) css-writing-modes-3/sizing-orthog-htb-in-vlr-015.xht
 fails-if(Android) css-writing-modes-3/sizing-orthog-htb-in-vlr-021.xht
--- a/layout/reftests/w3c-css/received/reftest.list
+++ b/layout/reftests/w3c-css/received/reftest.list
@@ -917,47 +917,47 @@ fuzzy-if(OSX||winWidget,110,1200) == css
 fuzzy-if(OSX||winWidget,110,1200) == css-writing-modes-3/row-progression-vrl-004.xht css-writing-modes-3/block-flow-direction-001-ref.xht
 fuzzy-if(OSX||winWidget,110,1200) == css-writing-modes-3/row-progression-vrl-006.xht css-writing-modes-3/block-flow-direction-001-ref.xht
 fuzzy-if(OSX||winWidget,110,1200) == css-writing-modes-3/row-progression-vrl-008.xht css-writing-modes-3/block-flow-direction-001-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vlr-001.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-001-ref.xht
 fails-if(Android) == css-writing-modes-3/sizing-orthog-htb-in-vlr-003.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-003-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vlr-004.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-004-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vlr-006.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-006-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vlr-007.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-007-ref.xht
-fails-if(OSX||winWidget||Android) == css-writing-modes-3/sizing-orthog-htb-in-vlr-008.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-008-ref.xht
+fails-if(OSX||winWidget) == css-writing-modes-3/sizing-orthog-htb-in-vlr-008.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-008-ref.xht
 fails-if(Android) == css-writing-modes-3/sizing-orthog-htb-in-vlr-009.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-003-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vlr-010.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-010-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vlr-011.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-011-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vlr-012.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-006-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vlr-013.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-013-ref.xht
 fails-if(Android) == css-writing-modes-3/sizing-orthog-htb-in-vlr-015.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-015-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vlr-016.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-016-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vlr-018.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-018-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vlr-019.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-019-ref.xht
-fails-if(OSX||winWidget||Android) == css-writing-modes-3/sizing-orthog-htb-in-vlr-020.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-020-ref.xht
+fails-if(OSX||winWidget) == css-writing-modes-3/sizing-orthog-htb-in-vlr-020.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-020-ref.xht
 fails-if(Android) == css-writing-modes-3/sizing-orthog-htb-in-vlr-021.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-015-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vlr-022.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-022-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vlr-023.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-023-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vlr-024.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-018-ref.xht
 fails == css-writing-modes-3/sizing-orthog-htb-in-vrl-001.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-001-ref.xht
 fails-if(Android) == css-writing-modes-3/sizing-orthog-htb-in-vrl-003.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-003-ref.xht
 fails == css-writing-modes-3/sizing-orthog-htb-in-vrl-004.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-004-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vrl-006.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-006-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vrl-007.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-007-ref.xht
-fails-if(OSX||winWidget||Android) == css-writing-modes-3/sizing-orthog-htb-in-vrl-008.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-008-ref.xht
+fails-if(OSX||winWidget) == css-writing-modes-3/sizing-orthog-htb-in-vrl-008.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-008-ref.xht
 fails-if(Android) == css-writing-modes-3/sizing-orthog-htb-in-vrl-009.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-003-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vrl-010.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-010-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vrl-011.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-011-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vrl-012.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-006-ref.xht
 fails == css-writing-modes-3/sizing-orthog-htb-in-vrl-013.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-013-ref.xht
 fails-if(Android) == css-writing-modes-3/sizing-orthog-htb-in-vrl-015.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-015-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vrl-016.xht css-writing-modes-3/sizing-orthog-htb-in-vlr-016-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vrl-018.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-018-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vrl-019.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-019-ref.xht
-fails-if(OSX||winWidget||Android) == css-writing-modes-3/sizing-orthog-htb-in-vrl-020.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-020-ref.xht
+fails-if(OSX||winWidget) == css-writing-modes-3/sizing-orthog-htb-in-vrl-020.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-020-ref.xht
 fails-if(Android) == css-writing-modes-3/sizing-orthog-htb-in-vrl-021.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-015-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vrl-022.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-022-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vrl-023.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-023-ref.xht
 == css-writing-modes-3/sizing-orthog-htb-in-vrl-024.xht css-writing-modes-3/sizing-orthog-htb-in-vrl-018-ref.xht
 == css-writing-modes-3/sizing-orthog-prct-htb-in-vlr-001.xht css-writing-modes-3/sizing-orthog-prct-htb-in-vlr-001-ref.xht
 == css-writing-modes-3/sizing-orthog-prct-htb-in-vlr-002.xht css-writing-modes-3/sizing-orthog-prct-htb-in-vlr-002-ref.xht
 == css-writing-modes-3/sizing-orthog-prct-htb-in-vlr-003.xht css-writing-modes-3/sizing-orthog-prct-htb-in-vlr-003-ref.xht
 == css-writing-modes-3/sizing-orthog-prct-htb-in-vlr-004.xht css-writing-modes-3/sizing-orthog-prct-htb-in-vlr-004-ref.xht
--- a/layout/style/BindingStyleRule.h
+++ b/layout/style/BindingStyleRule.h
@@ -55,22 +55,18 @@ public:
                                   uint64_t* aSpecificity) = 0;
   virtual nsresult SelectorMatchesElement(dom::Element* aElement,
                                           uint32_t aSelectorIndex,
                                           const nsAString& aPseudo,
                                           bool* aMatches) = 0;
   virtual NotNull<DeclarationBlock*> GetDeclarationBlock() const = 0;
 
   // WebIDL API
-  // For GetSelectorText/SetSelectorText, we purposefully use a signature that
-  // matches the nsIDOMCSSStyleRule one for now, so subclasses can just
-  // implement both at once.  The actual implementations must never return
-  // anything other than NS_OK;
-  NS_IMETHOD GetSelectorText(nsAString& aSelectorText) = 0;
-  NS_IMETHOD SetSelectorText(const nsAString& aSelectorText) = 0;
+  virtual void GetSelectorText(nsAString& aSelectorText) = 0;
+  virtual void SetSelectorText(const nsAString& aSelectorText) = 0;
   virtual nsICSSDeclaration* Style() = 0;
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
 };
 
 } // namespace mozilla
 
--- a/layout/style/CSSFontFeatureValuesRule.cpp
+++ b/layout/style/CSSFontFeatureValuesRule.cpp
@@ -5,39 +5,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/CSSFontFeatureValuesRule.h"
 #include "mozilla/dom/CSSFontFeatureValuesRuleBinding.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_ADDREF_INHERITED(CSSFontFeatureValuesRule, css::Rule)
-NS_IMPL_RELEASE_INHERITED(CSSFontFeatureValuesRule, css::Rule)
-
-// QueryInterface implementation for CSSFontFeatureValuesRule
 // If this ever gets its own cycle-collection bits, reevaluate our IsCCLeaf
 // implementation.
-NS_INTERFACE_MAP_BEGIN(CSSFontFeatureValuesRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSFontFeatureValuesRule)
-NS_INTERFACE_MAP_END_INHERITING(mozilla::css::Rule)
-
-void
-CSSFontFeatureValuesRule::SetFontFamily(const nsAString& aFamily,
-                                              ErrorResult& aRv)
-{
-  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
-}
-
-void
-CSSFontFeatureValuesRule::SetValueText(const nsAString& aFamily,
-                                             ErrorResult& aRv)
-{
-  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
-}
 
 bool
 CSSFontFeatureValuesRule::IsCCLeaf() const
 {
   return Rule::IsCCLeaf();
 }
 
 /* virtual */ JSObject*
--- a/layout/style/CSSFontFeatureValuesRule.h
+++ b/layout/style/CSSFontFeatureValuesRule.h
@@ -5,43 +5,35 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_CSSFontFeatureValuesRule_h
 #define mozilla_dom_CSSFontFeatureValuesRule_h
 
 #include "mozilla/css/Rule.h"
 
 #include "nsICSSDeclaration.h"
-#include "nsIDOMCSSFontFeatureValuesRule.h"
-#include "nsIDOMCSSStyleDeclaration.h"
 
 namespace mozilla {
 namespace dom {
 
 class CSSFontFeatureValuesRule : public css::Rule
-                               , public nsIDOMCSSFontFeatureValuesRule
 {
 public:
-  NS_DECL_ISUPPORTS_INHERITED
-
   virtual bool IsCCLeaf() const override;
 
   int32_t GetType() const final { return Rule::FONT_FEATURE_VALUES_RULE; }
-  using Rule::GetType;
   virtual already_AddRefed<mozilla::css::Rule> Clone() const override = 0;
 
-  using nsIDOMCSSFontFeatureValuesRule::SetFontFamily;
-  using nsIDOMCSSFontFeatureValuesRule::SetValueText;
   // WebIDL interfaces
-  uint16_t Type() const final { return nsIDOMCSSRule::FONT_FEATURE_VALUES_RULE; }
+  uint16_t Type() const final { return CSSRuleBinding::FONT_FEATURE_VALUES_RULE; }
   virtual void GetCssTextImpl(nsAString& aCssText) const override = 0;
-  // The XPCOM GetFontFamily is fine
-  void SetFontFamily(const nsAString& aFamily, mozilla::ErrorResult& aRv);
-  // The XPCOM GetValueText is fine
-  void SetValueText(const nsAString& aFamily, mozilla::ErrorResult& aRv);
+  virtual void GetFontFamily(nsAString& aFamily) = 0;
+  virtual void SetFontFamily(const nsAString& aFamily, mozilla::ErrorResult& aRv) = 0;
+  virtual void GetValueText(nsAString& aValueText) = 0;
+  virtual void SetValueText(const nsAString& aValueText, mozilla::ErrorResult& aRv) = 0;
 
   virtual size_t
   SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override = 0;
 
   JSObject*
   WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
 protected:
--- a/layout/style/CSSImportRule.cpp
+++ b/layout/style/CSSImportRule.cpp
@@ -7,47 +7,23 @@
 #include "mozilla/dom/CSSImportRule.h"
 
 #include "mozilla/dom/CSSImportRuleBinding.h"
 #include "mozilla/dom/MediaList.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_ADDREF_INHERITED(CSSImportRule, css::Rule)
-NS_IMPL_RELEASE_INHERITED(CSSImportRule, css::Rule)
-
-// QueryInterface implementation for CSSImportRule
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CSSImportRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSImportRule)
-NS_INTERFACE_MAP_END_INHERITING(css::Rule)
-
 bool
 CSSImportRule::IsCCLeaf() const
 {
   // We're not a leaf.
   return false;
 }
 
-NS_IMETHODIMP
-CSSImportRule::GetMedia(nsIDOMMediaList** aMedia)
-{
-  NS_ENSURE_ARG_POINTER(aMedia);
-  NS_IF_ADDREF(*aMedia = GetMedia());
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-CSSImportRule::GetStyleSheet(nsIDOMCSSStyleSheet** aStyleSheet)
-{
-  NS_ENSURE_ARG_POINTER(aStyleSheet);
-  NS_IF_ADDREF(*aStyleSheet = GetStyleSheet());
-  return NS_OK;
-}
-
 /* virtual */ JSObject*
 CSSImportRule::WrapObject(JSContext* aCx,
                           JS::Handle<JSObject*> aGivenProto)
 {
   return CSSImportRuleBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
--- a/layout/style/CSSImportRule.h
+++ b/layout/style/CSSImportRule.h
@@ -3,45 +3,37 @@
 /* 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 mozilla_dom_CSSImportRule_h
 #define mozilla_dom_CSSImportRule_h
 
 #include "mozilla/css/Rule.h"
-#include "nsIDOMCSSImportRule.h"
 
 namespace mozilla {
 namespace dom {
 
 class CSSImportRule : public css::Rule
-                    , public nsIDOMCSSImportRule
 {
 protected:
   using Rule::Rule;
   virtual ~CSSImportRule() {}
 
 public:
-  NS_DECL_ISUPPORTS_INHERITED
   bool IsCCLeaf() const final;
 
   int32_t GetType() const final { return css::Rule::IMPORT_RULE; }
-  using Rule::GetType;
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const override = 0;
 
-  // nsIDOMCSSImportRule interface
-  NS_IMETHOD GetMedia(nsIDOMMediaList** aMedia) final;
-  NS_IMETHOD GetStyleSheet(nsIDOMCSSStyleSheet** aStyleSheet) final;
-
   // WebIDL interface
-  uint16_t Type() const final { return nsIDOMCSSRule::IMPORT_RULE; }
-  // The XPCOM GetHref is fine, since it never fails.
+  uint16_t Type() const final { return CSSRuleBinding::IMPORT_RULE; }
+  virtual void GetHref(nsAString& aHref) const = 0;
   virtual dom::MediaList* GetMedia() const = 0;
   virtual StyleSheet* GetStyleSheet() const = 0;
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
 };
 
 } // namespace dom
--- a/layout/style/CSSKeyframeRule.cpp
+++ b/layout/style/CSSKeyframeRule.cpp
@@ -7,31 +7,16 @@
 #include "mozilla/dom/CSSKeyframeRule.h"
 
 #include "mozilla/dom/CSSKeyframeRuleBinding.h"
 #include "nsICSSDeclaration.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_ADDREF_INHERITED(CSSKeyframeRule, mozilla::css::Rule)
-NS_IMPL_RELEASE_INHERITED(CSSKeyframeRule, mozilla::css::Rule)
-
-// QueryInterface implementation for CSSKeyframeRule
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CSSKeyframeRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSKeyframeRule)
-NS_INTERFACE_MAP_END_INHERITING(mozilla::css::Rule)
-
-NS_IMETHODIMP
-CSSKeyframeRule::GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
-{
-  NS_ADDREF(*aStyle = Style());
-  return NS_OK;
-}
-
 /* virtual */ JSObject*
 CSSKeyframeRule::WrapObject(JSContext* aCx,
                             JS::Handle<JSObject*> aGivenProto)
 {
   return CSSKeyframeRuleBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
--- a/layout/style/CSSKeyframeRule.h
+++ b/layout/style/CSSKeyframeRule.h
@@ -3,42 +3,34 @@
 /* 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 mozilla_dom_CSSKeyframeRule_h
 #define mozilla_dom_CSSKeyframeRule_h
 
 #include "mozilla/css/Rule.h"
-#include "nsIDOMCSSKeyframeRule.h"
 
 namespace mozilla {
 namespace dom {
 
 class CSSKeyframeRule : public css::Rule
-                      , public nsIDOMCSSKeyframeRule
 {
 protected:
   using css::Rule::Rule;
   virtual ~CSSKeyframeRule() {}
 
 public:
-  NS_DECL_ISUPPORTS_INHERITED
-
   int32_t GetType() const final { return Rule::KEYFRAME_RULE; }
-  using Rule::GetType;
   bool IsCCLeaf() const override { return Rule::IsCCLeaf(); }
 
-  // nsIDOMCSSKeyframeRule
-  NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration** aStyle) final;
-
   // WebIDL interface
-  uint16_t Type() const final { return nsIDOMCSSRule::KEYFRAME_RULE; }
-  // The XPCOM GetKeyText is fine.
-  // The XPCOM SetKeyText is fine.
+  uint16_t Type() const final { return CSSRuleBinding::KEYFRAME_RULE; }
+  virtual void GetKeyText(nsAString& aKey) = 0;
+  virtual void SetKeyText(const nsAString& aKey) = 0;
   virtual nsICSSDeclaration* Style() = 0;
 
   size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override = 0;
 
   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
 };
 
 } // namespace dom
--- a/layout/style/CSSKeyframesRule.cpp
+++ b/layout/style/CSSKeyframesRule.cpp
@@ -6,39 +6,16 @@
 
 #include "mozilla/dom/CSSKeyframesRule.h"
 
 #include "mozilla/dom/CSSKeyframesRuleBinding.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_ADDREF_INHERITED(CSSKeyframesRule, css::GroupRule)
-NS_IMPL_RELEASE_INHERITED(CSSKeyframesRule, css::GroupRule)
-
-// QueryInterface implementation for CSSKeyframesRule
-NS_INTERFACE_MAP_BEGIN(CSSKeyframesRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSKeyframesRule)
-NS_INTERFACE_MAP_END_INHERITING(GroupRule)
-
-NS_IMETHODIMP
-CSSKeyframesRule::GetCssRules(nsIDOMCSSRuleList** aRuleList)
-{
-  NS_ADDREF(*aRuleList = CssRules());
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-CSSKeyframesRule::FindRule(const nsAString& aKey,
-                           nsIDOMCSSKeyframeRule** aResult)
-{
-  NS_IF_ADDREF(*aResult = FindRule(aKey));
-  return NS_OK;
-}
-
 /* virtual */ bool
 CSSKeyframesRule::UseForPresentation(nsPresContext* aPresContext,
                                      nsMediaQueryResultCacheKey& aKey)
 {
   MOZ_ASSERT_UNREACHABLE("should not be called");
   return false;
 }
 
--- a/layout/style/CSSKeyframesRule.h
+++ b/layout/style/CSSKeyframesRule.h
@@ -3,48 +3,37 @@
 /* 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 mozilla_dom_CSSKeyframesRule_h
 #define mozilla_dom_CSSKeyframesRule_h
 
 #include "mozilla/css/GroupRule.h"
-#include "nsIDOMCSSKeyframesRule.h"
-
 #include "mozilla/dom/CSSKeyframeRule.h"
 
 namespace mozilla {
 namespace dom {
 
 class CSSKeyframesRule : public css::GroupRule
-                       , public nsIDOMCSSKeyframesRule
 {
 protected:
   using css::GroupRule::GroupRule;
   virtual ~CSSKeyframesRule() {}
 
 public:
-  NS_DECL_ISUPPORTS_INHERITED
-
   int32_t GetType() const final { return Rule::KEYFRAMES_RULE; }
-  using Rule::GetType;
-
-  // nsIDOMCSSKeyframesRule interface
-  NS_IMETHOD GetCssRules(nsIDOMCSSRuleList** aRuleList) final;
-  NS_IMETHOD FindRule(const nsAString& aKey,
-                      nsIDOMCSSKeyframeRule** aResult) final;
 
   // WebIDL interface
-  uint16_t Type() const final { return nsIDOMCSSRule::KEYFRAMES_RULE; }
-  // The XPCOM GetName is OK
-  // The XPCOM SetName is OK
+  uint16_t Type() const final { return CSSRuleBinding::KEYFRAMES_RULE; }
+  virtual void GetName(nsAString& aName) const = 0;
+  virtual void SetName(const nsAString& aName) = 0;
   virtual CSSRuleList* CssRules() = 0;
-  // The XPCOM appendRule is OK, since it never throws
-  using nsIDOMCSSKeyframesRule::DeleteRule;
+  virtual void AppendRule(const nsAString& aRule) = 0;
+  virtual void DeleteRule(const nsAString& aKey) = 0;
   virtual CSSKeyframeRule* FindRule(const nsAString& aKey) = 0;
 
   bool UseForPresentation(nsPresContext* aPresContext,
                           nsMediaQueryResultCacheKey& aKey) final;
 
   size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override = 0;
 
   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
--- a/layout/style/CSSMediaRule.cpp
+++ b/layout/style/CSSMediaRule.cpp
@@ -7,66 +7,16 @@
 #include "mozilla/dom/CSSMediaRule.h"
 
 #include "mozilla/dom/CSSMediaRuleBinding.h"
 #include "mozilla/dom/MediaList.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_ADDREF_INHERITED(CSSMediaRule, css::ConditionRule)
-NS_IMPL_RELEASE_INHERITED(CSSMediaRule, css::ConditionRule)
-
-// QueryInterface implementation for CSSMediaRule
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CSSMediaRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSGroupingRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSConditionRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSMediaRule)
-NS_INTERFACE_MAP_END_INHERITING(css::ConditionRule)
-
-// nsIDOMCSSGroupingRule methods
-NS_IMETHODIMP
-CSSMediaRule::GetCssRules(nsIDOMCSSRuleList** aRuleList)
-{
-  return GroupRule::GetCssRules(aRuleList);
-}
-
-NS_IMETHODIMP
-CSSMediaRule::InsertRule(const nsAString& aRule,
-                         uint32_t aIndex, uint32_t* _retval)
-{
-  return GroupRule::InsertRule(aRule, aIndex, _retval);
-}
-
-NS_IMETHODIMP
-CSSMediaRule::DeleteRule(uint32_t aIndex)
-{
-  return GroupRule::DeleteRule(aIndex);
-}
-
-// nsIDOMCSSMediaRule methods
-NS_IMETHODIMP
-CSSMediaRule::GetMedia(nsIDOMMediaList* *aMedia)
-{
-  NS_ENSURE_ARG_POINTER(aMedia);
-  NS_IF_ADDREF(*aMedia = Media());
-  return NS_OK;
-}
-
-void
-CSSMediaRule::SetConditionText(const nsAString& aConditionText,
-                               ErrorResult& aRv)
-{
-  nsresult rv = static_cast<nsIDOMCSSConditionRule*>(this)->
-    SetConditionText(aConditionText);
-  if (NS_FAILED(rv)) {
-    aRv.Throw(rv);
-  }
-}
-
 /* virtual */ JSObject*
 CSSMediaRule::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return CSSMediaRuleBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/layout/style/CSSMediaRule.h
+++ b/layout/style/CSSMediaRule.h
@@ -3,50 +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/. */
 
 #ifndef mozilla_dom_CSSMediaRule_h
 #define mozilla_dom_CSSMediaRule_h
 
 #include "mozilla/css/GroupRule.h"
-#include "nsIDOMCSSMediaRule.h"
 
 namespace mozilla {
 namespace dom {
 
 class CSSMediaRule : public css::ConditionRule
-                   , public nsIDOMCSSMediaRule
 {
 protected:
   using ConditionRule::ConditionRule;
   virtual ~CSSMediaRule() {}
 
 public:
-  NS_DECL_ISUPPORTS_INHERITED
-
   int32_t GetType() const override { return css::Rule::MEDIA_RULE; }
 
-  // XPCOM interface
-  using Rule::GetType;
-
-  // nsIDOMCSSGroupingRule interface
-  NS_DECL_NSIDOMCSSGROUPINGRULE
-
-  // nsIDOMCSSConditionRule interface
-  NS_IMETHOD SetConditionText(const nsAString& aConditionText) override = 0;
-
-  // nsIDOMCSSMediaRule interface
-  NS_DECL_NSIDOMCSSMEDIARULE
-
   // WebIDL interface
-  uint16_t Type() const override { return nsIDOMCSSRule::MEDIA_RULE; }
-  // Our XPCOM GetConditionText is OK
-  void SetConditionText(const nsAString& aConditionText,
-                        ErrorResult& aRv) final;
+  uint16_t Type() const override { return CSSRuleBinding::MEDIA_RULE; }
   virtual MediaList* Media() = 0;
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/layout/style/CSSMozDocumentRule.cpp
+++ b/layout/style/CSSMozDocumentRule.cpp
@@ -7,53 +7,16 @@
 #include "mozilla/dom/CSSMozDocumentRule.h"
 #include "mozilla/dom/CSSMozDocumentRuleBinding.h"
 
 namespace mozilla {
 namespace dom {
 
 using namespace mozilla::css;
 
-NS_IMPL_ADDREF_INHERITED(CSSMozDocumentRule, css::ConditionRule)
-NS_IMPL_RELEASE_INHERITED(CSSMozDocumentRule, css::ConditionRule)
-
-// QueryInterface implementation for CSSMozDocumentRule
-NS_INTERFACE_MAP_BEGIN(CSSMozDocumentRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSGroupingRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSConditionRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSMozDocumentRule)
-NS_INTERFACE_MAP_END_INHERITING(ConditionRule)
-
-// nsIDOMCSSGroupingRule methods
-NS_IMETHODIMP
-CSSMozDocumentRule::GetCssRules(nsIDOMCSSRuleList** aRuleList)
-{
-  return GroupRule::GetCssRules(aRuleList);
-}
-
-NS_IMETHODIMP
-CSSMozDocumentRule::InsertRule(const nsAString & aRule,
-                               uint32_t aIndex, uint32_t* _retval)
-{
-  return GroupRule::InsertRule(aRule, aIndex, _retval);
-}
-
-NS_IMETHODIMP
-CSSMozDocumentRule::DeleteRule(uint32_t aIndex)
-{
-  return GroupRule::DeleteRule(aIndex);
-}
-
-void
-CSSMozDocumentRule::SetConditionText(const nsAString& aConditionText,
-                                     ErrorResult& aRv)
-{
-  aRv = SetConditionText(aConditionText);
-}
-
 /* virtual */ JSObject*
 CSSMozDocumentRule::WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto)
 {
   return CSSMozDocumentRuleBinding::Wrap(aCx, this, aGivenProto);
 }
 
 bool
--- a/layout/style/CSSMozDocumentRule.h
+++ b/layout/style/CSSMozDocumentRule.h
@@ -4,56 +4,37 @@
  * 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 mozilla_dom_CSSMozDocumentRule_h
 #define mozilla_dom_CSSMozDocumentRule_h
 
 #include "mozilla/css/GroupRule.h"
 #include "mozilla/css/URLMatchingFunction.h"
-#include "nsIDOMCSSMozDocumentRule.h"
 
 namespace mozilla {
 namespace dom {
 
 class CSSMozDocumentRule : public css::ConditionRule
-                         , public nsIDOMCSSMozDocumentRule
 {
 protected:
   using ConditionRule::ConditionRule;
   virtual ~CSSMozDocumentRule() {}
 
 public:
-  NS_DECL_ISUPPORTS_INHERITED
-
   int32_t GetType() const final override { return css::Rule::DOCUMENT_RULE; }
-  using Rule::GetType;
 
   static bool Match(nsIDocument* aDoc,
                     nsIURI* aDocURI,
                     const nsACString& aDocURISpec,
                     const nsACString& aPattern,
                     css::URLMatchingFunction aUrlMatchingFunction);
 
-  // nsIDOMCSSGroupingRule interface
-  NS_DECL_NSIDOMCSSGROUPINGRULE
-
-  // nsIDOMCSSConditionRule interface
-  NS_IMETHOD SetConditionText(const nsAString& aConditionText) override = 0;
-
-  // nsIDOMCSSMozDocumentRule interface
-  NS_DECL_NSIDOMCSSMOZDOCUMENTRULE
-
   // WebIDL interface
-  uint16_t Type() const final override {
-    return nsIDOMCSSRule::DOCUMENT_RULE;
-  }
-  // Our XPCOM GetConditionText is OK
-  void SetConditionText(const nsAString& aConditionText,
-                        ErrorResult& aRv) final;
+  uint16_t Type() const final override { return CSSRuleBinding::DOCUMENT_RULE; }
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/layout/style/CSSNamespaceRule.h
+++ b/layout/style/CSSNamespaceRule.h
@@ -22,25 +22,22 @@ protected:
 
 public:
   bool IsCCLeaf() const final {
     return Rule::IsCCLeaf();
   }
   int32_t GetType() const final {
     return Rule::NAMESPACE_RULE;
   }
-  using Rule::GetType;
 
   virtual nsAtom* GetPrefix() const = 0;
   virtual void GetURLSpec(nsString& aURLSpec) const = 0;
 
   // WebIDL interfaces
-  uint16_t Type() const final {
-    return nsIDOMCSSRule::NAMESPACE_RULE;
-  }
+  uint16_t Type() const final { return CSSRuleBinding::NAMESPACE_RULE; }
   void GetNamespaceURI(nsString& aNamespaceURI) {
     GetURLSpec(aNamespaceURI);
   }
   void GetPrefix(DOMString& aPrefix) {
     aPrefix.SetKnownLiveAtom(GetPrefix(), DOMString::eTreatNullAsEmpty);
   }
 
   size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const = 0;
--- a/layout/style/CSSPageRule.cpp
+++ b/layout/style/CSSPageRule.cpp
@@ -6,31 +6,16 @@
 
 #include "mozilla/dom/CSSPageRule.h"
 
 #include "mozilla/dom/CSSPageRuleBinding.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_ADDREF_INHERITED(CSSPageRule, css::Rule)
-NS_IMPL_RELEASE_INHERITED(CSSPageRule, css::Rule)
-
-// QueryInterface implementation for CSSPageRule
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CSSPageRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSPageRule)
-NS_INTERFACE_MAP_END_INHERITING(css::Rule)
-
-NS_IMETHODIMP
-CSSPageRule::GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
-{
-  NS_ADDREF(*aStyle = Style());
-  return NS_OK;
-}
-
 JSObject*
 CSSPageRule::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return CSSPageRuleBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/layout/style/CSSPageRule.h
+++ b/layout/style/CSSPageRule.h
@@ -5,42 +5,33 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_CSSPageRule_h
 #define mozilla_dom_CSSPageRule_h
 
 #include "mozilla/css/Rule.h"
 
 #include "nsICSSDeclaration.h"
-#include "nsIDOMCSSPageRule.h"
-#include "nsIDOMCSSStyleDeclaration.h"
 
 namespace mozilla {
 namespace dom {
 
 class CSSPageRule : public css::Rule
-                  , public nsIDOMCSSPageRule
 {
 protected:
   using Rule::Rule;
   virtual ~CSSPageRule() {};
 
 public:
-  NS_DECL_ISUPPORTS_INHERITED
-
-  // nsIDOMCSSPageRule interface
-  NS_DECL_NSIDOMCSSPAGERULE
-
   virtual bool IsCCLeaf() const override = 0;
 
   int32_t GetType() const final { return Rule::PAGE_RULE; }
-  using Rule::GetType;
 
   // WebIDL interfaces
-  uint16_t Type() const final { return nsIDOMCSSRule::PAGE_RULE; }
+  uint16_t Type() const final { return CSSRuleBinding::PAGE_RULE; }
   virtual void GetCssTextImpl(nsAString& aCssText) const override = 0;
   virtual nsICSSDeclaration* Style() = 0;
 
   virtual size_t
   SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override = 0;
 
   JSObject*
   WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
--- a/layout/style/CSSRuleList.cpp
+++ b/layout/style/CSSRuleList.cpp
@@ -11,18 +11,16 @@
 namespace mozilla {
 namespace dom {
 
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(CSSRuleList)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CSSRuleList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(CSSRuleList)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSRuleList)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(CSSRuleList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(CSSRuleList)
 
 /* virtual */ JSObject*
 CSSRuleList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
--- a/layout/style/CSSRuleList.h
+++ b/layout/style/CSSRuleList.h
@@ -4,65 +4,41 @@
  * 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 mozilla_dom_CSSRuleList_h
 #define mozilla_dom_CSSRuleList_h
 
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/css/Rule.h"
-#include "nsIDOMCSSRule.h"
-#include "nsIDOMCSSRuleList.h"
 #include "nsWrapperCache.h"
 
 namespace mozilla {
 namespace dom {
 
-// IID for the CSSRuleList interface
-#define NS_ICSSRULELIST_IID \
-{ 0x56ac8d1c, 0xc1ed, 0x45fe, \
-  { 0x9a, 0x4d, 0x3a, 0xdc, 0xf9, 0xd1, 0xb9, 0x3f } }
-
-class CSSRuleList : public nsIDOMCSSRuleList
+class CSSRuleList : public nsISupports
                   , public nsWrapperCache
 {
 public:
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSRULELIST_IID)
-
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CSSRuleList)
 
   virtual StyleSheet* GetParentObject() = 0;
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override final;
 
-  NS_IMETHOD
-  GetLength(uint32_t* aLength) override final
-  {
-    *aLength = Length();
-    return NS_OK;
-  }
-  NS_IMETHOD
-  Item(uint32_t aIndex, nsIDOMCSSRule** aReturn) override final
-  {
-    NS_IF_ADDREF(*aReturn = Item(aIndex));
-    return NS_OK;
-  }
-
   // WebIDL API
   css::Rule* Item(uint32_t aIndex)
   {
     bool unused;
     return IndexedGetter(aIndex, unused);
   }
 
   virtual css::Rule* IndexedGetter(uint32_t aIndex, bool& aFound) = 0;
   virtual uint32_t Length() = 0;
 
 protected:
   virtual ~CSSRuleList() {}
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(CSSRuleList, NS_ICSSRULELIST_IID)
-
 } // namespace dom
 } // namespace mozilla
 
 #endif /* mozilla_dom_CSSRuleList_h */
--- a/layout/style/CSSStyleSheet.cpp
+++ b/layout/style/CSSStyleSheet.cpp
@@ -19,19 +19,17 @@
 #include "nsMediaList.h"
 #include "nsIDocument.h"
 #include "nsPresContext.h"
 #include "nsGkAtoms.h"
 #include "nsQueryObject.h"
 #include "nsString.h"
 #include "nsStyleSet.h"
 #include "nsTArray.h"
-#include "nsIDOMCSSStyleSheet.h"
 #include "mozilla/dom/CSSRuleList.h"
-#include "nsIDOMMediaList.h"
 #include "nsIDOMNode.h"
 #include "nsError.h"
 #include "nsCSSParser.h"
 #include "mozilla/css/Loader.h"
 #include "nsNameSpaceManager.h"
 #include "nsXMLNameSpaceMap.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
@@ -144,28 +142,19 @@ CSSStyleSheet::RebuildChildList(css::Rul
     return true;
   }
 
   if (type != css::Rule::IMPORT_RULE) {
     // We're past all the import rules; stop the enumeration.
     return false;
   }
 
-  // XXXbz We really need to decomtaminate all this stuff.  Is there a reason
-  // that I can't just QI to ImportRule and get a CSSStyleSheet
-  // directly from it?
-  nsCOMPtr<nsIDOMCSSImportRule> importRule(do_QueryInterface(aRule));
-  NS_ASSERTION(importRule, "GetType lied");
+  css::ImportRule* importRule = static_cast<css::ImportRule*>(aRule);
+  StyleSheet* sheet = importRule->GetStyleSheet();
 
-  nsCOMPtr<nsIDOMCSSStyleSheet> childSheet;
-  importRule->GetStyleSheet(getter_AddRefs(childSheet));
-
-  // Have to do this QI to be safe, since XPConnect can fake
-  // nsIDOMCSSStyleSheets
-  RefPtr<CSSStyleSheet> sheet = do_QueryObject(childSheet);
   if (!sheet) {
     return true;
   }
 
   (*aBuilder->sheetSlot) = sheet;
   aBuilder->SetParentLinks(*aBuilder->sheetSlot);
   aBuilder->sheetSlot = &(*aBuilder->sheetSlot)->mNext;
   return true;
@@ -439,17 +428,16 @@ CSSStyleSheet::TraverseInner(nsCycleColl
     }
   }
 
   StyleSheet::TraverseInner(cb);
 }
 
 // QueryInterface implementation for CSSStyleSheet
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CSSStyleSheet)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMCSSStyleSheet)
   if (aIID.Equals(NS_GET_IID(CSSStyleSheet)))
     foundInterface = reinterpret_cast<nsISupports*>(this);
   else
 NS_INTERFACE_MAP_END_INHERITING(StyleSheet)
 
 NS_IMPL_ADDREF_INHERITED(CSSStyleSheet, StyleSheet)
 NS_IMPL_RELEASE_INHERITED(CSSStyleSheet, StyleSheet)
 
@@ -893,25 +881,20 @@ CSSStyleSheet::ReparseSheet(const nsAStr
   // detach existing rules (including child sheets via import rules)
   css::LoaderReusableStyleSheets reusableSheets;
   int ruleCount;
   while ((ruleCount = Inner()->mOrderedRules.Count()) != 0) {
     RefPtr<css::Rule> rule = Inner()->mOrderedRules.ObjectAt(ruleCount - 1);
     Inner()->mOrderedRules.RemoveObjectAt(ruleCount - 1);
     rule->SetStyleSheet(nullptr);
     if (rule->GetType() == css::Rule::IMPORT_RULE) {
-      nsCOMPtr<nsIDOMCSSImportRule> importRule(do_QueryInterface(rule));
-      NS_ASSERTION(importRule, "GetType lied");
-
-      nsCOMPtr<nsIDOMCSSStyleSheet> childSheet;
-      importRule->GetStyleSheet(getter_AddRefs(childSheet));
-
-      RefPtr<CSSStyleSheet> cssSheet = do_QueryObject(childSheet);
-      if (cssSheet && cssSheet->GetOriginalURI()) {
-        reusableSheets.AddReusableSheet(cssSheet);
+      auto importRule = static_cast<css::ImportRule*>(rule.get());
+      RefPtr<StyleSheet> sheet = importRule->GetStyleSheet();
+      if (sheet && sheet->GetOriginalURI()) {
+        reusableSheets.AddReusableSheet(sheet);
       }
     }
     RuleRemoved(*rule);
   }
 
   // nuke child sheets list and current namespace map
   for (StyleSheet* child = GetFirstChild(); child; ) {
     NS_ASSERTION(child->mParent == this, "Child sheet is not parented to this!");
--- a/layout/style/CSSSupportsRule.cpp
+++ b/layout/style/CSSSupportsRule.cpp
@@ -8,52 +8,16 @@
 
 #include "mozilla/dom/CSSSupportsRuleBinding.h"
 
 using namespace mozilla::css;
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_ADDREF_INHERITED(mozilla::dom::CSSSupportsRule, css::ConditionRule)
-NS_IMPL_RELEASE_INHERITED(mozilla::dom::CSSSupportsRule, css::ConditionRule)
-
-// QueryInterface implementation for CSSSupportsRule
-NS_INTERFACE_MAP_BEGIN(CSSSupportsRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSGroupingRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSConditionRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSSupportsRule)
-NS_INTERFACE_MAP_END_INHERITING(ConditionRule)
-
-// nsIDOMCSSGroupingRule methods
-NS_IMETHODIMP
-CSSSupportsRule::GetCssRules(nsIDOMCSSRuleList** aRuleList)
-{
-  return GroupRule::GetCssRules(aRuleList);
-}
-
-NS_IMETHODIMP
-CSSSupportsRule::InsertRule(const nsAString & aRule, uint32_t aIndex, uint32_t* _retval)
-{
-  return GroupRule::InsertRule(aRule, aIndex, _retval);
-}
-
-NS_IMETHODIMP
-CSSSupportsRule::DeleteRule(uint32_t aIndex)
-{
-  return GroupRule::DeleteRule(aIndex);
-}
-
-void
-CSSSupportsRule::SetConditionText(const nsAString& aConditionText,
-                                  ErrorResult& aRv)
-{
-  aRv = SetConditionText(aConditionText);
-}
-
 /* virtual */ JSObject*
 CSSSupportsRule::WrapObject(JSContext* aCx,
                             JS::Handle<JSObject*> aGivenProto)
 {
   return CSSSupportsRuleBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
--- a/layout/style/CSSSupportsRule.h
+++ b/layout/style/CSSSupportsRule.h
@@ -3,48 +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/. */
 
 #ifndef mozilla_dom_CSSSupportsRule_h
 #define mozilla_dom_CSSSupportsRule_h
 
 #include "mozilla/css/GroupRule.h"
-#include "nsIDOMCSSSupportsRule.h"
 
 namespace mozilla {
 namespace dom {
 
 class CSSSupportsRule : public css::ConditionRule
-                      , public nsIDOMCSSSupportsRule
 {
 protected:
   using ConditionRule::ConditionRule;
   virtual ~CSSSupportsRule() {}
 
 public:
-  NS_DECL_ISUPPORTS_INHERITED
-
   int32_t GetType() const override { return css::Rule::SUPPORTS_RULE; }
-  using Rule::GetType;
-
-  // nsIDOMCSSGroupingRule interface
-  NS_DECL_NSIDOMCSSGROUPINGRULE
-
-  // nsIDOMCSSConditionRule interface
-  NS_IMETHOD SetConditionText(const nsAString& aConditionText) override = 0;
-
-  // nsIDOMCSSSupportsRule interface
-  NS_DECL_NSIDOMCSSSUPPORTSRULE
 
   // WebIDL interface
-  uint16_t Type() const override { return nsIDOMCSSRule::SUPPORTS_RULE; }
-  // Our XPCOM GetConditionText is OK
-  void SetConditionText(const nsAString& aConditionText,
-                        ErrorResult& aRv) final;
+  uint16_t Type() const override { return CSSRuleBinding::SUPPORTS_RULE; }
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/layout/style/CSSValue.h
+++ b/layout/style/CSSValue.h
@@ -32,16 +32,18 @@ public:
   virtual void SetCssText(const nsAString& aText, mozilla::ErrorResult& aRv) = 0;
   virtual uint16_t CssValueType() const = 0;
 
   // Downcasting
 
   /**
    * Return this as a nsROCSSPrimitiveValue* if its a primitive value, and null
    * otherwise.
+   *
+   * Defined in nsROCSSPrimitiveValue.h.
    */
-  nsROCSSPrimitiveValue *AsPrimitiveValue();
+  inline nsROCSSPrimitiveValue* AsPrimitiveValue();
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -1311,35 +1311,34 @@ FontFaceSet::LogMessage(gfxUserFontEntry
   if (LOG_ENABLED()) {
     LOG(("userfonts (%p) %s", mUserFontSet.get(), message.get()));
   }
 
   // try to give the user an indication of where the rule came from
   nsCSSFontFaceRule* rule = FindRuleForUserFontEntry(aUserFontEntry);
   nsString href;
   nsString text;
-  nsresult rv;
   uint32_t line = 0;
   uint32_t column = 0;
   if (rule) {
-    rv = rule->GetCssText(text);
-    NS_ENSURE_SUCCESS(rv, rv);
+    rule->GetCssText(text);
     StyleSheet* sheet = rule->GetStyleSheet();
     // if the style sheet is removed while the font is loading can be null
     if (sheet) {
       nsCString spec = sheet->GetSheetURI()->GetSpecOrDefault();
       CopyUTF8toUTF16(spec, href);
     } else {
       NS_WARNING("null parent stylesheet for @font-face rule");
       href.AssignLiteral("unknown");
     }
     line = rule->GetLineNumber();
     column = rule->GetColumnNumber();
   }
 
+  nsresult rv;
   nsCOMPtr<nsIScriptError> scriptError =
     do_CreateInstance(NS_SCRIPTERROR_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   uint64_t innerWindowID = mDocument->InnerWindowID();
   rv = scriptError->InitWithWindowID(NS_ConvertUTF8toUTF16(message),
                                      href,         // file
                                      text,         // src line
--- a/layout/style/GroupRule.cpp
+++ b/layout/style/GroupRule.cpp
@@ -339,38 +339,22 @@ GroupRule::AppendRulesToCssText(nsAStrin
     rule->GetCssText(cssText);
     aCssText.AppendLiteral("  ");
     aCssText.Append(cssText);
     aCssText.Append('\n');
   }
   aCssText.Append('}');
 }
 
-// nsIDOMCSSMediaRule or nsIDOMCSSMozDocumentRule methods
-nsresult
-GroupRule::GetCssRules(nsIDOMCSSRuleList* *aRuleList)
-{
-  NS_ADDREF(*aRuleList = CssRules());
-  return NS_OK;
-}
-
 CSSRuleList*
 GroupRule::CssRules()
 {
   return CALL_INNER(mInner, CssRules(this));
 }
 
-nsresult
-GroupRule::InsertRule(const nsAString & aRule, uint32_t aIndex, uint32_t* _retval)
-{
-  ErrorResult rv;
-  *_retval = InsertRule(aRule, aIndex, rv);
-  return rv.StealNSResult();
-}
-
 uint32_t
 GroupRule::InsertRule(const nsAString& aRule, uint32_t aIndex, ErrorResult& aRv)
 {
   StyleSheet* sheet = GetStyleSheet();
   if (NS_WARN_IF(!sheet)) {
     aRv.Throw(NS_ERROR_FAILURE);
     return 0;
   }
@@ -386,24 +370,16 @@ GroupRule::InsertRule(const nsAString& a
   nsresult rv = sheet->InsertRuleIntoGroup(aRule, this, aIndex);
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
     return 0;
   }
   return aIndex;
 }
 
-nsresult
-GroupRule::DeleteRule(uint32_t aIndex)
-{
-  ErrorResult rv;
-  DeleteRule(aIndex, rv);
-  return rv.StealNSResult();
-}
-
 void
 GroupRule::DeleteRule(uint32_t aIndex, ErrorResult& aRv)
 {
   StyleSheet* sheet = GetStyleSheet();
   if (NS_WARN_IF(!sheet)) {
     aRv.Throw(NS_ERROR_FAILURE);
     return;
   }
--- a/layout/style/GroupRule.h
+++ b/layout/style/GroupRule.h
@@ -196,26 +196,18 @@ public:
 
   // WebIDL API
   dom::CSSRuleList* CssRules();
   uint32_t InsertRule(const nsAString& aRule, uint32_t aIndex,
                       ErrorResult& aRv);
   void DeleteRule(uint32_t aIndex, ErrorResult& aRv);
 
 protected:
-  // to help implement nsIDOMCSSRule
   void AppendRulesToCssText(nsAString& aCssText) const;
 
-  // to implement common methods on nsIDOMCSSMediaRule and
-  // nsIDOMCSSMozDocumentRule
-  nsresult GetCssRules(nsIDOMCSSRuleList* *aRuleList);
-  nsresult InsertRule(const nsAString & aRule, uint32_t aIndex,
-                      uint32_t* _retval);
-  nsresult DeleteRule(uint32_t aIndex);
-
   // Must only be called if this is a Gecko GroupRule.
   IncrementalClearCOMRuleArray& GeckoRules() {
     return mInner.as<GeckoGroupRuleRules>().mRules;
   }
   const IncrementalClearCOMRuleArray& GeckoRules() const {
     return mInner.as<GeckoGroupRuleRules>().mRules;
   }
 
@@ -227,20 +219,17 @@ private:
 
 // Implementation of WebIDL CSSConditionRule.
 class ConditionRule : public GroupRule
 {
 protected:
   using GroupRule::GroupRule;
 
 public:
-  // GetConditionText signature matches nsIDOMCSSConditionRule, so subclasses
-  // can implement this easily.  The implementations should never return
-  // anything other than NS_OK.
-  NS_IMETHOD GetConditionText(nsAString& aConditionText) = 0;
+  virtual void GetConditionText(nsAString& aConditionText) = 0;
   virtual void SetConditionText(const nsAString& aConditionText,
                                 ErrorResult& aRv) = 0;
 };
 
 } // namespace css
 } // namespace mozilla
 
 #endif /* mozilla_css_GroupRule_h__ */
--- a/layout/style/ImportRule.h
+++ b/layout/style/ImportRule.h
@@ -34,38 +34,32 @@ class ImportRule final : public dom::CSS
 public:
   ImportRule(nsMediaList* aMedia, const nsString& aURLSpec,
              uint32_t aLineNumber, uint32_t aColumnNumber);
 private:
   // for |Clone|
   ImportRule(const ImportRule& aCopy);
   ~ImportRule();
 public:
+  NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ImportRule, Rule)
-  NS_DECL_ISUPPORTS_INHERITED
-
-  // unhide since nsIDOMCSSImportRule has its own GetStyleSheet and GetMedia
-  using dom::CSSImportRule::GetStyleSheet;
-  using dom::CSSImportRule::GetMedia;
 
   // Rule methods
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
 #endif
   virtual already_AddRefed<Rule> Clone() const override;
 
   void SetSheet(CSSStyleSheet*);
 
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override;
 
-  // nsIDOMCSSImportRule interface
-  NS_IMETHOD GetHref(nsAString& aHref) final;
-
   // WebIDL interface
   void GetCssTextImpl(nsAString& aCssText) const override;
+  void GetHref(nsAString& aHref) const final;
   dom::MediaList* GetMedia() const final;
   StyleSheet* GetStyleSheet() const final;
 
 private:
   nsString  mURLSpec;
   RefPtr<nsMediaList> mMedia;
   RefPtr<CSSStyleSheet> mChildSheet;
 };
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -56,17 +56,16 @@
 #include "mozilla/ConsoleReportCollector.h"
 #include "mozilla/ServoUtils.h"
 #include "mozilla/css/StreamLoader.h"
 
 #ifdef MOZ_XUL
 #include "nsXULPrototypeCache.h"
 #endif
 
-#include "nsIDOMStyleSheet.h"
 #include "nsError.h"
 
 #include "nsIContentSecurityPolicy.h"
 #include "mozilla/dom/SRICheck.h"
 
 #include "mozilla/Encoding.h"
 
 using namespace mozilla::dom;
@@ -2595,17 +2594,17 @@ Loader::StartAlternateLoads()
 NS_IMPL_CYCLE_COLLECTION_CLASS(Loader)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Loader)
   if (tmp->mSheets) {
     for (auto iter = tmp->mSheets->mCompleteSheets.Iter();
          !iter.Done();
          iter.Next()) {
       NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "Sheet cache nsCSSLoader");
-      cb.NoteXPCOMChild(NS_ISUPPORTS_CAST(nsIDOMCSSStyleSheet*, iter.UserData()));
+      cb.NoteXPCOMChild(iter.UserData());
     }
   }
   nsTObserverArray<nsCOMPtr<nsICSSLoaderObserver>>::ForwardIterator
     it(tmp->mObservers);
   while (it.HasMore()) {
     ImplCycleCollectionTraverse(cb, it.GetNext(),
                                 "mozilla::css::Loader.mObservers");
   }
--- a/layout/style/MediaList.cpp
+++ b/layout/style/MediaList.cpp
@@ -15,17 +15,16 @@
 #include "nsCSSParser.h"
 #include "nsMediaList.h"
 
 namespace mozilla {
 namespace dom {
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MediaList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsIDOMMediaList)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(MediaList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(MediaList)
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(MediaList)
 
@@ -83,55 +82,44 @@ MediaList::Create(
   }
 
   nsCSSParser parser;
   RefPtr<nsMediaList> mediaList = new nsMediaList();
   parser.ParseMediaList(aMedia, nullptr, 0, mediaList, aCallerType);
   return mediaList.forget();
 }
 
-NS_IMETHODIMP
+void
 MediaList::GetMediaText(nsAString& aMediaText)
 {
   GetText(aMediaText);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 MediaList::SetMediaText(const nsAString& aMediaText)
 {
-  return DoMediaChange([&]() {
+  DoMediaChange([&]() {
     SetText(aMediaText);
     return NS_OK;
   });
 }
 
-NS_IMETHODIMP
-MediaList::GetLength(uint32_t* aLength)
-{
-  NS_ENSURE_ARG_POINTER(aLength);
-
-  *aLength = Length();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
+void
 MediaList::Item(uint32_t aIndex, nsAString& aReturn)
 {
   bool dummy;
   IndexedGetter(aIndex, dummy, aReturn);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-MediaList::DeleteMedium(const nsAString& aOldMedium)
+void
+MediaList::DeleteMedium(const nsAString& aOldMedium, ErrorResult& aRv)
 {
-  return DoMediaChange([&]() { return Delete(aOldMedium); });
+  aRv = DoMediaChange([&]() { return Delete(aOldMedium); });
 }
 
-NS_IMETHODIMP
-MediaList::AppendMedium(const nsAString& aNewMedium)
+void
+MediaList::AppendMedium(const nsAString& aNewMedium, ErrorResult& aRv)
 {
-  return DoMediaChange([&]() { return Append(aNewMedium); });
+  aRv = DoMediaChange([&]() { return Append(aNewMedium); });
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/layout/style/MediaList.h
+++ b/layout/style/MediaList.h
@@ -9,17 +9,16 @@
 #ifndef mozilla_dom_MediaList_h
 #define mozilla_dom_MediaList_h
 
 #include "mozilla/dom/BindingDeclarations.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/ServoUtils.h"
 #include "mozilla/StyleBackendType.h"
 
-#include "nsIDOMMediaList.h"
 #include "nsWrapperCache.h"
 
 class nsIDocument;
 class nsPresContext;
 class nsMediaQueryResultCacheKey;
 
 namespace mozilla {
 class StyleSheet;
@@ -29,17 +28,17 @@ namespace dom {
 // XXX This class doesn't use the branch dispatch approach that we use
 //     elsewhere for stylo, but instead just relies on virtual call.
 //     That's because this class should not be critical to performance,
 //     and using branch dispatch would make it much more complicated.
 //     Performance critical path should hold a subclass of this class
 //     directly. We may want to determine in the future whether the
 //     above is correct.
 
-class MediaList : public nsIDOMMediaList
+class MediaList : public nsISupports
                 , public nsWrapperCache
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaList)
 
   /**
    * Creates a MediaList backed by the given StyleBackendType.
@@ -59,32 +58,25 @@ public:
   virtual bool Matches(nsPresContext* aPresContext) const = 0;
 
 #ifdef DEBUG
   virtual bool IsServo() const = 0;
 #endif
 
   void SetStyleSheet(StyleSheet* aSheet);
 
-  NS_DECL_NSIDOMMEDIALIST
-
   // WebIDL
-  // XPCOM GetMediaText and SetMediaText are fine.
+  void GetMediaText(nsAString& aMediaText);
+  void SetMediaText(const nsAString& aMediaText);
   virtual uint32_t Length() = 0;
   virtual void IndexedGetter(uint32_t aIndex, bool& aFound,
                              nsAString& aReturn) = 0;
-  // XPCOM Item is fine.
-  void DeleteMedium(const nsAString& aMedium, ErrorResult& aRv)
-  {
-    aRv = DeleteMedium(aMedium);
-  }
-  void AppendMedium(const nsAString& aMedium, ErrorResult& aRv)
-  {
-    aRv = AppendMedium(aMedium);
-  }
+  void Item(uint32_t aIndex, nsAString& aResult);
+  void DeleteMedium(const nsAString& aMedium, ErrorResult& aRv);
+  void AppendMedium(const nsAString& aMedium, ErrorResult& aRv);
 
 protected:
   virtual nsresult Delete(const nsAString& aOldMedium) = 0;
   virtual nsresult Append(const nsAString& aNewMedium) = 0;
 
   virtual ~MediaList() {
     MOZ_ASSERT(!mStyleSheet, "Backpointer should have been cleared");
   }
--- a/layout/style/NameSpaceRule.h
+++ b/layout/style/NameSpaceRule.h
@@ -8,18 +8,16 @@
 
 #ifndef mozilla_css_NameSpaceRule_h__
 #define mozilla_css_NameSpaceRule_h__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/dom/CSSNamespaceRule.h"
 
-#include "nsIDOMCSSRule.h"
-
 class nsAtom;
 
 // IID for the NameSpaceRule class {f0b0dbe1-5031-4a21-b06a-dc141ef2af98}
 #define NS_CSS_NAMESPACE_RULE_IMPL_CID     \
 {0xf0b0dbe1, 0x5031, 0x4a21, {0xb0, 0x6a, 0xdc, 0x14, 0x1e, 0xf2, 0xaf, 0x98}}
 
 
 namespace mozilla {
--- a/layout/style/Rule.cpp
+++ b/layout/style/Rule.cpp
@@ -18,17 +18,16 @@ using namespace mozilla::dom;
 namespace mozilla {
 namespace css {
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(Rule)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(Rule)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Rule)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSRule)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(Rule)
 
 bool
 Rule::IsCCLeaf() const
 {
@@ -75,58 +74,21 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_E
 Rule::SetStyleSheet(StyleSheet* aSheet)
 {
   // We don't reference count this up reference. The style sheet
   // will tell us when it's going away or when we're detached from
   // it.
   mSheet = aSheet;
 }
 
-NS_IMETHODIMP
-Rule::GetParentRule(nsIDOMCSSRule** aParentRule)
-{
-  NS_IF_ADDREF(*aParentRule = mParentRule);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-Rule::GetParentStyleSheet(nsIDOMCSSStyleSheet** aSheet)
-{
-  NS_ENSURE_ARG_POINTER(aSheet);
-
-  NS_IF_ADDREF(*aSheet = GetStyleSheet());
-  return NS_OK;
-}
-
-/* virtual */ css::Rule*
-Rule::GetCSSRule()
-{
-  return this;
-}
-
-NS_IMETHODIMP
-Rule::GetType(uint16_t* aType)
-{
-  *aType = Type();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
+void
 Rule::SetCssText(const nsAString& aCssText)
 {
   // We used to throw for some rule types, but not all.  Specifically, we did
   // not throw for StyleRule.  Let's just always not throw.
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-Rule::GetCssText(nsAString& aCssText)
-{
-  GetCssTextImpl(aCssText);
-  return NS_OK;
 }
 
 Rule*
 Rule::GetParentRule() const
 {
   return mParentRule;
 }
 
--- a/layout/style/Rule.h
+++ b/layout/style/Rule.h
@@ -4,32 +4,32 @@
  * 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/. */
 
 /* base class for all rule types in a CSS style sheet */
 
 #ifndef mozilla_css_Rule_h___
 #define mozilla_css_Rule_h___
 
+#include "mozilla/dom/CSSRuleBinding.h"
 #include "mozilla/StyleSheet.h"
 #include "mozilla/MemoryReporting.h"
 #include "nsISupports.h"
-#include "nsIDOMCSSRule.h"
 #include "nsWrapperCache.h"
 
 class nsIDocument;
 struct nsRuleData;
 template<class T> struct already_AddRefed;
 class nsHTMLCSSStyleSheet;
 
 namespace mozilla {
 namespace css {
 class GroupRule;
 
-class Rule : public nsIDOMCSSRule
+class Rule : public nsISupports
            , public nsWrapperCache
 {
 protected:
   Rule(uint32_t aLineNumber, uint32_t aColumnNumber)
     : mSheet(nullptr),
       mParentRule(nullptr),
       mLineNumber(aLineNumber),
       mColumnNumber(aColumnNumber)
@@ -49,19 +49,16 @@ protected:
 public:
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(Rule)
   // Return true if this rule is known to be a cycle collection leaf, in the
   // sense that it doesn't have any outgoing owning edges.
   virtual bool IsCCLeaf() const MOZ_MUST_OVERRIDE;
 
-  // nsIDOMCSSRule interface
-  NS_DECL_NSIDOMCSSRULE
-
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, int32_t aIndent = 0) const = 0;
 #endif
 
   // The constants in this list must maintain the following invariants:
   //   If a rule of type N must appear before a rule of type M in stylesheets
   //   then N < M
   // Note that CSSStyleSheet::RebuildChildList assumes that no other kinds of
@@ -111,21 +108,21 @@ public:
    */
   virtual already_AddRefed<Rule> Clone() const = 0;
 
   // This is pure virtual because all of Rule's data members are non-owning and
   // thus measured elsewhere.
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const MOZ_MUST_OVERRIDE = 0;
 
-  // WebIDL interface, aka helpers for nsIDOMCSSRule implementation.
+  // WebIDL interface
   virtual uint16_t Type() const = 0;
   virtual void GetCssTextImpl(nsAString& aCssText) const = 0;
   void GetCssText(nsAString& aCssText) const { GetCssTextImpl(aCssText); }
-  // XPCOM SetCssText is OK, since it never throws.
+  void SetCssText(const nsAString& aCssText);
   Rule* GetParentRule() const;
   StyleSheet* GetParentStyleSheet() const { return GetStyleSheet(); }
   nsIDocument* GetParentObject() const { return GetDocument(); }
 
 protected:
   // True if we're known-live for cycle collection purposes.
   bool IsKnownLive() const;
 
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -418,16 +418,17 @@ opaque-types = [
     "mozilla::Maybe",
     "gfxSize",  # <- union { struct { T width; T height; }; T components[2] };
     "gfxSize_Super",  # Ditto.
     "mozilla::StyleAnimationValue",
     "StyleAnimationValue", # pulls in a whole bunch of stuff we don't need in the bindings
     "mozilla::dom::.*Callback", # Pulls in ErrorResult and other things that
                                 # don't align properly on Linux 32-bit
     "mozilla::SchedulerGroup", # Non-standard-layout packing of field into superclass
+    "nsCSSCounterStyleRule_Getter", # thiscall function pointer
 ]
 mapped-generic-types = [
     { generic = true, gecko = "mozilla::ServoUnsafeCell", servo = "::std::cell::UnsafeCell" },
     { generic = true, gecko = "mozilla::ServoCell", servo = "::std::cell::Cell" },
     { generic = false, gecko = "ServoNodeData", servo = "AtomicRefCell<ElementData>" },
     { generic = false, gecko = "mozilla::ServoWritingMode", servo = "::logical_geometry::WritingMode" },
     { generic = false, gecko = "mozilla::ServoCustomPropertiesMap", servo = "Option<::servo_arc::Arc<::custom_properties::CustomPropertiesMap>>" },
     { generic = false, gecko = "mozilla::ServoRuleNode", servo = "Option<::rule_tree::StrongRuleNode>" },
--- a/layout/style/ServoCSSRuleList.cpp
+++ b/layout/style/ServoCSSRuleList.cpp
@@ -51,18 +51,18 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
     if (!aRule->IsCCLeaf()) {
       NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mRules[i]");
       cb.NoteXPCOMChild(aRule);
       // Note about @font-face and @counter-style rule again, since
       // there is an indirect owning edge through Servo's struct that
       // FontFaceRule / CounterStyleRule in Servo owns a Gecko
       // nsCSSFontFaceRule / nsCSSCounterStyleRule object.
       auto type = aRule->Type();
-      if (type == nsIDOMCSSRule::FONT_FACE_RULE ||
-          type == nsIDOMCSSRule::COUNTER_STYLE_RULE) {
+      if (type == CSSRuleBinding::FONT_FACE_RULE ||
+          type == CSSRuleBinding::COUNTER_STYLE_RULE) {
         NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mRawRules[i]");
         cb.NoteXPCOMChild(aRule);
       }
     }
   });
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 void
@@ -86,17 +86,17 @@ ServoCSSRuleList::SetStyleSheet(StyleShe
 css::Rule*
 ServoCSSRuleList::GetRule(uint32_t aIndex)
 {
   uintptr_t rule = mRules[aIndex];
   if (rule <= kMaxRuleType) {
     RefPtr<css::Rule> ruleObj = nullptr;
     switch (rule) {
 #define CASE_RULE(const_, name_)                                            \
-      case nsIDOMCSSRule::const_##_RULE: {                                  \
+      case CSSRuleBinding::const_##_RULE: {                                 \
         uint32_t line = 0, column = 0;                                      \
         RefPtr<RawServo##name_##Rule> rule =                                \
           Servo_CssRules_Get##name_##RuleAt(                                \
               mRawRules, aIndex, &line, &column                             \
           ).Consume();                                                      \
         MOZ_ASSERT(rule);                                                   \
         ruleObj = new Servo##name_##Rule(rule.forget(), line, column);      \
         break;                                                              \
@@ -110,25 +110,25 @@ ServoCSSRuleList::GetRule(uint32_t aInde
       CASE_RULE(DOCUMENT, Document)
       CASE_RULE(IMPORT, Import)
       CASE_RULE(FONT_FEATURE_VALUES, FontFeatureValues)
 #undef CASE_RULE
       // For @font-face and @counter-style rules, the function returns
       // a borrowed Gecko rule object directly, so we don't need to
       // create anything here. But we still need to have the style sheet
       // and parent rule set properly.
-      case nsIDOMCSSRule::FONT_FACE_RULE: {
+      case CSSRuleBinding::FONT_FACE_RULE: {
         ruleObj = Servo_CssRules_GetFontFaceRuleAt(mRawRules, aIndex);
         break;
       }
-      case nsIDOMCSSRule::COUNTER_STYLE_RULE: {
+      case CSSRuleBinding::COUNTER_STYLE_RULE: {
         ruleObj = Servo_CssRules_GetCounterStyleRuleAt(mRawRules, aIndex);
         break;
       }
-      case nsIDOMCSSRule::KEYFRAME_RULE:
+      case CSSRuleBinding::KEYFRAME_RULE:
         MOZ_ASSERT_UNREACHABLE("keyframe rule cannot be here");
         return nullptr;
       default:
         NS_WARNING("stylo: not implemented yet");
         return nullptr;
     }
     ruleObj->SetStyleSheet(mStyleSheet);
     ruleObj->SetParentRule(mParentRule);
--- a/layout/style/ServoDocumentRule.cpp
+++ b/layout/style/ServoDocumentRule.cpp
@@ -60,29 +60,27 @@ ServoDocumentRule::List(FILE* out, int32
   for (int32_t i = 0; i < aIndent; i++) {
     str.AppendLiteral("  ");
   }
   Servo_DocumentRule_Debug(mRawRule, &str);
   fprintf_stderr(out, "%s\n", str.get());
 }
 #endif
 
-// nsIDOMCSSConditionRule methods
-
-NS_IMETHODIMP
+void
 ServoDocumentRule::GetConditionText(nsAString& aConditionText)
 {
   Servo_DocumentRule_GetConditionText(mRawRule, &aConditionText);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-ServoDocumentRule::SetConditionText(const nsAString& aConditionText)
+void
+ServoDocumentRule::SetConditionText(const nsAString& aConditionText,
+                                    ErrorResult& aRv)
 {
-  return NS_ERROR_NOT_IMPLEMENTED;
+  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
 }
 
 /* virtual */ void
 ServoDocumentRule::GetCssTextImpl(nsAString& aCssText) const
 {
   Servo_DocumentRule_GetCssText(mRawRule, &aCssText);
 }
 
--- a/layout/style/ServoDocumentRule.h
+++ b/layout/style/ServoDocumentRule.h
@@ -26,22 +26,21 @@ public:
   bool UseForPresentation(nsPresContext* aPresContext,
                           nsMediaQueryResultCacheKey& aKey) final;
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
 
   RawServoDocumentRule* Raw() const { return mRawRule; }
 
-  // nsIDOMCSSConditionRule interface
-  NS_DECL_NSIDOMCSSCONDITIONRULE
-
   // WebIDL interface
-  void GetCssTextImpl(nsAString& aCssText) const override;
-  using CSSMozDocumentRule::SetConditionText;
+  void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetConditionText(nsAString& aConditionText) final;
+  void SetConditionText(const nsAString& aConditionText,
+                        ErrorResult& aRv) final;
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const override;
 
 private:
   virtual ~ServoDocumentRule();
 
   RefPtr<RawServoDocumentRule> mRawRule;
--- a/layout/style/ServoFontFeatureValuesRule.cpp
+++ b/layout/style/ServoFontFeatureValuesRule.cpp
@@ -21,23 +21,16 @@ ServoFontFeatureValuesRule::ServoFontFea
   , mRawRule(Move(aRawRule))
 {
 }
 
 ServoFontFeatureValuesRule::~ServoFontFeatureValuesRule()
 {
 }
 
-NS_IMPL_ADDREF_INHERITED(ServoFontFeatureValuesRule, CSSFontFeatureValuesRule)
-NS_IMPL_RELEASE_INHERITED(ServoFontFeatureValuesRule, CSSFontFeatureValuesRule)
-
-// QueryInterface implementation for FontFeatureValuesRule
-NS_INTERFACE_MAP_BEGIN(ServoFontFeatureValuesRule)
-NS_INTERFACE_MAP_END_INHERITING(CSSFontFeatureValuesRule)
-
 already_AddRefed<css::Rule>
 ServoFontFeatureValuesRule::Clone() const
 {
   // Rule::Clone is only used when CSSStyleSheetInner is cloned in
   // preparation of being mutated. However, ServoStyleSheet never clones
   // anything, so this method should never be called.
   MOZ_ASSERT_UNREACHABLE("Shouldn't be cloning ServoFontFeatureValuesRule");
   return nullptr;
@@ -68,35 +61,35 @@ ServoFontFeatureValuesRule::List(FILE* o
 void
 ServoFontFeatureValuesRule::GetCssTextImpl(nsAString& aCssText) const
 {
   Servo_FontFeatureValuesRule_GetCssText(mRawRule, &aCssText);
 }
 
 /* CSSFontFeatureValuesRule implementation */
 
-NS_IMETHODIMP
+void
 ServoFontFeatureValuesRule::GetFontFamily(nsAString& aFamilyListStr)
 {
   Servo_FontFeatureValuesRule_GetFontFamily(mRawRule, &aFamilyListStr);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 ServoFontFeatureValuesRule::GetValueText(nsAString& aValueText)
 {
   Servo_FontFeatureValuesRule_GetValueText(mRawRule, &aValueText);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-ServoFontFeatureValuesRule::SetFontFamily(const nsAString& aFontFamily)
+void
+ServoFontFeatureValuesRule::SetFontFamily(const nsAString& aFontFamily,
+                                          ErrorResult& aRv)
 {
-  return NS_ERROR_NOT_IMPLEMENTED;
+  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
 }
 
-NS_IMETHODIMP
-ServoFontFeatureValuesRule::SetValueText(const nsAString& aValueText)
+void
+ServoFontFeatureValuesRule::SetValueText(const nsAString& aValueText,
+                                         ErrorResult& aRv)
 {
-  return NS_ERROR_NOT_IMPLEMENTED;
+  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
 }
 
 } // namespace mozilla
--- a/layout/style/ServoFontFeatureValuesRule.h
+++ b/layout/style/ServoFontFeatureValuesRule.h
@@ -15,25 +15,24 @@
 namespace mozilla {
 
 class ServoFontFeatureValuesRule final : public dom::CSSFontFeatureValuesRule
 {
 public:
   ServoFontFeatureValuesRule(RefPtr<RawServoFontFeatureValuesRule> aRawRule,
                              uint32_t aLine, uint32_t aColumn);
 
-  NS_DECL_ISUPPORTS_INHERITED
-
   RawServoFontFeatureValuesRule* Raw() const { return mRawRule; }
 
-  // nsIDOMCSSFontFeatureValuesRule interface
-  NS_DECL_NSIDOMCSSFONTFEATUREVALUESRULE
-
   // WebIDL interface
   void GetCssTextImpl(nsAString& aCssText) const override;
+  void GetFontFamily(nsAString& aFamily) final;
+  void SetFontFamily(const nsAString& aFamily, mozilla::ErrorResult& aRv) final;
+  void GetValueText(nsAString& aValueText) final;
+  void SetValueText(const nsAString& aValueText, mozilla::ErrorResult& aRv) final;
 
   // Methods of mozilla::css::Rule
   already_AddRefed<css::Rule> Clone() const final;
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const final;
 
   #ifdef DEBUG
     void List(FILE* out = stdout, int32_t aIndent = 0) const final;
--- a/layout/style/ServoImportRule.cpp
+++ b/layout/style/ServoImportRule.cpp
@@ -40,20 +40,20 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(ServoImpo
 NS_IMPL_ADDREF_INHERITED(ServoImportRule, dom::CSSImportRule)
 NS_IMPL_RELEASE_INHERITED(ServoImportRule, dom::CSSImportRule)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(ServoImportRule,
                                                   dom::CSSImportRule)
   // Note the child sheet twice, since the Servo rule also holds a strong
   // reference to it.
   NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mChildSheet");
-  cb.NoteXPCOMChild(static_cast<nsIDOMCSSStyleSheet*>(tmp->mChildSheet));
+  cb.NoteXPCOMChild(tmp->mChildSheet);
   MOZ_ASSERT_IF(tmp->mRawRule,
                 Servo_ImportRule_GetSheet(tmp->mRawRule) == tmp->mChildSheet);
-  cb.NoteXPCOMChild(static_cast<nsIDOMCSSStyleSheet*>(tmp->mChildSheet));
+  cb.NoteXPCOMChild(tmp->mChildSheet);
   NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mRawRule.stylesheet");
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ServoImportRule)
   if (tmp->mChildSheet) {
     tmp->mChildSheet->SetOwnerRule(nullptr);
     tmp->mChildSheet = nullptr;
   }
@@ -91,21 +91,20 @@ ServoImportRule::GetMedia() const
 }
 
 StyleSheet*
 ServoImportRule::GetStyleSheet() const
 {
   return mChildSheet;
 }
 
-NS_IMETHODIMP
-ServoImportRule::GetHref(nsAString& aHref)
+void
+ServoImportRule::GetHref(nsAString& aHref) const
 {
   Servo_ImportRule_GetHref(mRawRule, &aHref);
-  return NS_OK;
 }
 
 /* virtual */ void
 ServoImportRule::GetCssTextImpl(nsAString& aCssText) const
 {
   Servo_ImportRule_GetCssText(mRawRule, &aCssText);
 }
 
--- a/layout/style/ServoImportRule.h
+++ b/layout/style/ServoImportRule.h
@@ -21,31 +21,25 @@ class ServoImportRule final : public dom
 {
 public:
   ServoImportRule(RefPtr<RawServoImportRule> aRawRule,
                   uint32_t aLine, uint32_t aColumn);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServoImportRule, dom::CSSImportRule)
 
-  // unhide since nsIDOMCSSImportRule has its own GetStyleSheet and GetMedia
-  using dom::CSSImportRule::GetStyleSheet;
-  using dom::CSSImportRule::GetMedia;
-
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
   already_AddRefed<css::Rule> Clone() const final;
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const final;
 
-  // nsIDOMCSSImportRule interface
-  NS_IMETHOD GetHref(nsAString& aHref) final;
-
   // WebIDL interface
   void GetCssTextImpl(nsAString& aCssText) const override;
+  void GetHref(nsAString& aHref) const final;
   dom::MediaList* GetMedia() const final;
   StyleSheet* GetStyleSheet() const final;
 
 private:
   ~ServoImportRule();
 
   RefPtr<RawServoImportRule> mRawRule;
   RefPtr<ServoStyleSheet> mChildSheet;
--- a/layout/style/ServoKeyframeRule.cpp
+++ b/layout/style/ServoKeyframeRule.cpp
@@ -24,21 +24,17 @@ public:
     mDecls = new ServoDeclarationBlock(
       Servo_Keyframe_GetStyle(aRule->Raw()).Consume());
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(
     ServoKeyframeDeclaration, nsICSSDeclaration)
 
-  NS_IMETHOD GetParentRule(nsIDOMCSSRule** aParent) final
-  {
-    NS_IF_ADDREF(*aParent = mRule);
-    return NS_OK;
-  }
+  css::Rule* GetParentRule() final { return mRule; }
 
   void DropReference() {
     mRule = nullptr;
     mDecls->SetOwningRule(nullptr);
   }
 
   DeclarationBlock* GetCSSDeclaration(Operation aOperation) final
   {
@@ -183,31 +179,29 @@ ServoKeyframeRule::UpdateRule(Func aCall
 
   aCallback();
 
   if (StyleSheet* sheet = GetStyleSheet()) {
     sheet->RuleChanged(this);
   }
 }
 
-NS_IMETHODIMP
+void
 ServoKeyframeRule::GetKeyText(nsAString& aKeyText)
 {
   Servo_Keyframe_GetKeyText(mRaw, &aKeyText);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 ServoKeyframeRule::SetKeyText(const nsAString& aKeyText)
 {
   NS_ConvertUTF16toUTF8 keyText(aKeyText);
   UpdateRule([this, &keyText]() {
     Servo_Keyframe_SetKeyText(mRaw, &keyText);
   });
-  return NS_OK;
 }
 
 void
 ServoKeyframeRule::GetCssTextImpl(nsAString& aCssText) const
 {
   Servo_Keyframe_GetCssText(mRaw, &aCssText);
 }
 
--- a/layout/style/ServoKeyframeRule.h
+++ b/layout/style/ServoKeyframeRule.h
@@ -30,22 +30,20 @@ public:
   bool IsCCLeaf() const final;
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
   already_AddRefed<mozilla::css::Rule> Clone() const final;
 
   RawServoKeyframe* Raw() const { return mRaw; }
 
-  // nsIDOMCSSKeyframeRule interface
-  NS_IMETHOD GetKeyText(nsAString& aKeyText) final;
-  NS_IMETHOD SetKeyText(const nsAString& aKeyText) final;
-
   // WebIDL interface
   void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetKeyText(nsAString& aKeyText) final;
+  void SetKeyText(const nsAString& aKeyText) final;
   nsICSSDeclaration* Style() final;
 
   size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const final;
 
 private:
   virtual ~ServoKeyframeRule();
 
   friend class ServoKeyframeDeclaration;
--- a/layout/style/ServoKeyframesRule.cpp
+++ b/layout/style/ServoKeyframesRule.cpp
@@ -251,74 +251,70 @@ ServoKeyframesRule::UpdateRule(Func aCal
 
   aCallback();
 
   if (StyleSheet* sheet = GetStyleSheet()) {
     sheet->RuleChanged(this);
   }
 }
 
-NS_IMETHODIMP
-ServoKeyframesRule::GetName(nsAString& aName)
+void
+ServoKeyframesRule::GetName(nsAString& aName) const
 {
   nsAtom* name = Servo_KeyframesRule_GetName(mRawRule);
   aName = nsDependentAtomString(name);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 ServoKeyframesRule::SetName(const nsAString& aName)
 {
   RefPtr<nsAtom> name = NS_Atomize(aName);
   nsAtom* oldName = Servo_KeyframesRule_GetName(mRawRule);
   if (name == oldName) {
-    return NS_OK;
+    return;
   }
 
   UpdateRule([this, &name]() {
     Servo_KeyframesRule_SetName(mRawRule, name.forget().take());
   });
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 ServoKeyframesRule::AppendRule(const nsAString& aRule)
 {
   StyleSheet* sheet = GetStyleSheet();
   if (!sheet) {
     // We cannot parse the rule if we don't have a stylesheet.
-    return NS_OK;
+    return;
   }
 
   NS_ConvertUTF16toUTF8 rule(aRule);
   UpdateRule([this, sheet, &rule]() {
     bool parsedOk = Servo_KeyframesRule_AppendRule(
       mRawRule, sheet->AsServo()->RawContents(), &rule);
     if (parsedOk && mKeyframeList) {
       mKeyframeList->AppendRule();
     }
   });
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 ServoKeyframesRule::DeleteRule(const nsAString& aKey)
 {
   auto index = FindRuleIndexForKey(aKey);
   if (index == kRuleNotFound) {
-    return NS_OK;
+    return;
   }
 
   UpdateRule([this, index]() {
     Servo_KeyframesRule_DeleteRule(mRawRule, index);
     if (mKeyframeList) {
       mKeyframeList->RemoveRule(index);
     }
   });
-  return NS_OK;
 }
 
 /* virtual */ void
 ServoKeyframesRule::GetCssTextImpl(nsAString& aCssText) const
 {
   Servo_KeyframesRule_GetCssText(mRawRule, &aCssText);
 }
 
--- a/layout/style/ServoKeyframesRule.h
+++ b/layout/style/ServoKeyframesRule.h
@@ -26,26 +26,23 @@ public:
   bool IsCCLeaf() const final;
 
   already_AddRefed<css::Rule> Clone() const final;
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
   void SetStyleSheet(StyleSheet* aSheet) final;
 
-  // nsIDOMCSSKeyframesRule interface
-  NS_IMETHOD GetName(nsAString& aName) final;
-  NS_IMETHOD SetName(const nsAString& aName) final;
-  NS_IMETHOD AppendRule(const nsAString& aRule) final;
-  NS_IMETHOD DeleteRule(const nsAString& aKey) final;
-  using nsIDOMCSSKeyframesRule::FindRule;
-
   // WebIDL interface
   void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetName(nsAString& aName) const final;
+  void SetName(const nsAString& aName) final;
   dom::CSSRuleList* CssRules() final;
+  void AppendRule(const nsAString& aRule) final;
+  void DeleteRule(const nsAString& aKey) final;
   dom::CSSKeyframeRule* FindRule(const nsAString& aKey) final;
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const final;
 
 private:
   uint32_t FindRuleIndexForKey(const nsAString& aKey);
 
   template<typename Func>
--- a/layout/style/ServoMediaRule.cpp
+++ b/layout/style/ServoMediaRule.cpp
@@ -86,28 +86,27 @@ ServoMediaRule::List(FILE* out, int32_t 
   for (int32_t i = 0; i < aIndent; i++) {
     str.AppendLiteral("  ");
   }
   Servo_MediaRule_Debug(mRawRule, &str);
   fprintf_stderr(out, "%s\n", str.get());
 }
 #endif
 
-// nsIDOMCSSConditionRule methods
-
-NS_IMETHODIMP
+void
 ServoMediaRule::GetConditionText(nsAString& aConditionText)
 {
-  return Media()->GetMediaText(aConditionText);
+  Media()->GetMediaText(aConditionText);
 }
 
-NS_IMETHODIMP
-ServoMediaRule::SetConditionText(const nsAString& aConditionText)
+void
+ServoMediaRule::SetConditionText(const nsAString& aConditionText,
+                                 ErrorResult& aRv)
 {
-  return Media()->SetMediaText(aConditionText);
+  Media()->SetMediaText(aConditionText);
 }
 
 /* virtual */ void
 ServoMediaRule::GetCssTextImpl(nsAString& aCssText) const
 {
   Servo_MediaRule_GetCssText(mRawRule, &aCssText);
 }
 
--- a/layout/style/ServoMediaRule.h
+++ b/layout/style/ServoMediaRule.h
@@ -30,23 +30,22 @@ public:
                           nsMediaQueryResultCacheKey& aKey) final;
   void SetStyleSheet(StyleSheet* aSheet) override;
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
 
   RawServoMediaRule* Raw() const { return mRawRule; }
 
-  // nsIDOMCSSConditionRule interface
-  NS_DECL_NSIDOMCSSCONDITIONRULE
-
   // WebIDL interface
-  void GetCssTextImpl(nsAString& aCssText) const override;
-  using CSSMediaRule::SetConditionText;
-  dom::MediaList* Media() override;
+  void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetConditionText(nsAString& aConditionText) final;
+  void SetConditionText(const nsAString& aConditionText,
+                        ErrorResult& aRv) final;
+  dom::MediaList* Media() final;
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const override;
 
 private:
   virtual ~ServoMediaRule();
 
   RefPtr<RawServoMediaRule> mRawRule;
--- a/layout/style/ServoPageRule.cpp
+++ b/layout/style/ServoPageRule.cpp
@@ -41,21 +41,20 @@ NS_INTERFACE_MAP_BEGIN(ServoPageRuleDecl
   else
 NS_IMPL_QUERY_TAIL_INHERITING(nsDOMCSSDeclaration)
 
 NS_IMPL_ADDREF_USING_AGGREGATOR(ServoPageRuleDeclaration, Rule())
 NS_IMPL_RELEASE_USING_AGGREGATOR(ServoPageRuleDeclaration, Rule())
 
 /* nsDOMCSSDeclaration implementation */
 
-NS_IMETHODIMP
-ServoPageRuleDeclaration::GetParentRule(nsIDOMCSSRule** aParent)
+css::Rule*
+ServoPageRuleDeclaration::GetParentRule()
 {
-  *aParent = do_AddRef(Rule()).take();
-  return NS_OK;
+  return Rule();
 }
 
 nsINode*
 ServoPageRuleDeclaration::GetParentObject()
 {
   return Rule()->GetDocument();
 }
 
--- a/layout/style/ServoPageRule.h
+++ b/layout/style/ServoPageRule.h
@@ -23,17 +23,17 @@ class DocGroup;
 class ServoDeclarationBlock;
 class ServoPageRule;
 
 class ServoPageRuleDeclaration final : public nsDOMCSSDeclaration
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
 
-  NS_IMETHOD GetParentRule(nsIDOMCSSRule** aParent) final;
+  css::Rule* GetParentRule() final;
   nsINode* GetParentObject() final;
   DocGroup* GetDocGroup() const final;
 
 protected:
   DeclarationBlock* GetCSSDeclaration(Operation aOperation) final;
   nsresult SetCSSDeclaration(DeclarationBlock* aDecl) final;
   nsIDocument* DocToUpdate() final;
   void GetCSSParsingEnvironment(CSSParsingEnvironment& aCSSParseEnv,
--- a/layout/style/ServoStyleRule.cpp
+++ b/layout/style/ServoStyleRule.cpp
@@ -43,21 +43,20 @@ NS_INTERFACE_MAP_BEGIN(ServoStyleRuleDec
   else
 NS_IMPL_QUERY_TAIL_INHERITING(nsDOMCSSDeclaration)
 
 NS_IMPL_ADDREF_USING_AGGREGATOR(ServoStyleRuleDeclaration, Rule())
 NS_IMPL_RELEASE_USING_AGGREGATOR(ServoStyleRuleDeclaration, Rule())
 
 /* nsDOMCSSDeclaration implementation */
 
-NS_IMETHODIMP
-ServoStyleRuleDeclaration::GetParentRule(nsIDOMCSSRule** aParent)
+css::Rule*
+ServoStyleRuleDeclaration::GetParentRule()
 {
-  *aParent = do_AddRef(Rule()).take();
-  return NS_OK;
+  return Rule();
 }
 
 nsINode*
 ServoStyleRuleDeclaration::GetParentObject()
 {
   return Rule()->GetDocument();
 }
 
@@ -121,24 +120,17 @@ ServoStyleRuleDeclaration::GetServoCSSPa
 ServoStyleRule::ServoStyleRule(already_AddRefed<RawServoStyleRule> aRawRule,
                                uint32_t aLine, uint32_t aColumn)
   : BindingStyleRule(aLine, aColumn)
   , mRawRule(aRawRule)
   , mDecls(Servo_StyleRule_GetStyle(mRawRule).Consume())
 {
 }
 
-// QueryInterface implementation for ServoStyleRule
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ServoStyleRule)
-  NS_INTERFACE_MAP_ENTRY(nsICSSStyleRuleDOMWrapper)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSStyleRule)
-NS_INTERFACE_MAP_END_INHERITING(css::Rule)
-
-NS_IMPL_ADDREF_INHERITED(ServoStyleRule, css::Rule)
-NS_IMPL_RELEASE_INHERITED(ServoStyleRule, css::Rule)
+NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(ServoStyleRule, css::Rule)
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(ServoStyleRule)
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(ServoStyleRule, css::Rule)
   // Keep this in sync with IsCCLeaf.
 
   // Trace the wrapper for our declaration.  This just expands out
   // NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER which we can't use
@@ -200,68 +192,50 @@ ServoStyleRule::List(FILE* out, int32_t 
   for (int32_t i = 0; i < aIndent; i++) {
     str.AppendLiteral("  ");
   }
   Servo_StyleRule_Debug(mRawRule, &str);
   fprintf_stderr(out, "%s\n", str.get());
 }
 #endif
 
-/* nsICSSStyleRuleDOMWrapper implementation */
-
-NS_IMETHODIMP
-ServoStyleRule::GetCSSStyleRule(BindingStyleRule **aResult)
-{
-  NS_ADDREF(*aResult = this);
-  return NS_OK;
-}
-
 /* CSSRule implementation */
 
 uint16_t
 ServoStyleRule::Type() const
 {
-  return nsIDOMCSSRule::STYLE_RULE;
+  return CSSRuleBinding::STYLE_RULE;
 }
 
 void
 ServoStyleRule::GetCssTextImpl(nsAString& aCssText) const
 {
   Servo_StyleRule_GetCssText(mRawRule, &aCssText);
 }
 
 nsICSSDeclaration*
 ServoStyleRule::Style()
 {
   return &mDecls;
 }
 
 /* CSSStyleRule implementation */
 
-NS_IMETHODIMP
+void
 ServoStyleRule::GetSelectorText(nsAString& aSelectorText)
 {
   Servo_StyleRule_GetSelectorText(mRawRule, &aSelectorText);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 ServoStyleRule::SetSelectorText(const nsAString& aSelectorText)
 {
   // XXX We need to implement this... But Gecko doesn't have this either
   //     so it's probably okay to leave it unimplemented currently?
   //     See bug 37468 and mozilla::css::StyleRule::SetSelectorText.
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-ServoStyleRule::GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
-{
-  *aStyle = do_AddRef(&mDecls).take();
-  return NS_OK;
 }
 
 uint32_t
 ServoStyleRule::GetSelectorCount()
 {
   uint32_t aCount;
   Servo_StyleRule_GetSelectorCount(mRawRule, &aCount);
 
--- a/layout/style/ServoStyleRule.h
+++ b/layout/style/ServoStyleRule.h
@@ -8,36 +8,33 @@
 
 #ifndef mozilla_ServoStyleRule_h
 #define mozilla_ServoStyleRule_h
 
 #include "mozilla/BindingStyleRule.h"
 #include "mozilla/ServoBindingTypes.h"
 #include "mozilla/WeakPtr.h"
 
-#include "nsICSSStyleRuleDOMWrapper.h"
-#include "nsIDOMCSSStyleRule.h"
-#include "nsICSSStyleRuleDOMWrapper.h"
 #include "nsDOMCSSDeclaration.h"
 
 namespace mozilla {
 
 namespace dom {
 class DocGroup;
 } // namespace dom
 
 class ServoDeclarationBlock;
 class ServoStyleRule;
 
 class ServoStyleRuleDeclaration final : public nsDOMCSSDeclaration
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
 
-  NS_IMETHOD GetParentRule(nsIDOMCSSRule** aParent) final;
+  css::Rule* GetParentRule() final;
   nsINode* GetParentObject() final;
   mozilla::dom::DocGroup* GetDocGroup() const final;
 
 protected:
   DeclarationBlock* GetCSSDeclaration(Operation aOperation) final;
   nsresult SetCSSDeclaration(DeclarationBlock* aDecl) final;
   nsIDocument* DocToUpdate() final;
   void GetCSSParsingEnvironment(CSSParsingEnvironment& aCSSParseEnv,
@@ -55,55 +52,51 @@ private:
 
   inline ServoStyleRule* Rule();
   inline const ServoStyleRule* Rule() const;
 
   RefPtr<ServoDeclarationBlock> mDecls;
 };
 
 class ServoStyleRule final : public BindingStyleRule
-                           , public nsICSSStyleRuleDOMWrapper
                            , public SupportsWeakPtr<ServoStyleRule>
 {
 public:
   ServoStyleRule(already_AddRefed<RawServoStyleRule> aRawRule,
                  uint32_t aLine, uint32_t aColumn);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(ServoStyleRule,
                                                          css::Rule)
   bool IsCCLeaf() const final MOZ_MUST_OVERRIDE;
-  NS_DECL_NSIDOMCSSSTYLERULE
 
   MOZ_DECLARE_WEAKREFERENCE_TYPENAME(ServoStyleRule)
 
-  // nsICSSStyleRuleDOMWrapper
-  NS_IMETHOD GetCSSStyleRule(BindingStyleRule **aResult) override;
-
   uint32_t GetSelectorCount() override;
   nsresult GetSelectorText(uint32_t aSelectorIndex,
                            nsAString& aText) override;
   nsresult GetSpecificity(uint32_t aSelectorIndex,
                           uint64_t* aSpecificity) override;
   nsresult SelectorMatchesElement(dom::Element* aElement,
                                   uint32_t aSelectorIndex,
                                   const nsAString& aPseudo,
                                   bool* aMatches) override;
   NotNull<DeclarationBlock*> GetDeclarationBlock() const override;
 
   // WebIDL interface
   uint16_t Type() const final;
   void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetSelectorText(nsAString& aSelectorText) final;
+  void SetSelectorText(const nsAString& aSelectorText) final;
   nsICSSDeclaration* Style() final;
 
   RawServoStyleRule* Raw() const { return mRawRule; }
 
   // Methods of mozilla::css::Rule
   int32_t GetType() const final { return css::Rule::STYLE_RULE; }
-  using Rule::GetType;
   already_AddRefed<Rule> Clone() const final;
   size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const final;
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
 
 private:
   ~ServoStyleRule() {}
--- a/layout/style/ServoStyleSheet.cpp
+++ b/layout/style/ServoStyleSheet.cpp
@@ -16,17 +16,16 @@
 #include "mozilla/css/GroupRule.h"
 #include "mozilla/dom/CSSRuleList.h"
 #include "mozilla/dom/MediaList.h"
 #include "nsIStyleSheetLinkingElement.h"
 #include "Loader.h"
 
 
 #include "mozAutoDocUpdate.h"
-#include "nsIDOMCSSStyleSheet.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
 // -------------------------------
 // CSS Style Sheet Inner Data Container
 //
@@ -168,17 +167,16 @@ ServoStyleSheet::~ServoStyleSheet()
 void
 ServoStyleSheet::LastRelease()
 {
   DropRuleList();
 }
 
 // QueryInterface implementation for ServoStyleSheet
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ServoStyleSheet)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMCSSStyleSheet)
   if (aIID.Equals(NS_GET_IID(ServoStyleSheet)))
     foundInterface = reinterpret_cast<nsISupports*>(this);
   else
 NS_INTERFACE_MAP_END_INHERITING(StyleSheet)
 
 NS_IMPL_ADDREF_INHERITED(ServoStyleSheet, StyleSheet)
 NS_IMPL_RELEASE_INHERITED(ServoStyleSheet, StyleSheet)
 
--- a/layout/style/ServoSupportsRule.cpp
+++ b/layout/style/ServoSupportsRule.cpp
@@ -61,29 +61,27 @@ ServoSupportsRule::List(FILE* out, int32
   for (int32_t i = 0; i < aIndent; i++) {
     str.AppendLiteral("  ");
   }
   Servo_SupportsRule_Debug(mRawRule, &str);
   fprintf_stderr(out, "%s\n", str.get());
 }
 #endif
 
-// nsIDOMCSSConditionRule methods
-
-NS_IMETHODIMP
+void
 ServoSupportsRule::GetConditionText(nsAString& aConditionText)
 {
   Servo_SupportsRule_GetConditionText(mRawRule, &aConditionText);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-ServoSupportsRule::SetConditionText(const nsAString& aConditionText)
+void
+ServoSupportsRule::SetConditionText(const nsAString& aConditionText,
+                                    ErrorResult& aRv)
 {
-  return NS_ERROR_NOT_IMPLEMENTED;
+  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
 }
 
 /* virtual */ void
 ServoSupportsRule::GetCssTextImpl(nsAString& aCssText) const
 {
   Servo_SupportsRule_GetCssText(mRawRule, &aCssText);
 }
 
--- a/layout/style/ServoSupportsRule.h
+++ b/layout/style/ServoSupportsRule.h
@@ -26,22 +26,21 @@ public:
   bool UseForPresentation(nsPresContext* aPresContext,
                           nsMediaQueryResultCacheKey& aKey) final;
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
 
   RawServoSupportsRule* Raw() const { return mRawRule; }
 
-  // nsIDOMCSSConditionRule interface
-  NS_DECL_NSIDOMCSSCONDITIONRULE
-
   // WebIDL interface
-  void GetCssTextImpl(nsAString& aCssText) const override;
-  using CSSSupportsRule::SetConditionText;
+  void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetConditionText(nsAString& aConditionText) final;
+  void SetConditionText(const nsAString& aConditionText,
+                        ErrorResult& aRv) final;
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const override;
 
 private:
   virtual ~ServoSupportsRule();
 
   RefPtr<RawServoSupportsRule> mRawRule;
--- a/layout/style/StyleRule.cpp
+++ b/layout/style/StyleRule.cpp
@@ -28,19 +28,16 @@
 #include "nsCSSPseudoClasses.h"
 #include "nsCSSAnonBoxes.h"
 #include "nsTArray.h"
 #include "nsContentUtils.h"
 #include "nsError.h"
 #include "mozAutoDocUpdate.h"
 #include "nsRuleProcessorData.h"
 
-class nsIDOMCSSStyleDeclaration;
-class nsIDOMCSSStyleSheet;
-
 using namespace mozilla;
 
 #define NS_IF_CLONE(member_)                                                  \
   PR_BEGIN_MACRO                                                              \
     if (member_) {                                                            \
       result->member_ = member_->Clone();                                     \
       if (!result->member_) {                                                 \
         delete result;                                                        \
@@ -1058,17 +1055,17 @@ protected:
   virtual ~DOMCSSDeclarationImpl(void);
 
   // But we need to allow UniquePtr to delete us.
   friend class mozilla::DefaultDelete<DOMCSSDeclarationImpl>;
 
 public:
   explicit DOMCSSDeclarationImpl(css::StyleRule *aRule);
 
-  NS_IMETHOD GetParentRule(nsIDOMCSSRule **aParent) override;
+  css::Rule* GetParentRule() final { return mRule; }
   virtual DeclarationBlock* GetCSSDeclaration(Operation aOperation) override;
   virtual nsresult SetCSSDeclaration(DeclarationBlock* aDecl) override;
   virtual void GetCSSParsingEnvironment(CSSParsingEnvironment& aCSSParseEnv,
                                         nsIPrincipal* aSubjectPrincipal) override;
   nsDOMCSSDeclaration::ServoCSSParsingEnvironment
   GetServoCSSParsingEnvironment(nsIPrincipal* aSubjectPrincipal) const final;
   virtual nsIDocument* DocToUpdate() override;
 
@@ -1141,25 +1138,16 @@ DOMCSSDeclarationImpl::GetCSSParsingEnvi
 
 nsDOMCSSDeclaration::ServoCSSParsingEnvironment
 DOMCSSDeclarationImpl::GetServoCSSParsingEnvironment(
   nsIPrincipal* aSubjectPrincipal) const
 {
   MOZ_CRASH("GetURLData shouldn't be calling on a Gecko rule");
 }
 
-NS_IMETHODIMP
-DOMCSSDeclarationImpl::GetParentRule(nsIDOMCSSRule **aParent)
-{
-  NS_ENSURE_ARG_POINTER(aParent);
-
-  NS_IF_ADDREF(*aParent = mRule);
-  return NS_OK;
-}
-
 nsresult
 DOMCSSDeclarationImpl::SetCSSDeclaration(DeclarationBlock* aDecl)
 {
   NS_PRECONDITION(mRule,
          "can only be called when |GetCSSDeclaration| returned a declaration");
 
   nsCOMPtr<nsIDocument> doc;
   RefPtr<CSSStyleSheet> sheet = mRule->GetStyleSheet();
@@ -1186,43 +1174,28 @@ DOMCSSDeclarationImpl::DocToUpdate()
 // -- StyleRule ------------------------------------
 
 namespace mozilla {
 namespace css {
 
 uint16_t
 StyleRule::Type() const
 {
-  return nsIDOMCSSRule::STYLE_RULE;
-}
-
-NS_IMETHODIMP
-StyleRule::GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
-{
-  NS_ADDREF(*aStyle = Style());
-  return NS_OK;
+  return CSSRuleBinding::STYLE_RULE;
 }
 
 nsICSSDeclaration*
 StyleRule::Style()
 {
   if (!mDOMDeclaration) {
     mDOMDeclaration.reset(new DOMCSSDeclarationImpl(this));
   }
   return mDOMDeclaration.get();
 }
 
-NS_IMETHODIMP
-StyleRule::GetCSSStyleRule(BindingStyleRule **aResult)
-{
-  *aResult = this;
-  NS_ADDREF(*aResult);
-  return NS_OK;
-}
-
 StyleRule::StyleRule(nsCSSSelectorList* aSelector,
                      Declaration* aDeclaration,
                      uint32_t aLineNumber,
                      uint32_t aColumnNumber)
   : BindingStyleRule(aLineNumber, aColumnNumber),
     mSelector(aSelector),
     mDeclaration(aDeclaration)
 {
@@ -1258,18 +1231,16 @@ StyleRule::DropReferences()
 // QueryInterface implementation for StyleRule
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(StyleRule)
   if (aIID.Equals(NS_GET_IID(mozilla::css::StyleRule))) {
     *aInstancePtr = this;
     NS_ADDREF_THIS();
     return NS_OK;
   }
   else
-  NS_INTERFACE_MAP_ENTRY(nsICSSStyleRuleDOMWrapper)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSStyleRule)
 NS_INTERFACE_MAP_END_INHERITING(Rule)
 
 NS_IMPL_ADDREF_INHERITED(StyleRule, Rule)
 NS_IMPL_RELEASE_INHERITED(StyleRule, Rule)
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(StyleRule)
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(StyleRule, Rule)
   // Keep this in sync with IsCCLeaf.
@@ -1384,33 +1355,31 @@ StyleRule::GetCssTextImpl(nsAString& aCs
     nsAutoString   tempString;
     mDeclaration->ToString( tempString );
     aCssText.Append( tempString );
   }
   aCssText.Append(char16_t(' '));
   aCssText.Append(char16_t('}'));
 }
 
-NS_IMETHODIMP
+void
 StyleRule::GetSelectorText(nsAString& aSelectorText)
 {
   if (mSelector)
     mSelector->ToString(aSelectorText, GetStyleSheet());
   else
     aSelectorText.Truncate();
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 StyleRule::SetSelectorText(const nsAString& aSelectorText)
 {
   // XXX TBI - get a parser and re-parse the selectors,
   // XXX then need to re-compute the cascade
   // XXX and dirty sheet
-  return NS_OK;
 }
 
 /* virtual */ size_t
 StyleRule::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
   size_t n = aMallocSizeOf(this);
   n += mSelector ? mSelector->SizeOfIncludingThis(aMallocSizeOf) : 0;
   n += mDeclaration ? mDeclaration->SizeOfIncludingThis(aMallocSizeOf) : 0;
--- a/layout/style/StyleRule.h
+++ b/layout/style/StyleRule.h
@@ -17,17 +17,16 @@
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/StyleSetHandle.h"
 #include "mozilla/UniquePtr.h"
 
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsCSSPseudoElements.h"
 #include "nsIStyleRule.h"
-#include "nsICSSStyleRuleDOMWrapper.h"
 
 class nsAtom;
 struct nsCSSSelectorList;
 
 namespace mozilla {
 enum class CSSPseudoClassType : uint8_t;
 class CSSStyleSheet;
 } // namespace mozilla
@@ -313,62 +312,57 @@ private:
 class DOMCSSDeclarationImpl;
 
 namespace mozilla {
 namespace css {
 
 class Declaration;
 
 class StyleRule final : public BindingStyleRule
-                      , public nsICSSStyleRuleDOMWrapper
 {
  public:
   StyleRule(nsCSSSelectorList* aSelector,
             Declaration *aDeclaration,
             uint32_t aLineNumber, uint32_t aColumnNumber);
 private:
   // for |Clone|
   StyleRule(const StyleRule& aCopy);
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_CSS_STYLE_RULE_IMPL_CID)
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(StyleRule, Rule)
   bool IsCCLeaf() const override;
 
-  NS_DECL_NSIDOMCSSSTYLERULE
-
-  // nsICSSStyleRuleDOMWrapper
-  NS_IMETHOD GetCSSStyleRule(BindingStyleRule **aResult) override;
-
   uint32_t GetSelectorCount() override;
   nsresult GetSelectorText(uint32_t aSelectorIndex,
                                    nsAString& aText) override;
   nsresult GetSpecificity(uint32_t aSelectorIndex,
                           uint64_t* aSpecificity) override;
   nsresult SelectorMatchesElement(dom::Element* aElement,
                                   uint32_t aSelectorIndex,
                                   const nsAString& aPseudo,
                                   bool* aMatches) override;
   mozilla::NotNull<DeclarationBlock*> GetDeclarationBlock() const override;
 
   // WebIDL interface
   uint16_t Type() const override;
   void GetCssTextImpl(nsAString& aCssText) const override;
+  void GetSelectorText(nsAString& aSelectorText) final;
+  void SetSelectorText(const nsAString& aSelectorText) final;
   nsICSSDeclaration* Style() override;
 
   // null for style attribute
   nsCSSSelectorList* Selector() { return mSelector; }
 
   Declaration* GetDeclaration() const { return mDeclaration; }
 
   void SetDeclaration(Declaration* aDecl);
 
   int32_t GetType() const override;
-  using Rule::GetType;
 
   CSSStyleSheet* GetStyleSheet() const
   {
     StyleSheet* sheet = Rule::GetStyleSheet();
     return sheet ? sheet->AsGecko() : nullptr;
   }
 
   already_AddRefed<Rule> Clone() const override;
--- a/layout/style/StyleSheet.cpp
+++ b/layout/style/StyleSheet.cpp
@@ -131,27 +131,26 @@ StyleSheet::TraverseInner(nsCycleCollect
   // because otherwise there are no JS wrappers for anything in the inner.
   if (mInner->mSheets.Length() != 1) {
     return;
   }
 
   StyleSheet* childSheet = GetFirstChild();
   while (childSheet) {
     NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "child sheet");
-    cb.NoteXPCOMChild(NS_ISUPPORTS_CAST(nsIDOMCSSStyleSheet*, childSheet));
+    cb.NoteXPCOMChild(childSheet);
     childSheet = childSheet->mNext;
   }
 }
 
 // QueryInterface implementation for StyleSheet
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(StyleSheet)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsICSSLoaderObserver)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMStyleSheet)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSStyleSheet)
+  NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(StyleSheet)
 // We want to disconnect from our inner as soon as our refcount drops to zero,
 // without waiting for async deletion by the cycle collector.  Otherwise we
 // might end up cloning the inner if someone mutates another sheet that shares
 // it with us, even though there is only one such sheet and we're about to go
 // away.  This situation arises easily with sheet preloading.
@@ -309,120 +308,50 @@ StyleSheet::ChildSheetListBuilder::Repar
 {
   for (StyleSheet *child = aFirstChild; child; child = child->mNext) {
     child->mParent = aPrimarySheet;
     child->SetAssociatedDocument(aPrimarySheet->mDocument,
                                  aPrimarySheet->mDocumentAssociationMode);
   }
 }
 
-// nsIDOMStyleSheet interface
-
-NS_IMETHODIMP
+void
 StyleSheet::GetType(nsAString& aType)
 {
   aType.AssignLiteral("text/css");
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-StyleSheet::GetDisabled(bool* aDisabled)
-{
-  *aDisabled = Disabled();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
+void
 StyleSheet::SetDisabled(bool aDisabled)
 {
   // DOM method, so handle BeginUpdate/EndUpdate
   MOZ_AUTO_DOC_UPDATE(mDocument, UPDATE_STYLE, true);
   SetEnabled(!aDisabled);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-StyleSheet::GetOwnerNode(nsIDOMNode** aOwnerNode)
-{
-  nsCOMPtr<nsIDOMNode> ownerNode = do_QueryInterface(GetOwnerNode());
-  ownerNode.forget(aOwnerNode);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-StyleSheet::GetHref(nsAString& aHref)
+void
+StyleSheet::GetHref(nsAString& aHref, ErrorResult& aRv)
 {
   if (nsIURI* sheetURI = SheetInfo().mOriginalSheetURI) {
     nsAutoCString str;
     nsresult rv = sheetURI->GetSpec(str);
-    NS_ENSURE_SUCCESS(rv, rv);
+    if (NS_FAILED(rv)) {
+      aRv.Throw(rv);
+      return;
+    }
     CopyUTF8toUTF16(str, aHref);
   } else {
     SetDOMStringToNull(aHref);
   }
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 StyleSheet::GetTitle(nsAString& aTitle)
 {
   aTitle.Assign(mTitle);
-  return NS_OK;
-}
-
-// nsIDOMStyleSheet interface
-
-NS_IMETHODIMP
-StyleSheet::GetParentStyleSheet(nsIDOMStyleSheet** aParentStyleSheet)
-{
-  NS_ENSURE_ARG_POINTER(aParentStyleSheet);
-  NS_IF_ADDREF(*aParentStyleSheet = GetParentStyleSheet());
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-StyleSheet::GetMedia(nsIDOMMediaList** aMedia)
-{
-  NS_ADDREF(*aMedia = Media());
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-StyleSheet::GetOwnerRule(nsIDOMCSSRule** aOwnerRule)
-{
-  NS_IF_ADDREF(*aOwnerRule = GetDOMOwnerRule());
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-StyleSheet::GetCssRules(nsIDOMCSSRuleList** aCssRules)
-{
-  ErrorResult rv;
-  nsCOMPtr<nsIDOMCSSRuleList> rules =
-    GetCssRules(*nsContentUtils::SubjectPrincipal(), rv);
-  rules.forget(aCssRules);
-  return rv.StealNSResult();
-}
-
-NS_IMETHODIMP
-StyleSheet::InsertRule(const nsAString& aRule, uint32_t aIndex,
-                       uint32_t* aReturn)
-{
-  ErrorResult rv;
-  *aReturn =
-    InsertRule(aRule, aIndex, *nsContentUtils::SubjectPrincipal(), rv);
-  return rv.StealNSResult();
-}
-
-NS_IMETHODIMP
-StyleSheet::DeleteRule(uint32_t aIndex)
-{
-  ErrorResult rv;
-  DeleteRule(aIndex, *nsContentUtils::SubjectPrincipal(), rv);
-  return rv.StealNSResult();
 }
 
 void
 StyleSheet::WillDirty()
 {
   if (mInner->mComplete) {
     EnsureUniqueInner();
   }
--- a/layout/style/StyleSheet.h
+++ b/layout/style/StyleSheet.h
@@ -8,19 +8,17 @@
 #define mozilla_StyleSheet_h
 
 #include "mozilla/css/SheetParsingMode.h"
 #include "mozilla/dom/CSSStyleSheetBinding.h"
 #include "mozilla/net/ReferrerPolicy.h"
 #include "mozilla/StyleBackendType.h"
 #include "mozilla/CORSMode.h"
 #include "mozilla/ServoUtils.h"
-
 #include "nsICSSLoaderObserver.h"
-#include "nsIDOMCSSStyleSheet.h"
 #include "nsWrapperCache.h"
 
 class nsIDocument;
 class nsINode;
 class nsIPrincipal;
 class nsCSSRuleProcessor;
 
 namespace mozilla {
@@ -41,33 +39,31 @@ class SRIMetadata;
 namespace css {
 class GroupRule;
 class Rule;
 }
 
 /**
  * Superclass for data common to CSSStyleSheet and ServoStyleSheet.
  */
-class StyleSheet : public nsIDOMCSSStyleSheet
-                 , public nsICSSLoaderObserver
+class StyleSheet : public nsICSSLoaderObserver
                  , public nsWrapperCache
 {
 protected:
   StyleSheet(StyleBackendType aType, css::SheetParsingMode aParsingMode);
   StyleSheet(const StyleSheet& aCopy,
              StyleSheet* aParentToUse,
              dom::CSSImportRule* aOwnerRuleToUse,
              nsIDocument* aDocumentToUse,
              nsINode* aOwningNodeToUse);
   virtual ~StyleSheet();
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(StyleSheet,
-                                                         nsIDOMCSSStyleSheet)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StyleSheet)
 
   /**
    * The different changes that a stylesheet may go through.
    *
    * Used by the StyleSets in order to handle more efficiently some kinds of
    * changes.
    */
   enum class ChangeType {
@@ -95,17 +91,17 @@ public:
 
   /**
    * Set the stylesheet to be enabled.  This may or may not make it
    * applicable.  Note that this WILL inform the sheet's document of
    * its new applicable state if the state changes but WILL NOT call
    * BeginUpdate() or EndUpdate() on the document -- calling those is
    * the caller's responsibility.  This allows use of SetEnabled when
    * batched updates are desired.  If you want updates handled for
-   * you, see nsIDOMStyleSheet::SetDisabled().
+   * you, see SetDisabled().
    */
   void SetEnabled(bool aEnabled);
 
   MOZ_DECL_STYLO_METHODS(CSSStyleSheet, ServoStyleSheet)
 
   // Whether the sheet is for an inline <style> element.
   inline bool IsInline() const;
 
@@ -201,24 +197,24 @@ public:
   inline void GetIntegrity(dom::SRIMetadata& aResult) const;
 
   virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const;
 #ifdef DEBUG
   virtual void List(FILE* aOut = stdout, int32_t aIndex = 0) const;
 #endif
 
   // WebIDL StyleSheet API
-  // The XPCOM GetType is fine for WebIDL.
-  // The XPCOM GetHref is fine for WebIDL
+  void GetType(nsAString& aType);
+  void GetHref(nsAString& aHref, ErrorResult& aRv);
   // GetOwnerNode is defined above.
   inline StyleSheet* GetParentStyleSheet() const;
-  // The XPCOM GetTitle is fine for WebIDL.
+  void GetTitle(nsAString& aTitle);
   dom::MediaList* Media();
   bool Disabled() const { return mDisabled; }
-  // The XPCOM SetDisabled is fine for WebIDL.
+  void SetDisabled(bool aDisabled);
   void GetSourceMapURL(nsAString& aTitle);
   void SetSourceMapURL(const nsAString& aSourceMapURL);
   void SetSourceMapURLFromComment(const nsAString& aSourceMapURLFromComment);
   void GetSourceURL(nsAString& aSourceURL);
   void SetSourceURL(const nsAString& aSourceURL);
 
   // WebIDL CSSStyleSheet API
   // Can't be inline because we can't include ImportRule here.  And can't be
@@ -233,33 +229,16 @@ public:
   void DeleteRule(uint32_t aIndex,
                   nsIPrincipal& aSubjectPrincipal,
                   ErrorResult& aRv);
 
   // WebIDL miscellaneous bits
   inline dom::ParentObject GetParentObject() const;
   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
 
-  // nsIDOMStyleSheet interface
-  NS_IMETHOD GetType(nsAString& aType) final;
-  NS_IMETHOD GetDisabled(bool* aDisabled) final;
-  NS_IMETHOD SetDisabled(bool aDisabled) final;
-  NS_IMETHOD GetOwnerNode(nsIDOMNode** aOwnerNode) final;
-  NS_IMETHOD GetParentStyleSheet(nsIDOMStyleSheet** aParentStyleSheet) final;
-  NS_IMETHOD GetHref(nsAString& aHref) final;
-  NS_IMETHOD GetTitle(nsAString& aTitle) final;
-  NS_IMETHOD GetMedia(nsIDOMMediaList** aMedia) final;
-
-  // nsIDOMCSSStyleSheet
-  NS_IMETHOD GetOwnerRule(nsIDOMCSSRule** aOwnerRule) final;
-  NS_IMETHOD GetCssRules(nsIDOMCSSRuleList** aCssRules) final;
-  NS_IMETHOD InsertRule(const nsAString& aRule, uint32_t aIndex,
-                      uint32_t* aReturn) final;
-  NS_IMETHOD DeleteRule(uint32_t aIndex) final;
-
   // Changes to sheets should be inside of a WillDirty-DidDirty pair.
   // However, the calls do not need to be matched; it's ok to call
   // WillDirty and then make no change and skip the DidDirty call.
   void WillDirty();
   virtual void DidDirty() {}
 
   // Called when a rule changes from CSSOM.
   //
--- a/layout/style/StyleSheetInlines.h
+++ b/layout/style/StyleSheetInlines.h
@@ -84,17 +84,17 @@ StyleSheet::GetParentStyleSheet() const
 }
 
 dom::ParentObject
 StyleSheet::GetParentObject() const
 {
   if (mOwningNode) {
     return dom::ParentObject(mOwningNode);
   }
-  return dom::ParentObject(static_cast<nsIDOMCSSStyleSheet*>(mParent), mParent);
+  return dom::ParentObject(mParent);
 }
 
 nsIPrincipal*
 StyleSheet::Principal() const
 {
   return SheetInfo().mPrincipal;
 }
 
--- a/layout/style/moz.build
+++ b/layout/style/moz.build
@@ -50,17 +50,16 @@ EXPORTS += [
     'nsCSSRuleProcessor.h',
     'nsCSSScanner.h',
     'nsCSSValue.h',
     'nsDOMCSSAttrDeclaration.h',
     'nsDOMCSSDeclaration.h',
     'nsDOMCSSRGBColor.h',
     'nsICSSDeclaration.h',
     'nsICSSLoaderObserver.h',
-    'nsICSSStyleRuleDOMWrapper.h',
     'nsIStyleRule.h',
     'nsIStyleRuleProcessor.h',
     'nsLayoutStylesheetCache.h',
     'nsMediaFeatures.h',
     'nsMediaList.h',
     'nsRuleData.h',
     'nsRuleNode.h',
     'nsRuleProcessorData.h',
--- a/layout/style/nsCSSCounterStyleRule.cpp
+++ b/layout/style/nsCSSCounterStyleRule.cpp
@@ -41,25 +41,18 @@ nsCSSCounterStyleRule::Clone() const
 
 nsCSSCounterStyleRule::Getter const
 nsCSSCounterStyleRule::kGetters[] = {
 #define CSS_COUNTER_DESC(name_, method_) &nsCSSCounterStyleRule::Get##method_,
 #include "nsCSSCounterDescList.h"
 #undef CSS_COUNTER_DESC
 };
 
-NS_IMPL_ADDREF_INHERITED(nsCSSCounterStyleRule, mozilla::css::Rule)
-NS_IMPL_RELEASE_INHERITED(nsCSSCounterStyleRule, mozilla::css::Rule)
-
-// QueryInterface implementation for nsCSSCounterStyleRule
-// If this ever gets its own cycle-collection bits, reevaluate our IsCCLeaf
+// If this class gets its own cycle-collection bits, reevaluate our IsCCLeaf
 // implementation.
-NS_INTERFACE_MAP_BEGIN(nsCSSCounterStyleRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSCounterStyleRule)
-NS_INTERFACE_MAP_END_INHERITING(mozilla::css::Rule)
 
 bool
 nsCSSCounterStyleRule::IsCCLeaf() const
 {
   return Rule::IsCCLeaf();
 }
 
 #ifdef DEBUG
@@ -86,17 +79,17 @@ nsCSSCounterStyleRule::List(FILE* out, i
 nsCSSCounterStyleRule::GetType() const
 {
   return Rule::COUNTER_STYLE_RULE;
 }
 
 uint16_t
 nsCSSCounterStyleRule::Type() const
 {
-  return nsIDOMCSSRule::COUNTER_STYLE_RULE;
+  return CSSRuleBinding::COUNTER_STYLE_RULE;
 }
 
 void
 nsCSSCounterStyleRule::GetCssTextImpl(nsAString& aCssText) const
 {
   aCssText.AssignLiteral(u"@counter-style ");
   nsDependentAtomString name(mName);
   nsStyleUtil::AppendEscapedCSSIdent(name, aCssText);
@@ -115,27 +108,25 @@ nsCSSCounterStyleRule::GetCssTextImpl(ns
       aCssText.AppendLiteral(u": ");
       aCssText.Append(tmp);
       aCssText.AppendLiteral(u";\n");
     }
   }
   aCssText.AppendLiteral(u"}");
 }
 
-// nsIDOMCSSCounterStyleRule methods
-NS_IMETHODIMP
+void
 nsCSSCounterStyleRule::GetName(nsAString& aName)
 {
   aName.Truncate();
   nsDependentAtomString name(mName);
   nsStyleUtil::AppendEscapedCSSIdent(name, aName);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 nsCSSCounterStyleRule::SetName(const nsAString& aName)
 {
   RefPtr<nsAtom> name;
 
   nsIDocument* doc = GetDocument();
   if (!doc || doc->IsStyledByServo()) {
     name = ServoCSSParser::ParseCounterStyleName(aName);
   } else {
@@ -147,17 +138,16 @@ nsCSSCounterStyleRule::SetName(const nsA
     MOZ_AUTO_DOC_UPDATE(doc, UPDATE_STYLE, true);
 
     mName = name;
 
     if (StyleSheet* sheet = GetStyleSheet()) {
       sheet->RuleChanged(this);
     }
   }
-  return NS_OK;
 }
 
 int32_t
 nsCSSCounterStyleRule::GetSystem() const
 {
   const nsCSSValue& system = GetDesc(eCSSCounterDesc_System);
   switch (system.GetUnit()) {
     case eCSSUnit_Enumerated:
@@ -190,73 +180,70 @@ nsCSSCounterStyleRule::SetDesc(nsCSSCoun
   mValues[aDescID] = aValue;
   mGeneration++;
 
   if (StyleSheet* sheet = GetStyleSheet()) {
     sheet->RuleChanged(this);
   }
 }
 
-NS_IMETHODIMP
+void
 nsCSSCounterStyleRule::GetSystem(nsAString& aSystem)
 {
   const nsCSSValue& value = GetDesc(eCSSCounterDesc_System);
   if (value.GetUnit() == eCSSUnit_Null) {
     aSystem.Truncate();
-    return NS_OK;
+    return;
   }
 
   aSystem = NS_ConvertASCIItoUTF16(nsCSSProps::ValueToKeyword(
           GetSystem(), nsCSSProps::kCounterSystemKTable));
   if (value.GetUnit() == eCSSUnit_Pair) {
     aSystem.Append(' ');
     GetSystemArgument().AppendToString(eCSSProperty_UNKNOWN, aSystem);
   }
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 nsCSSCounterStyleRule::GetSymbols(nsAString& aSymbols)
 {
   const nsCSSValue& value = GetDesc(eCSSCounterDesc_Symbols);
 
   aSymbols.Truncate();
   if (value.GetUnit() == eCSSUnit_List) {
     for (const nsCSSValueList* item = value.GetListValue();
          item; item = item->mNext) {
       item->mValue.AppendToString(eCSSProperty_UNKNOWN, aSymbols);
       if (item->mNext) {
         aSymbols.Append(' ');
       }
     }
   }
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 nsCSSCounterStyleRule::GetAdditiveSymbols(nsAString& aSymbols)
 {
   const nsCSSValue& value = GetDesc(eCSSCounterDesc_AdditiveSymbols);
 
   aSymbols.Truncate();
   if (value.GetUnit() == eCSSUnit_PairList) {
     for (const nsCSSValuePairList* item = value.GetPairListValue();
          item; item = item->mNext) {
       item->mXValue.AppendToString(eCSSProperty_UNKNOWN, aSymbols);
       aSymbols.Append(' ');
       item->mYValue.AppendToString(eCSSProperty_UNKNOWN, aSymbols);
       if (item->mNext) {
         aSymbols.AppendLiteral(", ");
       }
     }
   }
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 nsCSSCounterStyleRule::GetRange(nsAString& aRange)
 {
   const nsCSSValue& value = GetDesc(eCSSCounterDesc_Range);
 
   switch (value.GetUnit()) {
     case eCSSUnit_Auto:
       aRange.AssignLiteral(u"auto");
       break;
@@ -288,20 +275,19 @@ nsCSSCounterStyleRule::GetRange(nsAStrin
           aRange.AppendLiteral(", ");
         }
       }
       break;
 
     default:
       aRange.Truncate();
   }
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 nsCSSCounterStyleRule::GetSpeakAs(nsAString& aSpeakAs)
 {
   const nsCSSValue& value = GetDesc(eCSSCounterDesc_SpeakAs);
 
   switch (value.GetUnit()) {
     case eCSSUnit_Enumerated:
       switch (value.GetIntValue()) {
         case NS_STYLE_COUNTER_SPEAKAS_BULLETS:
@@ -330,42 +316,40 @@ nsCSSCounterStyleRule::GetSpeakAs(nsAStr
     case eCSSUnit_Null:
       aSpeakAs.Truncate();
       break;
 
     default:
       NS_NOTREACHED("Unknown speech synthesis");
       aSpeakAs.Truncate();
   }
-  return NS_OK;
 }
 
-nsresult
+void
 nsCSSCounterStyleRule::GetDescriptor(nsCSSCounterDesc aDescID,
                                      nsAString& aValue)
 {
   NS_ASSERTION(aDescID == eCSSCounterDesc_Negative ||
                aDescID == eCSSCounterDesc_Prefix ||
                aDescID == eCSSCounterDesc_Suffix ||
                aDescID == eCSSCounterDesc_Pad ||
                aDescID == eCSSCounterDesc_Fallback,
                "Unexpected descriptor");
   const nsCSSValue& value = GetDesc(aDescID);
   aValue.Truncate();
   if (value.GetUnit() != eCSSUnit_Null) {
     value.AppendToString(eCSSProperty_UNKNOWN, aValue);
   }
-  return NS_OK;
 }
 
 #define CSS_COUNTER_DESC_GETTER(name_)                    \
-NS_IMETHODIMP                                             \
+void                                                      \
 nsCSSCounterStyleRule::Get##name_(nsAString& a##name_)    \
 {                                                         \
-  return GetDescriptor(eCSSCounterDesc_##name_, a##name_);\
+  GetDescriptor(eCSSCounterDesc_##name_, a##name_);       \
 }
 CSS_COUNTER_DESC_GETTER(Negative)
 CSS_COUNTER_DESC_GETTER(Prefix)
 CSS_COUNTER_DESC_GETTER(Suffix)
 CSS_COUNTER_DESC_GETTER(Pad)
 CSS_COUNTER_DESC_GETTER(Fallback)
 #undef CSS_COUNTER_DESC_GETTER
 
@@ -403,17 +387,17 @@ nsCSSCounterStyleRule::CheckDescValue(in
           return true;
       }
 
     default:
       return true;
   }
 }
 
-nsresult
+void
 nsCSSCounterStyleRule::SetDescriptor(nsCSSCounterDesc aDescID,
                                      const nsAString& aValue)
 {
   nsCSSValue value;
   bool ok;
 
   StyleSheet* sheet = GetStyleSheet();
 
@@ -433,25 +417,23 @@ nsCSSCounterStyleRule::SetDescriptor(nsC
     nsIPrincipal* principal = sheet ? sheet->Principal() : nullptr;
     ok = parser.ParseCounterDescriptor(aDescID, aValue, nullptr,
                                        baseURL, principal, value);
   }
 
   if (ok && CheckDescValue(GetSystem(), aDescID, value)) {
     SetDesc(aDescID, value);
   }
-
-  return NS_OK;
 }
 
 #define CSS_COUNTER_DESC_SETTER(name_)                        \
-NS_IMETHODIMP                                                 \
+void                                                          \
 nsCSSCounterStyleRule::Set##name_(const nsAString& a##name_)  \
 {                                                             \
-  return SetDescriptor(eCSSCounterDesc_##name_, a##name_);    \
+  SetDescriptor(eCSSCounterDesc_##name_, a##name_);           \
 }
 CSS_COUNTER_DESC_SETTER(System)
 CSS_COUNTER_DESC_SETTER(Symbols)
 CSS_COUNTER_DESC_SETTER(AdditiveSymbols)
 CSS_COUNTER_DESC_SETTER(Negative)
 CSS_COUNTER_DESC_SETTER(Prefix)
 CSS_COUNTER_DESC_SETTER(Suffix)
 CSS_COUNTER_DESC_SETTER(Range)
--- a/layout/style/nsCSSCounterStyleRule.h
+++ b/layout/style/nsCSSCounterStyleRule.h
@@ -4,74 +4,67 @@
  * 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 nsCSSCounterStyleRule_h
 #define nsCSSCounterStyleRule_h
 
 #include "mozilla/css/Rule.h"
 #include "nsCSSValue.h"
-#include "nsIDOMCSSCounterStyleRule.h"
 
-class nsCSSCounterStyleRule final : public mozilla::css::Rule,
-                                    public nsIDOMCSSCounterStyleRule
+class nsCSSCounterStyleRule final : public mozilla::css::Rule
 {
 public:
   explicit nsCSSCounterStyleRule(nsAtom* aName,
                                  uint32_t aLineNumber, uint32_t aColumnNumber)
     : mozilla::css::Rule(aLineNumber, aColumnNumber)
     , mName(aName)
     , mGeneration(0)
   {
     MOZ_ASSERT(aName, "Must have non-null name");
   }
 
 private:
   nsCSSCounterStyleRule(const nsCSSCounterStyleRule& aCopy);
   ~nsCSSCounterStyleRule();
 
 public:
-  NS_DECL_ISUPPORTS_INHERITED
   virtual bool IsCCLeaf() const override;
 
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
 #endif
   virtual int32_t GetType() const override;
-  using Rule::GetType;
   virtual already_AddRefed<mozilla::css::Rule> Clone() const override;
 
-  // nsIDOMCSSCounterStyleRule
-  NS_DECL_NSIDOMCSSCOUNTERSTYLERULE
-
   // WebIDL interface
   uint16_t Type() const override;
   void GetCssTextImpl(nsAString& aCssText) const override;
-  // The XPCOM GetName is OK
-  // The XPCOM SetName is OK
-  // The XPCOM GetSystem is OK
-  // The XPCOM SetSystem is OK
-  // The XPCOM GetSymbols is OK
-  // The XPCOM SetSymbols is OK
-  // The XPCOM GetAdditiveSymbols is OK
-  // The XPCOM SetAdditiveSymbols is OK
-  // The XPCOM GetNegative is OK
-  // The XPCOM SetNegative is OK
-  // The XPCOM GetPrefix is OK
-  // The XPCOM SetPrefix is OK
-  // The XPCOM GetSuffix is OK
-  // The XPCOM SetSuffix is OK
-  // The XPCOM GetRange is OK
-  // The XPCOM SetRange is OK
-  // The XPCOM GetPad is OK
-  // The XPCOM SetPad is OK
-  // The XPCOM GetSpeakAs is OK
-  // The XPCOM SetSpeakAs is OK
-  // The XPCOM GetFallback is OK
-  // The XPCOM SetFallback is OK
+  void GetName(nsAString& aName);
+  void SetName(const nsAString& aName);
+  void GetSystem(nsAString& aSystem);
+  void SetSystem(const nsAString& aSystem);
+  void GetSymbols(nsAString& aSymbols);
+  void SetSymbols(const nsAString& aSymbols);
+  void GetAdditiveSymbols(nsAString& aAdditiveSymbols);
+  void SetAdditiveSymbols(const nsAString& aAdditiveSymbols);
+  void GetNegative(nsAString& aNegative);
+  void SetNegative(const nsAString& aNegative);
+  void GetPrefix(nsAString& aPrefix);
+  void SetPrefix(const nsAString& aPrefix);
+  void GetSuffix(nsAString& aSuffix);
+  void SetSuffix(const nsAString& aSuffix);
+  void GetRange(nsAString& aRange);
+  void SetRange(const nsAString& aRange);
+  void GetPad(nsAString& aPad);
+  void SetPad(const nsAString& aPad);
+  void GetSpeakAs(nsAString& aSpeakAs);
+  void SetSpeakAs(const nsAString& aSpeakAs);
+  void GetFallback(nsAString& aFallback);
+  void SetFallback(const nsAString& aFallback);
 
   // This function is only used to check whether a non-empty value, which has
   // been accepted by parser, is valid for the given system and descriptor.
   static bool CheckDescValue(int32_t aSystem,
                              nsCSSCounterDesc aDescID,
                              const nsCSSValue& aValue);
 
   nsAtom* Name() const { return mName; }
@@ -94,17 +87,17 @@ public:
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
 
 private:
   typedef decltype(&nsCSSCounterStyleRule::GetSymbols) Getter;
   static const Getter kGetters[];
 
-  nsresult GetDescriptor(nsCSSCounterDesc aDescID, nsAString& aValue);
-  nsresult SetDescriptor(nsCSSCounterDesc aDescID, const nsAString& aValue);
+  void GetDescriptor(nsCSSCounterDesc aDescID, nsAString& aValue);
+  void SetDescriptor(nsCSSCounterDesc aDescID, const nsAString& aValue);
 
   RefPtr<nsAtom> mName;
   nsCSSValue mValues[eCSSCounterDesc_COUNT];
   uint32_t   mGeneration;
 };
 
 #endif // nsCSSCounterStyleRule_h
--- a/layout/style/nsCSSFontFaceRule.cpp
+++ b/layout/style/nsCSSFontFaceRule.cpp
@@ -40,17 +40,16 @@ CSSFontFaceDescriptors::Get(nsCSSFontDes
   MOZ_ASSERT(aFontDescID > eCSSFontDesc_UNKNOWN &&
              aFontDescID < eCSSFontDesc_COUNT);
   return this->*CSSFontFaceDescriptors::Fields[aFontDescID];
 }
 
 // QueryInterface implementation for nsCSSFontFaceStyleDecl
 NS_INTERFACE_MAP_BEGIN(nsCSSFontFaceStyleDecl)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSStyleDeclaration)
   NS_INTERFACE_MAP_ENTRY(nsICSSDeclaration)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   // We forward the cycle collection interfaces to ContainingRule(), which is
   // never null (in fact, we're part of that object!)
   if (aIID.Equals(NS_GET_IID(nsCycleCollectionISupports)) ||
       aIID.Equals(NS_GET_IID(nsXPCOMCycleCollectionParticipant))) {
     return ContainingRule()->QueryInterface(aIID, aInstancePtr);
   }
@@ -236,27 +235,16 @@ nsCSSFontFaceStyleDecl::GetLength(uint32
        id = nsCSSFontDesc(id + 1))
     if (mDescriptors.Get(id).GetUnit() != eCSSUnit_Null)
       len++;
 
   *aLength = len;
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsCSSFontFaceStyleDecl::Item(uint32_t aIndex, nsAString& aReturn)
-{
-  bool found;
-  IndexedGetter(aIndex, found, aReturn);
-  if (!found) {
-    aReturn.Truncate();
-  }
-  return NS_OK;
-}
-
 void
 nsCSSFontFaceStyleDecl::IndexedGetter(uint32_t index, bool& aFound, nsAString & aResult)
 {
   int32_t nset = -1;
   for (nsCSSFontDesc id = nsCSSFontDesc(eCSSFontDesc_UNKNOWN + 1);
        id < eCSSFontDesc_COUNT;
        id = nsCSSFontDesc(id + 1)) {
     if (mDescriptors.Get(id).GetUnit() != eCSSUnit_Null) {
@@ -266,21 +254,20 @@ nsCSSFontFaceStyleDecl::IndexedGetter(ui
         aResult.AssignASCII(nsCSSProps::GetStringValue(id).get());
         return;
       }
     }
   }
   aFound = false;
 }
 
-NS_IMETHODIMP
-nsCSSFontFaceStyleDecl::GetParentRule(nsIDOMCSSRule** aParentRule)
+css::Rule*
+nsCSSFontFaceStyleDecl::GetParentRule()
 {
-  NS_IF_ADDREF(*aParentRule = ContainingRule());
-  return NS_OK;
+  return ContainingRule();
 }
 
 NS_IMETHODIMP
 nsCSSFontFaceStyleDecl::GetPropertyValue(const nsCSSPropertyID aPropID,
                                          nsAString& aValue)
 {
   return
     GetPropertyValue(NS_ConvertUTF8toUTF16(nsCSSProps::GetStringValue(aPropID)),
@@ -321,19 +308,16 @@ nsCSSFontFaceStyleDecl::WrapObject(JSCon
 
 /* virtual */ already_AddRefed<css::Rule>
 nsCSSFontFaceRule::Clone() const
 {
   RefPtr<css::Rule> clone = new nsCSSFontFaceRule(*this);
   return clone.forget();
 }
 
-NS_IMPL_ADDREF_INHERITED(nsCSSFontFaceRule, mozilla::css::Rule)
-NS_IMPL_RELEASE_INHERITED(nsCSSFontFaceRule, mozilla::css::Rule)
-
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsCSSFontFaceRule)
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(nsCSSFontFaceRule,
                                                mozilla::css::Rule)
   // Keep this in sync with IsCCLeaf.
 
   // Trace the wrapper for our declaration.  This just expands out
   // NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER which we can't use
@@ -361,20 +345,17 @@ nsCSSFontFaceRule::IsCCLeaf() const
 {
   if (!Rule::IsCCLeaf()) {
     return false;
   }
 
   return !mDecl.PreservingWrapper();
 }
 
-// QueryInterface implementation for nsCSSFontFaceRule
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsCSSFontFaceRule)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMCSSFontFaceRule)
-NS_INTERFACE_MAP_END_INHERITING(Rule)
+NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(nsCSSFontFaceRule, mozilla::css::Rule)
 
 #ifdef DEBUG
 void
 nsCSSFontFaceRule::List(FILE* out, int32_t aIndent) const
 {
   nsCString baseInd, descInd;
   for (int32_t indent = aIndent; --indent >= 0; ) {
     baseInd.AppendLiteral("  ");
@@ -405,17 +386,17 @@ nsCSSFontFaceRule::List(FILE* out, int32
 nsCSSFontFaceRule::GetType() const
 {
   return Rule::FONT_FACE_RULE;
 }
 
 uint16_t
 nsCSSFontFaceRule::Type() const
 {
-  return nsIDOMCSSRule::FONT_FACE_RULE;
+  return CSSRuleBinding::FONT_FACE_RULE;
 }
 
 void
 nsCSSFontFaceRule::GetCssTextImpl(nsAString& aCssText) const
 {
   nsAutoString propText;
   mDecl.GetCssTextImpl(propText);
 
@@ -425,23 +406,16 @@ nsCSSFontFaceRule::GetCssTextImpl(nsAStr
 }
 
 nsICSSDeclaration*
 nsCSSFontFaceRule::Style()
 {
   return &mDecl;
 }
 
-NS_IMETHODIMP
-nsCSSFontFaceRule::GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
-{
-  NS_IF_ADDREF(*aStyle = &mDecl);
-  return NS_OK;
-}
-
 // Arguably these should forward to nsCSSFontFaceStyleDecl methods.
 void
 nsCSSFontFaceRule::SetDesc(nsCSSFontDesc aDescID, nsCSSValue const & aValue)
 {
   NS_PRECONDITION(aDescID > eCSSFontDesc_UNKNOWN &&
                   aDescID < eCSSFontDesc_COUNT,
                   "aDescID out of range in nsCSSFontFaceRule::SetDesc");
 
--- a/layout/style/nsCSSFontFaceRule.h
+++ b/layout/style/nsCSSFontFaceRule.h
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsCSSFontFaceRule_h
 #define nsCSSFontFaceRule_h
 
 #include "mozilla/css/Rule.h"
 #include "nsCSSValue.h"
 #include "nsICSSDeclaration.h"
-#include "nsIDOMCSSFontFaceRule.h"
 
 namespace mozilla {
 
 namespace dom {
 class DocGroup;
 } // namespace dom
 
 struct CSSFontFaceDescriptors
@@ -70,18 +69,17 @@ protected:
 
 private:
   // NOT TO BE IMPLEMENTED
   // This object cannot be allocated on its own, only as part of
   // nsCSSFontFaceRule.
   void* operator new(size_t size) CPP_THROW_NEW;
 };
 
-class nsCSSFontFaceRule final : public mozilla::css::Rule,
-                                public nsIDOMCSSFontFaceRule
+class nsCSSFontFaceRule final : public mozilla::css::Rule
 {
 public:
   nsCSSFontFaceRule(uint32_t aLineNumber, uint32_t aColumnNumber)
     : mozilla::css::Rule(aLineNumber, aColumnNumber)
   {
   }
 
   nsCSSFontFaceRule(const nsCSSFontFaceRule& aCopy)
@@ -94,22 +92,18 @@ public:
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(nsCSSFontFaceRule,
                                                          mozilla::css::Rule)
   virtual bool IsCCLeaf() const override;
 
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
 #endif
   virtual int32_t GetType() const override;
-  using Rule::GetType;
   virtual already_AddRefed<mozilla::css::Rule> Clone() const override;
 
-  // nsIDOMCSSFontFaceRule interface
-  NS_DECL_NSIDOMCSSFONTFACERULE
-
   void SetDesc(nsCSSFontDesc aDescID, nsCSSValue const & aValue);
   void GetDesc(nsCSSFontDesc aDescID, nsCSSValue & aValue);
 
   // WebIDL interface
   uint16_t Type() const override;
   void GetCssTextImpl(nsAString& aCssText) const override;
   nsICSSDeclaration* Style();
 
--- a/layout/style/nsCSSRules.cpp
+++ b/layout/style/nsCSSRules.cpp
@@ -18,17 +18,16 @@
 #include "mozilla/css/NameSpaceRule.h"
 
 #include "nsString.h"
 #include "nsAtom.h"
 
 #include "nsCSSProps.h"
 
 #include "nsCOMPtr.h"
-#include "nsIDOMCSSStyleSheet.h"
 #include "nsMediaList.h"
 #include "mozilla/dom/CSSRuleList.h"
 #include "nsIDocument.h"
 #include "nsPresContext.h"
 
 #include "nsContentUtils.h"
 #include "nsError.h"
 #include "nsStyleUtil.h"
@@ -179,21 +178,20 @@ ImportRule::GetMedia() const
 }
 
 StyleSheet*
 ImportRule::GetStyleSheet() const
 {
   return mChildSheet;
 }
 
-NS_IMETHODIMP
-ImportRule::GetHref(nsAString & aHref)
+void
+ImportRule::GetHref(nsAString& aHref) const
 {
   aHref = mURLSpec;
-  return NS_OK;
 }
 
 /* virtual */ size_t
 ImportRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   return aMallocSizeOf(this);
 
   // Measurement of the following members may be added later if DMD finds it is
@@ -318,39 +316,33 @@ MediaRule::Media()
 void
 MediaRule::GetCssTextImpl(nsAString& aCssText) const
 {
   aCssText.AssignLiteral("@media ");
   AppendConditionText(aCssText);
   GroupRule::AppendRulesToCssText(aCssText);
 }
 
-// nsIDOMCSSConditionRule methods
-NS_IMETHODIMP
+void
 MediaRule::GetConditionText(nsAString& aConditionText)
 {
   aConditionText.Truncate(0);
   AppendConditionText(aConditionText);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-MediaRule::SetConditionText(const nsAString& aConditionText)
+void
+MediaRule::SetConditionText(const nsAString& aConditionText,
+                            ErrorResult& aRv)
 {
   if (!mMedia) {
-    RefPtr<nsMediaList> media = new nsMediaList();
-    media->SetStyleSheet(GetStyleSheet());
-    nsresult rv = media->SetMediaText(aConditionText);
-    if (NS_SUCCEEDED(rv)) {
-      mMedia = media;
-    }
-    return rv;
+    mMedia = new nsMediaList();
+    mMedia->SetStyleSheet(GetStyleSheet());
   }
 
-  return mMedia->SetMediaText(aConditionText);
+  mMedia->SetMediaText(aConditionText);
 }
 
 // GroupRule interface
 /* virtual */ bool
 MediaRule::UseForPresentation(nsPresContext* aPresContext,
                               nsMediaQueryResultCacheKey& aKey)
 {
   if (mMedia) {
@@ -455,29 +447,28 @@ DocumentRule::Clone() const
 void
 DocumentRule::GetCssTextImpl(nsAString& aCssText) const
 {
   aCssText.AssignLiteral("@-moz-document ");
   AppendConditionText(aCssText);
   GroupRule::AppendRulesToCssText(aCssText);
 }
 
-// nsIDOMCSSConditionRule methods
-NS_IMETHODIMP
+void
 DocumentRule::GetConditionText(nsAString& aConditionText)
 {
   aConditionText.Truncate(0);
   AppendConditionText(aConditionText);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-DocumentRule::SetConditionText(const nsAString& aConditionText)
+void
+DocumentRule::SetConditionText(const nsAString& aConditionText,
+                               ErrorResult& aRv)
 {
-  return NS_ERROR_NOT_IMPLEMENTED;
+  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
 }
 
 // GroupRule interface
 /* virtual */ bool
 DocumentRule::UseForPresentation(nsPresContext* aPresContext,
                                  nsMediaQueryResultCacheKey& aKey)
 {
   return UseForPresentation(aPresContext);
@@ -650,25 +641,16 @@ NameSpaceRule::SizeOfIncludingThis(Mallo
 
 /* virtual */ already_AddRefed<css::Rule>
 nsCSSFontFeatureValuesRule::Clone() const
 {
   RefPtr<css::Rule> clone = new nsCSSFontFeatureValuesRule(*this);
   return clone.forget();
 }
 
-NS_IMPL_ADDREF_INHERITED(nsCSSFontFeatureValuesRule, dom::CSSFontFeatureValuesRule)
-NS_IMPL_RELEASE_INHERITED(nsCSSFontFeatureValuesRule, dom::CSSFontFeatureValuesRule)
-
-// QueryInterface implementation for nsCSSFontFeatureValuesRule
-// If this ever gets its own cycle-collection bits, reevaluate our IsCCLeaf
-// implementation.
-NS_INTERFACE_MAP_BEGIN(nsCSSFontFeatureValuesRule)
-NS_INTERFACE_MAP_END_INHERITING(dom::CSSFontFeatureValuesRule)
-
 static void
 FeatureValuesToString(
   const nsTArray<gfxFontFeatureValueSet::FeatureValues>& aFeatureValues,
   nsAString& aOutStr)
 {
   uint32_t i, n;
 
   // append values
@@ -741,40 +723,40 @@ nsCSSFontFeatureValuesRule::List(FILE* o
   nsAutoCString indentStr;
   for (i = aIndent; --i >= 0; ) {
     indentStr.AppendLiteral("  ");
   }
   fprintf_stderr(out, "%s%s\n", indentStr.get(), utf8.get());
 }
 #endif
 
-NS_IMETHODIMP
+void
 nsCSSFontFeatureValuesRule::GetFontFamily(nsAString& aFamilyListStr)
 {
   nsStyleUtil::AppendEscapedCSSFontFamilyList(mFamilyList, aFamilyListStr);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 nsCSSFontFeatureValuesRule::GetValueText(nsAString& aValueText)
 {
   FeatureValuesToString(mFeatureValues, aValueText);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-nsCSSFontFeatureValuesRule::SetFontFamily(const nsAString& aFontFamily)
+void
+nsCSSFontFeatureValuesRule::SetFontFamily(const nsAString& aFontFamily,
+                                          ErrorResult& aRv)
 {
-  return NS_ERROR_NOT_IMPLEMENTED;
+  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
 }
 
-NS_IMETHODIMP
-nsCSSFontFeatureValuesRule::SetValueText(const nsAString& aValueText)
+void
+nsCSSFontFeatureValuesRule::SetValueText(const nsAString& aValueText,
+                                         ErrorResult& aRv)
 {
-  return NS_ERROR_NOT_IMPLEMENTED;
+  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
 }
 
 void
 nsCSSFontFeatureValuesRule::GetCssTextImpl(nsAString& aCssText) const
 {
   FontFeatureValuesRuleToString(mFamilyList, mFeatureValues, aCssText);
 }
 
@@ -875,23 +857,20 @@ nsCSSKeyframeStyleDeclaration::GetCSSPar
 
 nsDOMCSSDeclaration::ServoCSSParsingEnvironment
 nsCSSKeyframeStyleDeclaration::GetServoCSSParsingEnvironment(
   nsIPrincipal* aSubjectPrincipal) const
 {
   MOZ_CRASH("GetURLData shouldn't be calling on a Gecko rule");
 }
 
-NS_IMETHODIMP
-nsCSSKeyframeStyleDeclaration::GetParentRule(nsIDOMCSSRule **aParent)
+css::Rule*
+nsCSSKeyframeStyleDeclaration::GetParentRule()
 {
-  NS_ENSURE_ARG_POINTER(aParent);
-
-  NS_IF_ADDREF(*aParent = mRule);
-  return NS_OK;
+  return mRule;
 }
 
 nsresult
 nsCSSKeyframeStyleDeclaration::SetCSSDeclaration(DeclarationBlock* aDecl)
 {
   MOZ_ASSERT(aDecl, "must be non-null");
   mRule->ChangeDeclaration(aDecl->AsGecko());
   return NS_OK;
@@ -1002,21 +981,20 @@ nsCSSKeyframeRule::GetCssTextImpl(nsAStr
   DoGetKeyText(aCssText);
   aCssText.AppendLiteral(" { ");
   nsAutoString tmp;
   mDeclaration->ToString(tmp);
   aCssText.Append(tmp);
   aCssText.AppendLiteral(" }");
 }
 
-NS_IMETHODIMP
+void
 nsCSSKeyframeRule::GetKeyText(nsAString& aKeyText)
 {
   DoGetKeyText(aKeyText);
-  return NS_OK;
 }
 
 void
 nsCSSKeyframeRule::DoGetKeyText(nsAString& aKeyText) const
 {
   aKeyText.Truncate();
   uint32_t i = 0, i_end = mKeys.Length();
   MOZ_ASSERT(i_end != 0, "must have some keys");
@@ -1025,38 +1003,36 @@ nsCSSKeyframeRule::DoGetKeyText(nsAStrin
     aKeyText.Append(char16_t('%'));
     if (++i == i_end) {
       break;
     }
     aKeyText.AppendLiteral(", ");
   }
 }
 
-NS_IMETHODIMP
+void
 nsCSSKeyframeRule::SetKeyText(const nsAString& aKeyText)
 {
   nsCSSParser parser;
 
   InfallibleTArray<float> newSelectors;
   // FIXME: pass filename and line number
   if (!parser.ParseKeyframeSelectorString(aKeyText, nullptr, 0, newSelectors)) {
     // for now, we don't do anything if the parse fails
-    return NS_OK;
+    return;
   }
 
   nsIDocument* doc = GetDocument();
   MOZ_AUTO_DOC_UPDATE(doc, UPDATE_STYLE, true);
 
   newSelectors.SwapElements(mKeys);
 
   if (StyleSheet* sheet = GetStyleSheet()) {
     sheet->RuleChanged(this);
   }
-
-  return NS_OK;
 }
 
 nsICSSDeclaration*
 nsCSSKeyframeRule::Style()
 {
   if (!mDOMDeclaration) {
     mDOMDeclaration = new nsCSSKeyframeStyleDeclaration(this);
   }
@@ -1114,23 +1090,16 @@ nsCSSKeyframesRule::~nsCSSKeyframesRule(
 
 /* virtual */ already_AddRefed<css::Rule>
 nsCSSKeyframesRule::Clone() const
 {
   RefPtr<css::Rule> clone = new nsCSSKeyframesRule(*this);
   return clone.forget();
 }
 
-NS_IMPL_ADDREF_INHERITED(nsCSSKeyframesRule, dom::CSSKeyframesRule)
-NS_IMPL_RELEASE_INHERITED(nsCSSKeyframesRule, dom::CSSKeyframesRule)
-
-// QueryInterface implementation for nsCSSKeyframesRule
-NS_INTERFACE_MAP_BEGIN(nsCSSKeyframesRule)
-NS_INTERFACE_MAP_END_INHERITING(dom::CSSKeyframesRule)
-
 #ifdef DEBUG
 void
 nsCSSKeyframesRule::List(FILE* out, int32_t aIndent) const
 {
   nsAutoCString indentStr;
   for (int32_t indent = aIndent; --indent >= 0; ) {
     indentStr.AppendLiteral("  ");
   }
@@ -1154,43 +1123,40 @@ nsCSSKeyframesRule::GetCssTextImpl(nsASt
   for (const Rule* rule : GeckoRules()) {
     static_cast<const nsCSSKeyframeRule*>(rule)->GetCssText(tmp);
     aCssText.Append(tmp);
     aCssText.Append('\n');
   }
   aCssText.Append('}');
 }
 
-NS_IMETHODIMP
-nsCSSKeyframesRule::GetName(nsAString& aName)
+void
+nsCSSKeyframesRule::GetName(nsAString& aName) const
 {
   mName->ToString(aName);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 nsCSSKeyframesRule::SetName(const nsAString& aName)
 {
   if (mName->Equals(aName)) {
-    return NS_OK;
+    return;
   }
 
   nsIDocument* doc = GetDocument();
   MOZ_AUTO_DOC_UPDATE(doc, UPDATE_STYLE, true);
 
   mName = NS_Atomize(aName);
 
   if (StyleSheet* sheet = GetStyleSheet()) {
     sheet->RuleChanged(this);
   }
-
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 nsCSSKeyframesRule::AppendRule(const nsAString& aRule)
 {
   // The spec is confusing, and I think we should just append the rule,
   // which also turns out to match WebKit:
   // http://lists.w3.org/Archives/Public/www-style/2011Apr/0034.html
   nsCSSParser parser;
 
   // FIXME: pass filename and line number
@@ -1201,18 +1167,16 @@ nsCSSKeyframesRule::AppendRule(const nsA
     MOZ_AUTO_DOC_UPDATE(doc, UPDATE_STYLE, true);
 
     AppendStyleRule(rule);
 
     if (StyleSheet* sheet = GetStyleSheet()) {
       sheet->RuleChanged(this);
     }
   }
-
-  return NS_OK;
 }
 
 static const uint32_t RULE_NOT_FOUND = uint32_t(-1);
 
 uint32_t
 nsCSSKeyframesRule::FindRuleIndexForKey(const nsAString& aKey)
 {
   nsCSSParser parser;
@@ -1231,31 +1195,30 @@ nsCSSKeyframesRule::FindRuleIndexForKey(
         return i;
       }
     }
   }
 
   return RULE_NOT_FOUND;
 }
 
-NS_IMETHODIMP
+void
 nsCSSKeyframesRule::DeleteRule(const nsAString& aKey)
 {
   uint32_t index = FindRuleIndexForKey(aKey);
   if (index != RULE_NOT_FOUND) {
     nsIDocument* doc = GetDocument();
     MOZ_AUTO_DOC_UPDATE(doc, UPDATE_STYLE, true);
 
     DeleteStyleRuleAt(index);
 
     if (StyleSheet* sheet = GetStyleSheet()) {
       sheet->RuleChanged(this);
     }
   }
-  return NS_OK;
 }
 
 nsCSSKeyframeRule*
 nsCSSKeyframesRule::FindRule(const nsAString& aKey)
 {
   uint32_t index = FindRuleIndexForKey(aKey);
   if (index == RULE_NOT_FOUND) {
     return nullptr;
@@ -1318,23 +1281,20 @@ nsCSSPageStyleDeclaration::GetCSSParsing
 
 nsDOMCSSDeclaration::ServoCSSParsingEnvironment
 nsCSSPageStyleDeclaration::GetServoCSSParsingEnvironment(
   nsIPrincipal* aSubjectPrincipal) const
 {
   MOZ_CRASH("GetURLData shouldn't be calling on a Gecko rule");
 }
 
-NS_IMETHODIMP
-nsCSSPageStyleDeclaration::GetParentRule(nsIDOMCSSRule** aParent)
+css::Rule*
+nsCSSPageStyleDeclaration::GetParentRule()
 {
-  NS_ENSURE_ARG_POINTER(aParent);
-
-  NS_IF_ADDREF(*aParent = mRule);
-  return NS_OK;
+  return mRule;
 }
 
 nsresult
 nsCSSPageStyleDeclaration::SetCSSDeclaration(DeclarationBlock* aDecl)
 {
   MOZ_ASSERT(aDecl, "must be non-null");
   mRule->ChangeDeclaration(aDecl->AsGecko());
   return NS_OK;
@@ -1541,28 +1501,27 @@ NS_INTERFACE_MAP_END_INHERITING(dom::CSS
 void
 CSSSupportsRule::GetCssTextImpl(nsAString& aCssText) const
 {
   aCssText.AssignLiteral("@supports ");
   aCssText.Append(mCondition);
   css::GroupRule::AppendRulesToCssText(aCssText);
 }
 
-// nsIDOMCSSConditionRule methods
-NS_IMETHODIMP
+void
 CSSSupportsRule::GetConditionText(nsAString& aConditionText)
 {
   aConditionText.Assign(mCondition);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-CSSSupportsRule::SetConditionText(const nsAString& aConditionText)
+void
+CSSSupportsRule::SetConditionText(const nsAString& aConditionText,
+                                  ErrorResult& aRv)
 {
-  return NS_ERROR_NOT_IMPLEMENTED;
+  aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
 }
 
 /* virtual */ size_t
 CSSSupportsRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t n = aMallocSizeOf(this);
   n += css::GroupRule::SizeOfExcludingThis(aMallocSizeOf);
   n += mCondition.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
--- a/layout/style/nsCSSRules.h
+++ b/layout/style/nsCSSRules.h
@@ -24,21 +24,16 @@
 #include "mozilla/dom/CSSMediaRule.h"
 #include "mozilla/dom/CSSPageRule.h"
 #include "mozilla/dom/CSSSupportsRule.h"
 #include "mozilla/dom/CSSMozDocumentRule.h"
 #include "nsAutoPtr.h"
 #include "nsCSSPropertyID.h"
 #include "nsCSSValue.h"
 #include "nsDOMCSSDeclaration.h"
-#include "nsIDOMCSSConditionRule.h"
-#include "nsIDOMCSSFontFeatureValuesRule.h"
-#include "nsIDOMCSSGroupingRule.h"
-#include "nsIDOMCSSMozDocumentRule.h"
-#include "nsIDOMCSSSupportsRule.h"
 #include "nsTArray.h"
 
 class nsMediaList;
 
 namespace mozilla {
 
 class ErrorResult;
 
@@ -67,30 +62,29 @@ public:
   virtual void SetStyleSheet(mozilla::StyleSheet* aSheet) override; //override GroupRule
   mozilla::CSSStyleSheet* GetStyleSheet() const
   {
     mozilla::StyleSheet* sheet = GroupRule::GetStyleSheet();
     return sheet ? sheet->AsGecko() : nullptr;
   }
   virtual already_AddRefed<Rule> Clone() const override;
 
-  // nsIDOMCSSConditionRule interface
-  NS_DECL_NSIDOMCSSCONDITIONRULE
-
   // rest of GroupRule
   virtual bool UseForPresentation(nsPresContext* aPresContext,
                                     nsMediaQueryResultCacheKey& aKey) override;
 
   // @media rule methods
   nsresult SetMedia(nsMediaList* aMedia);
 
   // WebIDL interface
-  void GetCssTextImpl(nsAString& aCssText) const override;
-  using CSSMediaRule::SetConditionText;
-  dom::MediaList* Media() override;
+  void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetConditionText(nsAString& aConditionText) final;
+  void SetConditionText(const nsAString& aConditionText,
+                        ErrorResult& aRv) final;
+  dom::MediaList* Media() final;
 
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const override MOZ_MUST_OVERRIDE;
 
 protected:
   void AppendConditionText(nsAString& aOutput) const;
 
   RefPtr<nsMediaList> mMedia;
@@ -108,19 +102,16 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   // Rule methods
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
 #endif
   virtual already_AddRefed<Rule> Clone() const override;
 
-  // nsIDOMCSSConditionRule interface
-  NS_DECL_NSIDOMCSSCONDITIONRULE
-
   // rest of GroupRule
   virtual bool UseForPresentation(nsPresContext* aPresContext,
                                   nsMediaQueryResultCacheKey& aKey) override;
 
   bool UseForPresentation(nsPresContext* aPresContext);
 
   struct URL {
     URLMatchingFunction func;
@@ -135,18 +126,20 @@ public:
     {
     }
     ~URL();
   };
 
   void SetURLs(URL *aURLs) { mURLs = aURLs; }
 
   // WebIDL interface
-  void GetCssTextImpl(nsAString& aCssText) const override;
-  using dom::CSSMozDocumentRule::SetConditionText;
+  void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetConditionText(nsAString& aConditionText) final;
+  void SetConditionText(const nsAString& aConditionText,
+                        ErrorResult& aRv) final;
 
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
     const override MOZ_MUST_OVERRIDE;
 
 protected:
   void AppendConditionText(nsAString& aOutput) const;
 
   nsAutoPtr<URL> mURLs; // linked list of |struct URL| above.
@@ -167,28 +160,27 @@ public:
   nsCSSFontFeatureValuesRule(const nsCSSFontFeatureValuesRule& aCopy)
     // copy everything except our reference count
     : mozilla::dom::CSSFontFeatureValuesRule(aCopy),
       mFamilyList(aCopy.mFamilyList),
       mFeatureValues(aCopy.mFeatureValues)
   {
   }
 
-  NS_DECL_ISUPPORTS_INHERITED
-
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
   already_AddRefed<mozilla::css::Rule> Clone() const final;
 
-  // nsIDOMCSSFontFeatureValuesRule interface
-  NS_DECL_NSIDOMCSSFONTFEATUREVALUESRULE
-
   // WebIDL interface
   void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetFontFamily(nsAString& aFamily) final;
+  void SetFontFamily(const nsAString& aFamily, mozilla::ErrorResult& aRv) final;
+  void GetValueText(nsAString& aValueText) final;
+  void SetValueText(const nsAString& aValueText, mozilla::ErrorResult& aRv) final;
 
   mozilla::SharedFontList* GetFamilyList() const { return mFamilyList; }
   void SetFamilyList(mozilla::SharedFontList* aFamilyList)
   {
     mFamilyList = aFamilyList;
   }
 
   void AddValueList(int32_t aVariantAlternate,
@@ -210,17 +202,17 @@ protected:
 
 class nsCSSKeyframeRule;
 
 class nsCSSKeyframeStyleDeclaration final : public nsDOMCSSDeclaration
 {
 public:
   explicit nsCSSKeyframeStyleDeclaration(nsCSSKeyframeRule *aRule);
 
-  NS_IMETHOD GetParentRule(nsIDOMCSSRule **aParent) override;
+  mozilla::css::Rule* GetParentRule() override;
   void DropReference() { mRule = nullptr; }
   virtual mozilla::DeclarationBlock* GetCSSDeclaration(Operation aOperation) override;
   virtual nsresult SetCSSDeclaration(mozilla::DeclarationBlock* aDecl) override;
   virtual void GetCSSParsingEnvironment(CSSParsingEnvironment& aCSSParseEnv,
                                         nsIPrincipal* aSubjectPrincipal) override;
   nsDOMCSSDeclaration::ServoCSSParsingEnvironment
   GetServoCSSParsingEnvironment(nsIPrincipal* aSubjectPrincipal) const final;
   virtual nsIDocument* DocToUpdate() override;
@@ -262,22 +254,20 @@ public:
                                            mozilla::dom::CSSKeyframeRule)
   virtual bool IsCCLeaf() const override;
 
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
 #endif
   virtual already_AddRefed<mozilla::css::Rule> Clone() const override;
 
-  // nsIDOMCSSKeyframeRule interface
-  NS_IMETHOD GetKeyText(nsAString& aKeyText) final;
-  NS_IMETHOD SetKeyText(const nsAString& aKeyText) final;
-
   // WebIDL interface
   void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetKeyText(nsAString& aKeyText) final;
+  void SetKeyText(const nsAString& aKeyText) final;
   nsICSSDeclaration* Style() final;
 
   const nsTArray<float>& GetKeys() const     { return mKeys; }
   mozilla::css::Declaration* Declaration()   { return mDeclaration; }
 
   void ChangeDeclaration(mozilla::css::Declaration* aDeclaration);
 
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override;
@@ -299,34 +289,29 @@ public:
     : mozilla::dom::CSSKeyframesRule(aLineNumber, aColumnNumber)
     , mName(aName)
   {
   }
 private:
   nsCSSKeyframesRule(const nsCSSKeyframesRule& aCopy);
   ~nsCSSKeyframesRule();
 public:
-  NS_DECL_ISUPPORTS_INHERITED
-
   // Rule methods
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
 #endif
   virtual already_AddRefed<mozilla::css::Rule> Clone() const override;
 
-  // nsIDOMCSSKeyframesRule interface
-  NS_IMETHOD GetName(nsAString& aName) final;
-  NS_IMETHOD SetName(const nsAString& aName) final;
-  NS_IMETHOD AppendRule(const nsAString& aRule) final;
-  NS_IMETHOD DeleteRule(const nsAString& aKey) final;
-  using nsIDOMCSSKeyframesRule::FindRule;
-
   // WebIDL interface
   void GetCssTextImpl(nsAString& aCssText) const final;
+  void GetName(nsAString& aName) const final;
+  void SetName(const nsAString& aName) final;
   mozilla::dom::CSSRuleList* CssRules() final { return GroupRule::CssRules(); }
+  void AppendRule(const nsAString& aRule) final;
+  void DeleteRule(const nsAString& aKey) final;
   nsCSSKeyframeRule* FindRule(const nsAString& aKey) final;
 
   const nsAtom* GetName() const { return mName; }
 
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override;
 
<