Merge mozilla-central to inbound. a=merge CLOSED TREE
authorTiberius Oros <toros@mozilla.com>
Sat, 06 Oct 2018 00:49:00 +0300
changeset 495628 6c48732725ecf42ca13ce54dce4e0f8786ef7487
parent 495627 62a73eefbaac08eb73951548547eeb2f0847fc9a (current diff)
parent 495565 54cb6a2f028b033ef567f00af2f82f5fb97ab437 (diff)
child 495629 82ed5b8d9f610d74ea7177ca49f066b7b6bb8706
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to inbound. a=merge CLOSED TREE
accessible/tests/mochitest/treeupdate/test_colorpicker.xul
accessible/xul/XULColorPickerAccessible.cpp
accessible/xul/XULColorPickerAccessible.h
browser/components/payments/res/vendor/custom-elements.min.js
browser/components/payments/res/vendor/custom-elements.min.js.map
modules/libpref/init/all.js
testing/web-platform/meta/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html.ini
testing/web-platform/tests/webdriver/tests/support/wait.py
toolkit/content/tests/chrome/test_colorpicker_popup.xul
toolkit/content/widgets/colorpicker.xml
toolkit/themes/linux/global/colorpicker.css
toolkit/themes/osx/global/colorpicker.css
toolkit/themes/windows/global/colorpicker.css
--- a/accessible/base/XULMap.h
+++ b/accessible/base/XULMap.h
@@ -34,47 +34,32 @@ XULMAP_TYPE(toolbarspring, XULToolbarSep
 XULMAP_TYPE(treecol, XULColumnItemAccessible)
 XULMAP_TYPE(treecolpicker, XULButtonAccessible)
 XULMAP_TYPE(treecols, XULTreeColumAccessible)
 XULMAP_TYPE(toolbar, XULToolbarAccessible)
 XULMAP_TYPE(toolbarbutton, XULToolbarButtonAccessible)
 XULMAP_TYPE(tooltip, XULTooltipAccessible)
 
 XULMAP(
-  colorpicker,
-  [](Element* aElement, Accessible* aContext) -> Accessible* {
-    if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
-                              nsGkAtoms::button, eIgnoreCase)) {
-      return new XULColorPickerAccessible(aElement, aContext->Document());
-    }
-    return nullptr;
-  }
-)
-
-XULMAP(
   label,
   [](Element* aElement, Accessible* aContext) -> Accessible* {
     if (aElement->ClassList()->Contains(NS_LITERAL_STRING("text-link"))) {
       return new XULLinkAccessible(aElement, aContext->Document());
     }
     return new XULLabelAccessible(aElement, aContext->Document());
   }
 )
 
 XULMAP(
   image,
   [](Element* aElement, Accessible* aContext) -> Accessible* {
     if (aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::onclick)) {
       return new XULToolbarButtonAccessible(aElement, aContext->Document());
     }
 
-    if (aElement->ClassList()->Contains(NS_LITERAL_STRING("colorpickertile"))) {
-      return new XULColorPickerTileAccessible(aElement, aContext->Document());
-    }
-
     // Don't include nameless images in accessible tree.
     if (!aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext)) {
       return nullptr;
     }
 
     return new ImageAccessibleWrap(aElement, aContext->Document());
   }
 )
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -70,17 +70,16 @@
 #include "mozilla/dom/DOMStringList.h"
 #include "mozilla/dom/EventTarget.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "nsDeckFrame.h"
 
 #ifdef MOZ_XUL
 #include "XULAlertAccessible.h"
-#include "XULColorPickerAccessible.h"
 #include "XULComboboxAccessible.h"
 #include "XULElementAccessibles.h"
 #include "XULFormControlAccessible.h"
 #include "XULListboxAccessibleWrap.h"
 #include "XULMenuAccessibleWrap.h"
 #include "XULTabAccessible.h"
 #include "XULTreeGridAccessibleWrap.h"
 #endif
--- a/accessible/tests/mochitest/events/test_focus_general.xul
+++ b/accessible/tests/mochitest/events/test_focus_general.xul
@@ -16,24 +16,16 @@
   <script type="application/javascript"
           src="../role.js" />
   <script type="application/javascript"
           src="../states.js" />
   <script type="application/javascript"
           src="../events.js" />
 
   <script type="application/javascript">
-    function getColorBtn(aBtnObj)
-    {
-      var colorpicker = aBtnObj.colorpicker;
-      var container = colorpicker.firstChild;
-      var btn = container.getChildAt(aBtnObj.btnIndex);
-      return btn;
-    }
-
     //gA11yEventDumpID = "eventdump"; // debug stuff
     //gA11yEventDumpToConsole = true; // debug stuff
 
     var gQueue = null;
     function doTests()
     {
       // Test focus events.
       gQueue = new eventQueue();
@@ -69,29 +61,16 @@
       gQueue.push(new synthClick("popupbutton", new nofocusChecker()));
       // select first menu item ("item 1"), focus on menu item
       gQueue.push(new synthDownKey("popupbutton", new focusChecker("bp_item1")));
       // choose select menu item, focus gets back to menubutton
       gQueue.push(new synthEnterKey("bp_item1", new focusChecker("menubutton")));
       // show popup again for the next test
       gQueue.push(new synthClick("popupbutton", new nofocusChecker()));
 
-      // focus colorpicker button
-      gQueue.push(new synthFocus("colorpicker"));
-      // click on button, open popup, focus goes to current color button
-      var btnObj = { colorpicker: getAccessible("colorpicker"), btnIndex: 0 };
-      var checker = new focusChecker(getColorBtn, btnObj);
-      gQueue.push(new synthClick("colorpicker", checker));
-      // select sibling color button, focus on it
-      btnObj = { colorpicker: getAccessible("colorpicker"), btnIndex: 1 };
-      var checker = new focusChecker(getColorBtn, btnObj);
-      gQueue.push(new synthRightKey("colorpicker", checker));
-      // choose selected color button, close popup, focus on colorpicker button
-      gQueue.push(new synthEnterKey("colorpicker", new focusChecker("colorpicker")));
-
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTests);
   </script>
 
   <hbox flex="1" style="overflow: auto;">
@@ -124,19 +103,16 @@
           <menuitem id="mb_item1" label="item1"/>
           <menuitem id="mb_item2" label="item2"/>
         </menupopup>
       </button>
 
       <button id="checkbutton" type="checkbox" label="checkbutton"/>
       <button id="radiobutton" type="radio" group="rbgroup" label="radio1"/>
 
-      <colorpicker id="colorpicker" type="button" label="color picker"
-                   color="#FFFFFF"/>
-
       <popupset>
         <menupopup id="backpopup" position="after_start">
           <menuitem id="bp_item1" label="Page 1"/>
           <menuitem id="bp_item2" label="Page 2"/>
         </menupopup>
       </popupset>
       <button id="popupbutton" label="Pop Me Up" popup="backpopup"/>
 
--- a/accessible/tests/mochitest/states/test_controls.xul
+++ b/accessible/tests/mochitest/states/test_controls.xul
@@ -15,71 +15,41 @@
           src="../role.js" />
   <script type="application/javascript"
           src="../states.js" />
   <script type="application/javascript"
           src="../events.js" />
 
   <script type="application/javascript">
   <![CDATA[
-    function openColorpicker(aID)
-    {
-      this.popupNode = getNode(aID).mPicker.parentNode;
-      this.popup = getAccessible(this.popupNode);
-
-      this.eventSeq = [
-        new invokerChecker(EVENT_REORDER, this.popupNode)
-      ];
-
-      this.invoke = function openColorpicker_invoke()
-      {
-        getNode(aID).showPopup();
-      }
-
-      this.finalCheck = function openColorpicker_finalCheck()
-      {
-        testStates(this.popup.firstChild,
-                   STATE_FOCUSABLE | STATE_SELECTABLE, 0,
-                   STATE_UNAVAILABLE);
-      }
-
-      this.getID = function openColorpicker_getID()
-      {
-        return "open colorpicker";
-      }
-    }
-
     var gQueue = null;
     function doTest()
     {
       testStates("checkbox", STATE_FOCUSABLE, 0, STATE_UNAVAILABLE);
       testStates("checkbox2", STATE_UNAVAILABLE, 0 , STATE_FOCUSABLE);
       testStates("radiogroup", 0, 0, STATE_FOCUSABLE | STATE_UNAVAILABLE);
       testStates("radio", STATE_FOCUSABLE, 0, STATE_UNAVAILABLE);
       testStates("radio-disabled", STATE_UNAVAILABLE, 0 , STATE_FOCUSABLE);
       testStates("radiogroup-disabled", STATE_UNAVAILABLE, 0 , STATE_FOCUSABLE);
       testStates("radio-disabledradiogroup", STATE_UNAVAILABLE, 0 , STATE_FOCUSABLE);
       testStates("button", STATE_FOCUSABLE, 0, STATE_UNAVAILABLE);
       testStates("button-disabled", STATE_UNAVAILABLE, 0 , STATE_FOCUSABLE);
-      testStates("colorpicker", STATE_FOCUSABLE | STATE_HASPOPUP, 0, STATE_UNAVAILABLE);
-      testStates("colorpicker-disabled", STATE_HASPOPUP, 0, STATE_FOCUSABLE);
       testStates("combobox", STATE_FOCUSABLE | STATE_HASPOPUP, 0, STATE_UNAVAILABLE);
       testStates("combobox-disabled", STATE_UNAVAILABLE | STATE_HASPOPUP, 0, STATE_FOCUSABLE);
       testStates("listbox", STATE_FOCUSABLE, 0, STATE_UNAVAILABLE);
       testStates("listitem", STATE_FOCUSABLE | STATE_SELECTABLE | STATE_SELECTED, 0, STATE_UNAVAILABLE);
       testStates("listbox-disabled", STATE_UNAVAILABLE, 0, STATE_FOCUSABLE | STATE_SELECTABLE);
       testStates("listitem-disabledlistbox", STATE_UNAVAILABLE | STATE_SELECTED, 0, STATE_FOCUSABLE | STATE_SELECTABLE);
       testStates("menubar", 0, 0, STATE_FOCUSABLE);
       testStates("menu", STATE_FOCUSABLE, 0, STATE_UNAVAILABLE);
       testStates("menu-disabled", STATE_UNAVAILABLE, 0, STATE_FOCUSABLE | STATE_SELECTABLE);
       testStates("tab", STATE_FOCUSABLE | STATE_SELECTABLE | STATE_SELECTED, 0, STATE_UNAVAILABLE);
       testStates("tab-disabled", STATE_UNAVAILABLE, 0, STATE_FOCUSABLE | STATE_SELECTABLE | STATE_SELECTED);
 
       gQueue = new eventQueue();
-      gQueue.push(new openColorpicker("colorpicker"));
       gQueue.invoke(); // Will call SimpleTest.finish()
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   ]]>
   </script>
 
@@ -115,19 +85,16 @@
     <radiogroup id="radiogroup-disabled" disabled="true">
       <radio id="radio-disabledradiogroup" label="Orange"/>
       <radio id="violet2" selected="true" label="Violet"/>
     </radiogroup>
 
     <button id="button" value="button"/>
     <button id="button-disabled" disabled="true" value="button"/>
 
-    <colorpicker id="colorpicker" type="button"/>
-    <colorpicker id="colorpicker-disabled" type="button" disabled="true"/>
-
     <menulist id="combobox">
       <menupopup>
         <menuitem label="item1"/>
       </menupopup>
     </menulist>
 
     <menulist id="combobox-disabled" disabled="true">
       <menupopup>
@@ -173,9 +140,8 @@
       </tabpanels>
     </tabbox>
 
     <tooltip id="tooltip"><description>tooltip</description></tooltip>
     </vbox>
   </hbox>
 
 </window>
-
--- a/accessible/tests/mochitest/treeupdate/a11y.ini
+++ b/accessible/tests/mochitest/treeupdate/a11y.ini
@@ -13,17 +13,16 @@ support-files =
 [test_bug895082.html]
 [test_bug1040735.html]
 [test_bug1100602.html]
 [test_bug1175913.html]
 [test_bug1189277.html]
 [test_bug1276857.html]
 support-files = test_bug1276857_subframe.html
 [test_canvas.html]
-[test_colorpicker.xul]
 [test_contextmenu.xul]
 [test_cssoverflow.html]
 [test_deck.xul]
 [test_doc.html]
 [test_gencontent.html]
 [test_general.html]
 [test_hidden.html]
 [test_imagemap.html]
deleted file mode 100644
--- a/accessible/tests/mochitest/treeupdate/test_colorpicker.xul
+++ /dev/null
@@ -1,150 +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"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        title="Accessible XUL button hierarchy tests">
-
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-  <script type="application/javascript"
-          src="../common.js" />
-  <script type="application/javascript"
-          src="../role.js" />
-  <script type="application/javascript"
-          src="../events.js" />
-
-  <script type="application/javascript">
-  <![CDATA[
-    ////////////////////////////////////////////////////////////////////////////
-    // Test
-
-    function openColorpicker(aColorpickerID)
-    {
-      this.node = getNode(aColorpickerID);
-
-      this.eventSeq = [];
-
-      var it = new colorButtonIterator(this.node);
-      for (var btnNode = it.next(); btnNode = it.next(); btnNode)
-        this.eventSeq.push(new invokerChecker(EVENT_SHOW, btnNode));
-
-      var popupNode = getPopupNode(this.node);
-      this.eventSeq.push(new invokerChecker(EVENT_REORDER, popupNode));
-
-      this.invoke = function openColorpicker_invoke()
-      {
-        var tree =
-          { BUTTONDROPDOWNGRID: [
-            { ALERT: [ ] }
-          ] };
-        testAccessibleTree(this.node, tree);
-
-        this.node.showPopup();
-      }
-
-      this.finalCheck = function openColorpicker_finalCheck()
-      {
-        var tree =
-          { BUTTONDROPDOWNGRID: [
-            { ALERT: [ ] }
-          ] };
-
-        var colorButtons = tree.BUTTONDROPDOWNGRID[0].ALERT;
-        var it = new colorButtonIterator(this.node);
-        while (it.next()) {
-          var obj = { PUSHBUTTON: [ ] };
-          colorButtons.push(obj);
-        }
-
-        testAccessibleTree(this.node, tree);
-      }
-
-      this.getID = function openColorpicker_getID()
-      {
-        return "open colorpicker " + prettyName(aColorpickerID);
-      }
-    }
-
-    function getPopupNode(aColorpickerNode)
-    {
-      return aColorpickerNode.mPicker.parentNode;
-    }
-
-    function colorButtonIterator(aColorpickerNode)
-    {
-      this.container = aColorpickerNode.mPicker.mBox;
-      this.group = this.container.firstChild;
-      this.item = null;
-
-      this.next = function colorButtonIterator_next()
-      {
-        if (!this.group)
-          return null;
-
-        if (!this.item) {
-          this.item = this.group.firstChild;
-          return this.item;
-        }
-
-        if (this.item.nextSibling) {
-          this.item = this.item.nextSibling;
-          return this.item;
-        }
-
-        if (this.group.nextSibling) {
-          this.group = this.group.nextSibling;
-          this.item = this.group.firstChild;
-          return this.item;
-        }
-
-        this.group = null;
-        this.item = null;
-        return null;
-      }
-    }
-
-    //gA11yEventDumpToConsole = true; // debug stuff
-
-    var gQueue = null;
-    function doTest()
-    {
-      gQueue = new eventQueue();
-      gQueue.push(new openColorpicker("colorpicker"));
-      gQueue.invoke(); // Will call SimpleTest.finish()
-    }
-
-    SimpleTest.waitForExplicitFinish();
-    addA11yLoadEvent(doTest);
-  ]]>
-  </script>
-
-  <hbox flex="1" style="overflow: auto;">
-    <body xmlns="http://www.w3.org/1999/xhtml">
-      <a target="_blank"
-         href="https://bugzilla.mozilla.org/show_bug.cgi?id=249292"
-         title="Ensure accessible children for toolbarbutton types 'menu'">
-        Mozilla Bug 249292
-      </a>
-      <a target="_blank"
-         href="https://bugzilla.mozilla.org/show_bug.cgi?id=630486"
-         title="Don't force accessible creation for popup children.">
-        Mozilla Bug 630486
-      </a>
-      <br/>
-      <p id="display"></p>
-      <div id="content" style="display: none">
-      </div>
-      <pre id="test">
-      </pre>
-    </body>
-
-    <vbox flex="1">
-      <colorpicker id="colorpicker" type="button"/>
-    </vbox>
-  </hbox>
-
-</window>
-
--- a/accessible/xul/XULAlertAccessible.cpp
+++ b/accessible/xul/XULAlertAccessible.cpp
@@ -54,13 +54,10 @@ bool
 XULAlertAccessible::IsWidget() const
 {
   return true;
 }
 
 Accessible*
 XULAlertAccessible::ContainerWidget() const
 {
-  // If a part of colorpicker widget.
-  if (mParent && mParent->IsMenuButton())
-    return mParent;
   return nullptr;
 }
deleted file mode 100644
--- a/accessible/xul/XULColorPickerAccessible.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/* -*- Mode: C++; 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 "XULColorPickerAccessible.h"
-
-#include "Accessible-inl.h"
-#include "nsAccUtils.h"
-#include "DocAccessible.h"
-#include "Role.h"
-#include "States.h"
-
-#include "nsMenuPopupFrame.h"
-
-using namespace mozilla::a11y;
-
-////////////////////////////////////////////////////////////////////////////////
-// XULColorPickerTileAccessible
-////////////////////////////////////////////////////////////////////////////////
-
-XULColorPickerTileAccessible::
-  XULColorPickerTileAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-  AccessibleWrap(aContent, aDoc)
-{
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// XULColorPickerTileAccessible: Accessible
-
-void
-XULColorPickerTileAccessible::Value(nsString& aValue) const
-{
-  aValue.Truncate();
-
-  mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::color, aValue);
-}
-
-role
-XULColorPickerTileAccessible::NativeRole() const
-{
-  return roles::PUSHBUTTON;
-}
-
-uint64_t
-XULColorPickerTileAccessible::NativeState() const
-{
-  uint64_t state = AccessibleWrap::NativeState();
-  if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::selected))
-    state |= states::SELECTED;
-
-  return state;
-}
-
-uint64_t
-XULColorPickerTileAccessible::NativeInteractiveState() const
-{
-  return NativelyUnavailable() ?
-    states::UNAVAILABLE : states::FOCUSABLE | states::SELECTABLE;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// XULColorPickerTileAccessible: Widgets
-
-Accessible*
-XULColorPickerTileAccessible::ContainerWidget() const
-{
-  Accessible* parent = Parent();
-  if (parent) {
-    Accessible* grandParent = parent->Parent();
-    if (grandParent && grandParent->IsMenuButton())
-      return grandParent;
-  }
-  return nullptr;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// XULColorPickerAccessible
-////////////////////////////////////////////////////////////////////////////////
-
-XULColorPickerAccessible::
-  XULColorPickerAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-  XULColorPickerTileAccessible(aContent, aDoc)
-{
-  mGenericTypes |= eMenuButton;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// XULColorPickerAccessible: Accessible
-
-uint64_t
-XULColorPickerAccessible::NativeState() const
-{
-  uint64_t state = AccessibleWrap::NativeState();
-  return state | states::HASPOPUP;
-}
-
-role
-XULColorPickerAccessible::NativeRole() const
-{
-  return roles::BUTTONDROPDOWNGRID;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// XULColorPickerAccessible: Widgets
-
-bool
-XULColorPickerAccessible::IsWidget() const
-{
-  return true;
-}
-
-bool
-XULColorPickerAccessible::IsActiveWidget() const
-{
-  return FocusMgr()->HasDOMFocus(mContent);
-}
-
-bool
-XULColorPickerAccessible::AreItemsOperable() const
-{
-  Accessible* menuPopup = mChildren.SafeElementAt(0, nullptr);
-  if (menuPopup) {
-    nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(menuPopup->GetFrame());
-    return menuPopupFrame && menuPopupFrame->IsOpen();
-  }
-  return false;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// XULColorPickerAccessible: Accessible
-
-bool
-XULColorPickerAccessible::IsAcceptableChild(nsIContent* aEl) const
-{
-  return aEl->IsXULElement(nsGkAtoms::panel) &&
-    aEl->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::noautofocus,
-                                  nsGkAtoms::_true, eCaseMatters);
-}
deleted file mode 100644
--- a/accessible/xul/XULColorPickerAccessible.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; 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/. */
-
-#ifndef mozilla_a11y_XULColorPickerAccessible_h__
-#define mozilla_a11y_XULColorPickerAccessible_h__
-
-#include "AccessibleWrap.h"
-
-namespace mozilla {
-namespace a11y {
-
-/**
- * Used for color button in colorpicker palette.
- */
-class XULColorPickerTileAccessible : public AccessibleWrap
-{
-public:
-  XULColorPickerTileAccessible(nsIContent* aContent,
-                               DocAccessible* aDoc);
-
-  // Accessible
-  virtual void Value(nsString& aValue) const override;
-  virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() const override;
-  virtual uint64_t NativeInteractiveState() const override;
-
-  // Widgets
-  virtual Accessible* ContainerWidget() const override;
-};
-
-
-/**
- * Used for colorpicker button (xul:colorpicker@type="button").
- */
-class XULColorPickerAccessible : public XULColorPickerTileAccessible
-{
-public:
-  XULColorPickerAccessible(nsIContent* aContent, DocAccessible* aDoc);
-
-  // Accessible
-  virtual a11y::role NativeRole() const override;
-  virtual uint64_t NativeState() const override;
-
-  // Widgets
-  virtual bool IsWidget() const override;
-  virtual bool IsActiveWidget() const override;
-  virtual bool AreItemsOperable() const override;
-
-  virtual bool IsAcceptableChild(nsIContent* aEl) const override;
-};
-
-} // namespace a11y
-} // namespace mozilla
-
-#endif
--- a/accessible/xul/moz.build
+++ b/accessible/xul/moz.build
@@ -1,17 +1,16 @@
 # -*- 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/.
 
 UNIFIED_SOURCES += [
     'XULAlertAccessible.cpp',
-    'XULColorPickerAccessible.cpp',
     'XULComboboxAccessible.cpp',
     'XULElementAccessibles.cpp',
     'XULFormControlAccessible.cpp',
     'XULListboxAccessible.cpp',
     'XULMenuAccessible.cpp',
     'XULSelectControlAccessible.cpp',
     'XULTabAccessible.cpp',
     'XULTreeAccessible.cpp',
--- a/browser/components/extensions/parent/ext-tabs.js
+++ b/browser/components/extensions/parent/ext-tabs.js
@@ -1277,32 +1277,32 @@ this.tabs = class extends ExtensionAPI {
           }
           return hidden;
         },
 
         highlight(highlightInfo) {
           if (!gMultiSelectEnabled) {
             throw new ExtensionError(`tabs.highlight is currently experimental and must be enabled with the ${MULTISELECT_PREFNAME} preference.`);
           }
-          let {windowId, tabs} = highlightInfo;
+          let {windowId, tabs, populate} = highlightInfo;
           if (windowId == null) {
             windowId = Window.WINDOW_ID_CURRENT;
           }
           let window = windowTracker.getWindow(windowId, context);
           if (!Array.isArray(tabs)) {
             tabs = [tabs];
           } else if (tabs.length == 0) {
             throw new ExtensionError("No highlighted tab.");
           }
           window.gBrowser.selectedTabs = tabs.map((tabIndex) => {
             let tab = window.gBrowser.tabs[tabIndex];
             if (!tab) {
               throw new ExtensionError("No tab at index: " + tabIndex);
             }
             return tab;
           });
-          return windowManager.convert(window, {populate: true});
+          return windowManager.convert(window, {populate});
         },
       },
     };
     return self;
   }
 };
--- a/browser/components/extensions/schemas/tabs.json
+++ b/browser/components/extensions/schemas/tabs.json
@@ -795,16 +795,22 @@
             "name": "highlightInfo",
             "properties": {
                "windowId": {
                  "type": "integer",
                  "optional": true,
                  "description": "The window that contains the tabs.",
                  "minimum": -2
                },
+               "populate": {
+                 "type": "boolean",
+                 "optional": true,
+                 "default": true,
+                 "description": "If true, the $(ref:windows.Window) returned will have a <var>tabs</var> property that contains a list of the $(ref:tabs.Tab) objects. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission. If false, the $(ref:windows.Window) won't have the <var>tabs</var> property."
+               },
                "tabs": {
                  "description": "One or more tab indices to highlight.",
                  "choices": [
                    {"type": "array", "items": {"type": "integer", "minimum": 0}},
                    {"type": "integer"}
                  ]
                }
              }
--- a/browser/components/extensions/test/browser/browser_ext_management.js
+++ b/browser/components/extensions/test/browser/browser_ext_management.js
@@ -64,16 +64,22 @@ add_task(async function test_management_
   is(id, "tiger@persona.beard", "Static web extension theme installed");
   is(type, "theme", "Extension type is correct");
 
   await transitionDone;
   let style = window.getComputedStyle(document.documentElement);
   is(style.backgroundColor, "rgb(255, 165, 0)", "Background is the new black");
 
   let addon = await AddonManager.getAddonByID("tiger@persona.beard");
+
+  Assert.deepEqual(addon.installTelemetryInfo, {
+    source: "extension",
+    method: "management-webext-api",
+  }, "Got the expected telemetry info on the installed webext theme");
+
   await addon.uninstall();
 
   // Test installing a standard WE.
   clickBrowserAction(extension);
   let error = await extension.awaitMessage("failed");
   is(error, "Incompatible addon", "Standard web extension rejected");
 
   await extension.unload();
--- a/browser/components/extensions/test/browser/browser_ext_tabs_highlight.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_highlight.js
@@ -63,16 +63,19 @@ add_task(async function test_highlighted
       await testHighlighted(1, [0]);
 
       browser.test.log("Highlight last tab");
       let window = await browser.tabs.highlight({tabs: 2});
       await testHighlighted(2, []);
 
       browser.test.assertEq(3, window.tabs.length, "Returned window should be populated");
 
+      window = await browser.tabs.highlight({tabs: 2, populate: false});
+      browser.test.assertFalse("tabs" in window, "Returned window shouldn't be populated");
+
       browser.test.notifyPass("test-finished");
     },
   });
 
   let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com/");
   let tab2 = await BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com/");
 
   await extension.startup();
--- a/browser/components/payments/res/containers/payment-dialog.js
+++ b/browser/components/payments/res/containers/payment-dialog.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-import "../vendor/custom-elements.min.js";
-
 import PaymentStateSubscriberMixin from "../mixins/PaymentStateSubscriberMixin.js";
 import paymentRequest from "../paymentRequest.js";
 
 import "../components/currency-amount.js";
 import "../components/payment-request-page.js";
 import "../components/accepted-cards.js";
 import "./address-picker.js";
 import "./address-form.js";
deleted file mode 100644
--- a/browser/components/payments/res/vendor/custom-elements.min.js
+++ /dev/null
@@ -1,37 +0,0 @@
-(function(){
-'use strict';var h=new function(){};var aa=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function n(b){var a=aa.has(b);b=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(b);return!a&&b}function p(b){var a=b.isConnected;if(void 0!==a)return a;for(;b&&!(b.__CE_isImportDocument||b instanceof Document);)b=b.parentNode||(window.ShadowRoot&&b instanceof ShadowRoot?b.host:void 0);return!(!b||!(b.__CE_isImportDocument||b instanceof Document))}
-function q(b,a){for(;a&&a!==b&&!a.nextSibling;)a=a.parentNode;return a&&a!==b?a.nextSibling:null}
-function t(b,a,c){c=c?c:new Set;for(var d=b;d;){if(d.nodeType===Node.ELEMENT_NODE){var e=d;a(e);var f=e.localName;if("link"===f&&"import"===e.getAttribute("rel")){d=e.import;if(d instanceof Node&&!c.has(d))for(c.add(d),d=d.firstChild;d;d=d.nextSibling)t(d,a,c);d=q(b,e);continue}else if("template"===f){d=q(b,e);continue}if(e=e.__CE_shadowRoot)for(e=e.firstChild;e;e=e.nextSibling)t(e,a,c)}d=d.firstChild?d.firstChild:q(b,d)}}function u(b,a,c){b[a]=c};function v(){this.a=new Map;this.o=new Map;this.f=[];this.b=!1}function ba(b,a,c){b.a.set(a,c);b.o.set(c.constructor,c)}function w(b,a){b.b=!0;b.f.push(a)}function x(b,a){b.b&&t(a,function(a){return y(b,a)})}function y(b,a){if(b.b&&!a.__CE_patched){a.__CE_patched=!0;for(var c=0;c<b.f.length;c++)b.f[c](a)}}function z(b,a){var c=[];t(a,function(b){return c.push(b)});for(a=0;a<c.length;a++){var d=c[a];1===d.__CE_state?b.connectedCallback(d):A(b,d)}}
-function B(b,a){var c=[];t(a,function(b){return c.push(b)});for(a=0;a<c.length;a++){var d=c[a];1===d.__CE_state&&b.disconnectedCallback(d)}}
-function C(b,a,c){c=c?c:{};var d=c.w||new Set,e=c.s||function(a){return A(b,a)},f=[];t(a,function(a){if("link"===a.localName&&"import"===a.getAttribute("rel")){var c=a.import;c instanceof Node&&"complete"===c.readyState?(c.__CE_isImportDocument=!0,c.__CE_hasRegistry=!0):a.addEventListener("load",function(){var c=a.import;if(!c.__CE_documentLoadHandled){c.__CE_documentLoadHandled=!0;c.__CE_isImportDocument=!0;c.__CE_hasRegistry=!0;var f=new Set(d);f.delete(c);C(b,c,{w:f,s:e})}})}else f.push(a)},d);
-if(b.b)for(a=0;a<f.length;a++)y(b,f[a]);for(a=0;a<f.length;a++)e(f[a])}
-function A(b,a){if(void 0===a.__CE_state){var c=b.a.get(a.localName);if(c){c.constructionStack.push(a);var d=c.constructor;try{try{if(new d!==a)throw Error("The custom element constructor did not produce the element being upgraded.");}finally{c.constructionStack.pop()}}catch(m){throw a.__CE_state=2,m;}a.__CE_state=1;a.__CE_definition=c;if(c.attributeChangedCallback)for(c=c.observedAttributes,d=0;d<c.length;d++){var e=c[d],f=a.getAttribute(e);null!==f&&b.attributeChangedCallback(a,e,null,f,null)}p(a)&&
-b.connectedCallback(a)}}}v.prototype.connectedCallback=function(b){var a=b.__CE_definition;a.connectedCallback&&a.connectedCallback.call(b)};v.prototype.disconnectedCallback=function(b){var a=b.__CE_definition;a.disconnectedCallback&&a.disconnectedCallback.call(b)};v.prototype.attributeChangedCallback=function(b,a,c,d,e){var f=b.__CE_definition;f.attributeChangedCallback&&-1<f.observedAttributes.indexOf(a)&&f.attributeChangedCallback.call(b,a,c,d,e)};function D(b,a){this.c=b;this.a=a;this.b=void 0;C(this.c,this.a);"loading"===this.a.readyState&&(this.b=new MutationObserver(this.f.bind(this)),this.b.observe(this.a,{childList:!0,subtree:!0}))}function E(b){b.b&&b.b.disconnect()}D.prototype.f=function(b){var a=this.a.readyState;"interactive"!==a&&"complete"!==a||E(this);for(a=0;a<b.length;a++)for(var c=b[a].addedNodes,d=0;d<c.length;d++)C(this.c,c[d])};function ca(){var b=this;this.b=this.a=void 0;this.f=new Promise(function(a){b.b=a;b.a&&a(b.a)})}function F(b){if(b.a)throw Error("Already resolved.");b.a=void 0;b.b&&b.b(void 0)};function G(b){this.i=!1;this.c=b;this.m=new Map;this.j=function(b){return b()};this.g=!1;this.l=[];this.u=new D(b,document)}
-G.prototype.define=function(b,a){var c=this;if(!(a instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!n(b))throw new SyntaxError("The element name '"+b+"' is not valid.");if(this.c.a.get(b))throw Error("A custom element with name '"+b+"' has already been defined.");if(this.i)throw Error("A custom element is already being defined.");this.i=!0;var d,e,f,m,l;try{var g=function(b){var a=k[b];if(void 0!==a&&!(a instanceof Function))throw Error("The '"+b+"' callback must be a function.");
-return a},k=a.prototype;if(!(k instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");d=g("connectedCallback");e=g("disconnectedCallback");f=g("adoptedCallback");m=g("attributeChangedCallback");l=a.observedAttributes||[]}catch(r){return}finally{this.i=!1}a={localName:b,constructor:a,connectedCallback:d,disconnectedCallback:e,adoptedCallback:f,attributeChangedCallback:m,observedAttributes:l,constructionStack:[]};ba(this.c,b,a);this.l.push(a);this.g||
-(this.g=!0,this.j(function(){return da(c)}))};function da(b){if(!1!==b.g){b.g=!1;for(var a=b.l,c=[],d=new Map,e=0;e<a.length;e++)d.set(a[e].localName,[]);C(b.c,document,{s:function(a){if(void 0===a.__CE_state){var e=a.localName,f=d.get(e);f?f.push(a):b.c.a.get(e)&&c.push(a)}}});for(e=0;e<c.length;e++)A(b.c,c[e]);for(;0<a.length;){for(var f=a.shift(),e=f.localName,f=d.get(f.localName),m=0;m<f.length;m++)A(b.c,f[m]);(e=b.m.get(e))&&F(e)}}}G.prototype.get=function(b){if(b=this.c.a.get(b))return b.constructor};
-G.prototype.whenDefined=function(b){if(!n(b))return Promise.reject(new SyntaxError("'"+b+"' is not a valid custom element name."));var a=this.m.get(b);if(a)return a.f;a=new ca;this.m.set(b,a);this.c.a.get(b)&&!this.l.some(function(a){return a.localName===b})&&F(a);return a.f};G.prototype.v=function(b){E(this.u);var a=this.j;this.j=function(c){return b(function(){return a(c)})}};window.CustomElementRegistry=G;G.prototype.define=G.prototype.define;G.prototype.get=G.prototype.get;
-G.prototype.whenDefined=G.prototype.whenDefined;G.prototype.polyfillWrapFlushCallback=G.prototype.v;var H=window.Document.prototype.createElement,ea=window.Document.prototype.createElementNS,fa=window.Document.prototype.importNode,ga=window.Document.prototype.prepend,ha=window.Document.prototype.append,ia=window.DocumentFragment.prototype.prepend,ja=window.DocumentFragment.prototype.append,I=window.Node.prototype.cloneNode,J=window.Node.prototype.appendChild,K=window.Node.prototype.insertBefore,L=window.Node.prototype.removeChild,M=window.Node.prototype.replaceChild,N=Object.getOwnPropertyDescriptor(window.Node.prototype,
-"textContent"),O=window.Element.prototype.attachShadow,P=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),Q=window.Element.prototype.getAttribute,R=window.Element.prototype.setAttribute,S=window.Element.prototype.removeAttribute,T=window.Element.prototype.getAttributeNS,U=window.Element.prototype.setAttributeNS,ka=window.Element.prototype.removeAttributeNS,la=window.Element.prototype.insertAdjacentElement,ma=window.Element.prototype.prepend,na=window.Element.prototype.append,
-V=window.Element.prototype.before,oa=window.Element.prototype.after,pa=window.Element.prototype.replaceWith,qa=window.Element.prototype.remove,ra=window.HTMLElement,W=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),sa=window.HTMLElement.prototype.insertAdjacentElement;function ta(){var b=X;window.HTMLElement=function(){function a(){var a=this.constructor,d=b.o.get(a);if(!d)throw Error("The custom element being constructed was not registered with `customElements`.");var e=d.constructionStack;if(!e.length)return e=H.call(document,d.localName),Object.setPrototypeOf(e,a.prototype),e.__CE_state=1,e.__CE_definition=d,y(b,e),e;var d=e.length-1,f=e[d];if(f===h)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.");
-e[d]=h;Object.setPrototypeOf(f,a.prototype);y(b,f);return f}a.prototype=ra.prototype;return a}()};function Y(b,a,c){function d(a){return function(d){for(var c=[],e=0;e<arguments.length;++e)c[e-0]=arguments[e];for(var e=[],f=[],k=0;k<c.length;k++){var r=c[k];r instanceof Element&&p(r)&&f.push(r);if(r instanceof DocumentFragment)for(r=r.firstChild;r;r=r.nextSibling)e.push(r);else e.push(r)}a.apply(this,c);for(c=0;c<f.length;c++)B(b,f[c]);if(p(this))for(c=0;c<e.length;c++)f=e[c],f instanceof Element&&z(b,f)}}c.h&&(a.prepend=d(c.h));c.append&&(a.append=d(c.append))};function ua(){var b=X;u(Document.prototype,"createElement",function(a){if(this.__CE_hasRegistry){var c=b.a.get(a);if(c)return new c.constructor}a=H.call(this,a);y(b,a);return a});u(Document.prototype,"importNode",function(a,c){a=fa.call(this,a,c);this.__CE_hasRegistry?C(b,a):x(b,a);return a});u(Document.prototype,"createElementNS",function(a,c){if(this.__CE_hasRegistry&&(null===a||"http://www.w3.org/1999/xhtml"===a)){var d=b.a.get(c);if(d)return new d.constructor}a=ea.call(this,a,c);y(b,a);return a});
-Y(b,Document.prototype,{h:ga,append:ha})};function va(){var b=X;function a(a,d){Object.defineProperty(a,"textContent",{enumerable:d.enumerable,configurable:!0,get:d.get,set:function(a){if(this.nodeType===Node.TEXT_NODE)d.set.call(this,a);else{var c=void 0;if(this.firstChild){var e=this.childNodes,l=e.length;if(0<l&&p(this))for(var c=Array(l),g=0;g<l;g++)c[g]=e[g]}d.set.call(this,a);if(c)for(a=0;a<c.length;a++)B(b,c[a])}}})}u(Node.prototype,"insertBefore",function(a,d){if(a instanceof DocumentFragment){var c=Array.prototype.slice.apply(a.childNodes);
-a=K.call(this,a,d);if(p(this))for(d=0;d<c.length;d++)z(b,c[d]);return a}c=p(a);d=K.call(this,a,d);c&&B(b,a);p(this)&&z(b,a);return d});u(Node.prototype,"appendChild",function(a){if(a instanceof DocumentFragment){var d=Array.prototype.slice.apply(a.childNodes);a=J.call(this,a);if(p(this))for(var c=0;c<d.length;c++)z(b,d[c]);return a}d=p(a);c=J.call(this,a);d&&B(b,a);p(this)&&z(b,a);return c});u(Node.prototype,"cloneNode",function(a){a=I.call(this,a);this.ownerDocument.__CE_hasRegistry?C(b,a):x(b,a);
-return a});u(Node.prototype,"removeChild",function(a){var d=p(a),c=L.call(this,a);d&&B(b,a);return c});u(Node.prototype,"replaceChild",function(a,d){if(a instanceof DocumentFragment){var c=Array.prototype.slice.apply(a.childNodes);a=M.call(this,a,d);if(p(this))for(B(b,d),d=0;d<c.length;d++)z(b,c[d]);return a}var c=p(a),f=M.call(this,a,d),m=p(this);m&&B(b,d);c&&B(b,a);m&&z(b,a);return f});N&&N.get?a(Node.prototype,N):w(b,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){for(var a=[],b=
-0;b<this.childNodes.length;b++)a.push(this.childNodes[b].textContent);return a.join("")},set:function(a){for(;this.firstChild;)L.call(this,this.firstChild);J.call(this,document.createTextNode(a))}})})};function wa(b){var a=Element.prototype;function c(a){return function(d){for(var c=[],e=0;e<arguments.length;++e)c[e-0]=arguments[e];for(var e=[],l=[],g=0;g<c.length;g++){var k=c[g];k instanceof Element&&p(k)&&l.push(k);if(k instanceof DocumentFragment)for(k=k.firstChild;k;k=k.nextSibling)e.push(k);else e.push(k)}a.apply(this,c);for(c=0;c<l.length;c++)B(b,l[c]);if(p(this))for(c=0;c<e.length;c++)l=e[c],l instanceof Element&&z(b,l)}}V&&(a.before=c(V));V&&(a.after=c(oa));pa&&u(a,"replaceWith",function(a){for(var c=
-[],d=0;d<arguments.length;++d)c[d-0]=arguments[d];for(var d=[],m=[],l=0;l<c.length;l++){var g=c[l];g instanceof Element&&p(g)&&m.push(g);if(g instanceof DocumentFragment)for(g=g.firstChild;g;g=g.nextSibling)d.push(g);else d.push(g)}l=p(this);pa.apply(this,c);for(c=0;c<m.length;c++)B(b,m[c]);if(l)for(B(b,this),c=0;c<d.length;c++)m=d[c],m instanceof Element&&z(b,m)});qa&&u(a,"remove",function(){var a=p(this);qa.call(this);a&&B(b,this)})};function xa(){var b=X;function a(a,c){Object.defineProperty(a,"innerHTML",{enumerable:c.enumerable,configurable:!0,get:c.get,set:function(a){var d=this,e=void 0;p(this)&&(e=[],t(this,function(a){a!==d&&e.push(a)}));c.set.call(this,a);if(e)for(var f=0;f<e.length;f++){var k=e[f];1===k.__CE_state&&b.disconnectedCallback(k)}this.ownerDocument.__CE_hasRegistry?C(b,this):x(b,this);return a}})}function c(a,c){u(a,"insertAdjacentElement",function(a,d){var e=p(d);a=c.call(this,a,d);e&&B(b,d);p(a)&&z(b,d);
-return a})}O&&u(Element.prototype,"attachShadow",function(a){return this.__CE_shadowRoot=a=O.call(this,a)});P&&P.get?a(Element.prototype,P):W&&W.get?a(HTMLElement.prototype,W):w(b,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){return I.call(this,!0).innerHTML},set:function(a){var b="template"===this.localName,c=b?this.content:this,d=H.call(document,this.localName);for(d.innerHTML=a;0<c.childNodes.length;)L.call(c,c.childNodes[0]);for(a=b?d.content:d;0<a.childNodes.length;)J.call(c,
-a.childNodes[0])}})});u(Element.prototype,"setAttribute",function(a,c){if(1!==this.__CE_state)return R.call(this,a,c);var d=Q.call(this,a);R.call(this,a,c);c=Q.call(this,a);b.attributeChangedCallback(this,a,d,c,null)});u(Element.prototype,"setAttributeNS",function(a,c,f){if(1!==this.__CE_state)return U.call(this,a,c,f);var d=T.call(this,a,c);U.call(this,a,c,f);f=T.call(this,a,c);b.attributeChangedCallback(this,c,d,f,a)});u(Element.prototype,"removeAttribute",function(a){if(1!==this.__CE_state)return S.call(this,
-a);var c=Q.call(this,a);S.call(this,a);null!==c&&b.attributeChangedCallback(this,a,c,null,null)});u(Element.prototype,"removeAttributeNS",function(a,c){if(1!==this.__CE_state)return ka.call(this,a,c);var d=T.call(this,a,c);ka.call(this,a,c);var e=T.call(this,a,c);d!==e&&b.attributeChangedCallback(this,c,d,e,a)});sa?c(HTMLElement.prototype,sa):la?c(Element.prototype,la):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");Y(b,Element.prototype,{h:ma,append:na});wa(b)};/*
-
- Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
- This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
- The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
- The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
- Code distributed by Google as part of the polymer project is also
- subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-*/
-var Z=window.customElements;if(!Z||Z.forcePolyfill||"function"!=typeof Z.define||"function"!=typeof Z.get){var X=new v;ta();ua();Y(X,DocumentFragment.prototype,{h:ia,append:ja});va();xa();document.__CE_hasRegistry=!0;var customElements=new G(X);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:customElements})};
-}).call(self);
-
-//# sourceMappingURL=custom-elements.min.js.map
deleted file mode 100644
--- a/browser/components/payments/res/vendor/custom-elements.min.js.map
+++ /dev/null
@@ -1,1 +0,0 @@
-{"version":3,"sources":["src/AlreadyConstructedMarker.js","src/Utilities.js","src/CustomElementInternals.js","src/CustomElementState.js","src/DocumentConstructionObserver.js","src/Deferred.js","src/CustomElementRegistry.js","src/Patch/Native.js","src/Patch/HTMLElement.js","src/custom-elements.js","src/Patch/Interface/ParentNode.js","src/Patch/Document.js","src/Patch/Node.js","src/Patch/Interface/ChildNode.js","src/Patch/Element.js","src/Patch/DocumentFragment.js"],"names":["$jscompDefaultExport","AlreadyConstructedMarker","reservedTagList","Set","isValidCustomElementName$$module$$src$Utilities","isValidCustomElementName","localName","reserved","has","validForm","test","isConnected$$module$$src$Utilities","isConnected","node","nativeValue","undefined","current","__CE_isImportDocument","Document","parentNode","window","ShadowRoot","host","nextSiblingOrAncestorSibling$$module$$src$Utilities","nextSiblingOrAncestorSibling","root","start","nextSibling","walkDeepDescendantElements$$module$$src$Utilities","walkDeepDescendantElements","callback","visitedImports","nodeType","Node","ELEMENT_NODE","element","getAttribute","importNode","import","add","child","firstChild","shadowRoot","__CE_shadowRoot","setPropertyUnchecked$$module$$src$Utilities","setPropertyUnchecked","destination","name","value","constructor","CustomElementInternals","_localNameToDefinition","Map","_constructorToDefinition","_patches","_hasPatches","setDefinition","definition","set","addPatch","listener","push","patchTree","patch","__CE_patched","i","length","connectTree","elements","custom","__CE_state","connectedCallback","upgradeElement","disconnectTree","disconnectedCallback","patchAndUpgradeTree","options","upgrade","gatherElements","readyState","__CE_hasRegistry","addEventListener","__CE_documentLoadHandled","clonedVisitedImports","delete","localNameToDefinition","get","constructionStack","result","Error","pop","e","failed","__CE_definition","attributeChangedCallback","observedAttributes","call","oldValue","newValue","namespace","indexOf","DocumentConstructionObserver","internals","doc","_internals","_document","_observer","MutationObserver","_handleMutations","bind","observe","childList","subtree","disconnect","mutations","addedNodes","j","Deferred","_resolve","_value","_promise","Promise","resolve","CustomElementRegistry","_elementDefinitionIsRunning","_whenDefinedDeferred","_flushCallback","this._flushCallback","fn","_flushPending","_pendingDefinitions","_documentConstructionObserver","document","define","Function","TypeError","SyntaxError","adoptedCallback","getCallback","callbackValue","prototype","Object","_flush","pendingDefinitions","elementsWithStableDefinitions","elementsWithPendingDefinitions","pendingElements","shift","pendingUpgradableElements","deferred","whenDefined","reject","prior","some","d","polyfillWrapFlushCallback","outer","inner","flush","Document_createElement","createElement","Document_createElementNS","createElementNS","Document_importNode","Document_prepend","Document_append","DocumentFragment_prepend","DocumentFragment","DocumentFragment_append","Node_cloneNode","cloneNode","Node_appendChild","appendChild","Node_insertBefore","insertBefore","Node_removeChild","removeChild","Node_replaceChild","replaceChild","Node_textContent","getOwnPropertyDescriptor","Element_attachShadow","Element","Element_innerHTML","Element_getAttribute","Element_setAttribute","setAttribute","Element_removeAttribute","removeAttribute","Element_getAttributeNS","getAttributeNS","Element_setAttributeNS","setAttributeNS","Element_removeAttributeNS","removeAttributeNS","Element_insertAdjacentElement","Element_prepend","Element_append","Element_before","Element_after","Element_replaceWith","Element_remove","HTMLElement","HTMLElement_innerHTML","HTMLElement_insertAdjacentElement","$jscompDefaultExport$$module$$src$Patch$HTMLElement","$jscompDefaultExport$$module$$src$Patch$Native.Document_createElement.call","setPrototypeOf","lastIndex","$jscompDefaultExport$$module$$src$Patch$Native.HTMLElement","$jscompDefaultExport$$module$$src$Patch$Interface$ParentNode","builtIn","appendPrependPatch","builtInMethod","flattenedNodes","connectedElements","nodes","apply","prepend","append","$jscompDefaultExport$$module$$src$Patch$Document","deep","clone","$jscompDefaultExport$$module$$src$Patch$Native.Document_importNode.call","NS_HTML","$jscompDefaultExport$$module$$src$Patch$Native.Document_createElementNS.call","$jscompDefaultExport$$module$$src$Patch$Native.Document_prepend","$jscompDefaultExport$$module$$src$Patch$Native.Document_append","$jscompDefaultExport$$module$$src$Patch$Node","patch_textContent","baseDescriptor","defineProperty","enumerable","configurable","assignedValue","TEXT_NODE","removedNodes","childNodes","childNodesLength","Array","refNode","insertedNodes","slice","nativeResult","$jscompDefaultExport$$module$$src$Patch$Native.Node_insertBefore.call","nodeWasConnected","$jscompDefaultExport$$module$$src$Patch$Native.Node_appendChild.call","$jscompDefaultExport$$module$$src$Patch$Native.Node_cloneNode.call","ownerDocument","$jscompDefaultExport$$module$$src$Patch$Native.Node_removeChild.call","nodeToInsert","nodeToRemove","$jscompDefaultExport$$module$$src$Patch$Native.Node_replaceChild.call","nodeToInsertWasConnected","thisIsConnected","$jscompDefaultExport$$module$$src$Patch$Native.Node_textContent","$jscompDefaultExport$$module$$src$Patch$Native.Node_textContent.get","parts","textContent","join","createTextNode","$jscompDefaultExport$$module$$src$Patch$Interface$ChildNode","beforeAfterPatch","$jscompDefaultExport$$module$$src$Patch$Native.Element_before","$jscompDefaultExport$$module$$src$Patch$Native.Element_after","$jscompDefaultExport$$module$$src$Patch$Native.Element_replaceWith","wasConnected","$jscompDefaultExport$$module$$src$Patch$Native.Element_remove","$jscompDefaultExport$$module$$src$Patch$Element","patch_innerHTML","htmlString","removedElements","patch_insertAdjacentElement","baseMethod","where","insertedElement","$jscompDefaultExport$$module$$src$Patch$Native.Element_attachShadow","init","$jscompDefaultExport$$module$$src$Patch$Native.Element_attachShadow.call","$jscompDefaultExport$$module$$src$Patch$Native.Element_innerHTML","$jscompDefaultExport$$module$$src$Patch$Native.Element_innerHTML.get","$jscompDefaultExport$$module$$src$Patch$Native.HTMLElement_innerHTML","$jscompDefaultExport$$module$$src$Patch$Native.HTMLElement_innerHTML.get","innerHTML","isTemplate","content","rawElement","container","$jscompDefaultExport$$module$$src$Patch$Native.Element_setAttribute.call","$jscompDefaultExport$$module$$src$Patch$Native.Element_getAttribute.call","$jscompDefaultExport$$module$$src$Patch$Native.Element_setAttributeNS.call","$jscompDefaultExport$$module$$src$Patch$Native.Element_getAttributeNS.call","$jscompDefaultExport$$module$$src$Patch$Native.Element_removeAttribute.call","$jscompDefaultExport$$module$$src$Patch$Native.Element_removeAttributeNS.call","$jscompDefaultExport$$module$$src$Patch$Native.HTMLElement_insertAdjacentElement","$jscompDefaultExport$$module$$src$Patch$Native.Element_insertAdjacentElement","console","warn","$jscompDefaultExport$$module$$src$Patch$Native.Element_prepend","$jscompDefaultExport$$module$$src$Patch$Native.Element_append","priorCustomElements","$jscompDefaultExport$$module$$src$Patch$Native.DocumentFragment_prepend","$jscompDefaultExport$$module$$src$Patch$Native.DocumentFragment_append","customElements"],"mappings":"A;aASA,IAAAA,EAAe,IAFfC,QAAA,EAAA,E,CCPA,IAAMC,GAAkB,IAAIC,GAAJ,CAAQ,kHAAA,MAAA,CAAA,GAAA,CAAR,CAejBC,SAASC,EAAwB,CAACC,CAAD,CAAY,CAClD,IAAMC,EAAWL,EAAAM,IAAA,CAAoBF,CAApB,CACXG,EAAAA,CAAY,kCAAAC,KAAA,CAAwCJ,CAAxC,CAClB,OAAO,CAACC,CAAR,EAAoBE,CAH8B,CAW7CE,QAASC,EAAW,CAACC,CAAD,CAAO,CAEhC,IAAMC,EAAcD,CAAAD,YACpB,IAAoBG,IAAAA,EAApB,GAAID,CAAJ,CACE,MAAOA,EAKT,KAAA,CAAOE,CAAP,EAAoB,EAAAA,CAAAC,sBAAA,EAAiCD,CAAjC,WAAoDE,SAApD,CAApB,CAAA,CACEF,CAAA,CAAUA,CAAAG,WAAV,GAAiCC,MAAAC,WAAA,EAAqBL,CAArB,WAAwCK,WAAxC,CAAqDL,CAAAM,KAArD,CAAoEP,IAAAA,EAArG,CAEF,OAAO,EAAGC,CAAAA,CAAH,EAAe,EAAAA,CAAAC,sBAAA,EAAiCD,CAAjC,WAAoDE,SAApD,CAAf,CAZyB;AAoBlCK,QAASC,EAA4B,CAACC,CAAD,CAAOC,CAAP,CAAc,CAEjD,IAAA,CAAOb,CAAP,EAAeA,CAAf,GAAwBY,CAAxB,EAAiCE,CAAAd,CAAAc,YAAjC,CAAA,CACEd,CAAA,CAAOA,CAAAM,WAET,OAASN,EAAF,EAAUA,CAAV,GAAmBY,CAAnB,CAAkCZ,CAAAc,YAAlC,CAA2B,IALe;AAsB5CC,QAASC,EAA0B,CAACJ,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BsD","file":"custom-elements.min.js","sourcesContent":["/**\n * This class exists only to work around Closure's lack of a way to describe\n * singletons. It represents the 'already constructed marker' used in custom\n * element construction stacks.\n *\n * https://html.spec.whatwg.org/#concept-already-constructed-marker\n */\nclass AlreadyConstructedMarker {}\n\nexport default new AlreadyConstructedMarker();\n","const reservedTagList = new Set([\n  'annotation-xml',\n  'color-profile',\n  'font-face',\n  'font-face-src',\n  'font-face-uri',\n  'font-face-format',\n  'font-face-name',\n  'missing-glyph',\n]);\n\n/**\n * @param {string} localName\n * @returns {boolean}\n */\nexport function isValidCustomElementName(localName) {\n  const reserved = reservedTagList.has(localName);\n  const validForm = /^[a-z][.0-9_a-z]*-[\\-.0-9_a-z]*$/.test(localName);\n  return !reserved && validForm;\n}\n\n/**\n * @private\n * @param {!Node} node\n * @return {boolean}\n */\nexport function isConnected(node) {\n  // Use `Node#isConnected`, if defined.\n  const nativeValue = node.isConnected;\n  if (nativeValue !== undefined) {\n    return nativeValue;\n  }\n\n  /** @type {?Node|undefined} */\n  let current = node;\n  while (current && !(current.__CE_isImportDocument || current instanceof Document)) {\n    current = current.parentNode || (window.ShadowRoot && current instanceof ShadowRoot ? current.host : undefined);\n  }\n  return !!(current && (current.__CE_isImportDocument || current instanceof Document));\n}\n\n/**\n * @param {!Node} root\n * @param {!Node} start\n * @return {?Node}\n */\nfunction nextSiblingOrAncestorSibling(root, start) {\n  let node = start;\n  while (node && node !== root && !node.nextSibling) {\n    node = node.parentNode;\n  }\n  return (!node || node === root) ? null : node.nextSibling;\n}\n\n/**\n * @param {!Node} root\n * @param {!Node} start\n * @return {?Node}\n */\nfunction nextNode(root, start) {\n  return start.firstChild ? start.firstChild : nextSiblingOrAncestorSibling(root, start);\n}\n\n/**\n * @param {!Node} root\n * @param {!function(!Element)} callback\n * @param {!Set<Node>=} visitedImports\n */\nexport function walkDeepDescendantElements(root, callback, visitedImports = new Set()) {\n  let node = root;\n  while (node) {\n    if (node.nodeType === Node.ELEMENT_NODE) {\n      const element = /** @type {!Element} */(node);\n\n      callback(element);\n\n      const localName = element.localName;\n      if (localName === 'link' && element.getAttribute('rel') === 'import') {\n        // If this import (polyfilled or not) has it's root node available,\n        // walk it.\n        const importNode = /** @type {!Node} */ (element.import);\n        if (importNode instanceof Node && !visitedImports.has(importNode)) {\n          // Prevent multiple walks of the same import root.\n          visitedImports.add(importNode);\n\n          for (let child = importNode.firstChild; child; child = child.nextSibling) {\n            walkDeepDescendantElements(child, callback, visitedImports);\n          }\n        }\n\n        // Ignore descendants of import links to prevent attempting to walk the\n        // elements created by the HTML Imports polyfill that we just walked\n        // above.\n        node = nextSiblingOrAncestorSibling(root, element);\n        continue;\n      } else if (localName === 'template') {\n        // Ignore descendants of templates. There shouldn't be any descendants\n        // because they will be moved into `.content` during construction in\n        // browsers that support template but, in case they exist and are still\n        // waiting to be moved by a polyfill, they will be ignored.\n        node = nextSiblingOrAncestorSibling(root, element);\n        continue;\n      }\n\n      // Walk shadow roots.\n      const shadowRoot = element.__CE_shadowRoot;\n      if (shadowRoot) {\n        for (let child = shadowRoot.firstChild; child; child = child.nextSibling) {\n          walkDeepDescendantElements(child, callback, visitedImports);\n        }\n      }\n    }\n\n    node = nextNode(root, node);\n  }\n}\n\n/**\n * Used to suppress Closure's \"Modifying the prototype is only allowed if the\n * constructor is in the same scope\" warning without using\n * `@suppress {newCheckTypes, duplicate}` because `newCheckTypes` is too broad.\n *\n * @param {!Object} destination\n * @param {string} name\n * @param {*} value\n */\nexport function setPropertyUnchecked(destination, name, value) {\n  destination[name] = value;\n}\n","import * as Utilities from './Utilities.js';\nimport CEState from './CustomElementState.js';\n\nexport default class CustomElementInternals {\n  constructor() {\n    /** @type {!Map<string, !CustomElementDefinition>} */\n    this._localNameToDefinition = new Map();\n\n    /** @type {!Map<!Function, !CustomElementDefinition>} */\n    this._constructorToDefinition = new Map();\n\n    /** @type {!Array<!function(!Node)>} */\n    this._patches = [];\n\n    /** @type {boolean} */\n    this._hasPatches = false;\n  }\n\n  /**\n   * @param {string} localName\n   * @param {!CustomElementDefinition} definition\n   */\n  setDefinition(localName, definition) {\n    this._localNameToDefinition.set(localName, definition);\n    this._constructorToDefinition.set(definition.constructor, definition);\n  }\n\n  /**\n   * @param {string} localName\n   * @return {!CustomElementDefinition|undefined}\n   */\n  localNameToDefinition(localName) {\n    return this._localNameToDefinition.get(localName);\n  }\n\n  /**\n   * @param {!Function} constructor\n   * @return {!CustomElementDefinition|undefined}\n   */\n  constructorToDefinition(constructor) {\n    return this._constructorToDefinition.get(constructor);\n  }\n\n  /**\n   * @param {!function(!Node)} listener\n   */\n  addPatch(listener) {\n    this._hasPatches = true;\n    this._patches.push(listener);\n  }\n\n  /**\n   * @param {!Node} node\n   */\n  patchTree(node) {\n    if (!this._hasPatches) return;\n\n    Utilities.walkDeepDescendantElements(node, element => this.patch(element));\n  }\n\n  /**\n   * @param {!Node} node\n   */\n  patch(node) {\n    if (!this._hasPatches) return;\n\n    if (node.__CE_patched) return;\n    node.__CE_patched = true;\n\n    for (let i = 0; i < this._patches.length; i++) {\n      this._patches[i](node);\n    }\n  }\n\n  /**\n   * @param {!Node} root\n   */\n  connectTree(root) {\n    const elements = [];\n\n    Utilities.walkDeepDescendantElements(root, element => elements.push(element));\n\n    for (let i = 0; i < elements.length; i++) {\n      const element = elements[i];\n      if (element.__CE_state === CEState.custom) {\n        this.connectedCallback(element);\n      } else {\n        this.upgradeElement(element);\n      }\n    }\n  }\n\n  /**\n   * @param {!Node} root\n   */\n  disconnectTree(root) {\n    const elements = [];\n\n    Utilities.walkDeepDescendantElements(root, element => elements.push(element));\n\n    for (let i = 0; i < elements.length; i++) {\n      const element = elements[i];\n      if (element.__CE_state === CEState.custom) {\n        this.disconnectedCallback(element);\n      }\n    }\n  }\n\n  /**\n   * Upgrades all uncustomized custom elements at and below a root node for\n   * which there is a definition. When custom element reaction callbacks are\n   * assumed to be called synchronously (which, by the current DOM / HTML spec\n   * definitions, they are *not*), callbacks for both elements customized\n   * synchronously by the parser and elements being upgraded occur in the same\n   * relative order.\n   *\n   * NOTE: This function, when used to simulate the construction of a tree that\n   * is already created but not customized (i.e. by the parser), does *not*\n   * prevent the element from reading the 'final' (true) state of the tree. For\n   * example, the element, during truly synchronous parsing / construction would\n   * see that it contains no children as they have not yet been inserted.\n   * However, this function does not modify the tree, the element will\n   * (incorrectly) have children. Additionally, self-modification restrictions\n   * for custom element constructors imposed by the DOM spec are *not* enforced.\n   *\n   *\n   * The following nested list shows the steps extending down from the HTML\n   * spec's parsing section that cause elements to be synchronously created and\n   * upgraded:\n   *\n   * The \"in body\" insertion mode:\n   * https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n   * - Switch on token:\n   *   .. other cases ..\n   *   -> Any other start tag\n   *      - [Insert an HTML element](below) for the token.\n   *\n   * Insert an HTML element:\n   * https://html.spec.whatwg.org/multipage/syntax.html#insert-an-html-element\n   * - Insert a foreign element for the token in the HTML namespace:\n   *   https://html.spec.whatwg.org/multipage/syntax.html#insert-a-foreign-element\n   *   - Create an element for a token:\n   *     https://html.spec.whatwg.org/multipage/syntax.html#create-an-element-for-the-token\n   *     - Will execute script flag is true?\n   *       - (Element queue pushed to the custom element reactions stack.)\n   *     - Create an element:\n   *       https://dom.spec.whatwg.org/#concept-create-element\n   *       - Sync CE flag is true?\n   *         - Constructor called.\n   *         - Self-modification restrictions enforced.\n   *       - Sync CE flag is false?\n   *         - (Upgrade reaction enqueued.)\n   *     - Attributes appended to element.\n   *       (`attributeChangedCallback` reactions enqueued.)\n   *     - Will execute script flag is true?\n   *       - (Element queue popped from the custom element reactions stack.\n   *         Reactions in the popped stack are invoked.)\n   *   - (Element queue pushed to the custom element reactions stack.)\n   *   - Insert the element:\n   *     https://dom.spec.whatwg.org/#concept-node-insert\n   *     - Shadow-including descendants are connected. During parsing\n   *       construction, there are no shadow-*excluding* descendants.\n   *       However, the constructor may have validly attached a shadow\n   *       tree to itself and added descendants to that shadow tree.\n   *       (`connectedCallback` reactions enqueued.)\n   *   - (Element queue popped from the custom element reactions stack.\n   *     Reactions in the popped stack are invoked.)\n   *\n   * @param {!Node} root\n   * @param {{\n   *   visitedImports: (!Set<!Node>|undefined),\n   *   upgrade: (!function(!Element)|undefined),\n   * }=} options\n   */\n  patchAndUpgradeTree(root, options = {}) {\n    const visitedImports = options.visitedImports || new Set();\n    const upgrade = options.upgrade || (element => this.upgradeElement(element));\n\n    const elements = [];\n\n    const gatherElements = element => {\n      if (element.localName === 'link' && element.getAttribute('rel') === 'import') {\n        // The HTML Imports polyfill sets a descendant element of the link to\n        // the `import` property, specifically this is *not* a Document.\n        const importNode = /** @type {?Node} */ (element.import);\n\n        if (importNode instanceof Node && importNode.readyState === 'complete') {\n          importNode.__CE_isImportDocument = true;\n\n          // Connected links are associated with the registry.\n          importNode.__CE_hasRegistry = true;\n        } else {\n          // If this link's import root is not available, its contents can't be\n          // walked. Wait for 'load' and walk it when it's ready.\n          element.addEventListener('load', () => {\n            const importNode = /** @type {!Node} */ (element.import);\n\n            if (importNode.__CE_documentLoadHandled) return;\n            importNode.__CE_documentLoadHandled = true;\n\n            importNode.__CE_isImportDocument = true;\n\n            // Connected links are associated with the registry.\n            importNode.__CE_hasRegistry = true;\n\n            // Clone the `visitedImports` set that was populated sync during\n            // the `patchAndUpgradeTree` call that caused this 'load' handler to\n            // be added. Then, remove *this* link's import node so that we can\n            // walk that import again, even if it was partially walked later\n            // during the same `patchAndUpgradeTree` call.\n            const clonedVisitedImports = new Set(visitedImports);\n            clonedVisitedImports.delete(importNode);\n\n            this.patchAndUpgradeTree(importNode, {visitedImports: clonedVisitedImports, upgrade});\n          });\n        }\n      } else {\n        elements.push(element);\n      }\n    };\n\n    // `walkDeepDescendantElements` populates (and internally checks against)\n    // `visitedImports` when traversing a loaded import.\n    Utilities.walkDeepDescendantElements(root, gatherElements, visitedImports);\n\n    if (this._hasPatches) {\n      for (let i = 0; i < elements.length; i++) {\n        this.patch(elements[i]);\n      }\n    }\n\n    for (let i = 0; i < elements.length; i++) {\n      upgrade(elements[i]);\n    }\n  }\n\n  /**\n   * @param {!Element} element\n   */\n  upgradeElement(element) {\n    const currentState = element.__CE_state;\n    if (currentState !== undefined) return;\n\n    const definition = this.localNameToDefinition(element.localName);\n    if (!definition) return;\n\n    definition.constructionStack.push(element);\n\n    const constructor = definition.constructor;\n    try {\n      try {\n        let result = new (constructor)();\n        if (result !== element) {\n          throw new Error('The custom element constructor did not produce the element being upgraded.');\n        }\n      } finally {\n        definition.constructionStack.pop();\n      }\n    } catch (e) {\n      element.__CE_state = CEState.failed;\n      throw e;\n    }\n\n    element.__CE_state = CEState.custom;\n    element.__CE_definition = definition;\n\n    if (definition.attributeChangedCallback) {\n      const observedAttributes = definition.observedAttributes;\n      for (let i = 0; i < observedAttributes.length; i++) {\n        const name = observedAttributes[i];\n        const value = element.getAttribute(name);\n        if (value !== null) {\n          this.attributeChangedCallback(element, name, null, value, null);\n        }\n      }\n    }\n\n    if (Utilities.isConnected(element)) {\n      this.connectedCallback(element);\n    }\n  }\n\n  /**\n   * @param {!Element} element\n   */\n  connectedCallback(element) {\n    const definition = element.__CE_definition;\n    if (definition.connectedCallback) {\n      definition.connectedCallback.call(element);\n    }\n  }\n\n  /**\n   * @param {!Element} element\n   */\n  disconnectedCallback(element) {\n    const definition = element.__CE_definition;\n    if (definition.disconnectedCallback) {\n      definition.disconnectedCallback.call(element);\n    }\n  }\n\n  /**\n   * @param {!Element} element\n   * @param {string} name\n   * @param {?string} oldValue\n   * @param {?string} newValue\n   * @param {?string} namespace\n   */\n  attributeChangedCallback(element, name, oldValue, newValue, namespace) {\n    const definition = element.__CE_definition;\n    if (\n      definition.attributeChangedCallback &&\n      definition.observedAttributes.indexOf(name) > -1\n    ) {\n      definition.attributeChangedCallback.call(element, name, oldValue, newValue, namespace);\n    }\n  }\n}\n","/**\n * @enum {number}\n */\nconst CustomElementState = {\n  custom: 1,\n  failed: 2,\n};\n\nexport default CustomElementState;\n","import CustomElementInternals from './CustomElementInternals.js';\n\nexport default class DocumentConstructionObserver {\n  constructor(internals, doc) {\n    /**\n     * @type {!CustomElementInternals}\n     */\n    this._internals = internals;\n\n    /**\n     * @type {!Document}\n     */\n    this._document = doc;\n\n    /**\n     * @type {MutationObserver|undefined}\n     */\n    this._observer = undefined;\n\n\n    // Simulate tree construction for all currently accessible nodes in the\n    // document.\n    this._internals.patchAndUpgradeTree(this._document);\n\n    if (this._document.readyState === 'loading') {\n      this._observer = new MutationObserver(this._handleMutations.bind(this));\n\n      // Nodes created by the parser are given to the observer *before* the next\n      // task runs. Inline scripts are run in a new task. This means that the\n      // observer will be able to handle the newly parsed nodes before the inline\n      // script is run.\n      this._observer.observe(this._document, {\n        childList: true,\n        subtree: true,\n      });\n    }\n  }\n\n  disconnect() {\n    if (this._observer) {\n      this._observer.disconnect();\n    }\n  }\n\n  /**\n   * @param {!Array<!MutationRecord>} mutations\n   */\n  _handleMutations(mutations) {\n    // Once the document's `readyState` is 'interactive' or 'complete', all new\n    // nodes created within that document will be the result of script and\n    // should be handled by patching.\n    const readyState = this._document.readyState;\n    if (readyState === 'interactive' || readyState === 'complete') {\n      this.disconnect();\n    }\n\n    for (let i = 0; i < mutations.length; i++) {\n      const addedNodes = mutations[i].addedNodes;\n      for (let j = 0; j < addedNodes.length; j++) {\n        const node = addedNodes[j];\n        this._internals.patchAndUpgradeTree(node);\n      }\n    }\n  }\n}\n","/**\n * @template T\n */\nexport default class Deferred {\n  constructor() {\n    /**\n     * @private\n     * @type {T|undefined}\n     */\n    this._value = undefined;\n\n    /**\n     * @private\n     * @type {Function|undefined}\n     */\n    this._resolve = undefined;\n\n    /**\n     * @private\n     * @type {!Promise<T>}\n     */\n    this._promise = new Promise(resolve => {\n      this._resolve = resolve;\n\n      if (this._value) {\n        resolve(this._value);\n      }\n    });\n  }\n\n  /**\n   * @param {T} value\n   */\n  resolve(value) {\n    if (this._value) {\n      throw new Error('Already resolved.');\n    }\n\n    this._value = value;\n\n    if (this._resolve) {\n      this._resolve(value);\n    }\n  }\n\n  /**\n   * @return {!Promise<T>}\n   */\n  toPromise() {\n    return this._promise;\n  }\n}\n","import CustomElementInternals from './CustomElementInternals.js';\nimport DocumentConstructionObserver from './DocumentConstructionObserver.js';\nimport Deferred from './Deferred.js';\nimport * as Utilities from './Utilities.js';\n\n/**\n * @unrestricted\n */\nexport default class CustomElementRegistry {\n\n  /**\n   * @param {!CustomElementInternals} internals\n   */\n  constructor(internals) {\n    /**\n     * @private\n     * @type {boolean}\n     */\n    this._elementDefinitionIsRunning = false;\n\n    /**\n     * @private\n     * @type {!CustomElementInternals}\n     */\n    this._internals = internals;\n\n    /**\n     * @private\n     * @type {!Map<string, !Deferred<undefined>>}\n     */\n    this._whenDefinedDeferred = new Map();\n\n    /**\n     * The default flush callback triggers the document walk synchronously.\n     * @private\n     * @type {!Function}\n     */\n    this._flushCallback = fn => fn();\n\n    /**\n     * @private\n     * @type {boolean}\n     */\n    this._flushPending = false;\n\n    /**\n     * @private\n     * @type {!Array<!CustomElementDefinition>}\n     */\n    this._pendingDefinitions = [];\n\n    /**\n     * @private\n     * @type {!DocumentConstructionObserver}\n     */\n    this._documentConstructionObserver = new DocumentConstructionObserver(internals, document);\n  }\n\n  /**\n   * @param {string} localName\n   * @param {!Function} constructor\n   */\n  define(localName, constructor) {\n    if (!(constructor instanceof Function)) {\n      throw new TypeError('Custom element constructors must be functions.');\n    }\n\n    if (!Utilities.isValidCustomElementName(localName)) {\n      throw new SyntaxError(`The element name '${localName}' is not valid.`);\n    }\n\n    if (this._internals.localNameToDefinition(localName)) {\n      throw new Error(`A custom element with name '${localName}' has already been defined.`);\n    }\n\n    if (this._elementDefinitionIsRunning) {\n      throw new Error('A custom element is already being defined.');\n    }\n    this._elementDefinitionIsRunning = true;\n\n    let connectedCallback;\n    let disconnectedCallback;\n    let adoptedCallback;\n    let attributeChangedCallback;\n    let observedAttributes;\n    try {\n      /** @type {!Object} */\n      const prototype = constructor.prototype;\n      if (!(prototype instanceof Object)) {\n        throw new TypeError('The custom element constructor\\'s prototype is not an object.');\n      }\n\n      function getCallback(name) {\n        const callbackValue = prototype[name];\n        if (callbackValue !== undefined && !(callbackValue instanceof Function)) {\n          throw new Error(`The '${name}' callback must be a function.`);\n        }\n        return callbackValue;\n      }\n\n      connectedCallback = getCallback('connectedCallback');\n      disconnectedCallback = getCallback('disconnectedCallback');\n      adoptedCallback = getCallback('adoptedCallback');\n      attributeChangedCallback = getCallback('attributeChangedCallback');\n      observedAttributes = constructor['observedAttributes'] || [];\n    } catch (e) {\n      return;\n    } finally {\n      this._elementDefinitionIsRunning = false;\n    }\n\n    const definition = {\n      localName,\n      constructor,\n      connectedCallback,\n      disconnectedCallback,\n      adoptedCallback,\n      attributeChangedCallback,\n      observedAttributes,\n      constructionStack: [],\n    };\n\n    this._internals.setDefinition(localName, definition);\n    this._pendingDefinitions.push(definition);\n\n    // If we've already called the flush callback and it hasn't called back yet,\n    // don't call it again.\n    if (!this._flushPending) {\n      this._flushPending = true;\n      this._flushCallback(() => this._flush());\n    }\n  }\n\n  _flush() {\n    // If no new definitions were defined, don't attempt to flush. This could\n    // happen if a flush callback keeps the function it is given and calls it\n    // multiple times.\n    if (this._flushPending === false) return;\n    this._flushPending = false;\n\n    const pendingDefinitions = this._pendingDefinitions;\n\n    /**\n     * Unupgraded elements with definitions that were defined *before* the last\n     * flush, in document order.\n     * @type {!Array<!Element>}\n     */\n    const elementsWithStableDefinitions = [];\n\n    /**\n     * A map from `localName`s of definitions that were defined *after* the last\n     * flush to unupgraded elements matching that definition, in document order.\n     * @type {!Map<string, !Array<!Element>>}\n     */\n    const elementsWithPendingDefinitions = new Map();\n    for (let i = 0; i < pendingDefinitions.length; i++) {\n      elementsWithPendingDefinitions.set(pendingDefinitions[i].localName, []);\n    }\n\n    this._internals.patchAndUpgradeTree(document, {\n      upgrade: element => {\n        // Ignore the element if it has already upgraded or failed to upgrade.\n        if (element.__CE_state !== undefined) return;\n\n        const localName = element.localName;\n\n        // If there is an applicable pending definition for the element, add the\n        // element to the list of elements to be upgraded with that definition.\n        const pendingElements = elementsWithPendingDefinitions.get(localName);\n        if (pendingElements) {\n          pendingElements.push(element);\n        // If there is *any other* applicable definition for the element, add it\n        // to the list of elements with stable definitions that need to be upgraded.\n        } else if (this._internals.localNameToDefinition(localName)) {\n          elementsWithStableDefinitions.push(element);\n        }\n      },\n    });\n\n    // Upgrade elements with 'stable' definitions first.\n    for (let i = 0; i < elementsWithStableDefinitions.length; i++) {\n      this._internals.upgradeElement(elementsWithStableDefinitions[i]);\n    }\n\n    // Upgrade elements with 'pending' definitions in the order they were defined.\n    while (pendingDefinitions.length > 0) {\n      const definition = pendingDefinitions.shift();\n      const localName = definition.localName;\n\n      // Attempt to upgrade all applicable elements.\n      const pendingUpgradableElements = elementsWithPendingDefinitions.get(definition.localName);\n      for (let i = 0; i < pendingUpgradableElements.length; i++) {\n        this._internals.upgradeElement(pendingUpgradableElements[i]);\n      }\n\n      // Resolve any promises created by `whenDefined` for the definition.\n      const deferred = this._whenDefinedDeferred.get(localName);\n      if (deferred) {\n        deferred.resolve(undefined);\n      }\n    }\n  }\n\n  /**\n   * @param {string} localName\n   * @return {Function|undefined}\n   */\n  get(localName) {\n    const definition = this._internals.localNameToDefinition(localName);\n    if (definition) {\n      return definition.constructor;\n    }\n\n    return undefined;\n  }\n\n  /**\n   * @param {string} localName\n   * @return {!Promise<undefined>}\n   */\n  whenDefined(localName) {\n    if (!Utilities.isValidCustomElementName(localName)) {\n      return Promise.reject(new SyntaxError(`'${localName}' is not a valid custom element name.`));\n    }\n\n    const prior = this._whenDefinedDeferred.get(localName);\n    if (prior) {\n      return prior.toPromise();\n    }\n\n    const deferred = new Deferred();\n    this._whenDefinedDeferred.set(localName, deferred);\n\n    const definition = this._internals.localNameToDefinition(localName);\n    // Resolve immediately only if the given local name has a definition *and*\n    // the full document walk to upgrade elements with that local name has\n    // already happened.\n    if (definition && !this._pendingDefinitions.some(d => d.localName === localName)) {\n      deferred.resolve(undefined);\n    }\n\n    return deferred.toPromise();\n  }\n\n  polyfillWrapFlushCallback(outer) {\n    this._documentConstructionObserver.disconnect();\n    const inner = this._flushCallback;\n    this._flushCallback = flush => outer(() => inner(flush));\n  }\n}\n\n// Closure compiler exports.\nwindow['CustomElementRegistry'] = CustomElementRegistry;\nCustomElementRegistry.prototype['define'] = CustomElementRegistry.prototype.define;\nCustomElementRegistry.prototype['get'] = CustomElementRegistry.prototype.get;\nCustomElementRegistry.prototype['whenDefined'] = CustomElementRegistry.prototype.whenDefined;\nCustomElementRegistry.prototype['polyfillWrapFlushCallback'] = CustomElementRegistry.prototype.polyfillWrapFlushCallback;\n","export default {\n  Document_createElement: window.Document.prototype.createElement,\n  Document_createElementNS: window.Document.prototype.createElementNS,\n  Document_importNode: window.Document.prototype.importNode,\n  Document_prepend: window.Document.prototype['prepend'],\n  Document_append: window.Document.prototype['append'],\n  DocumentFragment_prepend: window.DocumentFragment.prototype['prepend'],\n  DocumentFragment_append: window.DocumentFragment.prototype['append'],\n  Node_cloneNode: window.Node.prototype.cloneNode,\n  Node_appendChild: window.Node.prototype.appendChild,\n  Node_insertBefore: window.Node.prototype.insertBefore,\n  Node_removeChild: window.Node.prototype.removeChild,\n  Node_replaceChild: window.Node.prototype.replaceChild,\n  Node_textContent: Object.getOwnPropertyDescriptor(window.Node.prototype, 'textContent'),\n  Element_attachShadow: window.Element.prototype['attachShadow'],\n  Element_innerHTML: Object.getOwnPropertyDescriptor(window.Element.prototype, 'innerHTML'),\n  Element_getAttribute: window.Element.prototype.getAttribute,\n  Element_setAttribute: window.Element.prototype.setAttribute,\n  Element_removeAttribute: window.Element.prototype.removeAttribute,\n  Element_getAttributeNS: window.Element.prototype.getAttributeNS,\n  Element_setAttributeNS: window.Element.prototype.setAttributeNS,\n  Element_removeAttributeNS: window.Element.prototype.removeAttributeNS,\n  Element_insertAdjacentElement: window.Element.prototype['insertAdjacentElement'],\n  Element_prepend: window.Element.prototype['prepend'],\n  Element_append: window.Element.prototype['append'],\n  Element_before: window.Element.prototype['before'],\n  Element_after: window.Element.prototype['after'],\n  Element_replaceWith: window.Element.prototype['replaceWith'],\n  Element_remove: window.Element.prototype['remove'],\n  HTMLElement: window.HTMLElement,\n  HTMLElement_innerHTML: Object.getOwnPropertyDescriptor(window.HTMLElement.prototype, 'innerHTML'),\n  HTMLElement_insertAdjacentElement: window.HTMLElement.prototype['insertAdjacentElement'],\n};\n","import Native from './Native.js';\nimport CustomElementInternals from '../CustomElementInternals.js';\nimport CEState from '../CustomElementState.js';\nimport AlreadyConstructedMarker from '../AlreadyConstructedMarker.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n  window['HTMLElement'] = (function() {\n    /**\n     * @type {function(new: HTMLElement): !HTMLElement}\n     */\n    function HTMLElement() {\n      // This should really be `new.target` but `new.target` can't be emulated\n      // in ES5. Assuming the user keeps the default value of the constructor's\n      // prototype's `constructor` property, this is equivalent.\n      /** @type {!Function} */\n      const constructor = this.constructor;\n\n      const definition = internals.constructorToDefinition(constructor);\n      if (!definition) {\n        throw new Error('The custom element being constructed was not registered with `customElements`.');\n      }\n\n      const constructionStack = definition.constructionStack;\n\n      if (constructionStack.length === 0) {\n        const element = Native.Document_createElement.call(document, definition.localName);\n        Object.setPrototypeOf(element, constructor.prototype);\n        element.__CE_state = CEState.custom;\n        element.__CE_definition = definition;\n        internals.patch(element);\n        return element;\n      }\n\n      const lastIndex = constructionStack.length - 1;\n      const element = constructionStack[lastIndex];\n      if (element === AlreadyConstructedMarker) {\n        throw new Error('The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.');\n      }\n      constructionStack[lastIndex] = AlreadyConstructedMarker;\n\n      Object.setPrototypeOf(element, constructor.prototype);\n      internals.patch(/** @type {!HTMLElement} */ (element));\n\n      return element;\n    }\n\n    HTMLElement.prototype = Native.HTMLElement.prototype;\n\n    return HTMLElement;\n  })();\n};\n","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\nimport CustomElementInternals from './CustomElementInternals.js';\nimport CustomElementRegistry from './CustomElementRegistry.js';\n\nimport PatchHTMLElement from './Patch/HTMLElement.js';\nimport PatchDocument from './Patch/Document.js';\nimport PatchDocumentFragment from './Patch/DocumentFragment.js';\nimport PatchNode from './Patch/Node.js';\nimport PatchElement from './Patch/Element.js';\n\nconst priorCustomElements = window['customElements'];\n\nif (!priorCustomElements ||\n     priorCustomElements['forcePolyfill'] ||\n     (typeof priorCustomElements['define'] != 'function') ||\n     (typeof priorCustomElements['get'] != 'function')) {\n  /** @type {!CustomElementInternals} */\n  const internals = new CustomElementInternals();\n\n  PatchHTMLElement(internals);\n  PatchDocument(internals);\n  PatchDocumentFragment(internals);\n  PatchNode(internals);\n  PatchElement(internals);\n\n  // The main document is always associated with the registry.\n  document.__CE_hasRegistry = true;\n\n  /** @type {!CustomElementRegistry} */\n  const customElements = new CustomElementRegistry(internals);\n\n  Object.defineProperty(window, 'customElements', {\n    configurable: true,\n    enumerable: true,\n    value: customElements,\n  });\n}\n","import CustomElementInternals from '../../CustomElementInternals.js';\nimport * as Utilities from '../../Utilities.js';\n\n/**\n * @typedef {{\n *   prepend: !function(...(!Node|string)),\n  *  append: !function(...(!Node|string)),\n * }}\n */\nlet ParentNodeNativeMethods;\n\n/**\n * @param {!CustomElementInternals} internals\n * @param {!Object} destination\n * @param {!ParentNodeNativeMethods} builtIn\n */\nexport default function(internals, destination, builtIn) {\n  /**\n   * @param {!function(...(!Node|string))} builtInMethod\n   * @return {!function(...(!Node|string))}\n   */\n  function appendPrependPatch(builtInMethod) {\n    return function(...nodes) {\n      /**\n       * A copy of `nodes`, with any DocumentFragment replaced by its children.\n       * @type {!Array<!Node>}\n       */\n      const flattenedNodes = [];\n\n      /**\n       * Elements in `nodes` that were connected before this call.\n       * @type {!Array<!Node>}\n       */\n      const connectedElements = [];\n\n      for (var i = 0; i < nodes.length; i++) {\n        const node = nodes[i];\n\n        if (node instanceof Element && Utilities.isConnected(node)) {\n          connectedElements.push(node);\n        }\n\n        if (node instanceof DocumentFragment) {\n          for (let child = node.firstChild; child; child = child.nextSibling) {\n            flattenedNodes.push(child);\n          }\n        } else {\n          flattenedNodes.push(node);\n        }\n      }\n\n      builtInMethod.apply(this, nodes);\n\n      for (let i = 0; i < connectedElements.length; i++) {\n        internals.disconnectTree(connectedElements[i]);\n      }\n\n      if (Utilities.isConnected(this)) {\n        for (let i = 0; i < flattenedNodes.length; i++) {\n          const node = flattenedNodes[i];\n          if (node instanceof Element) {\n            internals.connectTree(node);\n          }\n        }\n      }\n    };\n  }\n\n  if (builtIn.prepend !== undefined) {\n    Utilities.setPropertyUnchecked(destination, 'prepend', appendPrependPatch(builtIn.prepend));\n  }\n\n  if (builtIn.append !== undefined) {\n    Utilities.setPropertyUnchecked(destination, 'append', appendPrependPatch(builtIn.append));\n  }\n};\n","import Native from './Native.js';\nimport CustomElementInternals from '../CustomElementInternals.js';\nimport * as Utilities from '../Utilities.js';\n\nimport PatchParentNode from './Interface/ParentNode.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n  Utilities.setPropertyUnchecked(Document.prototype, 'createElement',\n    /**\n     * @this {Document}\n     * @param {string} localName\n     * @return {!Element}\n     */\n    function(localName) {\n      // Only create custom elements if this document is associated with the registry.\n      if (this.__CE_hasRegistry) {\n        const definition = internals.localNameToDefinition(localName);\n        if (definition) {\n          return new (definition.constructor)();\n        }\n      }\n\n      const result = /** @type {!Element} */\n        (Native.Document_createElement.call(this, localName));\n      internals.patch(result);\n      return result;\n    });\n\n  Utilities.setPropertyUnchecked(Document.prototype, 'importNode',\n    /**\n     * @this {Document}\n     * @param {!Node} node\n     * @param {boolean=} deep\n     * @return {!Node}\n     */\n    function(node, deep) {\n      const clone = Native.Document_importNode.call(this, node, deep);\n      // Only create custom elements if this document is associated with the registry.\n      if (!this.__CE_hasRegistry) {\n        internals.patchTree(clone);\n      } else {\n        internals.patchAndUpgradeTree(clone);\n      }\n      return clone;\n    });\n\n  const NS_HTML = \"http://www.w3.org/1999/xhtml\";\n\n  Utilities.setPropertyUnchecked(Document.prototype, 'createElementNS',\n    /**\n     * @this {Document}\n     * @param {?string} namespace\n     * @param {string} localName\n     * @return {!Element}\n     */\n    function(namespace, localName) {\n      // Only create custom elements if this document is associated with the registry.\n      if (this.__CE_hasRegistry && (namespace === null || namespace === NS_HTML)) {\n        const definition = internals.localNameToDefinition(localName);\n        if (definition) {\n          return new (definition.constructor)();\n        }\n      }\n\n      const result = /** @type {!Element} */\n        (Native.Document_createElementNS.call(this, namespace, localName));\n      internals.patch(result);\n      return result;\n    });\n\n  PatchParentNode(internals, Document.prototype, {\n    prepend: Native.Document_prepend,\n    append: Native.Document_append,\n  });\n};\n","import Native from './Native.js';\nimport CustomElementInternals from '../CustomElementInternals.js';\nimport * as Utilities from '../Utilities.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n  // `Node#nodeValue` is implemented on `Attr`.\n  // `Node#textContent` is implemented on `Attr`, `Element`.\n\n  Utilities.setPropertyUnchecked(Node.prototype, 'insertBefore',\n    /**\n     * @this {Node}\n     * @param {!Node} node\n     * @param {?Node} refNode\n     * @return {!Node}\n     */\n    function(node, refNode) {\n      if (node instanceof DocumentFragment) {\n        const insertedNodes = Array.prototype.slice.apply(node.childNodes);\n        const nativeResult = Native.Node_insertBefore.call(this, node, refNode);\n\n        // DocumentFragments can't be connected, so `disconnectTree` will never\n        // need to be called on a DocumentFragment's children after inserting it.\n\n        if (Utilities.isConnected(this)) {\n          for (let i = 0; i < insertedNodes.length; i++) {\n            internals.connectTree(insertedNodes[i]);\n          }\n        }\n\n        return nativeResult;\n      }\n\n      const nodeWasConnected = Utilities.isConnected(node);\n      const nativeResult = Native.Node_insertBefore.call(this, node, refNode);\n\n      if (nodeWasConnected) {\n        internals.disconnectTree(node);\n      }\n\n      if (Utilities.isConnected(this)) {\n        internals.connectTree(node);\n      }\n\n      return nativeResult;\n    });\n\n  Utilities.setPropertyUnchecked(Node.prototype, 'appendChild',\n    /**\n     * @this {Node}\n     * @param {!Node} node\n     * @return {!Node}\n     */\n    function(node) {\n      if (node instanceof DocumentFragment) {\n        const insertedNodes = Array.prototype.slice.apply(node.childNodes);\n        const nativeResult = Native.Node_appendChild.call(this, node);\n\n        // DocumentFragments can't be connected, so `disconnectTree` will never\n        // need to be called on a DocumentFragment's children after inserting it.\n\n        if (Utilities.isConnected(this)) {\n          for (let i = 0; i < insertedNodes.length; i++) {\n            internals.connectTree(insertedNodes[i]);\n          }\n        }\n\n        return nativeResult;\n      }\n\n      const nodeWasConnected = Utilities.isConnected(node);\n      const nativeResult = Native.Node_appendChild.call(this, node);\n\n      if (nodeWasConnected) {\n        internals.disconnectTree(node);\n      }\n\n      if (Utilities.isConnected(this)) {\n        internals.connectTree(node);\n      }\n\n      return nativeResult;\n    });\n\n  Utilities.setPropertyUnchecked(Node.prototype, 'cloneNode',\n    /**\n     * @this {Node}\n     * @param {boolean=} deep\n     * @return {!Node}\n     */\n    function(deep) {\n      const clone = Native.Node_cloneNode.call(this, deep);\n      // Only create custom elements if this element's owner document is\n      // associated with the registry.\n      if (!this.ownerDocument.__CE_hasRegistry) {\n        internals.patchTree(clone);\n      } else {\n        internals.patchAndUpgradeTree(clone);\n      }\n      return clone;\n    });\n\n  Utilities.setPropertyUnchecked(Node.prototype, 'removeChild',\n    /**\n     * @this {Node}\n     * @param {!Node} node\n     * @return {!Node}\n     */\n    function(node) {\n      const nodeWasConnected = Utilities.isConnected(node);\n      const nativeResult = Native.Node_removeChild.call(this, node);\n\n      if (nodeWasConnected) {\n        internals.disconnectTree(node);\n      }\n\n      return nativeResult;\n    });\n\n  Utilities.setPropertyUnchecked(Node.prototype, 'replaceChild',\n    /**\n     * @this {Node}\n     * @param {!Node} nodeToInsert\n     * @param {!Node} nodeToRemove\n     * @return {!Node}\n     */\n    function(nodeToInsert, nodeToRemove) {\n      if (nodeToInsert instanceof DocumentFragment) {\n        const insertedNodes = Array.prototype.slice.apply(nodeToInsert.childNodes);\n        const nativeResult = Native.Node_replaceChild.call(this, nodeToInsert, nodeToRemove);\n\n        // DocumentFragments can't be connected, so `disconnectTree` will never\n        // need to be called on a DocumentFragment's children after inserting it.\n\n        if (Utilities.isConnected(this)) {\n          internals.disconnectTree(nodeToRemove);\n          for (let i = 0; i < insertedNodes.length; i++) {\n            internals.connectTree(insertedNodes[i]);\n          }\n        }\n\n        return nativeResult;\n      }\n\n      const nodeToInsertWasConnected = Utilities.isConnected(nodeToInsert);\n      const nativeResult = Native.Node_replaceChild.call(this, nodeToInsert, nodeToRemove);\n      const thisIsConnected = Utilities.isConnected(this);\n\n      if (thisIsConnected) {\n        internals.disconnectTree(nodeToRemove);\n      }\n\n      if (nodeToInsertWasConnected) {\n        internals.disconnectTree(nodeToInsert);\n      }\n\n      if (thisIsConnected) {\n        internals.connectTree(nodeToInsert);\n      }\n\n      return nativeResult;\n    });\n\n\n  function patch_textContent(destination, baseDescriptor) {\n    Object.defineProperty(destination, 'textContent', {\n      enumerable: baseDescriptor.enumerable,\n      configurable: true,\n      get: baseDescriptor.get,\n      set: /** @this {Node} */ function(assignedValue) {\n        // If this is a text node then there are no nodes to disconnect.\n        if (this.nodeType === Node.TEXT_NODE) {\n          baseDescriptor.set.call(this, assignedValue);\n          return;\n        }\n\n        let removedNodes = undefined;\n        // Checking for `firstChild` is faster than reading `childNodes.length`\n        // to compare with 0.\n        if (this.firstChild) {\n          // Using `childNodes` is faster than `children`, even though we only\n          // care about elements.\n          const childNodes = this.childNodes;\n          const childNodesLength = childNodes.length;\n          if (childNodesLength > 0 && Utilities.isConnected(this)) {\n            // Copying an array by iterating is faster than using slice.\n            removedNodes = new Array(childNodesLength);\n            for (let i = 0; i < childNodesLength; i++) {\n              removedNodes[i] = childNodes[i];\n            }\n          }\n        }\n\n        baseDescriptor.set.call(this, assignedValue);\n\n        if (removedNodes) {\n          for (let i = 0; i < removedNodes.length; i++) {\n            internals.disconnectTree(removedNodes[i]);\n          }\n        }\n      },\n    });\n  }\n\n  if (Native.Node_textContent && Native.Node_textContent.get) {\n    patch_textContent(Node.prototype, Native.Node_textContent);\n  } else {\n    internals.addPatch(function(element) {\n      patch_textContent(element, {\n        enumerable: true,\n        configurable: true,\n        // NOTE: This implementation of the `textContent` getter assumes that\n        // text nodes' `textContent` getter will not be patched.\n        get: /** @this {Node} */ function() {\n          /** @type {!Array<string>} */\n          const parts = [];\n\n          for (let i = 0; i < this.childNodes.length; i++) {\n            parts.push(this.childNodes[i].textContent);\n          }\n\n          return parts.join('');\n        },\n        set: /** @this {Node} */ function(assignedValue) {\n          while (this.firstChild) {\n            Native.Node_removeChild.call(this, this.firstChild);\n          }\n          Native.Node_appendChild.call(this, document.createTextNode(assignedValue));\n        },\n      });\n    });\n  }\n};\n","import CustomElementInternals from '../../CustomElementInternals.js';\nimport * as Utilities from '../../Utilities.js';\n\n/**\n * @typedef {{\n *   before: !function(...(!Node|string)),\n *   after: !function(...(!Node|string)),\n *   replaceWith: !function(...(!Node|string)),\n *   remove: !function(),\n * }}\n */\nlet ChildNodeNativeMethods;\n\n/**\n * @param {!CustomElementInternals} internals\n * @param {!Object} destination\n * @param {!ChildNodeNativeMethods} builtIn\n */\nexport default function(internals, destination, builtIn) {\n  /**\n   * @param {!function(...(!Node|string))} builtInMethod\n   * @return {!function(...(!Node|string))}\n   */\n  function beforeAfterPatch(builtInMethod) {\n    return function(...nodes) {\n      /**\n       * A copy of `nodes`, with any DocumentFragment replaced by its children.\n       * @type {!Array<!Node>}\n       */\n      const flattenedNodes = [];\n\n      /**\n       * Elements in `nodes` that were connected before this call.\n       * @type {!Array<!Node>}\n       */\n      const connectedElements = [];\n\n      for (var i = 0; i < nodes.length; i++) {\n        const node = nodes[i];\n\n        if (node instanceof Element && Utilities.isConnected(node)) {\n          connectedElements.push(node);\n        }\n\n        if (node instanceof DocumentFragment) {\n          for (let child = node.firstChild; child; child = child.nextSibling) {\n            flattenedNodes.push(child);\n          }\n        } else {\n          flattenedNodes.push(node);\n        }\n      }\n\n      builtInMethod.apply(this, nodes);\n\n      for (let i = 0; i < connectedElements.length; i++) {\n        internals.disconnectTree(connectedElements[i]);\n      }\n\n      if (Utilities.isConnected(this)) {\n        for (let i = 0; i < flattenedNodes.length; i++) {\n          const node = flattenedNodes[i];\n          if (node instanceof Element) {\n            internals.connectTree(node);\n          }\n        }\n      }\n    };\n  }\n\n  if (builtIn.before !== undefined) {\n    Utilities.setPropertyUnchecked(destination, 'before', beforeAfterPatch(builtIn.before));\n  }\n\n  if (builtIn.before !== undefined) {\n    Utilities.setPropertyUnchecked(destination, 'after', beforeAfterPatch(builtIn.after));\n  }\n\n  if (builtIn.replaceWith !== undefined) {\n    Utilities.setPropertyUnchecked(destination, 'replaceWith',\n      /**\n       * @param {...(!Node|string)} nodes\n       */\n      function(...nodes) {\n        /**\n         * A copy of `nodes`, with any DocumentFragment replaced by its children.\n         * @type {!Array<!Node>}\n         */\n        const flattenedNodes = [];\n\n        /**\n         * Elements in `nodes` that were connected before this call.\n         * @type {!Array<!Node>}\n         */\n        const connectedElements = [];\n\n        for (var i = 0; i < nodes.length; i++) {\n          const node = nodes[i];\n\n          if (node instanceof Element && Utilities.isConnected(node)) {\n            connectedElements.push(node);\n          }\n\n          if (node instanceof DocumentFragment) {\n            for (let child = node.firstChild; child; child = child.nextSibling) {\n              flattenedNodes.push(child);\n            }\n          } else {\n            flattenedNodes.push(node);\n          }\n        }\n\n        const wasConnected = Utilities.isConnected(this);\n\n        builtIn.replaceWith.apply(this, nodes);\n\n        for (let i = 0; i < connectedElements.length; i++) {\n          internals.disconnectTree(connectedElements[i]);\n        }\n\n        if (wasConnected) {\n          internals.disconnectTree(this);\n          for (let i = 0; i < flattenedNodes.length; i++) {\n            const node = flattenedNodes[i];\n            if (node instanceof Element) {\n              internals.connectTree(node);\n            }\n          }\n        }\n      });\n    }\n\n  if (builtIn.remove !== undefined) {\n    Utilities.setPropertyUnchecked(destination, 'remove',\n      function() {\n        const wasConnected = Utilities.isConnected(this);\n\n        builtIn.remove.call(this);\n\n        if (wasConnected) {\n          internals.disconnectTree(this);\n        }\n      });\n  }\n};\n","import Native from './Native.js';\nimport CustomElementInternals from '../CustomElementInternals.js';\nimport CEState from '../CustomElementState.js';\nimport * as Utilities from '../Utilities.js';\n\nimport PatchParentNode from './Interface/ParentNode.js';\nimport PatchChildNode from './Interface/ChildNode.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n  if (Native.Element_attachShadow) {\n    Utilities.setPropertyUnchecked(Element.prototype, 'attachShadow',\n      /**\n       * @this {Element}\n       * @param {!{mode: string}} init\n       * @return {ShadowRoot}\n       */\n      function(init) {\n        const shadowRoot = Native.Element_attachShadow.call(this, init);\n        this.__CE_shadowRoot = shadowRoot;\n        return shadowRoot;\n      });\n  }\n\n\n  function patch_innerHTML(destination, baseDescriptor) {\n    Object.defineProperty(destination, 'innerHTML', {\n      enumerable: baseDescriptor.enumerable,\n      configurable: true,\n      get: baseDescriptor.get,\n      set: /** @this {Element} */ function(htmlString) {\n        const isConnected = Utilities.isConnected(this);\n\n        // NOTE: In IE11, when using the native `innerHTML` setter, all nodes\n        // that were previously descendants of the context element have all of\n        // their children removed as part of the set - the entire subtree is\n        // 'disassembled'. This work around walks the subtree *before* using the\n        // native setter.\n        /** @type {!Array<!Element>|undefined} */\n        let removedElements = undefined;\n        if (isConnected) {\n          removedElements = [];\n          Utilities.walkDeepDescendantElements(this, element => {\n            if (element !== this) {\n              removedElements.push(element);\n            }\n          });\n        }\n\n        baseDescriptor.set.call(this, htmlString);\n\n        if (removedElements) {\n          for (let i = 0; i < removedElements.length; i++) {\n            const element = removedElements[i];\n            if (element.__CE_state === CEState.custom) {\n              internals.disconnectedCallback(element);\n            }\n          }\n        }\n\n        // Only create custom elements if this element's owner document is\n        // associated with the registry.\n        if (!this.ownerDocument.__CE_hasRegistry) {\n          internals.patchTree(this);\n        } else {\n          internals.patchAndUpgradeTree(this);\n        }\n        return htmlString;\n      },\n    });\n  }\n\n  if (Native.Element_innerHTML && Native.Element_innerHTML.get) {\n    patch_innerHTML(Element.prototype, Native.Element_innerHTML);\n  } else if (Native.HTMLElement_innerHTML && Native.HTMLElement_innerHTML.get) {\n    patch_innerHTML(HTMLElement.prototype, Native.HTMLElement_innerHTML);\n  } else {\n\n    internals.addPatch(function(element) {\n      patch_innerHTML(element, {\n        enumerable: true,\n        configurable: true,\n        // Implements getting `innerHTML` by performing an unpatched `cloneNode`\n        // of the element and returning the resulting element's `innerHTML`.\n        // TODO: Is this too expensive?\n        get: /** @this {Element} */ function() {\n          return Native.Node_cloneNode.call(this, true).innerHTML;\n        },\n        // Implements setting `innerHTML` by creating an unpatched element,\n        // setting `innerHTML` of that element and replacing the target\n        // element's children with those of the unpatched element.\n        set: /** @this {Element} */ function(assignedValue) {\n          // NOTE: re-route to `content` for `template` elements.\n          // We need to do this because `template.appendChild` does not\n          // route into `template.content`.\n          const isTemplate = (this.localName === 'template');\n          /** @type {!Node} */\n          const content = isTemplate ? (/** @type {!HTMLTemplateElement} */\n            (this)).content : this;\n          /** @type {!Node} */\n          const rawElement = Native.Document_createElement.call(document,\n            this.localName);\n          rawElement.innerHTML = assignedValue;\n\n          while (content.childNodes.length > 0) {\n            Native.Node_removeChild.call(content, content.childNodes[0]);\n          }\n          const container = isTemplate ? rawElement.content : rawElement;\n          while (container.childNodes.length > 0) {\n            Native.Node_appendChild.call(content, container.childNodes[0]);\n          }\n        },\n      });\n    });\n  }\n\n\n  Utilities.setPropertyUnchecked(Element.prototype, 'setAttribute',\n    /**\n     * @this {Element}\n     * @param {string} name\n     * @param {string} newValue\n     */\n    function(name, newValue) {\n      // Fast path for non-custom elements.\n      if (this.__CE_state !== CEState.custom) {\n        return Native.Element_setAttribute.call(this, name, newValue);\n      }\n\n      const oldValue = Native.Element_getAttribute.call(this, name);\n      Native.Element_setAttribute.call(this, name, newValue);\n      newValue = Native.Element_getAttribute.call(this, name);\n      internals.attributeChangedCallback(this, name, oldValue, newValue, null);\n    });\n\n  Utilities.setPropertyUnchecked(Element.prototype, 'setAttributeNS',\n    /**\n     * @this {Element}\n     * @param {?string} namespace\n     * @param {string} name\n     * @param {string} newValue\n     */\n    function(namespace, name, newValue) {\n      // Fast path for non-custom elements.\n      if (this.__CE_state !== CEState.custom) {\n        return Native.Element_setAttributeNS.call(this, namespace, name, newValue);\n      }\n\n      const oldValue = Native.Element_getAttributeNS.call(this, namespace, name);\n      Native.Element_setAttributeNS.call(this, namespace, name, newValue);\n      newValue = Native.Element_getAttributeNS.call(this, namespace, name);\n      internals.attributeChangedCallback(this, name, oldValue, newValue, namespace);\n    });\n\n  Utilities.setPropertyUnchecked(Element.prototype, 'removeAttribute',\n    /**\n     * @this {Element}\n     * @param {string} name\n     */\n    function(name) {\n      // Fast path for non-custom elements.\n      if (this.__CE_state !== CEState.custom) {\n        return Native.Element_removeAttribute.call(this, name);\n      }\n\n      const oldValue = Native.Element_getAttribute.call(this, name);\n      Native.Element_removeAttribute.call(this, name);\n      if (oldValue !== null) {\n        internals.attributeChangedCallback(this, name, oldValue, null, null);\n      }\n    });\n\n  Utilities.setPropertyUnchecked(Element.prototype, 'removeAttributeNS',\n    /**\n     * @this {Element}\n     * @param {?string} namespace\n     * @param {string} name\n     */\n    function(namespace, name) {\n      // Fast path for non-custom elements.\n      if (this.__CE_state !== CEState.custom) {\n        return Native.Element_removeAttributeNS.call(this, namespace, name);\n      }\n\n      const oldValue = Native.Element_getAttributeNS.call(this, namespace, name);\n      Native.Element_removeAttributeNS.call(this, namespace, name);\n      // In older browsers, `Element#getAttributeNS` may return the empty string\n      // instead of null if the attribute does not exist. For details, see;\n      // https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNS#Notes\n      const newValue = Native.Element_getAttributeNS.call(this, namespace, name);\n      if (oldValue !== newValue) {\n        internals.attributeChangedCallback(this, name, oldValue, newValue, namespace);\n      }\n    });\n\n\n  function patch_insertAdjacentElement(destination, baseMethod) {\n    Utilities.setPropertyUnchecked(destination, 'insertAdjacentElement',\n      /**\n       * @this {Element}\n       * @param {string} where\n       * @param {!Element} element\n       * @return {?Element}\n       */\n      function(where, element) {\n        const wasConnected = Utilities.isConnected(element);\n        const insertedElement = /** @type {!Element} */\n          (baseMethod.call(this, where, element));\n\n        if (wasConnected) {\n          internals.disconnectTree(element);\n        }\n\n        if (Utilities.isConnected(insertedElement)) {\n          internals.connectTree(element);\n        }\n        return insertedElement;\n      });\n  }\n\n  if (Native.HTMLElement_insertAdjacentElement) {\n    patch_insertAdjacentElement(HTMLElement.prototype, Native.HTMLElement_insertAdjacentElement);\n  } else if (Native.Element_insertAdjacentElement) {\n    patch_insertAdjacentElement(Element.prototype, Native.Element_insertAdjacentElement);\n  } else {\n    console.warn('Custom Elements: `Element#insertAdjacentElement` was not patched.');\n  }\n\n\n  PatchParentNode(internals, Element.prototype, {\n    prepend: Native.Element_prepend,\n    append: Native.Element_append,\n  });\n\n  PatchChildNode(internals, Element.prototype, {\n    before: Native.Element_before,\n    after: Native.Element_after,\n    replaceWith: Native.Element_replaceWith,\n    remove: Native.Element_remove,\n  });\n};\n","import CustomElementInternals from '../CustomElementInternals.js';\nimport Native from './Native.js';\nimport PatchParentNode from './Interface/ParentNode.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n  PatchParentNode(internals, DocumentFragment.prototype, {\n    prepend: Native.DocumentFragment_prepend,\n    append: Native.DocumentFragment_append,\n  });\n};\n"]}
\ No newline at end of file
--- a/browser/components/payments/test/mochitest/mochitest.ini
+++ b/browser/components/payments/test/mochitest/mochitest.ini
@@ -1,11 +1,9 @@
 [DEFAULT]
-prefs =
-   dom.webcomponents.customelements.enabled=false
 support-files =
    !/browser/extensions/formautofill/content/editAddress.xhtml
    !/browser/extensions/formautofill/content/editCreditCard.xhtml
    ../../../../../browser/extensions/formautofill/content/autofillEditForms.js
    ../../../../../browser/extensions/formautofill/skin/shared/editDialog-shared.css
    ../../../../../testing/modules/sinon-2.3.2.js
    # paymentRequest.xhtml is needed for `importDialogDependencies` so that the relative paths of
    # formautofill/edit*.xhtml work from the *-form elements in paymentRequest.xhtml.
--- a/browser/components/payments/test/mochitest/test_ObservedPropertiesMixin.html
+++ b/browser/components/payments/test/mochitest/test_ObservedPropertiesMixin.html
@@ -4,17 +4,16 @@
 Test the ObservedPropertiesMixin
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the ObservedPropertiesMixin</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
 
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
   <p id="display">
     <test-element id="el1" one="foo" two-word="bar"></test-element>
   </p>
 <div id="content" style="display: none">
--- a/browser/components/payments/test/mochitest/test_PaymentStateSubscriberMixin.html
+++ b/browser/components/payments/test/mochitest/test_PaymentStateSubscriberMixin.html
@@ -5,17 +5,16 @@ Test the PaymentStateSubscriberMixin
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the PaymentStateSubscriberMixin</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script src="sinon-2.3.2.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
 
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
   <p id="display">
     <test-element id="el1"></test-element>
   </p>
 <div id="content" style="display: none">
--- a/browser/components/payments/test/mochitest/test_accepted_cards.html
+++ b/browser/components/payments/test/mochitest/test_accepted_cards.html
@@ -6,17 +6,16 @@ Test the accepted-cards element
 <head>
   <meta charset="utf-8">
   <title>Test the accepted-cards element</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script src="sinon-2.3.2.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
   <script src="../../res/unprivileged-fallbacks.js"></script>
 
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/paymentRequest.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/components/accepted-cards.css"/>
 </head>
 <body>
   <p id="display">
--- a/browser/components/payments/test/mochitest/test_address_form.html
+++ b/browser/components/payments/test/mochitest/test_address_form.html
@@ -6,17 +6,16 @@ Test the address-form element
 <head>
   <meta charset="utf-8">
   <title>Test the address-form element</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script src="sinon-2.3.2.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
   <script src="../../res/unprivileged-fallbacks.js"></script>
   <script src="autofillEditForms.js"></script>
 
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/paymentRequest.css"/>
   <link rel="stylesheet" type="text/css" href="editDialog-shared.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/containers/address-form.css"/>
 </head>
--- a/browser/components/payments/test/mochitest/test_address_option.html
+++ b/browser/components/payments/test/mochitest/test_address_option.html
@@ -5,17 +5,16 @@ Test the address-option component
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the address-option component</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
   <script src="../../res/unprivileged-fallbacks.js"></script>
   <script src="autofillEditForms.js"></script>
 
   <link rel="stylesheet" type="text/css" href="../../res/components/rich-select.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/components/address-option.css"/>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
--- a/browser/components/payments/test/mochitest/test_address_picker.html
+++ b/browser/components/payments/test/mochitest/test_address_picker.html
@@ -5,17 +5,16 @@ Test the address-picker component
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the address-picker component</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
   <script src="../../res/unprivileged-fallbacks.js"></script>
   <script src="autofillEditForms.js"></script>
 
   <link rel="stylesheet" type="text/css" href="../../res/containers/rich-picker.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/components/rich-select.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/components/address-option.css"/>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
--- a/browser/components/payments/test/mochitest/test_basic_card_form.html
+++ b/browser/components/payments/test/mochitest/test_basic_card_form.html
@@ -6,17 +6,16 @@ Test the basic-card-form element
 <head>
   <meta charset="utf-8">
   <title>Test the basic-card-form element</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script src="sinon-2.3.2.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
   <script src="../../res/unprivileged-fallbacks.js"></script>
   <script src="autofillEditForms.js"></script>
 
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/paymentRequest.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/components/accepted-cards.css"/>
 </head>
 <body>
--- a/browser/components/payments/test/mochitest/test_basic_card_option.html
+++ b/browser/components/payments/test/mochitest/test_basic_card_option.html
@@ -5,17 +5,16 @@ Test the basic-card-option component
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the basic-card-option component</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
   <script src="../../res/unprivileged-fallbacks.js"></script>
 
   <link rel="stylesheet" type="text/css" href="../../res/components/rich-select.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/components/basic-card-option.css"/>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
   <p id="display">
--- a/browser/components/payments/test/mochitest/test_completion_error_page.html
+++ b/browser/components/payments/test/mochitest/test_completion_error_page.html
@@ -4,17 +4,16 @@
 Test the completion-error-page component
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the completion-error-page component</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
   <script src="../../res/unprivileged-fallbacks.js"></script>
 
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
   <p id="display">
     <completion-error-page id="completion-timeout-error" class="illustrated"
             data-page-title="Sample Title"
--- a/browser/components/payments/test/mochitest/test_currency_amount.html
+++ b/browser/components/payments/test/mochitest/test_currency_amount.html
@@ -4,17 +4,16 @@
 Test the currency-amount component
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the currency-amount component</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
 
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
   <p id="display">
     <currency-amount id="amount1"></currency-amount>
   </p>
 <div id="content" style="display: none">
--- a/browser/components/payments/test/mochitest/test_labelled_checkbox.html
+++ b/browser/components/payments/test/mochitest/test_labelled_checkbox.html
@@ -4,17 +4,16 @@
 Test the labelled-checkbox component
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the labelled-checkbox component</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
 
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
   <p id="display">
     <labelled-checkbox id="box0"></labelled-checkbox>
     <labelled-checkbox id="box1" label="the label" value="the value"></labelled-checkbox>
   </p>
--- a/browser/components/payments/test/mochitest/test_order_details.html
+++ b/browser/components/payments/test/mochitest/test_order_details.html
@@ -4,17 +4,16 @@
   Test the order-details component
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the order-details component</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
   <script src="../../res/unprivileged-fallbacks.js"></script>
 
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/containers/order-details.css"/>
 
   <template id="order-details-template">
     <ul class="main-list"></ul>
     <ul class="footer-items-list"></ul>
--- a/browser/components/payments/test/mochitest/test_payer_address_picker.html
+++ b/browser/components/payments/test/mochitest/test_payer_address_picker.html
@@ -5,17 +5,16 @@ Test the paymentOptions address-picker
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the paymentOptions address-picker</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script src="payments_common.js"></script>
 
-  <script src="../../res/vendor/custom-elements.min.js"></script>
   <script src="../../res/unprivileged-fallbacks.js"></script>
   <script src="autofillEditForms.js"></script>
 
   <link rel="stylesheet" type="text/css" href="../../res/components/rich-select.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/components/address-option.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/paymentRequest.css"/>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
@@ -115,17 +114,19 @@ let DUPED_ADDRESSES = {
 };
 
 let elPicker;
 let elDialog;
 let initialState;
 
 add_task(async function setup_once() {
   registerConsoleFilter(function consoleFilter(msg) {
-    return msg.errorMessage.includes("selectedPayerAddress option a9e830667189 does not exist");
+    return msg.errorMessage &&
+      msg.errorMessage.toString().includes("selectedPayerAddress option a9e830667189 " +
+                                           "does not exist");
   });
 
   let templateFrame = document.getElementById("templateFrame");
   await SimpleTest.promiseFocus(templateFrame.contentWindow);
 
   let displayEl = document.getElementById("display");
   importDialogDependencies(templateFrame, displayEl);
 
@@ -260,16 +261,20 @@ add_task(async function test_filtered_op
   is(closedRichOption.getAttribute("guid"), "a9e830667189", "expected option is visible");
 
   for (let fieldName of ["name", "email"]) {
     let elem = closedRichOption.querySelector(`.${fieldName}`);
     ok(elem, `field ${fieldName} exists`);
     ok(isVisible(elem), `field ${fieldName} is visible`);
   }
 
+  // The selectedPayerAddress (a9e830667189) doesn't have a phone number and
+  // therefore will cause an error.
+  SimpleTest.expectUncaughtException(true);
+
   setPaymentOptions(requestStore, {
     requestPayerPhone: true,
   });
   await asyncElementRendered();
 
   is(elPicker.dropdown.popupBox.children.length, 1, "Check dropdown has 1 addresses");
 
   setPaymentOptions(requestStore, {});
@@ -280,16 +285,20 @@ add_task(async function test_filtered_op
 
 add_task(async function test_no_matches() {
   await setup();
   let requestStore = elPicker.requestStore;
   setPaymentOptions(requestStore, {
     requestPayerPhone: true,
   });
 
+  // The selectedPayerAddress (a9e830667189) doesn't have a phone number and
+  // therefore will cause an error.
+  SimpleTest.expectUncaughtException(true);
+
   requestStore.setState({
     savedAddresses: {
       "2b4dce0fbc1f": {
         "email": "rita@foo.com",
         "guid": "2b4dce0fbc1f",
         "name": "Rita Foo",
       },
       "46b2635a5b26": {
--- a/browser/components/payments/test/mochitest/test_payment_details_item.html
+++ b/browser/components/payments/test/mochitest/test_payment_details_item.html
@@ -4,17 +4,16 @@
 Test the payment-details-item component
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the payment-details-item component</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
 
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
   <p id="display">
     <payment-details-item id="item1"></payment-details-item>
     <payment-details-item id="item2" label="Some item" amount-value="2" amount-currency="USD"></payment-details-item>
   </p>
--- a/browser/components/payments/test/mochitest/test_payment_dialog.html
+++ b/browser/components/payments/test/mochitest/test_payment_dialog.html
@@ -6,17 +6,16 @@ Test the payment-dialog custom element
 <head>
   <meta charset="utf-8">
   <title>Test the payment-dialog element</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <script src="sinon-2.3.2.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
   <script src="../../res/unprivileged-fallbacks.js"></script>
   <script src="autofillEditForms.js"></script>
 
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/paymentRequest.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/containers/rich-picker.css"/>
 </head>
 <body>
--- a/browser/components/payments/test/mochitest/test_payment_dialog_required_top_level_items.html
+++ b/browser/components/payments/test/mochitest/test_payment_dialog_required_top_level_items.html
@@ -5,17 +5,16 @@ Test the payment-dialog custom element
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the payment-dialog element</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
   <script src="../../res/unprivileged-fallbacks.js"></script>
   <script src="autofillEditForms.js"></script>
 
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/paymentRequest.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/containers/rich-picker.css"/>
 </head>
 <body>
--- a/browser/components/payments/test/mochitest/test_payment_method_picker.html
+++ b/browser/components/payments/test/mochitest/test_payment_method_picker.html
@@ -5,17 +5,16 @@ Test the payment-method-picker component
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the payment-method-picker component</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
   <script src="../../res/unprivileged-fallbacks.js"></script>
 
   <link rel="stylesheet" type="text/css" href="../../res/containers/rich-picker.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/components/rich-select.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/components/basic-card-option.css"/>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
--- a/browser/components/payments/test/mochitest/test_rich_select.html
+++ b/browser/components/payments/test/mochitest/test_rich_select.html
@@ -5,17 +5,16 @@ Test the rich-select component
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the rich-select component</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <script src="payments_common.js"></script>
-  <script src="../../res/vendor/custom-elements.min.js"></script>
   <script src="../../res/unprivileged-fallbacks.js"></script>
   <script src="autofillEditForms.js"></script>
 
   <link rel="stylesheet" type="text/css" href="../../res/components/rich-select.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/components/address-option.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/components/basic-card-option.css"/>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
--- a/browser/components/payments/test/mochitest/test_shipping_option_picker.html
+++ b/browser/components/payments/test/mochitest/test_shipping_option_picker.html
@@ -6,18 +6,16 @@ Test the shipping-option-picker componen
 <head>
   <meta charset="utf-8">
   <title>Test the shipping-option-picker component</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <script src="payments_common.js"></script>
 
-  <script src="../../res/vendor/custom-elements.min.js"></script>
-
   <link rel="stylesheet" type="text/css" href="../../res/components/rich-select.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/components/shipping-option.css"/>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
   <p id="display">
     <shipping-option-picker id="picker1"></shipping-option-picker>
   </p>
--- a/browser/components/preferences/colors.xul
+++ b/browser/components/preferences/colors.xul
@@ -5,16 +5,17 @@
 # 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/.
 
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
 
 <dialog id="ColorsDialog" type="child" class="prefwindow"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        xmlns:html="http://www.w3.org/1999/xhtml"
         data-l10n-id="colors-window"
         data-l10n-attrs="title, style"
         buttons="accept,cancel,help"
         persist="lastSelected screenX screenY"
         role="dialog"
         helpTopic="prefs-fonts-and-colors"
         ondialoghelp="openPrefsHelp()">
 
@@ -34,45 +35,45 @@
     <script type="application/javascript" src="chrome://browser/content/preferences/colors.js"/>
 
     <hbox>
       <groupbox flex="1">
         <caption><label data-l10n-id="colors-text-and-background"/></caption>
         <hbox align="center">
           <label data-l10n-id="colors-text-header" control="foregroundtextmenu"/>
           <spacer flex="1"/>
-          <colorpicker type="button" id="foregroundtextmenu" palettename="standard"
-                       preference="browser.display.foreground_color"/>
+          <html:input type="color" id="foregroundtextmenu"
+                      preference="browser.display.foreground_color"/>
         </hbox>
         <hbox align="center" style="margin-top: 5px">
           <label data-l10n-id="colors-background" control="backgroundmenu" />
           <spacer flex="1"/>
-          <colorpicker type="button" id="backgroundmenu" palettename="standard"
-                       preference="browser.display.background_color"/>
+          <html:input type="color" id="backgroundmenu"
+                      preference="browser.display.background_color"/>
         </hbox>
         <separator class="thin"/>
         <hbox align="center">
           <checkbox id="browserUseSystemColors" data-l10n-id="colors-use-system"
                     preference="browser.display.use_system_colors"/>
         </hbox>
       </groupbox>
 
       <groupbox flex="1">
         <caption><label data-l10n-id="colors-links-header"/></caption>
         <hbox align="center">
           <label data-l10n-id="colors-unvisited-links" control="unvisitedlinkmenu" />
           <spacer flex="1"/>
-          <colorpicker type="button" id="unvisitedlinkmenu" palettename="standard"
-                       preference="browser.anchor_color"/>
+          <html:input type="color" id="unvisitedlinkmenu"
+                      preference="browser.anchor_color"/>
         </hbox>
         <hbox align="center" style="margin-top: 5px">
           <label data-l10n-id="colors-visited-links" control="visitedlinkmenu" />
           <spacer flex="1"/>
-          <colorpicker type="button" id="visitedlinkmenu" palettename="standard"
-                       preference="browser.visited_color"/>
+          <html:input type="color" id="visitedlinkmenu"
+                      preference="browser.visited_color"/>
         </hbox>
         <separator class="thin"/>
         <hbox align="center">
           <checkbox id="browserUnderlineAnchors" data-l10n-id="colors-underline-links"
                     preference="browser.underline_anchors"/>
         </hbox>
       </groupbox>
     </hbox>
--- a/browser/components/shell/content/setDesktopBackground.js
+++ b/browser/components/shell/content/setDesktopBackground.js
@@ -160,17 +160,17 @@ if (AppConstants.platform != "macosx") {
     const gMask = 65280;
     const bMask = 255;
     var r = (color & rMask) >> 16;
     var g = (color & gMask) >> 8;
     var b = (color & bMask);
     this.updateColor(this._rgbToHex(r, g, b));
 
     var colorpicker = document.getElementById("desktopColor");
-    colorpicker.color = this._backgroundColor;
+    colorpicker.value = this._backgroundColor;
   };
 
   gSetBackground.updateColor = function(aColor) {
     this._backgroundColor = aColor;
     this._canvas.style.backgroundColor = aColor;
   };
 
   // Converts a color string in the format "#RRGGBB" to an integer.
--- a/browser/components/shell/content/setDesktopBackground.xul
+++ b/browser/components/shell/content/setDesktopBackground.xul
@@ -1,15 +1,15 @@
-<?xml version="1.0"?> <!-- -*- Mode: HTML -*- --> 
+<?xml version="1.0"?> <!-- -*- Mode: HTML -*- -->
 
 # 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/.
 
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> 
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/skin/setDesktopBackground.css" type="text/css"?>
 
 
 <!DOCTYPE dialog [
 <!ENTITY % setDesktopBackgroundDTD SYSTEM "chrome://browser/locale/setDesktopBackground.dtd">
 %setDesktopBackgroundDTD;
 #ifdef XP_MACOSX
 #include ../../../base/content/browser-doctype.inc
@@ -39,48 +39,48 @@
     <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
     <script type="application/javascript" src="chrome://browser/content/setDesktopBackground.js"/>
     <script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
 
 #ifndef XP_MACOSX
     <hbox align="center">
       <label value="&position.label;"/>
       <menulist id="menuPosition"
-                label="&position.label;" 
+                label="&position.label;"
                 oncommand="gSetBackground.updatePosition();">
         <menupopup>
           <menuitem label="&center.label;"  value="CENTER"/>
           <menuitem label="&tile.label;"    value="TILE"/>
           <menuitem label="&stretch.label;" value="STRETCH"/>
           <menuitem label="&fill.label;"    value="FILL" id="fillPosition"/>
           <menuitem label="&fit.label;"     value="FIT"  id="fitPosition"/>
         </menupopup>
       </menulist>
       <spacer flex="1"/>
       <label value="&color.label;"/>
-      <colorpicker id="desktopColor"
-                   type="button" 
-                   onchange="gSetBackground.updateColor(this.color);"/> 
+      <html:input id="desktopColor"
+                  type="color"
+                  onchange="gSetBackground.updateColor(this.value);"/> 
     </hbox>
 #endif
     <groupbox align="center">
       <caption label="&preview.label;"/>
       <stack>
         <!-- if width and height are not present, they default to 300x150 and stretch the stack -->
         <html:canvas id="screen" width="1" height="1"/>
         <image id="monitor"/>
       </stack>
     </groupbox>
-    
+
 #ifdef XP_MACOSX
     <separator/>
-    
+
     <hbox align="right">
       <button id="setDesktopBackground"
-              label="&setDesktopBackground.title;" 
+              label="&setDesktopBackground.title;"
               oncommand="gSetBackground.setDesktopBackground();"/>
       <button id="showDesktopPreferences"
               label="&openDesktopPrefs.label;"
               oncommand="gSetBackground.showDesktopPrefs();"
               hidden="true"/>
     </hbox>
 #endif
 
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -2695,16 +2695,17 @@ HTMLMediaElement::CurrentTime() const
 
 void
 HTMLMediaElement::FastSeek(double aTime, ErrorResult& aRv)
 {
   LOG(LogLevel::Debug, ("%p FastSeek(%f) called by JS", this, aTime));
   LOG(LogLevel::Debug, ("Reporting telemetry VIDEO_FASTSEEK_USED"));
   Telemetry::Accumulate(Telemetry::VIDEO_FASTSEEK_USED, 1);
   RefPtr<Promise> tobeDropped = Seek(aTime, SeekTarget::PrevSyncPoint, aRv);
+  aRv.SuppressException();
 }
 
 already_AddRefed<Promise>
 HTMLMediaElement::SeekToNextFrame(ErrorResult& aRv)
 {
   /* This will cause JIT code to be kept around longer, to help performance
    * when using SeekToNextFrame to iterate through every frame of a video.
    */
@@ -2720,16 +2721,17 @@ HTMLMediaElement::SeekToNextFrame(ErrorR
 }
 
 void
 HTMLMediaElement::SetCurrentTime(double aCurrentTime, ErrorResult& aRv)
 {
   LOG(LogLevel::Debug,
       ("%p SetCurrentTime(%f) called by JS", this, aCurrentTime));
   RefPtr<Promise> tobeDropped = Seek(aCurrentTime, SeekTarget::Accurate, aRv);
+  aRv.SuppressException();
 }
 
 /**
  * Check if aValue is inside a range of aRanges, and if so returns true
  * and puts the range index in aIntervalIndex. If aValue is not
  * inside a range, returns false, and aIntervalIndex
  * is set to the index of the range which starts immediately after aValue
  * (and can be aRanges.Length() if aValue is after the last range).
@@ -2755,37 +2757,39 @@ IsInRanges(TimeRanges& aRanges, double a
   return false;
 }
 
 already_AddRefed<Promise>
 HTMLMediaElement::Seek(double aTime,
                        SeekTarget::Type aSeekType,
                        ErrorResult& aRv)
 {
+  // Note: Seek is called both by synchronous code that expects errors thrown in
+  // aRv, as well as asynchronous code that expects a promise. Make sure all
+  // synchronous errors are returned using aRv, not promise rejections.
+
   // aTime should be non-NaN.
   MOZ_ASSERT(!mozilla::IsNaN(aTime));
 
-  RefPtr<Promise> promise = CreateDOMPromise(aRv);
-
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
   // Detect if user has interacted with element by seeking so that
   // play will not be blocked when initiated by a script.
   if (EventStateManager::IsHandlingUserInput()) {
     mIsBlessed = true;
   }
 
   StopSuspendingAfterFirstFrame();
 
   if (mSrcStream) {
     // do nothing since media streams have an empty Seekable range.
-    promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
-    return promise.forget();
+    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
+    return nullptr;
   }
 
   if (mPlayed && mCurrentPlayRangeStart != -1.0) {
     double rangeEndTime = CurrentTime();
     LOG(LogLevel::Debug,
         ("%p Adding \'played\' a range : [%f, %f]",
          this,
          mCurrentPlayRangeStart,
@@ -2796,39 +2800,39 @@ HTMLMediaElement::Seek(double aTime,
     }
     // Reset the current played range start time. We'll re-set it once
     // the seek completes.
     mCurrentPlayRangeStart = -1.0;
   }
 
   if (mReadyState == HAVE_NOTHING) {
     mDefaultPlaybackStartPosition = aTime;
-    promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
-    return promise.forget();
+    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
+    return nullptr;
   }
 
   if (!mDecoder) {
     // mDecoder must always be set in order to reach this point.
     NS_ASSERTION(mDecoder, "SetCurrentTime failed: no decoder");
-    promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
-    return promise.forget();
+    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
+    return nullptr;
   }
 
   // Clamp the seek target to inside the seekable ranges.
   media::TimeIntervals seekableIntervals = mDecoder->GetSeekable();
   if (seekableIntervals.IsInvalid()) {
-    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); // This will reject the promise.
-    return promise.forget();
+    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
+    return nullptr;
   }
   RefPtr<TimeRanges> seekable =
     new TimeRanges(ToSupports(OwnerDoc()), seekableIntervals);
   uint32_t length = seekable->Length();
   if (length == 0) {
-    promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
-    return promise.forget();
+    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
+    return nullptr;
   }
 
   // If the position we want to seek to is not in a seekable range, we seek
   // to the closest position in the seekable ranges instead. If two positions
   // are equally close, we seek to the closest position from the currentTime.
   // See seeking spec, point 7 :
   // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#seeking
   uint32_t range = 0;
@@ -2881,19 +2885,17 @@ HTMLMediaElement::Seek(double aTime,
   // event if it changes the playback position as a result of the seek.
   LOG(LogLevel::Debug, ("%p SetCurrentTime(%f) starting seek", this, aTime));
   mDecoder->Seek(aTime, aSeekType);
 
   // We changed whether we're seeking so we need to AddRemoveSelfReference.
   AddRemoveSelfReference();
 
   // Keep the DOM promise.
-  mSeekDOMPromise = promise;
-
-  return promise.forget();
+  return do_AddRef(mSeekDOMPromise = CreateDOMPromise(aRv));
 }
 
 double
 HTMLMediaElement::Duration() const
 {
   if (mSrcStream) {
     return std::numeric_limits<double>::infinity();
   }
--- a/modules/libpref/init/StaticPrefList.h
+++ b/modules/libpref/init/StaticPrefList.h
@@ -195,17 +195,17 @@ VARCACHE_PREF(
   "dom.mutation-events.cssom.disabled",
    dom_mutation_events_cssom_disabled,
   bool, true
 )
 
 VARCACHE_PREF(
   "dom.performance.enable_scheduler_timing",
   dom_performance_enable_scheduler_timing,
-  RelaxedAtomicBool, false
+  RelaxedAtomicBool, true
 )
 
 // If true. then the service worker interception and the ServiceWorkerManager
 // will live in the parent process.  This only takes effect on browser start.
 // Note, this is not currently safe to use for normal browsing yet.
 PREF("dom.serviceWorkers.parent_intercept", bool, false)
 
 // Enable PaymentRequest API
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -166,17 +166,17 @@ pref("dom.enable_resource_timing", true)
 
 // Whether performance.GetEntries* will contain an entry for the active document
 pref("dom.enable_performance_navigation_timing", true);
 
 // Enable notification of performance timing
 pref("dom.performance.enable_notify_performance_timing", false);
 
 // Enable collecting of docgroup activity in the scheduler
-pref("dom.performance.enable_scheduler_timing", false);
+pref("dom.performance.enable_scheduler_timing", true);
 
 // Enable Permission API's .revoke() method
 pref("dom.permissions.revoke.enable", false);
 
 // Enable exposing timeToNonBlankPaint
 pref("dom.performance.time_to_non_blank_paint.enabled", false);
 
 // Enable exposing timeToDOMContentFlushed
@@ -5067,17 +5067,17 @@ pref("extensions.webextensions.backgroun
 // Whether or not the installed extensions should be migrated to the storage.local IndexedDB backend.
 #ifdef NIGHTLY_BUILD
 pref("extensions.webextensions.ExtensionStorageIDB.enabled", true);
 #else
 pref("extensions.webextensions.ExtensionStorageIDB.enabled", false);
 #endif
 
 // if enabled, store execution times for API calls
-pref("extensions.webextensions.enablePerformanceCounters", false);
+pref("extensions.webextensions.enablePerformanceCounters", true);
 
 // Maximum age in milliseconds of performance counters in children
 // When reached, the counters are sent to the main process and
 // reset, so we reduce memory footprint.
 pref("extensions.webextensions.performanceCountersMaxAge", 1000);
 
 // Report Site Issue button
 pref("extensions.webcompat-reporter.newIssueEndpoint", "https://webcompat.com/issues/new");
--- a/taskcluster/ci/google-play-strings/kind.yml
+++ b/taskcluster/ci/google-play-strings/kind.yml
@@ -32,33 +32,23 @@ jobs:
          env:
             # TODO Use the branch name instead of the android package name
             PACKAGE_NAME:
                by-project:
                   mozilla-central: org.mozilla.fennec_aurora
                   mozilla-beta: org.mozilla.firefox_beta
                   mozilla-release: org.mozilla.firefox
                   default: org.mozilla.fennec_aurora  # Fetches strings for mozilla-central
-            MAJOR_VERSION_NUMBER:
-               by-project:
-                  # Specifying major version allows get_l10n_strings.py to download the correct
-                  # "whatsnew" section in Fennec RCs. We don't specify it in mozilla-beta because
-                  # strings may not be ready at the time of the first Fennec beta.
-                  mozilla-release: "{major_version}"
-                  # Will be unset by transform if empty
-                  default: ''
-
             # XXX The folder depends on the one defined in the Dockerfile
             GOOGLE_PLAY_STRING_FILE: /builds/worker/google_play_strings.json
          command:
             - bash
             - -cx
             - >
               python3 ./mozapkpublisher/get_l10n_strings.py
               --package-name "${PACKAGE_NAME}"
               --output-file "${GOOGLE_PLAY_STRING_FILE}"
-              ${MAJOR_VERSION_NUMBER+--major-version-number ${MAJOR_VERSION_NUMBER}}
       treeherder:
          symbol: pub(gps)
          platform: Android/opt
          tier: 2
          kind: other
       run-on-projects: ['maple', 'mozilla-central', 'mozilla-beta', 'mozilla-release']
--- a/taskcluster/taskgraph/transforms/google_play_strings.py
+++ b/taskcluster/taskgraph/transforms/google_play_strings.py
@@ -5,17 +5,16 @@
 Transform the push-apk kind into an actual task description.
 """
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 from taskgraph.transforms.base import TransformSequence
 from taskgraph.transforms.task import task_description_schema
 from taskgraph.util.schema import resolve_keyed_by, Schema, validate_schema
-from taskgraph.util.scriptworker import get_release_config
 
 from voluptuous import Required
 
 
 transforms = TransformSequence()
 
 # Voluptuous uses marker objects as dictionary *keys*, but they are not
 # comparable, so we cast all of the keys back to regular strings
@@ -53,22 +52,9 @@ def set_worker_data(config, jobs):
         worker = job['worker']
 
         env = worker.setdefault('env', {})
         resolve_keyed_by(
             env, 'PACKAGE_NAME', item_name=job['name'],
             project=config.params['project']
         )
 
-        resolve_keyed_by(
-            env, 'MAJOR_VERSION_NUMBER', item_name=job['name'],
-            project=config.params['project']
-        )
-        if env.get('MAJOR_VERSION_NUMBER'):
-            release_config = get_release_config(config)
-            major_version = release_config['version'].split('.')[0]
-            env['MAJOR_VERSION_NUMBER'] = env['MAJOR_VERSION_NUMBER'].format(
-                major_version=major_version
-            )
-        else:
-            del env['MAJOR_VERSION_NUMBER']
-
         yield job
--- a/testing/geckodriver/doc/Support.md
+++ b/testing/geckodriver/doc/Support.md
@@ -1,14 +1,20 @@
 Supported platforms
 ===================
 
 The following table shows a mapping between [geckodriver releases],
 supported versions of Firefox, and required Selenium version:
 
+<style type="text/css">
+  table { width: 100%; margin-bottom: 2em; }
+  table, th, td { border: solid gray 1px; }
+  td { padding: 5px 10px; text-align: center; }
+</style>
+
 <table>
  <thead>
   <tr>
     <th rowspan="2">geckodriver
     <th rowspan="2">Selenium
     <th colspan="2">Supported versions of Firefox
   </tr>
   <tr>
@@ -57,17 +63,17 @@ supported versions of Firefox, and requi
   <td>≥ 3.4
   <td>53
   <td>62
  <tr>
   <td>0.17.0
   <td>≥ 3.4
   <td>52
   <td>62
-
+</table>
 
 Clients
 -------
 
 [Selenium] users must update to version 3.11 or later to use geckodriver.
 Other clients that follow the [W3C WebDriver specification][WebDriver]
 are also supported.
 
deleted file mode 100644
--- a/testing/web-platform/meta/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[MediaStream-MediaElement-srcObject.https.html]
-  [Tests that a MediaStream can be assigned to a video element with srcObject]
-    expected: FAIL
-
--- a/testing/web-platform/tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html
+++ b/testing/web-platform/tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html
@@ -13,41 +13,50 @@ the success callback in getUserMedia can
 via the <code>srcObject</code> attribute.</p>
 
 <video id="vid"></video>
 
 <div id='log'></div>
 <script src=/resources/testharness.js></script>
 <script src=/resources/testharnessreport.js></script>
 <script>
-var vid = document.getElementById("vid");
-var t = async_test("Tests that a MediaStream can be assigned to a video element with srcObject", {timeout: 10000});
-t.step(function() {
-  navigator.mediaDevices.getUserMedia({video: true})
-    .then(t.step_func(function (stream) {
-      var testOncePlaying = function() {
-         assert_equals(vid.played.length, 1, "A MediaStream's timeline always consists of a single range");
-         assert_equals(vid.played.start(0), 0, "A MediaStream's timeline always consists of a single range");
-         assert_approx_equals(vid.played.end(0), vid.currentTime, 0.0001, "A MediaStream's timeline always consists of a single range");
-         assert_equals(vid.readyState, vid.HAVE_ENOUGH_DATA, "Upon selecting a media stream, the UA sets readyState to HAVE_ENOUGH_DATA");
-         assert_equals(vid.duration, Infinity, " A MediaStream does not have a pre-defined duration. ");
-         var time = vid.currentTime;
+'use strict';
+const vid = document.getElementById("vid");
+
+promise_test(async t => {
+  const wait = ms => new Promise(r => t.step_timeout(r, ms));
+  const timeout = (promise, time, msg) =>
+    Promise.race([promise, wait(time).then(() => Promise.reject(new Error(msg)))]);
+
+  const stream = await timeout(navigator.mediaDevices.getUserMedia({video: true}), 10000, "getUserMedia timeout");
+  t.add_cleanup(() => stream.getTracks().forEach(track => track.stop()));
+  vid.srcObject = stream;
+  vid.play();
+  assert_true(!vid.seeking, "A MediaStream is not seekable");
+  assert_equals(vid.seekable.length, 0, "A MediaStream is not seekable");
+  assert_equals(vid.defaultPlaybackRate, 1, "playback rate is always 1");
+  assert_equals(vid.playbackRate, 1, "playback rate is always 1");
+  assert_equals(vid.buffered.length, 0, "A MediaStream cannot be preloaded.  Therefore, there is no buffered timeranges");
+  assert_equals(vid.readyState, vid.HAVE_NOTHING, "readyState is HAVE_NOTHING initially");
+  assert_equals(vid.duration, NaN, "A MediaStream does not have any duration initially.");
 
-         assert_approx_equals(vid.currentTime, time, 0.0001, "The UA MUST ignore attempts to set the currentTime attribute");
-         // TODO add test that duration must be set to currentTime
-         // when mediastream is destroyed
-         vid.removeEventListener("timeupdate", testOncePlaying, false);
-         t.done();
-      }
-      vid.addEventListener("timeupdate", t.step_func(testOncePlaying), false);
-      vid.srcObject = stream;
-      vid.play();
-      assert_true(!vid.seeking, "A MediaStream is not seekable");
-      assert_equals(vid.seekable.length, 0, "A MediaStream is not seekable");
-      assert_equals(vid.defaultPlaybackRate, 1, "playback rate is always 1");
-      assert_equals(vid.playbackRate, 1, "playback rate is always 1");
-      assert_equals(vid.buffered.length, 0, "A MediaStream cannot be preloaded.  Therefore, there is no buffered timeranges");
-      assert_equals(vid.duration, vid.readyState == vid.HAVE_NOTHING ? NaN : Infinity, " A MediaStream does not have a pre-defined duration. ");
-    }), function(error) {});
-});
+  const haveLoadedData = new Promise(r => vid.addEventListener("loadeddata", r, {once: true}));
+
+  await new Promise(r => vid.addEventListener("timeupdate", r, {once: true}));
+  assert_equals(vid.played.length, 1, "A MediaStream's timeline always consists of a single range");
+  assert_equals(vid.played.start(0), 0, "A MediaStream's timeline always starts at zero");
+  assert_equals(vid.played.end(0), vid.currentTime, "A MediaStream's end MUST return the last known currentTime, says mediacapture-main");
+  assert_equals(vid.duration, Infinity, "A MediaStream does not have a pre-defined duration. ");
+
+  const time = vid.currentTime;
+  vid.currentTime = 0;
+  assert_equals(vid.currentTime, time, "The UA MUST ignore attempts to set the currentTime attribute");
+
+  await haveLoadedData;
+  assert_equals(vid.readyState, vid.HAVE_ENOUGH_DATA, "Upon having loaded a media stream, the UA sets readyState to HAVE_ENOUGH_DATA");
+  assert_equals(vid.duration, Infinity, "A MediaStream does not have a pre-defined duration.");
+
+  // TODO add test that duration must be set to currentTime
+  // when mediastream is destroyed
+}, "Tests that a MediaStream can be assigned to a video element with srcObject");
 </script>
 </body>
 </html>
--- a/testing/web-platform/tests/webdriver/tests/conftest.py
+++ b/testing/web-platform/tests/webdriver/tests/conftest.py
@@ -4,17 +4,17 @@ import os
 import urlparse
 
 import pytest
 import webdriver
 
 from tests.support import defaults
 from tests.support.helpers import cleanup_session
 from tests.support.http_request import HTTPRequest
-from tests.support.wait import wait
+from tests.support.sync import Poll
 
 
 _current_session = None
 _custom_session = False
 
 
 def pytest_configure(config):
     # register the capabilities marker
@@ -203,21 +203,22 @@ def create_dialog(session):
               if (dialog_type == 'prompt') {
                 window.dialog_return_value = window[dialog_type](text, '');
               } else {
                 window.dialog_return_value = window[dialog_type](text);
               }
             }, 0);
             """, args=(dialog_type, text))
 
-        wait(session,
-             lambda s: s.alert.text == text,
-             "No user prompt with text '{}' detected".format(text),
-             timeout=15,
-             ignored_exceptions=webdriver.NoSuchAlertException)
+        wait = Poll(
+            session,
+            timeout=15,
+            ignored_exceptions=webdriver.NoSuchAlertException,
+            message="No user prompt with text '{}' detected".format(text))
+        wait.until(lambda s: s.alert.text == text)
 
     return create_dialog
 
 
 @pytest.fixture
 def closed_window(session, create_window):
     original_handle = session.window_handle
 
--- a/testing/web-platform/tests/webdriver/tests/get_current_url/get.py
+++ b/testing/web-platform/tests/webdriver/tests/get_current_url/get.py
@@ -1,15 +1,15 @@
 import json
 import pytest
 import types
 
 from tests.support.inline import inline
 from tests.support.asserts import assert_error, assert_success
-from tests.support.wait import wait
+from tests.support.sync import Poll
 
 alert_doc = inline("<script>window.alert()</script>")
 frame_doc = inline("<p>frame")
 one_frame_doc = inline("<iframe src='%s'></iframe>" % frame_doc)
 two_frames_doc = inline("<iframe src='%s'></iframe>" % one_frame_doc)
 
 
 def get_current_url(session):
@@ -64,19 +64,18 @@ def test_set_malformed_url(session):
                                     "session/%s/url" % session.session_id,
                                     {"url": "foo"})
 
     assert_error(result, "invalid argument")
 
 def test_get_current_url_after_modified_location(session):
     start = get_current_url(session)
     session.execute_script("window.location.href = 'about:blank#wd_test_modification'")
-    wait(session,
-         lambda _: get_current_url(session).body["value"] != start.body["value"],
-         "URL did not change")
+    Poll(session, message="URL did not change").until(
+         lambda s: get_current_url(s).body["value"] != start.body["value"])
 
     result = get_current_url(session)
     assert_success(result, "about:blank#wd_test_modification")
 
 def test_get_current_url_nested_browsing_context(session, create_frame):
     session.url = "about:blank#wd_from_within_frame"
     session.switch_frame(create_frame())
 
--- a/testing/web-platform/tests/webdriver/tests/get_title/get.py
+++ b/testing/web-platform/tests/webdriver/tests/get_title/get.py
@@ -1,11 +1,11 @@
 from tests.support.asserts import assert_error, assert_success
 from tests.support.inline import inline
-from tests.support.wait import wait
+from tests.support.sync import Poll
 
 
 def read_global(session, name):
     return session.execute_script("return %s;" % name)
 
 
 def get_title(session):
     return session.transport.send(
@@ -34,22 +34,24 @@ def test_title_with_duplicate_element(se
 def test_title_without_element(session):
     session.url = inline("<h2>Hello</h2>")
 
     result = get_title(session)
     assert_success(result, read_global(session, "document.title"))
 
 
 def test_title_after_modification(session):
+    def title():
+        return read_global(session, "document.title")
+
     session.url = inline("<title>Initial</title><h2>Hello</h2>")
     session.execute_script("document.title = 'Updated'")
 
-    wait(session,
-         lambda s: assert_success(get_title(s)) == read_global(session, "document.title"),
-         "Document title doesn't match '{}'".format(read_global(session, "document.title")))
+    wait = Poll(session, message='Document title does not match "{}"'.format(title()))
+    wait.until(lambda s: assert_success(get_title(s)) == title())
 
 
 def test_title_strip_and_collapse(session):
     document = "<title>   a b\tc\nd\t \n e\t\n </title><h2>Hello</h2>"
     session.url = inline(document)
 
     result = get_title(session)
     assert_success(result, read_global(session, "document.title"))
--- a/testing/web-platform/tests/webdriver/tests/perform_actions/pointer.py
+++ b/testing/web-platform/tests/webdriver/tests/perform_actions/pointer.py
@@ -1,17 +1,17 @@
 import pytest
 
 from webdriver.error import NoSuchWindowException
 
 from tests.perform_actions.support.mouse import get_inview_center, get_viewport_rect
 from tests.perform_actions.support.refine import filter_dict, get_events
 from tests.support.asserts import assert_move_to_coordinates
 from tests.support.inline import inline
-from tests.support.wait import wait
+from tests.support.sync import Poll
 
 
 def link_doc(dest):
     content = "<a href=\"{}\" id=\"link\">destination</a>".format(dest)
     return inline(content)
 
 
 def test_null_response_value(session, mouse_chain):
@@ -96,21 +96,21 @@ def test_click_navigation(session, url):
         mouse_chain = session.actions.sequence(
             "pointer", "pointer_id", {"pointerType": "mouse"})
         mouse_chain.click(element=link).perform()
 
     session.url = start
     error_message = "Did not navigate to %s" % destination
 
     click(session.find.css("#link", all=False))
-    wait(session, lambda s: s.url == destination, error_message)
+    Poll(session, message=error_message).until(lambda s: s.url == destination)
     # repeat steps to check behaviour after document unload
     session.url = start
     click(session.find.css("#link", all=False))
-    wait(session, lambda s: s.url == destination, error_message)
+    Poll(session, message=error_message).until(lambda s: s.url == destination)
 
 
 @pytest.mark.parametrize("drag_duration", [0, 300, 800])
 @pytest.mark.parametrize("dx, dy", [
     (20, 0), (0, 15), (10, 15), (-20, 0), (10, -15), (-10, -15)
 ])
 def test_drag_and_drop(session,
                        test_actions_page,
rename from testing/web-platform/tests/webdriver/tests/support/wait.py
rename to testing/web-platform/tests/webdriver/tests/support/sync.py
--- a/testing/web-platform/tests/webdriver/tests/support/wait.py
+++ b/testing/web-platform/tests/webdriver/tests/support/sync.py
@@ -1,38 +1,146 @@
+import collections
 import sys
 import time
 
+from webdriver import error
 
-class TimeoutException(Exception):
-    pass
+
+DEFAULT_TIMEOUT = 5
+DEFAULT_INTERVAL = 0.1
 
 
-def wait(session, condition, message,
-         interval=0.1, timeout=5, ignored_exceptions=Exception):
-    """ Poll a condition until it's true or the timeout ellapses.
+class Poll(object):
+    """
+    An explicit conditional utility primitive for polling until a
+    condition evaluates to something truthy.
 
-    :param session: WebDriver session to use with `condition`
-    :param condition: function that accepts a WebDriver session and returns a boolean
-    :param message: failure description to display in case the timeout is reached
-    :param interval: seconds between each call to `condition`. Default: 0.1
-    :param timeout: seconds until we stop polling. Default: 5
-    :param ignored_exceptions: Exceptions that are expected and can be ignored.
-        Default: Exception
+    A `Poll` instance defines the maximum amount of time to wait
+    for a condition, as well as the frequency with which to check
+    the condition.  Furthermore, the user may configure the wait
+    to ignore specific types of exceptions whilst waiting, such as
+    `error.NoSuchElementException` when searching for an element
+    on the page.
     """
 
-    start = time.time()
-    end = start + timeout
+    def __init__(self,
+                 session,
+                 timeout=DEFAULT_TIMEOUT,
+                 interval=DEFAULT_INTERVAL,
+                 raises=error.TimeoutException,
+                 message=None,
+                 ignored_exceptions=None,
+                 clock=time):
+        """
+        Configure the poller to have a custom timeout, interval,
+        and list of ignored exceptions.  Optionally a different time
+        implementation than the one provided by the standard library
+        (`time`) can also be provided.
+
+        Sample usage::
+
+            # Wait 30 seconds for window to open,
+            # checking for its presence once every 5 seconds.
+            from support.sync import Poll
+            wait = Poll(session, timeout=30, interval=5,
+                        ignored_exceptions=error.NoSuchWindowException)
+            window = wait.until(lambda s: s.switch_to_window(42))
+
+        :param session: The input value to be provided to conditions,
+            usually a `webdriver.Session` instance.
+
+        :param timeout: How long to wait for the evaluated condition
+            to become true.
+
+        :param interval: How often the condition should be evaluated.
+            In reality the interval may be greater as the cost of
+            evaluating the condition function. If that is not the case the
+            interval for the next condition function call is shortend to keep
+            the original interval sequence as best as possible.
+
+        :param raises: Optional exception to raise when poll elapses.
+            If not used, an `error.TimeoutException` is raised.
+            If it is `None`, no exception is raised on the poll elapsing.
+
+        :param message: An optional message to include in `raises`'s
+            message if the `until` condition times out.
+
+        :param ignored_exceptions: Ignore specific types of exceptions
+            whilst waiting for the condition.  Any exceptions not
+            whitelisted will be allowed to propagate, terminating the
+            wait.
+
+        :param clock: Allows overriding the use of the runtime's
+            default time library.  See `sync.SystemClock` for
+            implementation details.
+        """
+        self.session = session
+        self.timeout = timeout
+        self.interval = interval
+        self.exc_cls = raises
+        self.exc_msg = message
+        self.clock = clock
 
-    while not (time.time() >= end):
-        next_step = time.time() + interval
-        try:
-            success = condition(session)
-        except ignored_exceptions:
-            last_exc = sys.exc_info()[0]
-            success = False
-        next_interval = max(next_step - time.time(), 0)
-        if not success:
-            time.sleep(next_interval)
-            continue
-        return success
+        exceptions = []
+        if ignored_exceptions is not None:
+            if isinstance(ignored_exceptions, collections.Iterable):
+                exceptions.extend(iter(ignored_exceptions))
+            else:
+                exceptions.append(ignored_exceptions)
+        self.exceptions = tuple(set(exceptions))
+
+    def until(self, condition):
+        """
+        This will repeatedly evaluate `condition` in anticipation
+        for a truthy return value, or the timeout to expire.
+
+        A condition that returns `None` or does not evaluate to
+        true will fully elapse its timeout before raising, unless
+        the `raises` keyword argument is `None`, in which case the
+        condition's return value is propagated unconditionally.
+
+        If an exception is raised in `condition` and it's not ignored,
+        this function will raise immediately.  If the exception is
+        ignored it will be swallowed and polling will resume until
+        either the condition meets the return requirements or the
+        timeout duration is reached.
+
+        :param condition: A callable function whose return value will
+            be returned by this function.
+        """
+        rv = None
+        last_exc = None
+        start = self.clock.time()
+        end = start + self.timeout
 
-    raise TimeoutException("Timed out after %d seconds: %s" % (timeout, message))
+        while not self.clock.time() >= end:
+            try:
+                next = self.clock.time() + self.interval
+                rv = condition(self.session)
+            except (KeyboardInterrupt, SystemExit):
+                raise
+            except self.exceptions:
+                last_exc = sys.exc_info()
+
+            # re-adjust the interval depending on how long
+            # the callback took to evaluate the condition
+            interval_new = max(next - self.clock.time(), 0)
+
+            if not rv:
+                self.clock.sleep(interval_new)
+                continue
+
+            if rv is not None:
+                return rv
+
+            self.clock.sleep(interval_new)
+
+        if self.exc_cls is not None:
+            elapsed = round((self.clock.time() - start), 1)
+            message = ""
+            if self.exc_msg is not None:
+                message = " with message: {}".format(self.exc_msg)
+            raise self.exc_cls(
+                "Timed out after {} seconds{}".format(elapsed, message),
+                cause=last_exc)
+        else:
+            return rv
--- a/toolkit/components/aboutperformance/tests/browser/browser.ini
+++ b/toolkit/components/aboutperformance/tests/browser/browser.ini
@@ -1,9 +1,9 @@
 [DEFAULT]
 head = head.js
 support-files = 
   browser_compartments.html
   browser_compartments_frame.html
   browser_compartments_script.js
 
 [browser_aboutperformance.js]
-skip-if = (os == 'linux' && asan) || (verify && !debug && (os == 'linux'))
+skip-if = true
--- a/toolkit/components/extensions/parent/ext-management.js
+++ b/toolkit/components/extensions/parent/ext-management.js
@@ -192,17 +192,22 @@ this.management = class extends Extensio
             onDownloadEnded(install) {
               if (install.addon.appDisabled || install.addon.type !== "theme") {
                 install.cancel();
                 return false;
               }
             },
           };
 
-          let install = await AddonManager.getInstallForURL(url, "application/x-xpinstall", hash);
+          let telemetryInfo = {
+            source: "extension",
+            method: "management-webext-api",
+          };
+          let install = await AddonManager.getInstallForURL(url, "application/x-xpinstall", hash,
+                                                            null, null, null, null, telemetryInfo);
           install.addListener(listener);
           try {
             await install.install();
           } catch (e) {
             Cu.reportError(e);
             throw new ExtensionError("Incompatible addon");
           }
           await install.addon.enable();
--- a/toolkit/components/telemetry/pings/TelemetrySession.jsm
+++ b/toolkit/components/telemetry/pings/TelemetrySession.jsm
@@ -1977,17 +1977,17 @@ var Impl = {
         prioParams[prioName] = firstCount;
 
       } catch (ex) {
         this._log.error(ex);
       }
     }
 
     // Prio encode the data and add to payload.
-    const batchID = Policy.now();
+    const batchID = Services.appinfo.appBuildID;
 
     let prioEncodedData;
 
     try {
       prioEncodedData = PrioEncoder.encode(batchID, prioParams);
     } catch (ex) {
       this._log.error(ex);
     }
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -63,17 +63,16 @@ toolkit.jar:
    content/global/viewZoomOverlay.js
 #endif
    content/global/widgets.css
    content/global/bindings/autocomplete.xml    (widgets/autocomplete.xml)
    content/global/bindings/browser.xml         (widgets/browser.xml)
    content/global/bindings/button.xml          (widgets/button.xml)
    content/global/bindings/calendar.js         (widgets/calendar.js)
    content/global/bindings/checkbox.xml        (widgets/checkbox.xml)
-   content/global/bindings/colorpicker.xml     (widgets/colorpicker.xml)
    content/global/bindings/datekeeper.js       (widgets/datekeeper.js)
    content/global/bindings/datepicker.js       (widgets/datepicker.js)
    content/global/bindings/datetimepopup.xml   (widgets/datetimepopup.xml)
    content/global/bindings/datetimebox.xml     (widgets/datetimebox.xml)
    content/global/bindings/datetimebox.css     (widgets/datetimebox.css)
 *  content/global/bindings/dialog.xml          (widgets/dialog.xml)
    content/global/bindings/general.xml         (widgets/general.xml)
    content/global/bindings/groupbox.xml        (widgets/groupbox.xml)
--- a/toolkit/content/preferencesBindings.js
+++ b/toolkit/content/preferencesBindings.js
@@ -193,23 +193,16 @@ const Preferences = window.Preferences =
     onCommand(event) {
       // This "command" event handler tracks changes made to preferences by
       // the user in this window.
       if (event.sourceEvent)
         event = event.sourceEvent;
       this.userChangedValue(event.target);
     },
 
-    onSelect(event) {
-      // This "select" event handler tracks changes made to colorpicker
-      // preferences by the user in this window.
-      if (event.target.localName == "colorpicker")
-        this.userChangedValue(event.target);
-    },
-
     onChange(event) {
       // This "change" event handler tracks changes made to preferences by
       // the user in this window.
       this.userChangedValue(event.target);
     },
 
     onInput(event) {
       // This "input" event handler tracks changes made to preferences by
@@ -253,17 +246,16 @@ const Preferences = window.Preferences =
     },
 
     handleEvent(event) {
       switch (event.type) {
         case "change": return this.onChange(event);
         case "command": return this.onCommand(event);
         case "dialogaccept": return this.onDialogAccept(event);
         case "input": return this.onInput(event);
-        case "select": return this.onSelect(event);
         case "unload": return this.onUnload(event);
         default: return undefined;
       }
     },
   };
 
   Services.prefs.addObserver("", Preferences);
   domContentLoadedPromise.then(result => Preferences.onDOMContentLoaded(result));
@@ -372,18 +364,16 @@ const Preferences = window.Preferences =
             element.removeAttribute(attribute);
           }
         } else {
           element.setAttribute(attribute, value);
         }
       }
       if (aElement.localName == "checkbox")
         setValue(aElement, "checked", val);
-      else if (aElement.localName == "colorpicker")
-        setValue(aElement, "color", val);
       else if (aElement.localName == "textbox") {
         // XXXmano Bug 303998: Avoid a caret placement issue if either the
         // preference observer or its setter calls updateElements as a result
         // of the input event handler.
         if (aElement.value !== val)
           setValue(aElement, "value", val);
       } else
         setValue(aElement, "value", val);
@@ -414,34 +404,32 @@ const Preferences = window.Preferences =
       function getValue(element, attribute) {
         if (attribute in element)
           return element[attribute];
         return element.getAttribute(attribute);
       }
       let value;
       if (aElement.localName == "checkbox")
         value = getValue(aElement, "checked");
-      else if (aElement.localName == "colorpicker")
-        value = getValue(aElement, "color");
       else
         value = getValue(aElement, "value");
 
       switch (this.type) {
       case "int":
         return parseInt(value, 10) || 0;
       case "bool":
         return typeof(value) == "boolean" ? value : value == "true";
       }
       return value;
     }
 
     isElementEditable(aElement) {
       switch (aElement.localName) {
       case "checkbox":
-      case "colorpicker":
+      case "input":
       case "radiogroup":
       case "textbox":
       case "menulist":
         return true;
       }
       return false;
     }
 
--- a/toolkit/content/tests/chrome/chrome.ini
+++ b/toolkit/content/tests/chrome/chrome.ini
@@ -98,17 +98,16 @@ support-files = bug451540_window.xul
 [test_bug585946.xul]
 [test_bug624329.xul]
 skip-if = (os == 'mac' && os_version == '10.10') # Unexpectedly perma-passes on OSX 10.10
 [test_bug792324.xul]
 [test_bug1048178.xul]
 skip-if = toolkit == "cocoa"
 [test_button.xul]
 [test_closemenu_attribute.xul]
-[test_colorpicker_popup.xul]
 [test_contextmenu_list.xul]
 [test_custom_element_base.xul]
 [test_deck.xul]
 [test_dialogfocus.xul]
 [test_editor_for_input_with_autocomplete.html]
 [test_editor_for_textbox_with_autocomplete.xul]
 [test_findbar.xul]
 subsuite = clipboard
deleted file mode 100644
--- a/toolkit/content/tests/chrome/test_colorpicker_popup.xul
+++ /dev/null
@@ -1,148 +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"?>
-
-<window title="Colorpicker Tests"
-  onload="setTimeout(runTests, 0);"
-  onpopupshown="popupShown();"
-  onpopuphidden="popupHiding();"
-  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>      
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>      
-
-<colorpicker id="colorpicker-popup" type="button" color="#FF0000" tabindex="1"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-var gTestPhase = -1;
-var gCp = null;
-
-SimpleTest.waitForExplicitFinish();
-
-function preventDefault(event) {
-  event.preventDefault();
-}
-
-function runTests()
-{
-  gCp = document.getElementById("colorpicker-popup");
-  is(gCp.color, "#FF0000", "popup color is initialized");
-  is(gCp.tabIndex, 1, "button tabindex is initialized");
-  is(gCp.disabled, false, "button is not disabled");
-  
-  document.addEventListener("keypress", preventDefault, false);
-
-  goNext();
-}
-
-var phases = [ "mouse click", "showPopup",
-               "key left", "key right", "key up", "key down", "key space" ];
-
-function popupShown()
-{
-  if (gTestPhase >= phases.length)
-    return;
-
-  var phase = phases[gTestPhase];
-
-  is(gCp.open, true, phase + " popup shown, open property is true");
-
-  switch (phase) {
-    case "mouse click":
-      synthesizeMouse(gCp, 2, 2, { });
-      break;
-    case "showPopup":
-      gCp.hidePopup();
-      break;
-    case "key left":
-      synthesizeKey("KEY_ArrowLeft");
-      synthesizeKeyExpectEvent("KEY_Enter");
-      is(gCp.color, "#C0C0C0", "key left while open");
-      break;
-    case "key right":
-      synthesizeKey("KEY_ArrowRight");
-      synthesizeKeyExpectEvent("VK_SPACE");
-      is(gCp.color, "#FF0000", "key right while open");
-      break;
-    case "key up":
-      synthesizeKey("KEY_ArrowUp");
-      synthesizeKeyExpectEvent("KEY_Enter");
-      is(gCp.color, "#FF6666", "key up while open");
-      break;
-    case "key down":
-      synthesizeKey("KEY_ArrowDown");
-      synthesizeKeyExpectEvent(" ");
-      is(gCp.color, "#FF0000", "key down while open");
-      break;
-    default:
-      synthesizeMouse(gCp, 2, 2, { });
-// this breaks on the Mac, so disable for now
-//      synthesizeKey("KEY_Escape");
-      break;
-  }
-}
-
-function popupHiding()
-{
-  var phase = phases[gTestPhase];
-  if (phase == "showPopup")
-    phase = "hidePopup";
-  if (phase == "key left")
-    phase = "escape";
-  is(gCp.open, false, phase + " popup hidden, open property is false");
-
-  goNext();
-}
-
-function goNext()
-{
-  gTestPhase++;
-  if (gTestPhase >= phases.length) {
-    document.removeEventListener("keypress", preventDefault, false);
-    SimpleTest.finish();
-    return;
-  }
-
-  gCp.focus();
-
-  var phase = phases[gTestPhase];
-  switch (phase) {
-    case "mouse click":
-      synthesizeMouse(gCp, 2, 2, { });
-      break;
-    case "showPopup":
-      gCp.showPopup();
-      break;
-    case "key left":
-      synthesizeKey("KEY_ArrowLeft");
-      break;
-    case "key right":
-      synthesizeKey("KEY_ArrowRight");
-      break;
-    case "key down":
-      synthesizeKey("KEY_ArrowUp");
-      break;
-    case "key up":
-      synthesizeKey("KEY_ArrowDown");
-      break;
-    case "key space":
-      sendString(" ");
-      break;
-  }
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
deleted file mode 100644
--- a/toolkit/content/widgets/colorpicker.xml
+++ /dev/null
@@ -1,560 +0,0 @@
-<?xml version="1.0"?>
-<!-- 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/. -->
-
-
-<bindings id="colorpickerBindings"
-   xmlns="http://www.mozilla.org/xbl"
-   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-   xmlns:xbl="http://www.mozilla.org/xbl">
-
-  <binding id="colorpicker" extends="chrome://global/content/bindings/general.xml#basecontrol">
-    <resources>
-      <stylesheet src="chrome://global/skin/colorpicker.css"/>
-    </resources>
-
-    <content>
-      <xul:vbox flex="1">
-
-        <xul:hbox>
-          <xul:image class="colorpickertile cp-light" color="#FFFFFF"/>
-          <xul:image class="colorpickertile cp-light" color="#FFCCCC"/>
-          <xul:image class="colorpickertile cp-light" color="#FFCC99"/>
-          <xul:image class="colorpickertile cp-light" color="#FFFF99"/>
-          <xul:image class="colorpickertile cp-light" color="#FFFFCC"/>
-          <xul:image class="colorpickertile cp-light" color="#99FF99"/>
-          <xul:image class="colorpickertile cp-light" color="#99FFFF"/>
-          <xul:image class="colorpickertile cp-light" color="#CCFFFF"/>
-          <xul:image class="colorpickertile cp-light" color="#CCCCFF"/>
-          <xul:image class="colorpickertile cp-light" color="#FFCCFF"/>
-        </xul:hbox>
-        <xul:hbox>
-          <xul:image class="colorpickertile" color="#CCCCCC"/>
-          <xul:image class="colorpickertile" color="#FF6666"/>
-          <xul:image class="colorpickertile" color="#FF9966"/>
-          <xul:image class="colorpickertile cp-light" color="#FFFF66"/>
-          <xul:image class="colorpickertile cp-light" color="#FFFF33"/>
-          <xul:image class="colorpickertile cp-light" color="#66FF99"/>
-          <xul:image class="colorpickertile cp-light" color="#33FFFF"/>
-          <xul:image class="colorpickertile cp-light" color="#66FFFF"/>
-          <xul:image class="colorpickertile" color="#9999FF"/>
-          <xul:image class="colorpickertile" color="#FF99FF"/>
-        </xul:hbox>
-        <xul:hbox>
-          <xul:image class="colorpickertile" color="#C0C0C0"/>
-          <xul:image class="colorpickertile" color="#FF0000"/>
-          <xul:image class="colorpickertile" color="#FF9900"/>
-          <xul:image class="colorpickertile" color="#FFCC66"/>
-          <xul:image class="colorpickertile cp-light" color="#FFFF00"/>
-          <xul:image class="colorpickertile cp-light" color="#33FF33"/>
-          <xul:image class="colorpickertile" color="#66CCCC"/>
-          <xul:image class="colorpickertile" color="#33CCFF"/>
-          <xul:image class="colorpickertile" color="#6666CC"/>
-          <xul:image class="colorpickertile" color="#CC66CC"/>
-        </xul:hbox>
-        <xul:hbox>
-          <xul:image class="colorpickertile" color="#999999"/>
-          <xul:image class="colorpickertile" color="#CC0000"/>
-          <xul:image class="colorpickertile" color="#FF6600"/>
-          <xul:image class="colorpickertile" color="#FFCC33"/>
-          <xul:image class="colorpickertile" color="#FFCC00"/>
-          <xul:image class="colorpickertile" color="#33CC00"/>
-          <xul:image class="colorpickertile" color="#00CCCC"/>
-          <xul:image class="colorpickertile" color="#3366FF"/>
-          <xul:image class="colorpickertile" color="#6633FF"/>
-          <xul:image class="colorpickertile" color="#CC33CC"/>
-        </xul:hbox>
-        <xul:hbox>
-          <xul:image class="colorpickertile" color="#666666"/>
-          <xul:image class="colorpickertile" color="#990000"/>
-          <xul:image class="colorpickertile" color="#CC6600"/>
-          <xul:image class="colorpickertile" color="#CC9933"/>
-          <xul:image class="colorpickertile" color="#999900"/>
-          <xul:image class="colorpickertile" color="#009900"/>
-          <xul:image class="colorpickertile" color="#339999"/>
-          <xul:image class="colorpickertile" color="#3333FF"/>
-          <xul:image class="colorpickertile" color="#6600CC"/>
-          <xul:image class="colorpickertile" color="#993399"/>
-        </xul:hbox>
-        <xul:hbox>
-          <xul:image class="colorpickertile" color="#333333"/>
-          <xul:image class="colorpickertile" color="#660000"/>
-          <xul:image class="colorpickertile" color="#993300"/>
-          <xul:image class="colorpickertile" color="#996633"/>
-          <xul:image class="colorpickertile" color="#666600"/>
-          <xul:image class="colorpickertile" color="#006600"/>
-          <xul:image class="colorpickertile" color="#336666"/>
-          <xul:image class="colorpickertile" color="#000099"/>
-          <xul:image class="colorpickertile" color="#333399"/>
-          <xul:image class="colorpickertile" color="#663366"/>
-        </xul:hbox>
-        <xul:hbox>
-          <xul:image class="colorpickertile" color="#000000"/>
-          <xul:image class="colorpickertile" color="#330000"/>
-          <xul:image class="colorpickertile" color="#663300"/>
-          <xul:image class="colorpickertile" color="#663333"/>
-          <xul:image class="colorpickertile" color="#333300"/>
-          <xul:image class="colorpickertile" color="#003300"/>
-          <xul:image class="colorpickertile" color="#003333"/>
-          <xul:image class="colorpickertile" color="#000066"/>
-          <xul:image class="colorpickertile" color="#330099"/>
-          <xul:image class="colorpickertile" color="#330033"/>
-        </xul:hbox>
-      </xul:vbox>
-      <!-- Something to take tab focus
-      <button style="border : 0px; width: 0px; height: 0px;"/>
-      -->
-    </content>
-
-    <implementation>
-      <property name="color">
-        <getter><![CDATA[
-          return this.mSelectedCell ? this.mSelectedCell.getAttribute("color") : null;
-        ]]></getter>
-        <setter><![CDATA[
-          if (!val)
-            return val;
-          var uppercaseVal = val.toUpperCase();
-          // Translate standard HTML color strings:
-          if (uppercaseVal[0] != "#") {
-            switch (uppercaseVal) {
-              case "GREEN":
-                uppercaseVal = "#008000";
-                break;
-              case "LIME":
-                uppercaseVal = "#00FF00";
-                break;
-              case "OLIVE":
-                uppercaseVal = "#808000";
-                break;
-              case "TEAL":
-                uppercaseVal = "#008080";
-                break;
-              case "YELLOW":
-                uppercaseVal = "#FFFF00";
-                break;
-              case "RED":
-                uppercaseVal = "#FF0000";
-                break;
-              case "MAROON":
-                uppercaseVal = "#800000";
-                break;
-              case "PURPLE":
-                uppercaseVal = "#800080";
-                break;
-              case "FUCHSIA":
-                uppercaseVal = "#FF00FF";
-                break;
-              case "NAVY":
-                uppercaseVal = "#000080";
-                break;
-              case "BLUE":
-                uppercaseVal = "#0000FF";
-                break;
-              case "AQUA":
-                uppercaseVal = "#00FFFF";
-                break;
-              case "WHITE":
-                uppercaseVal = "#FFFFFF";
-                break;
-              case "SILVER":
-                uppercaseVal = "#C0C0C0";
-                break;
-              case "GRAY":
-                uppercaseVal = "#808080";
-                break;
-              default: // BLACK
-                uppercaseVal = "#000000";
-                break;
-            }
-          }
-          var cells = this.mBox.getElementsByAttribute("color", uppercaseVal);
-          if (cells.item(0)) {
-            this.selectCell(cells[0]);
-            this.hoverCell(this.mSelectedCell);
-          }
-          return val;
-        ]]></setter>
-      </property>
-
-      <method name="initColor">
-        <parameter name="aColor"/>
-        <body><![CDATA[
-          // Use this to initialize color without
-          //  triggering the "onselect" handler,
-          //  which closes window when it's a popup
-          this.mDoOnSelect = false;
-          this.color = aColor;
-          this.mDoOnSelect = true;
-        ]]></body>
-      </method>
-
-      <method name="initialize">
-        <body><![CDATA[
-          this.mSelectedCell = null;
-          this.mHoverCell = null;
-          this.mBox = document.getAnonymousNodes(this)[0];
-          this.mIsPopup = false;
-          this.mDoOnSelect = true;
-
-          let imageEls = this.mBox.querySelectorAll("image");
-          // We set the background of the picker tiles here using images in
-          // order for the color to show up even when author colors are
-          // disabled or the user is using high contrast mode.
-          for (let el of imageEls) {
-            let dataURI = "data:image/svg+xml,<svg style='background-color: " +
-                          encodeURIComponent(el.getAttribute("color")) +
-                          "' xmlns='http://www.w3.org/2000/svg' />";
-            el.setAttribute("src", dataURI);
-          }
-
-          this.hoverCell(this.mBox.childNodes[0].childNodes[0]);
-
-          // used to capture keydown at the document level
-          this.mPickerKeyDown = function(aEvent) {
-            document._focusedPicker.pickerKeyDown(aEvent);
-          };
-
-        ]]></body>
-      </method>
-
-      <method name="_fireEvent">
-        <parameter name="aTarget"/>
-        <parameter name="aEventName"/>
-        <body>
-        <![CDATA[
-          try {
-            var event = document.createEvent("Events");
-            event.initEvent(aEventName, true, true);
-            var cancel = !aTarget.dispatchEvent(event);
-            if (aTarget.hasAttribute("on" + aEventName)) {
-              var fn = new Function("event", aTarget.getAttribute("on" + aEventName));
-              var rv = fn.call(aTarget, event);
-              // eslint-disable-next-line mozilla/no-compare-against-boolean-literals
-              if (rv == false)
-                cancel = true;
-            }
-            return !cancel;
-          } catch (e) {
-            Cu.reportError(e);
-          }
-          return false;
-        ]]>
-        </body>
-      </method>
-
-      <method name="resetHover">
-        <body><![CDATA[
-          if (this.mHoverCell)
-            this.mHoverCell.removeAttribute("hover");
-        ]]></body>
-      </method>
-
-      <method name="getColIndex">
-        <parameter name="aCell"/>
-        <body><![CDATA[
-          var cell = aCell;
-          var idx;
-          for (idx = -1; cell; idx++)
-            cell = cell.previousSibling;
-
-          return idx;
-        ]]></body>
-      </method>
-
-      <method name="isColorCell">
-        <parameter name="aCell"/>
-        <body><![CDATA[
-          return aCell && aCell.hasAttribute("color");
-        ]]></body>
-      </method>
-
-      <method name="hoverLeft">
-        <body><![CDATA[
-          var cell = this.mHoverCell.previousSibling;
-          this.hoverCell(cell);
-        ]]></body>
-      </method>
-
-      <method name="hoverRight">
-        <body><![CDATA[
-          var cell = this.mHoverCell.nextSibling;
-          this.hoverCell(cell);
-        ]]></body>
-      </method>
-
-      <method name="hoverUp">
-        <body><![CDATA[
-          var row = this.mHoverCell.parentNode.previousSibling;
-          if (row) {
-            var colIdx = this.getColIndex(this.mHoverCell);
-            var cell = row.childNodes[colIdx];
-            this.hoverCell(cell);
-          }
-        ]]></body>
-      </method>
-
-      <method name="hoverDown">
-        <body><![CDATA[
-          var row = this.mHoverCell.parentNode.nextSibling;
-          if (row) {
-            var colIdx = this.getColIndex(this.mHoverCell);
-            var cell = row.childNodes[colIdx];
-            this.hoverCell(cell);
-          }
-        ]]></body>
-      </method>
-
-      <method name="hoverTo">
-        <parameter name="aRow"/>
-        <parameter name="aCol"/>
-
-        <body><![CDATA[
-          var row = this.mBox.childNodes[aRow];
-          if (!row) return;
-          var cell = row.childNodes[aCol];
-          if (!cell) return;
-          this.hoverCell(cell);
-        ]]></body>
-      </method>
-
-      <method name="hoverCell">
-        <parameter name="aCell"/>
-
-        <body><![CDATA[
-          if (this.isColorCell(aCell)) {
-            this.resetHover();
-            aCell.setAttribute("hover", "true");
-            this.mHoverCell = aCell;
-            var event = document.createEvent("Events");
-            event.initEvent("DOMMenuItemActive", true, true);
-            aCell.dispatchEvent(event);
-          }
-        ]]></body>
-      </method>
-
-      <method name="selectHoverCell">
-        <body><![CDATA[
-          this.selectCell(this.mHoverCell);
-        ]]></body>
-      </method>
-
-      <method name="selectCell">
-        <parameter name="aCell"/>
-
-        <body><![CDATA[
-          if (this.isColorCell(aCell)) {
-            if (this.mSelectedCell)
-              this.mSelectedCell.removeAttribute("selected");
-
-            this.mSelectedCell = aCell;
-            aCell.setAttribute("selected", "true");
-
-            if (this.mDoOnSelect)
-              this._fireEvent(this, "select");
-          }
-        ]]></body>
-      </method>
-
-      <method name="handleEvent">
-        <parameter name="aEvent"/>
-        <body><![CDATA[
-          switch (aEvent.keyCode) {
-            case 37: // left
-              this.hoverLeft();
-              break;
-            case 38: // up
-              this.hoverUp();
-              break;
-            case 39: // right
-              this.hoverRight();
-              break;
-            case 40: // down
-              this.hoverDown();
-              break;
-            case 13: // enter
-            case 32: // space
-              this.selectHoverCell();
-              break;
-          }
-        ]]></body>
-      </method>
-
-	  <constructor><![CDATA[
-        this.initialize();
-      ]]></constructor>
-
-    </implementation>
-
-    <handlers>
-      <handler event="mouseover"><![CDATA[
-        this.hoverCell(event.originalTarget);
-      ]]></handler>
-
-      <handler event="click"><![CDATA[
-        if (event.originalTarget.hasAttribute("color")) {
-          this.selectCell(event.originalTarget);
-          this.hoverCell(this.mSelectedCell);
-        }
-      ]]></handler>
-
-
-      <handler event="focus" phase="capturing">
-      <![CDATA[
-        if (!this.mIsPopup && this.getAttribute("focused") != "true") {
-          this.setAttribute("focused", "true");
-          document.addEventListener("keydown", this, true);
-          if (this.mSelectedCell)
-            this.hoverCell(this.mSelectedCell);
-        }
-      ]]>
-      </handler>
-
-      <handler event="blur" phase="capturing">
-      <![CDATA[
-        if (!this.mIsPopup && this.getAttribute("focused") == "true") {
-          document.removeEventListener("keydown", this, true);
-          this.removeAttribute("focused");
-          this.resetHover();
-        }
-      ]]>
-      </handler>
-    </handlers>
-  </binding>
-
-  <binding id="colorpicker-button" display="xul:menu"
-           extends="chrome://global/content/bindings/general.xml#basecontrol">
-    <resources>
-      <stylesheet src="chrome://global/skin/colorpicker.css"/>
-    </resources>
-
-    <content>
-      <xul:image class="colorpicker-button-colorbox" anonid="colorbox" flex="1" xbl:inherits="disabled"/>
-
-      <xul:panel class="colorpicker-button-menupopup"
-                 anonid="colorpopup" noautofocus="true" level="top"
-                 onmousedown="event.stopPropagation()"
-                 onpopupshowing="this._colorPicker.onPopupShowing()"
-                 onpopuphiding="this._colorPicker.onPopupHiding()"
-                 onselect="this._colorPicker.pickerChange()">
-        <xul:colorpicker xbl:inherits="palettename,disabled" allowevents="true" anonid="colorpicker"/>
-      </xul:panel>
-    </content>
-
-    <implementation>
-      <property name="open"
-                onget="return this.getAttribute('open') == 'true'"
-                onset="this.showPopup();"/>
-      <property name="color">
-        <getter><![CDATA[
-          return this.getAttribute("color");
-        ]]></getter>
-        <setter><![CDATA[
-          this.mColorBox.setAttribute("src",
-            "data:image/svg+xml,<svg style='background-color: " +
-            encodeURIComponent(val) +
-            "' xmlns='http://www.w3.org/2000/svg' />");
-          this.setAttribute("color", val);
-          return val;
-        ]]></setter>
-      </property>
-
-      <method name="initialize">
-        <body><![CDATA[
-          this.mColorBox = document.getAnonymousElementByAttribute(this, "anonid", "colorbox");
-          this.mColorBox.setAttribute("src",
-            "data:image/svg+xml,<svg style='background-color: " +
-            encodeURIComponent(this.color) +
-            "' xmlns='http://www.w3.org/2000/svg' />");
-
-          var popup = document.getAnonymousElementByAttribute(this, "anonid", "colorpopup");
-          popup._colorPicker = this;
-
-          this.mPicker = document.getAnonymousElementByAttribute(this, "anonid", "colorpicker");
-        ]]></body>
-      </method>
-
-      <method name="_fireEvent">
-        <parameter name="aTarget"/>
-        <parameter name="aEventName"/>
-        <body>
-        <![CDATA[
-          try {
-            var event = document.createEvent("Events");
-            event.initEvent(aEventName, true, true);
-            var cancel = !aTarget.dispatchEvent(event);
-            if (aTarget.hasAttribute("on" + aEventName)) {
-              var fn = new Function("event", aTarget.getAttribute("on" + aEventName));
-              var rv = fn.call(aTarget, event);
-              // eslint-disable-next-line mozilla/no-compare-against-boolean-literals
-              if (rv == false)
-                cancel = true;
-            }
-            return !cancel;
-          } catch (e) {
-            dump(e);
-          }
-          return false;
-        ]]>
-        </body>
-      </method>
-
-      <method name="showPopup">
-        <body><![CDATA[
-          this.mPicker.parentNode.openPopup(this, "after_start", 0, 0, false, false);
-        ]]></body>
-      </method>
-
-      <method name="hidePopup">
-        <body><![CDATA[
-          this.mPicker.parentNode.hidePopup();
-        ]]></body>
-      </method>
-
-      <method name="onPopupShowing">
-        <body><![CDATA[
-          if ("resetHover" in this.mPicker)
-            this.mPicker.resetHover();
-          document.addEventListener("keydown", this.mPicker, true);
-          this.mPicker.mIsPopup = true;
-          // Initialize to current button's color
-          this.mPicker.initColor(this.color);
-        ]]></body>
-      </method>
-
-      <method name="onPopupHiding">
-        <body><![CDATA[
-          // Removes the key listener
-          document.removeEventListener("keydown", this.mPicker, true);
-          this.mPicker.mIsPopup = false;
-        ]]></body>
-      </method>
-
-      <method name="pickerChange">
-        <body><![CDATA[
-          this.color = this.mPicker.color;
-          setTimeout(function(aPopup) { aPopup.hidePopup(); }, 1, this.mPicker.parentNode);
-
-          this._fireEvent(this, "change");
-        ]]></body>
-      </method>
-
-      <constructor><![CDATA[
-        this.initialize();
-      ]]></constructor>
-
-    </implementation>
-
-    <handlers>
-      <handler event="keydown"><![CDATA[
-        // open popup if key is space/up/left/right/down and popup is closed
-        if ( (event.keyCode == 32 || (event.keyCode > 36 && event.keyCode < 41)) && !this.open)
-          this.showPopup();
-        else if ( (event.keyCode == 27) && this.open)
-          this.hidePopup();
-      ]]></handler>
-    </handlers>
-  </binding>
-
-</bindings>
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -68,17 +68,16 @@ treechildren, treeitem, treeseparator, t
 xbl|children {
   display: none !important;
 }
 
 /********** focus rules **********/
 
 button,
 checkbox,
-colorpicker[type="button"],
 datepicker[type="grid"],
 menulist,
 radiogroup,
 tree,
 browser,
 editor,
 iframe {
   -moz-user-focus: normal;
@@ -666,26 +665,16 @@ panel[type="autocomplete-richlistbox"] {
    This is a stopgap measure, and it does not address the real bug.  */
 .autocomplete-result-popupset {
   max-width: 0px;
   width: 0 !important;
   min-width: 0%;
   min-height: 0%;
 }
 
-/********** colorpicker **********/
-
-colorpicker {
-  -moz-binding: url("chrome://global/content/bindings/colorpicker.xml#colorpicker");
-}
-
-colorpicker[type="button"] {
-  -moz-binding: url("chrome://global/content/bindings/colorpicker.xml#colorpicker-button");
-}
-
 /********** menulist **********/
 
 menulist {
   -moz-binding: url("chrome://global/content/bindings/menulist.xml#menulist");
 }
 
 menulist[popuponly="true"] {
   -moz-binding: url("chrome://global/content/bindings/menulist.xml#menulist-popuponly");
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -1993,17 +1993,17 @@ var gDiscoverView = {
     };
 
     if (!Services.prefs.getBoolPref(PREF_GETADDONS_CACHE_ENABLED)) {
       setURL(url);
       return;
     }
 
     gPendingInitializations++;
-    let aAddons = await AddonManager.getAllAddons();
+    let aAddons = await AddonManager.getAddonsByTypes(["extension", "theme"]);
     var list = {};
     for (let addon of aAddons) {
       var prefName = PREF_GETADDONS_CACHE_ID_ENABLED.replace("%ID%",
                                                              addon.id);
       try {
         if (!Services.prefs.getBoolPref(prefName))
           continue;
       } catch (e) { }
--- a/toolkit/mozapps/extensions/test/browser/browser_discovery.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_discovery.js
@@ -47,24 +47,16 @@ function test() {
     id: "addon1@tests.mozilla.org",
     name: "Test add-on 1",
     type: "extension",
     version: "2.2",
     isCompatible: false,
     blocklistState: Ci.nsIBlocklistService.STATE_SOFTBLOCKED,
     userDisabled: false,
   }, {
-    id: "addon2@tests.mozilla.org",
-    name: "Test add-on 2",
-    type: "plugin",
-    version: "3.1.5",
-    isCompatible: true,
-    blocklistState: Ci.nsIBlocklistService.STATE_NOT_BLOCKED,
-    userDisabled: false,
-  }, {
     id: "addon3@tests.mozilla.org",
     name: "Test add-on 3",
     type: "theme",
     version: "1.2b1",
     isCompatible: false,
     blocklistState: Ci.nsIBlocklistService.STATE_BLOCKED,
     userDisabled: true,
   }]);
@@ -112,27 +104,23 @@ async function testHash(aBrowser, aTestA
   is(typeof data, "object", "Hash should be a JS object");
 
   // Ensure that at least the test add-ons are present
   if (aTestAddonVisible[0])
     ok("addon1@tests.mozilla.org" in data, "Test add-on 1 should be listed");
   else
     ok(!("addon1@tests.mozilla.org" in data), "Test add-on 1 should not be listed");
   if (aTestAddonVisible[1])
-    ok("addon2@tests.mozilla.org" in data, "Test add-on 2 should be listed");
-  else
-    ok(!("addon2@tests.mozilla.org" in data), "Test add-on 2 should not be listed");
-  if (aTestAddonVisible[2])
     ok("addon3@tests.mozilla.org" in data, "Test add-on 3 should be listed");
   else
     ok(!("addon3@tests.mozilla.org" in data), "Test add-on 3 should not be listed");
 
   // Test against all the add-ons the manager knows about since plugins and
   // app extensions may exist
-  let aAddons = await AddonManager.getAllAddons();
+  let aAddons = await AddonManager.getAddonsByTypes(["extension", "theme"]);
   for (let addon of aAddons) {
     if (!(addon.id in data)) {
       // Test add-ons will have shown an error if necessary above
       if (addon.id.substring(6) != "@tests.mozilla.org")
         ok(false, "Add-on " + addon.id + " was not included in the data");
       continue;
     }
 
@@ -190,64 +178,60 @@ add_test(async function() {
   let aWindow = await open_manager("addons://list/extension");
   gManagerWindow = aWindow;
   gCategoryUtilities = new CategoryUtilities(gManagerWindow);
 
   await gCategoryUtilities.openType("discover");
   var browser = gManagerWindow.document.getElementById("discover-browser");
   is(getURL(browser), MAIN_URL, "Should have loaded the right url");
 
-  await testHash(browser, [true, true, true]);
+  await testHash(browser, [true, true]);
   close_manager(gManagerWindow, run_next_test);
 });
 
 // Tests that loading the add-ons manager with the discovery view as the last
 // selected view displays the right url
 add_test(async function() {
   // Hide one of the test add-ons
-  Services.prefs.setBoolPref("extensions.addon2@tests.mozilla.org.getAddons.cache.enabled", false);
-  Services.prefs.setBoolPref("extensions.addon3@tests.mozilla.org.getAddons.cache.enabled", true);
-
+  Services.prefs.setBoolPref("extensions.addon3@tests.mozilla.org.getAddons.cache.enabled", false);
   await open_manager(null, null, function(aWindow) {
     gManagerWindow = aWindow;
     ok(isLoading(), "Should be loading at first");
   });
   gCategoryUtilities = new CategoryUtilities(gManagerWindow);
   is(gCategoryUtilities.selectedCategory, "discover", "Should have loaded the right view");
 
   var browser = gManagerWindow.document.getElementById("discover-browser");
   is(getURL(browser), MAIN_URL, "Should have loaded the right url");
 
-  await testHash(browser, [true, false, true]);
+  await testHash(browser, [true, false]);
   close_manager(gManagerWindow, run_next_test);
 });
 
 // Tests that loading the add-ons manager with the discovery view as the initial
 // view displays the right url
 add_test(async function() {
-  Services.prefs.clearUserPref("extensions.addon2@tests.mozilla.org.getAddons.cache.enabled");
-  Services.prefs.setBoolPref("extensions.addon3@tests.mozilla.org.getAddons.cache.enabled", false);
-
+  Services.prefs.clearUserPref("extensions.addon3@tests.mozilla.org.getAddons.cache.enabled");
   let aWindow = await open_manager(null);
   gManagerWindow = aWindow;
   gCategoryUtilities = new CategoryUtilities(gManagerWindow);
   await gCategoryUtilities.openType("extension");
   await close_manager(gManagerWindow);
   aWindow = await open_manager("addons://discover/", null, function(aWindow) {
     gManagerWindow = aWindow;
     ok(isLoading(), "Should be loading at first");
   });
   gCategoryUtilities = new CategoryUtilities(gManagerWindow);
   is(gCategoryUtilities.selectedCategory, "discover", "Should have loaded the right view");
 
   var browser = gManagerWindow.document.getElementById("discover-browser");
   is(getURL(browser), MAIN_URL, "Should have loaded the right url");
 
-  await testHash(browser, [true, true, false]);
-  Services.prefs.clearUserPref("extensions.addon3@tests.mozilla.org.getAddons.cache.enabled");
+  await testHash(browser, [true, true]);
+
   close_manager(gManagerWindow, run_next_test);
 });
 
 // Tests that switching to the discovery view displays the right url
 add_test(async function() {
   Services.prefs.setBoolPref(PREF_GETADDONS_CACHE_ENABLED, false);
 
   let aWindow = await open_manager("addons://list/extension");
deleted file mode 100644
--- a/toolkit/themes/linux/global/colorpicker.css
+++ /dev/null
@@ -1,47 +0,0 @@
-/* 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/. */
-
-/* ===== colorpicker.css ================================================
-  == Styles used by the XUL colorpicker element.
-  ======================================================================= */
-
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-
-/* ::::: colorpicker button ::::: */
- 
-/* colorpicker button */
-
-colorpicker[type="button"] {
-  -moz-appearance: button;
-  width: 38px;
-  height: 24px;
-}
-
-.colorpicker-button-colorbox {
-  border: 1px solid #000000;
-}
-
-/* ::::: colorpicker tiles ::::: */
-
-.colorpickertile {
-  width: 20px;
-  height: 20px;
-  margin: 1px;
-  border-left: 1px solid ThreeDShadow;
-  border-top: 1px solid ThreeDShadow;
-  border-right: 1px solid ThreeDHighlight;
-  border-bottom: 1px solid ThreeDHighlight;
-}
-
-.colorpickertile[selected="true"] {
-  border: 2px outset #C0C0C0;
-}
-
-.colorpickertile[hover="true"] {
-  border: 2px dotted #FFFFFF;
-}
-
-.cp-light[hover="true"] {
-  border: 2px dotted #909090;
-}
--- a/toolkit/themes/linux/global/jar.mn
+++ b/toolkit/themes/linux/global/jar.mn
@@ -3,17 +3,16 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include ../../shared/non-mac.jar.inc.mn
 
 toolkit.jar:
    skin/classic/global/autocomplete.css
    skin/classic/global/button.css
    skin/classic/global/checkbox.css
-   skin/classic/global/colorpicker.css
    skin/classic/global/commonDialog.css
    skin/classic/global/dropmarker.css
 *  skin/classic/global/findBar.css
 *  skin/classic/global/global.css
    skin/classic/global/groupbox.css
    skin/classic/global/menu.css
    skin/classic/global/menulist.css
    skin/classic/global/netError.css
deleted file mode 100644
--- a/toolkit/themes/osx/global/colorpicker.css
+++ /dev/null
@@ -1,41 +0,0 @@
-/* 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/. */
-
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-
-/* ::::: colorpicker button ::::: */
-
-colorpicker[type="button"] {
-  width: 38px;
-  height: 24px;
-  border: 1px solid #a7a7a7;
-  background-color: ThreeDFace;
-  padding: 3px;
-  -moz-appearance: button-bevel;
-}
-
-.colorpicker-button-colorbox {
-  border: 1px solid #000000;
-}
-
-/* ::::: colorpicker tiles ::::: */
-
-.colorpickertile {
-  width                 : 20px;
-  height                : 20px;
-  margin                : 1px;
-}
-
-.colorpickertile[selected="true"] {
-  border : 1px outset #C0C0C0;
-
-}
-
-.colorpickertile[hover="true"] {
-  border : 1px dotted #A7A7A7;
-}
-
-.cp-light[hover="true"] {
-  border : 1px dotted #000000;
-}
--- a/toolkit/themes/osx/global/jar.mn
+++ b/toolkit/themes/osx/global/jar.mn
@@ -3,17 +3,16 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include ../../shared/jar.inc.mn
 
 toolkit.jar:
   skin/classic/global/autocomplete.css
   skin/classic/global/button.css
   skin/classic/global/checkbox.css
-  skin/classic/global/colorpicker.css
   skin/classic/global/commonDialog.css
   skin/classic/global/dialog.css
   skin/classic/global/dropmarker.css
 * skin/classic/global/findBar.css
 * skin/classic/global/global.css
   skin/classic/global/groupbox.css
   skin/classic/global/menu.css
   skin/classic/global/menulist.css
--- a/toolkit/themes/shared/in-content/common.inc.css
+++ b/toolkit/themes/shared/in-content/common.inc.css
@@ -164,17 +164,17 @@ xul|tab[selected] {
 html|button {
   padding: 3px;
 }
 
 /* xul buttons and menulists */
 
 *|button,
 html|select,
-xul|colorpicker[type="button"],
+html|input[type="color"],
 xul|menulist,
 html|*.numberbox-input::-moz-number-spin-up,
 html|*.numberbox-input::-moz-number-spin-down {
   -moz-appearance: none;
   min-height: 30px;
   color: var(--in-content-text-color);
   border: 1px solid var(--in-content-box-border-color);
   border-radius: 2px;
@@ -205,37 +205,37 @@ html|select:not([size]):not([multiple]) 
 html|select:not([size]):not([multiple]):dir(rtl){
   background-position: left 3px center;
 }
 
 html|button:enabled:hover,
 html|select:not([size]):not([multiple]):enabled:hover,
 html|*.numberbox-input::-moz-number-spin-up:hover,
 html|*.numberbox-input::-moz-number-spin-down:hover,
+html|input[type="color"]:hover,
 xul|button:not([disabled="true"]):hover,
-xul|colorpicker[type="button"]:not([disabled="true"]):hover,
 xul|menulist:not([disabled="true"]):hover {
   background-color: var(--in-content-box-background-hover);
 }
 
 html|button:enabled:hover:active,
 html|select:not([size]):not([multiple]):enabled:hover:active,
 html|*.numberbox-input::-moz-number-spin-up:hover:active,
 html|*.numberbox-input::-moz-number-spin-down:hover:active,
+html|input[type="color"]:enabled:hover:active,
 xul|button:not([disabled="true"]):hover:active,
-xul|colorpicker[type="button"]:not([disabled="true"]):hover:active,
 xul|menulist[open="true"]:not([disabled="true"]) {
   background-color: var(--in-content-box-background-active);
 }
 
 html|button:disabled,
 html|select:disabled,
 html|*.numberbox-input:disabled::-moz-number-spin-box,
+html|input[type="color"]:disabled,
 xul|button[disabled="true"],
-xul|colorpicker[type="button"][disabled="true"],
 xul|menulist[disabled="true"] {
   opacity: 0.5;
 }
 
 *|button.primary {
   background-color: var(--in-content-primary-button-background);
   border-color: transparent;
   color: var(--in-content-selected-text);
@@ -246,17 +246,17 @@ xul|button.primary:not([disabled="true"]
   background-color: var(--in-content-primary-button-background-hover);
 }
 
 html|button.primary:enabled:hover:active,
 xul|button.primary:not([disabled="true"]):hover:active {
   background-color: var(--in-content-primary-button-background-active);
 }
 
-xul|colorpicker[type="button"] {
+html|input[type="color"] {
   padding: 6px;
   width: 50px;
 }
 
 xul|button > xul|*.button-box,
 xul|menulist > xul|*.menulist-label-box {
   padding-right: 10px !important;
   padding-left: 10px !important;
deleted file mode 100644
--- a/toolkit/themes/windows/global/colorpicker.css
+++ /dev/null
@@ -1,48 +0,0 @@
-/* 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/. */
-
-/* ===== colorpicker.css ================================================
-  == Styles used by the XUL colorpicker element.
-  ======================================================================= */
-
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-
-/* ::::: colorpicker button ::::: */
- 
-/* colorpicker button */
-
-colorpicker[type="button"] {
-  -moz-appearance: button;
-  width: 38px;
-  height: 24px;
-  padding: 3px;
-}
-
-.colorpicker-button-colorbox {
-  border: 1px solid #000000;
-}
-
-/* ::::: colorpicker tiles ::::: */
-
-.colorpickertile {
-  width: 20px;
-  height: 20px;
-  margin: 1px;
-  border-left: 1px solid ThreeDShadow;
-  border-top: 1px solid ThreeDShadow;
-  border-right: 1px solid ThreeDHighlight;
-  border-bottom: 1px solid ThreeDHighlight;
-}
-
-.colorpickertile[selected="true"] {
-  border: 2px outset #C0C0C0;
-}
-
-.colorpickertile[hover="true"] {
-  border: 2px dotted #FFFFFF;
-}
-
-.cp-light[hover="true"] {
-  border: 2px dotted #909090;
-}
--- a/toolkit/themes/windows/global/jar.mn
+++ b/toolkit/themes/windows/global/jar.mn
@@ -11,17 +11,16 @@ toolkit.jar:
   skin/classic/global/dropmarker.css
   skin/classic/global/groupbox.css
 * skin/classic/global/menu.css
   skin/classic/global/menulist.css
 * skin/classic/global/popup.css
   skin/classic/global/radio.css
   skin/classic/global/tabbox.css
   skin/classic/global/textbox.css
-  skin/classic/global/colorpicker.css
   skin/classic/global/commonDialog.css
 * skin/classic/global/findBar.css
 * skin/classic/global/global.css
   skin/classic/global/netError.css
 * skin/classic/global/notification.css
   skin/classic/global/printPageSetup.css
   skin/classic/global/richlistbox.css
   skin/classic/global/scrollbox.css
--- a/xpcom/ds/StaticAtoms.py
+++ b/xpcom/ds/StaticAtoms.py
@@ -1236,17 +1236,16 @@ STATIC_ATOMS = [
     Atom("clip_rule", "clip-rule"),
     Atom("clipPath", "clipPath"),
     Atom("clipPathUnits", "clipPathUnits"),
     Atom("cm", "cm"),
     Atom("colorBurn", "color-burn"),
     Atom("colorDodge", "color-dodge"),
     Atom("colorInterpolation", "color-interpolation"),
     Atom("colorInterpolationFilters", "color-interpolation-filters"),
-    Atom("colorpicker", "colorpicker"),
     Atom("colorProfile", "color-profile"),
     Atom("cursor", "cursor"),
     Atom("cx", "cx"),
     Atom("cy", "cy"),
     Atom("d", "d"),
     Atom("darken", "darken"),
     Atom("defs", "defs"),
     Atom("deg", "deg"),