Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE
authorCiure Andrei <aciure@mozilla.com>
Wed, 11 Apr 2018 12:00:35 +0300
changeset 412801 9422362ff3fd216a47bd7973c8d37eff5c06e95d
parent 412800 4220b682f56eb4364cd57824d33da21fcff7d530 (current diff)
parent 412689 f6c3a0a19d82db25750d8badccd5cf37e79d028e (diff)
child 412802 8014105bae53b2a4e90918e9762b0067494b4516
push id33818
push userapavel@mozilla.com
push dateWed, 11 Apr 2018 14:36:40 +0000
treeherdermozilla-central@cfe6399e142c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone61.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 mozilla-inbound. a=merge CLOSED TREE
browser/components/extensions/test/browser/browser-common.ini
dom/html/HTMLInputElement.cpp
dom/html/HTMLInputElement.h
dom/html/HTMLTextAreaElement.cpp
dom/html/nsGenericHTMLElement.cpp
dom/html/nsGenericHTMLElement.h
layout/base/nsDocumentViewer.cpp
layout/style/res/number-control.css
toolkit/components/extensions/ExtensionParent.jsm
--- a/accessible/base/ARIAMap.cpp
+++ b/accessible/base/ARIAMap.cpp
@@ -33,1205 +33,1205 @@ static const uint32_t kGenericAccType = 
  *
  *  When no Role enum mapping exists for an ARIA role, the role will be exposed
  *  via the object attribute "xml-roles".
  */
 
 static const nsRoleMapEntry sWAIRoleMaps[] =
 {
   { // alert
-    nsGkAtoms::alert,
+    &nsGkAtoms::alert,
     roles::ALERT,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eAlert,
     kNoReqStates
   },
   { // alertdialog
-    nsGkAtoms::alertdialog,
+    &nsGkAtoms::alertdialog,
     roles::DIALOG,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // application
-    nsGkAtoms::application,
+    &nsGkAtoms::application,
     roles::APPLICATION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // article
-    nsGkAtoms::article,
+    &nsGkAtoms::article,
     roles::ARTICLE,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eReadonlyUntilEditable
   },
   { // banner
-    nsGkAtoms::banner,
+    &nsGkAtoms::banner,
     roles::NOTHING,
     kUseNativeRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // button
-    nsGkAtoms::button,
+    &nsGkAtoms::button,
     roles::PUSHBUTTON,
     kUseMapRole,
     eNoValue,
     ePressAction,
     eNoLiveAttr,
     eButton,
     kNoReqStates
     // eARIAPressed is auto applied on any button
   },
   { // cell
-    nsGkAtoms::cell,
+    &nsGkAtoms::cell,
     roles::CELL,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eTableCell,
     kNoReqStates
   },
   { // checkbox
-    nsGkAtoms::checkbox,
+    &nsGkAtoms::checkbox,
     roles::CHECKBUTTON,
     kUseMapRole,
     eNoValue,
     eCheckUncheckAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIACheckableMixed,
     eARIAReadonly
   },
   { // columnheader
-    nsGkAtoms::columnheader,
+    &nsGkAtoms::columnheader,
     roles::COLUMNHEADER,
     kUseMapRole,
     eNoValue,
     eSortAction,
     eNoLiveAttr,
     eTableCell,
     kNoReqStates,
     eARIASelectableIfDefined,
     eARIAReadonlyOrEditableIfDefined
   },
   { // combobox, which consists of text input and popup
-    nsGkAtoms::combobox,
+    &nsGkAtoms::combobox,
     roles::EDITCOMBOBOX,
     kUseMapRole,
     eNoValue,
     eOpenCloseAction,
     eNoLiveAttr,
     eCombobox,
     states::COLLAPSED | states::HASPOPUP,
     eARIAAutoComplete,
     eARIAReadonly,
     eARIAOrientation
   },
   { // complementary
-    nsGkAtoms::complementary,
+    &nsGkAtoms::complementary,
     roles::NOTHING,
     kUseNativeRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // contentinfo
-    nsGkAtoms::contentinfo,
+    &nsGkAtoms::contentinfo,
     roles::NOTHING,
     kUseNativeRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // dialog
-    nsGkAtoms::dialog,
+    &nsGkAtoms::dialog,
     roles::DIALOG,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // directory
-    nsGkAtoms::directory,
+    &nsGkAtoms::directory,
     roles::LIST,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eList,
     states::READONLY
   },
   { // doc-abstract
-    nsGkAtoms::docAbstract,
+    &nsGkAtoms::docAbstract,
     roles::SECTION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // doc-acknowledgments
-    nsGkAtoms::docAcknowledgments,
+    &nsGkAtoms::docAcknowledgments,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-afterword
-    nsGkAtoms::docAfterword,
+    &nsGkAtoms::docAfterword,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-appendix
-    nsGkAtoms::docAppendix,
+    &nsGkAtoms::docAppendix,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-backlink
-    nsGkAtoms::docBacklink,
+    &nsGkAtoms::docBacklink,
     roles::LINK,
     kUseMapRole,
     eNoValue,
     eJumpAction,
     eNoLiveAttr,
     kGenericAccType,
     states::LINKED
   },
   { // doc-biblioentry
-    nsGkAtoms::docBiblioentry,
+    &nsGkAtoms::docBiblioentry,
     roles::LISTITEM,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     states::READONLY
   },
   { // doc-bibliography
-    nsGkAtoms::docBibliography,
+    &nsGkAtoms::docBibliography,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-biblioref
-    nsGkAtoms::docBiblioref,
+    &nsGkAtoms::docBiblioref,
     roles::LINK,
     kUseMapRole,
     eNoValue,
     eJumpAction,
     eNoLiveAttr,
     kGenericAccType,
     states::LINKED
   },
   { // doc-chapter
-    nsGkAtoms::docChapter,
+    &nsGkAtoms::docChapter,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-colophon
-    nsGkAtoms::docColophon,
+    &nsGkAtoms::docColophon,
     roles::SECTION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // doc-conclusion
-    nsGkAtoms::docConclusion,
+    &nsGkAtoms::docConclusion,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-cover
-    nsGkAtoms::docCover,
+    &nsGkAtoms::docCover,
     roles::GRAPHIC,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // doc-credit
-    nsGkAtoms::docCredit,
+    &nsGkAtoms::docCredit,
     roles::SECTION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // doc-credits
-    nsGkAtoms::docCredits,
+    &nsGkAtoms::docCredits,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-dedication
-    nsGkAtoms::docDedication,
+    &nsGkAtoms::docDedication,
     roles::SECTION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // doc-endnote
-    nsGkAtoms::docEndnote,
+    &nsGkAtoms::docEndnote,
     roles::LISTITEM,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     states::READONLY
   },
   { // doc-endnotes
-    nsGkAtoms::docEndnotes,
+    &nsGkAtoms::docEndnotes,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-epigraph
-    nsGkAtoms::docEpigraph,
+    &nsGkAtoms::docEpigraph,
     roles::SECTION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // doc-epilogue
-    nsGkAtoms::docEpilogue,
+    &nsGkAtoms::docEpilogue,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-errata
-    nsGkAtoms::docErrata,
+    &nsGkAtoms::docErrata,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-example
-    nsGkAtoms::docExample,
+    &nsGkAtoms::docExample,
     roles::SECTION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // doc-footnote
-    nsGkAtoms::docFootnote,
+    &nsGkAtoms::docFootnote,
     roles::FOOTNOTE,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-foreword
-    nsGkAtoms::docForeword,
+    &nsGkAtoms::docForeword,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-glossary
-    nsGkAtoms::docGlossary,
+    &nsGkAtoms::docGlossary,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-glossref
-    nsGkAtoms::docGlossref,
+    &nsGkAtoms::docGlossref,
     roles::LINK,
     kUseMapRole,
     eNoValue,
     eJumpAction,
     eNoLiveAttr,
     kGenericAccType,
     states::LINKED
   },
   { // doc-index
-    nsGkAtoms::docIndex,
+    &nsGkAtoms::docIndex,
     roles::NAVIGATION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-introduction
-    nsGkAtoms::docIntroduction,
+    &nsGkAtoms::docIntroduction,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-noteref
-    nsGkAtoms::docNoteref,
+    &nsGkAtoms::docNoteref,
     roles::LINK,
     kUseMapRole,
     eNoValue,
     eJumpAction,
     eNoLiveAttr,
     kGenericAccType,
     states::LINKED
   },
   { // doc-notice
-    nsGkAtoms::docNotice,
+    &nsGkAtoms::docNotice,
     roles::NOTE,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // doc-pagebreak
-    nsGkAtoms::docPagebreak,
+    &nsGkAtoms::docPagebreak,
     roles::SEPARATOR,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // doc-pagelist
-    nsGkAtoms::docPagelist,
+    &nsGkAtoms::docPagelist,
     roles::NAVIGATION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-part
-    nsGkAtoms::docPart,
+    &nsGkAtoms::docPart,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-preface
-    nsGkAtoms::docPreface,
+    &nsGkAtoms::docPreface,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-prologue
-    nsGkAtoms::docPrologue,
+    &nsGkAtoms::docPrologue,
     roles::LANDMARK,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // doc-pullquote
-    nsGkAtoms::docPullquote,
+    &nsGkAtoms::docPullquote,
     roles::SECTION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // doc-qna
-    nsGkAtoms::docQna,
+    &nsGkAtoms::docQna,
     roles::SECTION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // doc-subtitle
-    nsGkAtoms::docSubtitle,
+    &nsGkAtoms::docSubtitle,
     roles::HEADING,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // doc-tip
-    nsGkAtoms::docTip,
+    &nsGkAtoms::docTip,
     roles::NOTE,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // doc-toc
-    nsGkAtoms::docToc,
+    &nsGkAtoms::docToc,
     roles::NAVIGATION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // document
-    nsGkAtoms::document,
+    &nsGkAtoms::document,
     roles::NON_NATIVE_DOCUMENT,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eReadonlyUntilEditable
   },
   { // feed
-    nsGkAtoms::feed,
+    &nsGkAtoms::feed,
     roles::GROUPING,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // figure
-    nsGkAtoms::figure,
+    &nsGkAtoms::figure,
     roles::FIGURE,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // form
-    nsGkAtoms::form,
+    &nsGkAtoms::form,
     roles::FORM,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // graphics-document
-    nsGkAtoms::graphicsDocument,
+    &nsGkAtoms::graphicsDocument,
     roles::NON_NATIVE_DOCUMENT,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eReadonlyUntilEditable
   },
   { // graphics-object
-    nsGkAtoms::graphicsObject,
+    &nsGkAtoms::graphicsObject,
     roles::GROUPING,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // graphics-symbol
-    nsGkAtoms::graphicsSymbol,
+    &nsGkAtoms::graphicsSymbol,
     roles::GRAPHIC,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // grid
-    nsGkAtoms::grid,
+    &nsGkAtoms::grid,
     roles::TABLE,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eSelect | eTable,
     kNoReqStates,
     eARIAMultiSelectable,
     eARIAReadonlyOrEditable,
     eFocusableUntilDisabled
   },
   { // gridcell
-    nsGkAtoms::gridcell,
+    &nsGkAtoms::gridcell,
     roles::GRID_CELL,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eTableCell,
     kNoReqStates,
     eARIASelectable,
     eARIAReadonlyOrEditableIfDefined
   },
   { // group
-    nsGkAtoms::group,
+    &nsGkAtoms::group,
     roles::GROUPING,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // heading
-    nsGkAtoms::heading,
+    &nsGkAtoms::heading,
     roles::HEADING,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // img
-    nsGkAtoms::img,
+    &nsGkAtoms::img,
     roles::GRAPHIC,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // key
-    nsGkAtoms::key,
+    &nsGkAtoms::key,
     roles::KEY,
     kUseMapRole,
     eNoValue,
     ePressAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIAPressed
   },
   { // link
-    nsGkAtoms::link,
+    &nsGkAtoms::link,
     roles::LINK,
     kUseMapRole,
     eNoValue,
     eJumpAction,
     eNoLiveAttr,
     kGenericAccType,
     states::LINKED
   },
   { // list
-    nsGkAtoms::list_,
+    &nsGkAtoms::list_,
     roles::LIST,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eList,
     states::READONLY
   },
   { // listbox
-    nsGkAtoms::listbox,
+    &nsGkAtoms::listbox,
     roles::LISTBOX,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eListControl | eSelect,
     states::VERTICAL,
     eARIAMultiSelectable,
     eARIAReadonly,
     eFocusableUntilDisabled,
     eARIAOrientation
   },
   { // listitem
-    nsGkAtoms::listitem,
+    &nsGkAtoms::listitem,
     roles::LISTITEM,
     kUseMapRole,
     eNoValue,
     eNoAction, // XXX: should depend on state, parent accessible
     eNoLiveAttr,
     kGenericAccType,
     states::READONLY
   },
   { // log
-    nsGkAtoms::log_,
+    &nsGkAtoms::log_,
     roles::NOTHING,
     kUseNativeRole,
     eNoValue,
     eNoAction,
     ePoliteLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // main
-    nsGkAtoms::main,
+    &nsGkAtoms::main,
     roles::NOTHING,
     kUseNativeRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // marquee
-    nsGkAtoms::marquee,
+    &nsGkAtoms::marquee,
     roles::ANIMATION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eOffLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // math
-    nsGkAtoms::math,
+    &nsGkAtoms::math,
     roles::FLAT_EQUATION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // menu
-    nsGkAtoms::menu,
+    &nsGkAtoms::menu,
     roles::MENUPOPUP,
     kUseMapRole,
     eNoValue,
     eNoAction, // XXX: technically accessibles of menupopup role haven't
                // any action, but menu can be open or close.
     eNoLiveAttr,
     kGenericAccType,
     states::VERTICAL,
     eARIAOrientation
   },
   { // menubar
-    nsGkAtoms::menubar,
+    &nsGkAtoms::menubar,
     roles::MENUBAR,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     states::HORIZONTAL,
     eARIAOrientation
   },
   { // menuitem
-    nsGkAtoms::menuitem,
+    &nsGkAtoms::menuitem,
     roles::MENUITEM,
     kUseMapRole,
     eNoValue,
     eClickAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // menuitemcheckbox
-    nsGkAtoms::menuitemcheckbox,
+    &nsGkAtoms::menuitemcheckbox,
     roles::CHECK_MENU_ITEM,
     kUseMapRole,
     eNoValue,
     eClickAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIACheckableMixed,
     eARIAReadonly
   },
   { // menuitemradio
-    nsGkAtoms::menuitemradio,
+    &nsGkAtoms::menuitemradio,
     roles::RADIO_MENU_ITEM,
     kUseMapRole,
     eNoValue,
     eClickAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIACheckableBool,
     eARIAReadonly
   },
   { // navigation
-    nsGkAtoms::navigation,
+    &nsGkAtoms::navigation,
     roles::NOTHING,
     kUseNativeRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // none
-    nsGkAtoms::none,
+    &nsGkAtoms::none,
     roles::NOTHING,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // note
-    nsGkAtoms::note_,
+    &nsGkAtoms::note_,
     roles::NOTE,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // option
-    nsGkAtoms::option,
+    &nsGkAtoms::option,
     roles::OPTION,
     kUseMapRole,
     eNoValue,
     eSelectAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIASelectable,
     eARIACheckedMixed
   },
   { // presentation
-    nsGkAtoms::presentation,
+    &nsGkAtoms::presentation,
     roles::NOTHING,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // progressbar
-    nsGkAtoms::progressbar,
+    &nsGkAtoms::progressbar,
     roles::PROGRESSBAR,
     kUseMapRole,
     eHasValueMinMax,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     states::READONLY,
     eIndeterminateIfNoValue
   },
   { // radio
-    nsGkAtoms::radio,
+    &nsGkAtoms::radio,
     roles::RADIOBUTTON,
     kUseMapRole,
     eNoValue,
     eSelectAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIACheckableBool
   },
   { // radiogroup
-    nsGkAtoms::radiogroup,
+    &nsGkAtoms::radiogroup,
     roles::RADIO_GROUP,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIAOrientation,
     eARIAReadonly
   },
   { // region
-    nsGkAtoms::region,
+    &nsGkAtoms::region,
     roles::REGION,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // row
-    nsGkAtoms::row,
+    &nsGkAtoms::row,
     roles::ROW,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eTableRow,
     kNoReqStates,
     eARIASelectable
   },
   { // rowgroup
-    nsGkAtoms::rowgroup,
+    &nsGkAtoms::rowgroup,
     roles::GROUPING,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // rowheader
-    nsGkAtoms::rowheader,
+    &nsGkAtoms::rowheader,
     roles::ROWHEADER,
     kUseMapRole,
     eNoValue,
     eSortAction,
     eNoLiveAttr,
     eTableCell,
     kNoReqStates,
     eARIASelectableIfDefined,
     eARIAReadonlyOrEditableIfDefined
   },
   { // scrollbar
-    nsGkAtoms::scrollbar,
+    &nsGkAtoms::scrollbar,
     roles::SCROLLBAR,
     kUseMapRole,
     eHasValueMinMax,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     states::VERTICAL,
     eARIAOrientation,
     eARIAReadonly
   },
   { // search
-    nsGkAtoms::search,
+    &nsGkAtoms::search,
     roles::NOTHING,
     kUseNativeRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eLandmark,
     kNoReqStates
   },
   { // searchbox
-    nsGkAtoms::searchbox,
+    &nsGkAtoms::searchbox,
     roles::ENTRY,
     kUseMapRole,
     eNoValue,
     eActivateAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIAAutoComplete,
     eARIAMultiline,
     eARIAReadonlyOrEditable
   },
   { // separator
-    nsGkAtoms::separator_,
+    &nsGkAtoms::separator_,
     roles::SEPARATOR,
     kUseMapRole,
     eHasValueMinMaxIfFocusable,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     states::HORIZONTAL,
     eARIAOrientation
   },
   { // slider
-    nsGkAtoms::slider,
+    &nsGkAtoms::slider,
     roles::SLIDER,
     kUseMapRole,
     eHasValueMinMax,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     states::HORIZONTAL,
     eARIAOrientation,
     eARIAReadonly
   },
   { // spinbutton
-    nsGkAtoms::spinbutton,
+    &nsGkAtoms::spinbutton,
     roles::SPINBUTTON,
     kUseMapRole,
     eHasValueMinMax,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIAReadonly
   },
   { // status
-    nsGkAtoms::status,
+    &nsGkAtoms::status,
     roles::STATUSBAR,
     kUseMapRole,
     eNoValue,
     eNoAction,
     ePoliteLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // switch
-    nsGkAtoms::svgSwitch,
+    &nsGkAtoms::svgSwitch,
     roles::SWITCH,
     kUseMapRole,
     eNoValue,
     eCheckUncheckAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIACheckableBool,
     eARIAReadonly
   },
   { // tab
-    nsGkAtoms::tab,
+    &nsGkAtoms::tab,
     roles::PAGETAB,
     kUseMapRole,
     eNoValue,
     eSwitchAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIASelectable
   },
   { // table
-    nsGkAtoms::table,
+    &nsGkAtoms::table,
     roles::TABLE,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eTable,
     kNoReqStates,
     eARIASelectable
   },
   { // tablist
-    nsGkAtoms::tablist,
+    &nsGkAtoms::tablist,
     roles::PAGETABLIST,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eSelect,
     states::HORIZONTAL,
     eARIAOrientation
   },
   { // tabpanel
-    nsGkAtoms::tabpanel,
+    &nsGkAtoms::tabpanel,
     roles::PROPERTYPAGE,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // term
-    nsGkAtoms::term,
+    &nsGkAtoms::term,
     roles::TERM,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     states::READONLY
   },
   { // textbox
-    nsGkAtoms::textbox,
+    &nsGkAtoms::textbox,
     roles::ENTRY,
     kUseMapRole,
     eNoValue,
     eActivateAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIAAutoComplete,
     eARIAMultiline,
     eARIAReadonlyOrEditable
   },
   { // timer
-    nsGkAtoms::timer,
+    &nsGkAtoms::timer,
     roles::NOTHING,
     kUseNativeRole,
     eNoValue,
     eNoAction,
     eOffLiveAttr,
     kNoReqStates
   },
   { // toolbar
-    nsGkAtoms::toolbar,
+    &nsGkAtoms::toolbar,
     roles::TOOLBAR,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     states::HORIZONTAL,
     eARIAOrientation
   },
   { // tooltip
-    nsGkAtoms::tooltip,
+    &nsGkAtoms::tooltip,
     roles::TOOLTIP,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates
   },
   { // tree
-    nsGkAtoms::tree,
+    &nsGkAtoms::tree,
     roles::OUTLINE,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eSelect,
     states::VERTICAL,
     eARIAReadonly,
     eARIAMultiSelectable,
     eFocusableUntilDisabled,
     eARIAOrientation
   },
   { // treegrid
-    nsGkAtoms::treegrid,
+    &nsGkAtoms::treegrid,
     roles::TREE_TABLE,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eSelect | eTable,
     kNoReqStates,
     eARIAReadonlyOrEditable,
     eARIAMultiSelectable,
     eFocusableUntilDisabled,
     eARIAOrientation
   },
   { // treeitem
-    nsGkAtoms::treeitem,
+    &nsGkAtoms::treeitem,
     roles::OUTLINEITEM,
     kUseMapRole,
     eNoValue,
     eActivateAction, // XXX: should expose second 'expand/collapse' action based
                      // on states
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIASelectable,
     eARIACheckedMixed
   }
 };
 
 static const nsRoleMapEntry sLandmarkRoleMap = {
-  nsGkAtoms::_empty,
+  &nsGkAtoms::_empty,
   roles::NOTHING,
   kUseNativeRole,
   eNoValue,
   eNoAction,
   eNoLiveAttr,
   kGenericAccType,
   kNoReqStates
 };
 
 nsRoleMapEntry aria::gEmptyRoleMap = {
-  nsGkAtoms::_empty,
+  &nsGkAtoms::_empty,
   roles::NOTHING,
   kUseMapRole,
   eNoValue,
   eNoAction,
   eNoLiveAttr,
   kGenericAccType,
   kNoReqStates
 };
@@ -1256,58 +1256,58 @@ static const EStateRule sWAIUnivStateMap
 
 /**
  * ARIA attribute map for attribute characteristics.
  * @note ARIA attributes that don't have any flags are not included here.
  */
 
 struct AttrCharacteristics
 {
-  const nsStaticAtom* const attributeName;
+  nsStaticAtom** attributeName;
   const uint8_t characteristics;
 };
 
 static const AttrCharacteristics gWAIUnivAttrMap[] = {
-  {nsGkAtoms::aria_activedescendant,  ATTR_BYPASSOBJ                               },
-  {nsGkAtoms::aria_atomic,   ATTR_BYPASSOBJ_IF_FALSE | ATTR_VALTOKEN | ATTR_GLOBAL },
-  {nsGkAtoms::aria_busy,                               ATTR_VALTOKEN | ATTR_GLOBAL },
-  {nsGkAtoms::aria_checked,           ATTR_BYPASSOBJ | ATTR_VALTOKEN               }, /* exposes checkable obj attr */
-  {nsGkAtoms::aria_controls,          ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
-  {nsGkAtoms::aria_describedby,       ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
-  {nsGkAtoms::aria_details,           ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
-  {nsGkAtoms::aria_disabled,          ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL },
-  {nsGkAtoms::aria_dropeffect,                         ATTR_VALTOKEN | ATTR_GLOBAL },
-  {nsGkAtoms::aria_errormessage,      ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
-  {nsGkAtoms::aria_expanded,          ATTR_BYPASSOBJ | ATTR_VALTOKEN               },
-  {nsGkAtoms::aria_flowto,            ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
-  {nsGkAtoms::aria_grabbed,                            ATTR_VALTOKEN | ATTR_GLOBAL },
-  {nsGkAtoms::aria_haspopup,          ATTR_BYPASSOBJ_IF_FALSE | ATTR_VALTOKEN | ATTR_GLOBAL },
-  {nsGkAtoms::aria_hidden,            ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL }, /* handled special way */
-  {nsGkAtoms::aria_invalid,           ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL },
-  {nsGkAtoms::aria_label,             ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
-  {nsGkAtoms::aria_labelledby,        ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
-  {nsGkAtoms::aria_level,             ATTR_BYPASSOBJ                               }, /* handled via groupPosition */
-  {nsGkAtoms::aria_live,                               ATTR_VALTOKEN | ATTR_GLOBAL },
-  {nsGkAtoms::aria_modal,             ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL },
-  {nsGkAtoms::aria_multiline,         ATTR_BYPASSOBJ | ATTR_VALTOKEN               },
-  {nsGkAtoms::aria_multiselectable,   ATTR_BYPASSOBJ | ATTR_VALTOKEN               },
-  {nsGkAtoms::aria_owns,              ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
-  {nsGkAtoms::aria_orientation,                        ATTR_VALTOKEN               },
-  {nsGkAtoms::aria_posinset,          ATTR_BYPASSOBJ                               }, /* handled via groupPosition */
-  {nsGkAtoms::aria_pressed,           ATTR_BYPASSOBJ | ATTR_VALTOKEN               },
-  {nsGkAtoms::aria_readonly,          ATTR_BYPASSOBJ | ATTR_VALTOKEN               },
-  {nsGkAtoms::aria_relevant,          ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
-  {nsGkAtoms::aria_required,          ATTR_BYPASSOBJ | ATTR_VALTOKEN               },
-  {nsGkAtoms::aria_selected,          ATTR_BYPASSOBJ | ATTR_VALTOKEN               },
-  {nsGkAtoms::aria_setsize,           ATTR_BYPASSOBJ                               }, /* handled via groupPosition */
-  {nsGkAtoms::aria_sort,                               ATTR_VALTOKEN               },
-  {nsGkAtoms::aria_valuenow,          ATTR_BYPASSOBJ                               },
-  {nsGkAtoms::aria_valuemin,          ATTR_BYPASSOBJ                               },
-  {nsGkAtoms::aria_valuemax,          ATTR_BYPASSOBJ                               },
-  {nsGkAtoms::aria_valuetext,         ATTR_BYPASSOBJ                               }
+  {&nsGkAtoms::aria_activedescendant,  ATTR_BYPASSOBJ                               },
+  {&nsGkAtoms::aria_atomic,   ATTR_BYPASSOBJ_IF_FALSE | ATTR_VALTOKEN | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_busy,                               ATTR_VALTOKEN | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_checked,           ATTR_BYPASSOBJ | ATTR_VALTOKEN               }, /* exposes checkable obj attr */
+  {&nsGkAtoms::aria_controls,          ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_describedby,       ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_details,           ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_disabled,          ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_dropeffect,                         ATTR_VALTOKEN | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_errormessage,      ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_expanded,          ATTR_BYPASSOBJ | ATTR_VALTOKEN               },
+  {&nsGkAtoms::aria_flowto,            ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_grabbed,                            ATTR_VALTOKEN | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_haspopup,          ATTR_BYPASSOBJ_IF_FALSE | ATTR_VALTOKEN | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_hidden,            ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL }, /* handled special way */
+  {&nsGkAtoms::aria_invalid,           ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_label,             ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_labelledby,        ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_level,             ATTR_BYPASSOBJ                               }, /* handled via groupPosition */
+  {&nsGkAtoms::aria_live,                               ATTR_VALTOKEN | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_modal,             ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_multiline,         ATTR_BYPASSOBJ | ATTR_VALTOKEN               },
+  {&nsGkAtoms::aria_multiselectable,   ATTR_BYPASSOBJ | ATTR_VALTOKEN               },
+  {&nsGkAtoms::aria_owns,              ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_orientation,                        ATTR_VALTOKEN               },
+  {&nsGkAtoms::aria_posinset,          ATTR_BYPASSOBJ                               }, /* handled via groupPosition */
+  {&nsGkAtoms::aria_pressed,           ATTR_BYPASSOBJ | ATTR_VALTOKEN               },
+  {&nsGkAtoms::aria_readonly,          ATTR_BYPASSOBJ | ATTR_VALTOKEN               },
+  {&nsGkAtoms::aria_relevant,          ATTR_BYPASSOBJ                 | ATTR_GLOBAL },
+  {&nsGkAtoms::aria_required,          ATTR_BYPASSOBJ | ATTR_VALTOKEN               },
+  {&nsGkAtoms::aria_selected,          ATTR_BYPASSOBJ | ATTR_VALTOKEN               },
+  {&nsGkAtoms::aria_setsize,           ATTR_BYPASSOBJ                               }, /* handled via groupPosition */
+  {&nsGkAtoms::aria_sort,                               ATTR_VALTOKEN               },
+  {&nsGkAtoms::aria_valuenow,          ATTR_BYPASSOBJ                               },
+  {&nsGkAtoms::aria_valuemin,          ATTR_BYPASSOBJ                               },
+  {&nsGkAtoms::aria_valuemax,          ATTR_BYPASSOBJ                               },
+  {&nsGkAtoms::aria_valuetext,         ATTR_BYPASSOBJ                               }
 };
 
 namespace {
 
 struct RoleComparator
 {
   const nsDependentSubstring& mRole;
   explicit RoleComparator(const nsDependentSubstring& aRole) : mRole(aRole) {}
@@ -1390,17 +1390,17 @@ aria::UniversalStatesFor(mozilla::dom::E
 
   return state;
 }
 
 uint8_t
 aria::AttrCharacteristicsFor(nsAtom* aAtom)
 {
   for (uint32_t i = 0; i < ArrayLength(gWAIUnivAttrMap); i++)
-    if (gWAIUnivAttrMap[i].attributeName == aAtom)
+    if (*gWAIUnivAttrMap[i].attributeName == aAtom)
       return gWAIUnivAttrMap[i].characteristics;
 
   return 0;
 }
 
 bool
 aria::HasDefinedARIAHidden(nsIContent* aContent)
 {
--- a/accessible/base/ARIAMap.h
+++ b/accessible/base/ARIAMap.h
@@ -137,32 +137,32 @@ const uint8_t ATTR_GLOBAL = 0x1 << 3;
  * For each ARIA role, this maps the nsIAccessible information.
  */
 struct nsRoleMapEntry
 {
   /**
    * Return true if matches to the given ARIA role.
    */
   bool Is(nsAtom* aARIARole) const
-    { return roleAtom == aARIARole; }
+    { return *roleAtom == aARIARole; }
 
   /**
    * Return true if ARIA role has the given accessible type.
    */
   bool IsOfType(mozilla::a11y::AccGenericType aType) const
     { return accTypes & aType; }
 
   /**
    * Return ARIA role.
    */
   const nsDependentAtomString ARIARoleString() const
-    { return nsDependentAtomString(roleAtom); }
+    { return nsDependentAtomString(*roleAtom); }
 
   // ARIA role: string representation such as "button"
-  nsStaticAtom* const roleAtom;
+  nsStaticAtom** roleAtom;
 
   // Role mapping rule: maps to enum Role
   mozilla::a11y::role role;
 
   // Role rule: whether to use mapped role or native semantics
   bool roleRule;
 
   // Value mapping rule: how to compute accessible value
--- a/accessible/base/ARIAStateMap.cpp
+++ b/accessible/base/ARIAStateMap.cpp
@@ -19,17 +19,17 @@ using namespace mozilla::a11y::aria;
  */
 struct EnumTypeData
 {
   // ARIA attribute name.
   nsStaticAtom* const mAttrName;
 
   // States if the attribute value is matched to the enum value. Used as
   // Element::AttrValuesArray, last item must be nullptr.
-  nsStaticAtom* const mValues[4];
+  nsStaticAtom* const* const mValues[4];
 
   // States applied if corresponding enum values are matched.
   const uint64_t mStates[3];
 
   // States to clear in case of match.
   const uint64_t mClearState;
 };
 
@@ -84,34 +84,34 @@ static void MapTokenType(dom::Element* a
 bool
 aria::MapToState(EStateRule aRule, dom::Element* aElement, uint64_t* aState)
 {
   switch (aRule) {
     case eARIAAutoComplete:
     {
       static const EnumTypeData data = {
         nsGkAtoms::aria_autocomplete,
-        { nsGkAtoms::inlinevalue,
-          nsGkAtoms::list_,
-          nsGkAtoms::both, nullptr },
+        { &nsGkAtoms::inlinevalue,
+          &nsGkAtoms::list_,
+          &nsGkAtoms::both, nullptr },
         { states::SUPPORTS_AUTOCOMPLETION,
           states::HASPOPUP | states::SUPPORTS_AUTOCOMPLETION,
           states::HASPOPUP | states::SUPPORTS_AUTOCOMPLETION }, 0
       };
 
       MapEnumType(aElement, aState, data);
       return true;
     }
 
     case eARIABusy:
     {
       static const EnumTypeData data = {
         nsGkAtoms::aria_busy,
-        { nsGkAtoms::_true,
-          nsGkAtoms::error, nullptr },
+        { &nsGkAtoms::_true,
+          &nsGkAtoms::error, nullptr },
         { states::BUSY,
           states::INVALID }, 0
       };
 
       MapEnumType(aElement, aState, data);
       return true;
     }
 
@@ -224,18 +224,18 @@ aria::MapToState(EStateRule aRule, dom::
       MapTokenType(aElement, aState, data);
       return true;
     }
 
     case eARIAOrientation:
     {
       static const EnumTypeData data = {
         nsGkAtoms::aria_orientation,
-        { nsGkAtoms::horizontal,
-          nsGkAtoms::vertical, nullptr },
+        { &nsGkAtoms::horizontal,
+          &nsGkAtoms::vertical, nullptr },
         { states::HORIZONTAL,
           states::VERTICAL },
         states::HORIZONTAL | states::VERTICAL
       };
 
       MapEnumType(aElement, aState, data);
       return true;
     }
--- a/accessible/base/TextAttrs.cpp
+++ b/accessible/base/TextAttrs.cpp
@@ -297,17 +297,17 @@ TextAttrsMgr::InvalidTextAttr::
 bool
 TextAttrsMgr::InvalidTextAttr::
   GetValue(nsIContent* aElm, uint32_t* aValue)
 {
   nsIContent* elm = aElm;
   do {
     if (nsAccUtils::HasDefinedARIAToken(elm, nsGkAtoms::aria_invalid)) {
       static Element::AttrValuesArray tokens[] =
-        { nsGkAtoms::_false, nsGkAtoms::grammar, nsGkAtoms::spelling,
+        { &nsGkAtoms::_false, &nsGkAtoms::grammar, &nsGkAtoms::spelling,
           nullptr };
 
       int32_t idx = elm->AsElement()->FindAttrValueIn(kNameSpaceID_None,
                                                       nsGkAtoms::aria_invalid,
                                                       tokens, eCaseMatters);
       switch (idx) {
         case 0:
           *aValue = eFalse;
--- a/accessible/base/XULMap.h
+++ b/accessible/base/XULMap.h
@@ -115,17 +115,17 @@ XULMAP(
     return CreateMenupopupAccessible(aContent, aContext);
   }
 )
 
 XULMAP(
   panel,
   [](nsIContent* aContent, Accessible* aContext) -> Accessible* {
     static const Element::AttrValuesArray sIgnoreTypeVals[] =
-      { nsGkAtoms::autocomplete_richlistbox, nsGkAtoms::autocomplete, nullptr };
+      { &nsGkAtoms::autocomplete_richlistbox, &nsGkAtoms::autocomplete, nullptr };
 
     if (!aContent->IsElement() ||
         aContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
                                                sIgnoreTypeVals, eIgnoreCase) >= 0) {
       return nullptr;
     }
 
     if (aContent->AsElement()->AttrValueIs(kNameSpaceID_None,
--- a/accessible/base/nsAccUtils.cpp
+++ b/accessible/base/nsAccUtils.cpp
@@ -203,29 +203,30 @@ nsAccUtils::HasDefinedARIAToken(nsIConte
                            eCaseMatters) ||
       element->AttrValueIs(kNameSpaceID_None, aAtom, nsGkAtoms::_undefined,
                            eCaseMatters)) {
         return false;
   }
   return true;
 }
 
-nsStaticAtom*
+nsAtom*
 nsAccUtils::GetARIAToken(dom::Element* aElement, nsAtom* aAttr)
 {
   if (!HasDefinedARIAToken(aElement, aAttr))
     return nsGkAtoms::_empty;
 
   static Element::AttrValuesArray tokens[] =
-    { nsGkAtoms::_false, nsGkAtoms::_true, nsGkAtoms::mixed, nullptr};
+    { &nsGkAtoms::_false, &nsGkAtoms::_true,
+      &nsGkAtoms::mixed, nullptr};
 
   int32_t idx = aElement->FindAttrValueIn(kNameSpaceID_None,
                                           aAttr, tokens, eCaseMatters);
   if (idx >= 0)
-    return tokens[idx];
+    return *(tokens[idx]);
 
   return nullptr;
 }
 
 Accessible*
 nsAccUtils::GetSelectableContainer(Accessible* aAccessible, uint64_t aState)
 {
   if (!aAccessible)
--- a/accessible/base/nsAccUtils.h
+++ b/accessible/base/nsAccUtils.h
@@ -96,18 +96,17 @@ public:
    *
    * Return true if the ARIA property is defined, otherwise false
    */
   static bool HasDefinedARIAToken(nsIContent *aContent, nsAtom *aAtom);
 
   /**
    * Return atomic value of ARIA attribute of boolean or NMTOKEN type.
    */
-  static nsStaticAtom* GetARIAToken(mozilla::dom::Element* aElement,
-                                    nsAtom* aAttr);
+  static nsAtom* GetARIAToken(mozilla::dom::Element* aElement, nsAtom* aAttr);
 
   /**
    * Return document accessible for the given DOM node.
    */
   static DocAccessible* GetDocAccessibleFor(nsINode* aNode)
   {
     nsIPresShell *presShell = nsCoreUtils::GetPresShellFor(aNode);
     return GetAccService()->GetDocAccessible(presShell);
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -299,36 +299,36 @@ New_HTMLTableHeaderCellIfScope(nsIConten
  * Cached value of the PREF_ACCESSIBILITY_FORCE_DISABLED preference.
  */
 static int32_t sPlatformDisabledState = 0;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Markup maps array.
 
 #define Attr(name, value) \
-  { nsGkAtoms::name, nsGkAtoms::value }
+  { &nsGkAtoms::name, &nsGkAtoms::value }
 
 #define AttrFromDOM(name, DOMAttrName) \
-  { nsGkAtoms::name, nullptr, nsGkAtoms::DOMAttrName }
+  { &nsGkAtoms::name, nullptr, &nsGkAtoms::DOMAttrName }
 
 #define AttrFromDOMIf(name, DOMAttrName, DOMAttrValue) \
-  { nsGkAtoms::name, nullptr,  nsGkAtoms::DOMAttrName, nsGkAtoms::DOMAttrValue }
+  { &nsGkAtoms::name, nullptr,  &nsGkAtoms::DOMAttrName, &nsGkAtoms::DOMAttrValue }
 
 #define MARKUPMAP(atom, new_func, r, ... ) \
-  { nsGkAtoms::atom, new_func, static_cast<a11y::role>(r), { __VA_ARGS__ } },
+  { &nsGkAtoms::atom, new_func, static_cast<a11y::role>(r), { __VA_ARGS__ } },
 
 static const HTMLMarkupMapInfo sHTMLMarkupMapList[] = {
   #include "MarkupMap.h"
 };
 
 #undef MARKUPMAP
 
 #ifdef MOZ_XUL
 #define XULMAP(atom, ...) \
-  { nsGkAtoms::atom, __VA_ARGS__ },
+  { &nsGkAtoms::atom, __VA_ARGS__ },
 
 #define XULMAP_TYPE(atom, new_type) \
 XULMAP( \
   atom, \
   [](nsIContent* aContent, Accessible* aContext) -> Accessible* { \
     return new new_type(aContent, aContext->Document()); \
   } \
 )
@@ -1344,21 +1344,21 @@ nsAccessibilityService::Init()
   nsCOMPtr<nsIEventListenerService> eventListenerService =
     do_GetService("@mozilla.org/eventlistenerservice;1");
   if (!eventListenerService)
     return false;
 
   eventListenerService->AddListenerChangeListener(this);
 
   for (uint32_t i = 0; i < ArrayLength(sHTMLMarkupMapList); i++)
-    mHTMLMarkupMap.Put(sHTMLMarkupMapList[i].tag, &sHTMLMarkupMapList[i]);
+    mHTMLMarkupMap.Put(*sHTMLMarkupMapList[i].tag, &sHTMLMarkupMapList[i]);
 
 #ifdef MOZ_XUL
   for (uint32_t i = 0; i < ArrayLength(sXULMarkupMapList); i++)
-    mXULMarkupMap.Put(sXULMarkupMapList[i].tag, &sXULMarkupMapList[i]);
+    mXULMarkupMap.Put(*sXULMarkupMapList[i].tag, &sXULMarkupMapList[i]);
 #endif
 
 #ifdef A11Y_LOG
   logging::CheckEnv();
 #endif
 
   gAccessibilityService = this;
   NS_ADDREF(gAccessibilityService); // will release in Shutdown()
@@ -1610,37 +1610,37 @@ nsAccessibilityService::MarkupAttributes
     const MarkupAttrInfo* info = markupMap->attrs + i;
     if (!info->name)
       break;
 
     if (info->DOMAttrName) {
       if (info->DOMAttrValue) {
         if (aContent->IsElement() &&
             aContent->AsElement()->AttrValueIs(kNameSpaceID_None,
-                                               info->DOMAttrName,
-                                               info->DOMAttrValue,
+                                               *info->DOMAttrName,
+                                               *info->DOMAttrValue,
                                                eCaseMatters)) {
-          nsAccUtils::SetAccAttr(aAttributes, info->name, info->DOMAttrValue);
+          nsAccUtils::SetAccAttr(aAttributes, *info->name, *info->DOMAttrValue);
         }
         continue;
       }
 
       nsAutoString value;
 
       if (aContent->IsElement()) {
-        aContent->AsElement()->GetAttr(kNameSpaceID_None, info->DOMAttrName, value);
+        aContent->AsElement()->GetAttr(kNameSpaceID_None, *info->DOMAttrName, value);
       }
 
       if (!value.IsEmpty())
-        nsAccUtils::SetAccAttr(aAttributes, info->name, value);
+        nsAccUtils::SetAccAttr(aAttributes, *info->name, value);
 
       continue;
     }
 
-    nsAccUtils::SetAccAttr(aAttributes, info->name, info->value);
+    nsAccUtils::SetAccAttr(aAttributes, *info->name, *info->value);
   }
 }
 
 Accessible*
 nsAccessibilityService::AddNativeRootAccessible(void* aAtkAccessible)
 {
 #ifdef MOZ_ACCESSIBILITY_ATK
   ApplicationAccessible* applicationAcc = ApplicationAcc();
--- a/accessible/base/nsAccessibilityService.h
+++ b/accessible/base/nsAccessibilityService.h
@@ -48,35 +48,34 @@ SelectionManager* SelectionMgr();
 /**
  * Returns the application accessible.
  */
 ApplicationAccessible* ApplicationAcc();
 xpcAccessibleApplication* XPCApplicationAcc();
 
 typedef Accessible* (New_Accessible)(nsIContent* aContent, Accessible* aContext);
 
-// These fields are not `nsStaticAtom* const` because MSVC doesn't like it.
 struct MarkupAttrInfo {
-  nsStaticAtom* name;
-  nsStaticAtom* value;
+  nsStaticAtom** name;
+  nsStaticAtom** value;
 
-  nsStaticAtom* DOMAttrName;
-  nsStaticAtom* DOMAttrValue;
+  nsStaticAtom** DOMAttrName;
+  nsStaticAtom** DOMAttrValue;
 };
 
 struct HTMLMarkupMapInfo {
-  const nsStaticAtom* const tag;
+  nsStaticAtom** tag;
   New_Accessible* new_func;
   a11y::role role;
   MarkupAttrInfo attrs[4];
 };
 
 #ifdef MOZ_XUL
 struct XULMarkupMapInfo {
-  const nsStaticAtom* const tag;
+  nsStaticAtom** tag;
   New_Accessible* new_func;
 };
 #endif
 
 /**
  * PREF_ACCESSIBILITY_FORCE_DISABLED preference change callback.
  */
 void PrefChanged(const char* aPref, void* aClosure);
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -1486,19 +1486,18 @@ Accessible::ARIATransformRole(role aRole
 
   return aRole;
 }
 
 nsAtom*
 Accessible::LandmarkRole() const
 {
   const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
-  return roleMapEntry && roleMapEntry->IsOfType(eLandmark)
-       ? roleMapEntry->roleAtom
-       : nullptr;
+  return roleMapEntry && roleMapEntry->IsOfType(eLandmark) ?
+    *(roleMapEntry->roleAtom) : nullptr;
 }
 
 role
 Accessible::NativeRole()
 {
   return roles::NOTHING;
 }
 
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -49,27 +49,27 @@
 #include "mozilla/dom/MutationEventBinding.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Static member initialization
 
-static nsStaticAtom* const kRelationAttrs[] =
+static nsStaticAtom** kRelationAttrs[] =
 {
-  nsGkAtoms::aria_labelledby,
-  nsGkAtoms::aria_describedby,
-  nsGkAtoms::aria_details,
-  nsGkAtoms::aria_owns,
-  nsGkAtoms::aria_controls,
-  nsGkAtoms::aria_flowto,
-  nsGkAtoms::aria_errormessage,
-  nsGkAtoms::_for,
-  nsGkAtoms::control
+  &nsGkAtoms::aria_labelledby,
+  &nsGkAtoms::aria_describedby,
+  &nsGkAtoms::aria_details,
+  &nsGkAtoms::aria_owns,
+  &nsGkAtoms::aria_controls,
+  &nsGkAtoms::aria_flowto,
+  &nsGkAtoms::aria_errormessage,
+  &nsGkAtoms::_for,
+  &nsGkAtoms::control
 };
 
 static const uint32_t kRelationAttrsLen = ArrayLength(kRelationAttrs);
 
 ////////////////////////////////////////////////////////////////////////////////
 // Constructor/desctructor
 
 DocAccessible::
@@ -1552,17 +1552,17 @@ DocAccessible::ProcessLoad()
 void
 DocAccessible::AddDependentIDsFor(Accessible* aRelProvider, nsAtom* aRelAttr)
 {
   dom::Element* relProviderEl = aRelProvider->Elm();
   if (!relProviderEl)
     return;
 
   for (uint32_t idx = 0; idx < kRelationAttrsLen; idx++) {
-    nsStaticAtom* relAttr = kRelationAttrs[idx];
+    nsAtom* relAttr = *kRelationAttrs[idx];
     if (aRelAttr && aRelAttr != relAttr)
       continue;
 
     if (relAttr == nsGkAtoms::_for) {
       if (!relProviderEl->IsAnyOfHTMLElements(nsGkAtoms::label,
                                                nsGkAtoms::output))
         continue;
 
@@ -1624,18 +1624,18 @@ void
 DocAccessible::RemoveDependentIDsFor(Accessible* aRelProvider,
                                      nsAtom* aRelAttr)
 {
   dom::Element* relProviderElm = aRelProvider->Elm();
   if (!relProviderElm)
     return;
 
   for (uint32_t idx = 0; idx < kRelationAttrsLen; idx++) {
-    nsStaticAtom* relAttr = kRelationAttrs[idx];
-    if (aRelAttr && aRelAttr != kRelationAttrs[idx])
+    nsAtom* relAttr = *kRelationAttrs[idx];
+    if (aRelAttr && aRelAttr != *kRelationAttrs[idx])
       continue;
 
     IDRefsIterator iter(this, relProviderElm, relAttr);
     while (true) {
       const nsDependentSubstring id = iter.NextID();
       if (id.IsEmpty())
         break;
 
--- a/accessible/html/HTMLTableAccessible.cpp
+++ b/accessible/html/HTMLTableAccessible.cpp
@@ -306,18 +306,18 @@ HTMLTableHeaderCellAccessible::
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLTableHeaderCellAccessible: Accessible implementation
 
 role
 HTMLTableHeaderCellAccessible::NativeRole()
 {
   // Check value of @scope attribute.
   static Element::AttrValuesArray scopeValues[] =
-    { nsGkAtoms::col, nsGkAtoms::colgroup,
-      nsGkAtoms::row, nsGkAtoms::rowgroup, nullptr };
+    { &nsGkAtoms::col, &nsGkAtoms::colgroup,
+      &nsGkAtoms::row, &nsGkAtoms::rowgroup, nullptr };
   int32_t valueIdx =
     mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::scope,
                                            scopeValues, eCaseMatters);
 
   switch (valueIdx) {
     case 0:
     case 1:
       return roles::COLUMNHEADER;
--- a/accessible/ipc/ProxyAccessibleShared.h
+++ b/accessible/ipc/ProxyAccessibleShared.h
@@ -57,17 +57,17 @@ nsTArray<ProxyAccessible*> RelationByTyp
  */
 void Relations(nsTArray<RelationType>* aTypes,
     nsTArray<nsTArray<ProxyAccessible*>>* aTargetSets) const;
 
 bool IsSearchbox() const;
 
 nsAtom* LandmarkRole() const;
 
-nsStaticAtom* ARIARoleAtom() const;
+nsAtom* ARIARoleAtom() const;
 
 int32_t GetLevelInternal();
 void ScrollTo(uint32_t aScrollType);
 void ScrollToPoint(uint32_t aScrollType, int32_t aX, int32_t aY);
 
 int32_t CaretLineNumber();
 int32_t CaretOffset();
 void SetCaretOffset(int32_t aOffset);
--- a/accessible/ipc/other/DocAccessibleChild.cpp
+++ b/accessible/ipc/other/DocAccessibleChild.cpp
@@ -288,17 +288,17 @@ mozilla::ipc::IPCResult
 DocAccessibleChild::RecvARIARoleAtom(const uint64_t& aID, nsString* aRole)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc) {
     return IPC_OK();
   }
 
   if (const nsRoleMapEntry* roleMap = acc->ARIARoleMap()) {
-    if (nsStaticAtom* roleAtom = roleMap->roleAtom) {
+    if (nsAtom* roleAtom = *(roleMap->roleAtom)) {
       roleAtom->ToString(*aRole);
     }
   }
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
--- a/accessible/ipc/other/ProxyAccessible.cpp
+++ b/accessible/ipc/other/ProxyAccessible.cpp
@@ -122,17 +122,17 @@ ProxyAccessible::IsSearchbox() const
 nsAtom*
 ProxyAccessible::LandmarkRole() const
 {
   nsString landmark;
   Unused << mDoc->SendLandmarkRole(mID, &landmark);
   return NS_GetStaticAtom(landmark);
 }
 
-nsStaticAtom*
+nsAtom*
 ProxyAccessible::ARIARoleAtom() const
 {
   nsString role;
   Unused << mDoc->SendARIARoleAtom(mID, &role);
   return NS_GetStaticAtom(role);
 }
 
 int32_t
--- a/accessible/mac/mozAccessible.mm
+++ b/accessible/mac/mozAccessible.mm
@@ -765,20 +765,20 @@ ConvertToNSArray(nsTArray<ProxyAccessibl
   // macOS groups the specific landmark types of DPub ARIA into two broad
   // categories with corresponding subroles: Navigation and region/container.
   if (mRole == roles::NAVIGATION)
     return @"AXLandmarkNavigation";
   if (mRole == roles::LANDMARK)
     return @"AXLandmarkRegion";
 
   // Now, deal with widget roles
-  nsStaticAtom* roleAtom = nullptr;
+  nsAtom* roleAtom = nullptr;
   if (accWrap && accWrap->HasARIARole()) {
     const nsRoleMapEntry* roleMap = accWrap->ARIARoleMap();
-    roleAtom = roleMap->roleAtom;
+    roleAtom = *roleMap->roleAtom;
   }
   if (proxy)
     roleAtom = proxy->ARIARoleAtom();
 
   if (roleAtom) {
     if (roleAtom == nsGkAtoms::alert)
       return @"AXApplicationAlert";
     if (roleAtom == nsGkAtoms::alertdialog)
--- a/accessible/xul/XULFormControlAccessible.cpp
+++ b/accessible/xul/XULFormControlAccessible.cpp
@@ -188,17 +188,17 @@ XULButtonAccessible::IsAcceptableChild(n
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULButtonAccessible protected
 
 bool
 XULButtonAccessible::ContainsMenu() const
 {
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::menu, nsGkAtoms::menuButton, nullptr};
+    {&nsGkAtoms::menu, &nsGkAtoms::menuButton, nullptr};
 
   return mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None,
                                                 nsGkAtoms::type,
                                                 strings, eCaseMatters) >= 0;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULDropmarkerAccessible
--- a/accessible/xul/XULMenuAccessible.cpp
+++ b/accessible/xul/XULMenuAccessible.cpp
@@ -54,17 +54,17 @@ XULMenuitemAccessible::NativeState()
     if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::open))
       state |= states::EXPANDED;
     else
       state |= states::COLLAPSED;
   }
 
   // Checkable/checked?
   static Element::AttrValuesArray strings[] =
-    { nsGkAtoms::radio, nsGkAtoms::checkbox, nullptr };
+    { &nsGkAtoms::radio, &nsGkAtoms::checkbox, nullptr };
 
   if (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
                                              strings, eCaseMatters) >= 0) {
 
     // Checkable?
     state |= states::CHECKABLE;
 
     // Checked?
--- a/browser/components/extensions/test/browser/browser-common.ini
+++ b/browser/components/extensions/test/browser/browser-common.ini
@@ -65,16 +65,17 @@ skip-if = (os == 'win' && !debug) # bug 
 [browser_ext_browsingData_serviceWorkers.js]
 [browser_ext_chrome_settings_overrides_home.js]
 [browser_ext_commands_execute_browser_action.js]
 [browser_ext_commands_execute_page_action.js]
 [browser_ext_commands_execute_sidebar_action.js]
 [browser_ext_commands_getAll.js]
 [browser_ext_commands_onCommand.js]
 [browser_ext_commands_update.js]
+[browser_ext_connect_and_move_tabs.js]
 [browser_ext_contentscript_connect.js]
 [browser_ext_contextMenus.js]
 [browser_ext_contextMenus_checkboxes.js]
 [browser_ext_contextMenus_commands.js]
 [browser_ext_contextMenus_icons.js]
 [browser_ext_contextMenus_onclick.js]
 [browser_ext_contextMenus_radioGroups.js]
 [browser_ext_contextMenus_uninstall.js]
new file mode 100644
--- /dev/null
+++ b/browser/components/extensions/test/browser/browser_ext_connect_and_move_tabs.js
@@ -0,0 +1,95 @@
+/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set sts=2 sw=2 et tw=80: */
+"use strict";
+
+// Tests that the Port object created by browser.runtime.connect is not
+// prematurely disconnected as the underlying message managers change when a
+// tab is moved between windows.
+
+function loadExtension() {
+  return ExtensionTestUtils.loadExtension({
+    manifest: {
+      "content_scripts": [{
+        "js": ["script.js"],
+        "matches": ["http://mochi.test/"],
+      }],
+    },
+    background() {
+      browser.runtime.onConnect.addListener((port) => {
+        port.onDisconnect.addListener(() => {
+          browser.test.fail("onDisconnect should not fire because the port is to be closed from this side");
+          browser.test.sendMessage("port_disconnected");
+        });
+        port.onMessage.addListener(async msg => {
+          browser.test.assertEq("connect_from_contentscript", msg, "expected message");
+          // Move a tab to a new window and back. Regression test for bugzil.la/1448674
+          let {windowId, id: tabId, index} = port.sender.tab;
+          await browser.windows.create({tabId});
+          await browser.tabs.move(tabId, {index, windowId});
+          await browser.windows.create({tabId});
+          await browser.tabs.move(tabId, {index, windowId});
+          try {
+            // When the port is unexpectedly disconnected, postMessage will throw an error.
+            port.postMessage("ping");
+          } catch (e) {
+            browser.test.fail(`Error: ${e} :: ${e.stack}`);
+            browser.test.sendMessage("port_ping_ponged_before_disconnect");
+          }
+        });
+
+        browser.runtime.onMessage.addListener((msg, sender) => {
+          browser.test.assertEq("disconnect-me", msg, "expected message");
+          port.disconnect();
+          // Now port.onDisconnect should fire in the content script.
+        });
+      });
+
+      browser.test.onMessage.addListener(msg => {
+        browser.test.assertEq("open_extension_tab", msg, "expected message");
+        browser.tabs.create({url: "tab.html"});
+      });
+    },
+
+    files: {
+      "tab.html": `
+        <!DOCTYPE html><meta charset="utf-8">
+        <script src="script.js"></script>
+      `,
+      "script.js": function() {
+        let port = browser.runtime.connect();
+        port.onMessage.addListener(msg => {
+          browser.test.assertEq("ping", msg, "expected message");
+          browser.test.sendMessage("port_ping_ponged_before_disconnect");
+          port.onDisconnect.addListener(() => {
+            browser.test.sendMessage("port_disconnected");
+          });
+          browser.runtime.sendMessage("disconnect-me");
+        });
+        port.postMessage("connect_from_contentscript");
+      },
+    },
+  });
+}
+
+add_task(async function contentscript_connect_and_move_tabs() {
+  let extension = loadExtension();
+  await extension.startup();
+  await BrowserTestUtils.openNewForegroundTab(gBrowser, "http://mochi.test:8888/");
+  await extension.awaitMessage("port_ping_ponged_before_disconnect");
+  await extension.awaitMessage("port_disconnected");
+  // Must use gBrowser.selectedTab instead of the return value of
+  // BrowserTestUtils.openNewForegroundTab because the latter does not refer to
+  // the tab because the tab is moved between windows during the test.
+  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
+  await extension.unload();
+});
+
+add_task(async function extension_tab_connect_and_move_tabs() {
+  let extension = loadExtension();
+  await extension.startup();
+  extension.sendMessage("open_extension_tab");
+  await extension.awaitMessage("port_ping_ponged_before_disconnect");
+  await extension.awaitMessage("port_disconnected");
+  // Upon unloading the extension, the extension tab is automatically removed.
+  await extension.unload();
+});
--- a/build/unix/build-gcc/build-gcc.sh
+++ b/build/unix/build-gcc/build-gcc.sh
@@ -24,37 +24,49 @@ prepare() {
   cd gcc-$gcc_version
 
   (
     # Divert commands that download_prerequisites use
     ln() { :; }
     tar() { :; }
     sed() { :; }
     wget() {
-      echo $1
+      # Get last argument given to wget.
+      eval echo \$$# >&3
     }
 
+    # In GCC >= 7, the download_prerequisites script tried to do its own
+    # verification, but we have ours, so disable it.
+    set -- --no-verify
     . ./contrib/download_prerequisites
-  ) | while read url; do
+  ) 3>&1 > /dev/null | while read url; do
     file=$(basename $url)
     case "$file" in
     gmp-*.tar.*)
       # If download_prerequisites wants 4.3.2, use 5.1.3 instead.
       file=${file/4.3.2/5.1.3}
       download_and_check https://gmplib.org/download/gmp $file.sig
       ;;
     mpfr-*.tar.*)
       # If download_prerequisites wants 2.4.2, use 3.1.5 instead.
       file=${file/2.4.2/3.1.5}
       download_and_check http://www.mpfr.org/${file%.tar.*} $file.asc
       ;;
     mpc-*.tar.*)
       # If download_prerequisites wants 0.8.1, use 0.8.2 instead.
       file=${file/0.8.1/0.8.2}
-      download_and_check http://www.multiprecision.org/downloads $file.asc
+      case "$file" in
+      *-0.8.2.tar*|*-0.9.tar*|*-1.0.tar*)
+        ext=asc
+        ;;
+      *)
+        ext=sig
+        ;;
+      esac
+      download_and_check http://www.multiprecision.org/downloads $file.$ext
       ;;
     *)
       download $(dirname $url) $file
       ;;
     esac
     tar xaf $TMPDIR/$file
     ln -sf ${file%.tar.*} ${file%-*}
   done
--- a/devtools/client/inspector/animation/components/AnimatedPropertyListContainer.js
+++ b/devtools/client/inspector/animation/components/AnimatedPropertyListContainer.js
@@ -50,16 +50,22 @@ class AnimatedPropertyListContainer exte
           addAnimationsCurrentTimeListener,
           animation,
           getAnimationsCurrentTime,
           removeAnimationsCurrentTimeListener,
           simulateAnimationForKeyframesProgressBar,
           timeScale,
         }
       ),
+      dom.div(
+        {
+          className: "animated-property-list-background",
+        },
+        dom.span()
+      ),
       AnimatedPropertyList(
         {
           animation,
           emitEventForTest,
           getAnimatedPropertyMap,
           getComputedStyle,
           simulateAnimation,
         }
--- a/devtools/client/inspector/animation/components/AnimatedPropertyListHeader.js
+++ b/devtools/client/inspector/animation/components/AnimatedPropertyListHeader.js
@@ -30,18 +30,23 @@ class AnimatedPropertyListHeader extends
       getAnimationsCurrentTime,
       removeAnimationsCurrentTimeListener,
       simulateAnimationForKeyframesProgressBar,
       timeScale,
     } = this.props;
 
     return dom.div(
       {
-        className: "animated-property-list-header devtools-toolbar"
+        className: "animated-property-list-header"
       },
+      dom.div(
+        {
+          className: "devtools-toolbar"
+        }
+      ),
       KeyframesProgressTickList(),
       KeyframesProgressBar(
         {
           addAnimationsCurrentTimeListener,
           animation,
           getAnimationsCurrentTime,
           removeAnimationsCurrentTimeListener,
           simulateAnimationForKeyframesProgressBar,
--- a/devtools/client/inspector/animation/components/AnimationListHeader.js
+++ b/devtools/client/inspector/animation/components/AnimationListHeader.js
@@ -28,18 +28,23 @@ class AnimationListHeader extends PureCo
       addAnimationsCurrentTimeListener,
       removeAnimationsCurrentTimeListener,
       setAnimationsCurrentTime,
       timeScale,
     } = this.props;
 
     return dom.div(
       {
-        className: "animation-list-header devtools-toolbar"
+        className: "animation-list-header"
       },
+      dom.div(
+        {
+          className: "devtools-toolbar"
+        }
+      ),
       AnimationTimelineTickList(
         {
           timeScale
         }
       ),
       CurrentTimeScrubberController(
         {
           addAnimationsCurrentTimeListener,
--- a/devtools/client/inspector/animation/components/CurrentTimeScrubberController.js
+++ b/devtools/client/inspector/animation/components/CurrentTimeScrubberController.js
@@ -35,18 +35,18 @@ class CurrentTimeScrubberController exte
       // offset of the position for the scrubber
       offset: 0,
     };
 
     addAnimationsCurrentTimeListener(this.onCurrentTimeUpdated);
   }
 
   componentDidMount() {
-    const parentEl = ReactDOM.findDOMNode(this).parentElement;
-    parentEl.addEventListener("mousedown", this.onMouseDown);
+    const el = ReactDOM.findDOMNode(this);
+    el.addEventListener("mousedown", this.onMouseDown);
   }
 
   componentWillUnmount() {
     const { removeAnimationsCurrentTimeListener } = this.props;
     removeAnimationsCurrentTimeListener(this.onCurrentTimeUpdated);
   }
 
   onCurrentTimeUpdated(currentTime) {
@@ -122,17 +122,17 @@ class CurrentTimeScrubberController exte
     setAnimationsCurrentTime(time, needRefresh);
   }
 
   render() {
     const { offset } = this.state;
 
     return dom.div(
       {
-        className: "current-time-scrubber-controller devtools-toolbar",
+        className: "current-time-scrubber-controller",
       },
       CurrentTimeScrubber(
         {
           offset,
         }
       )
     );
   }
--- a/devtools/client/inspector/animation/test/browser_animation_animation-timeline-tick.js
+++ b/devtools/client/inspector/animation/test/browser_animation_animation-timeline-tick.js
@@ -23,48 +23,48 @@ add_task(async function() {
   const timeScale = new TimeScale(animationInspector.state.animations);
 
   info("Checking animation list header element existence");
   const listContainerEl = panel.querySelector(".animation-list-container");
   const listHeaderEl = listContainerEl.querySelector(".devtools-toolbar");
   ok(listHeaderEl, "The header element should be in animation list container element");
 
   info("Checking time tick item elements existence");
-  assertTimelineTickItems(timeScale, listHeaderEl);
+  assertTimelineTickItems(timeScale, listContainerEl);
   const timelineTickItemLength =
-    listHeaderEl.querySelectorAll(".animation-timeline-tick-item").length;
+    listContainerEl.querySelectorAll(".animation-timeline-tick-item").length;
 
   info("Checking timeline tick item elements after enlarge sidebar width");
   await setSidebarWidth("100%", inspector);
-  assertTimelineTickItems(timeScale, listHeaderEl);
+  assertTimelineTickItems(timeScale, listContainerEl);
   ok(timelineTickItemLength <
-    listHeaderEl.querySelectorAll(".animation-timeline-tick-item").length,
+     listContainerEl.querySelectorAll(".animation-timeline-tick-item").length,
      "The timeline tick item elements should increase");
 });
 
 /**
  * Assert timeline tick item's position and label.
  *
  * @param {TimeScale} - timeScale
- * @param {Element} - listHeaderEl which is header element
+ * @param {Element} - listContainerEl
  */
-function assertTimelineTickItems(timeScale, listHeaderEl) {
-  const animationTimelineTickListEl =
-    listHeaderEl.querySelector(".animation-timeline-tick-list");
-  ok(animationTimelineTickListEl,
+function assertTimelineTickItems(timeScale, listContainerEl) {
+  const timelineTickListEl =
+    listContainerEl.querySelector(".animation-timeline-tick-list");
+  ok(timelineTickListEl,
     "The animation timeline tick list element should be in header");
 
-  const width = animationTimelineTickListEl.offsetWidth;
+  const width = timelineTickListEl.offsetWidth;
   const animationDuration = timeScale.getDuration();
   const minTimeInterval = TIME_GRADUATION_MIN_SPACING * animationDuration / width;
   const interval = findOptimalTimeInterval(minTimeInterval);
   const expectedTickItem = Math.ceil(animationDuration / interval);
 
   const timelineTickItemEls =
-    listHeaderEl.querySelectorAll(".animation-timeline-tick-item");
+    timelineTickListEl.querySelectorAll(".animation-timeline-tick-item");
   is(timelineTickItemEls.length, expectedTickItem,
     "The expected number of timeline ticks were found");
 
   info("Make sure graduations are evenly distributed and show the right times");
   for (const [index, tickEl] of timelineTickItemEls.entries()) {
     const left = parseFloat(tickEl.style.left);
     const expectedPos = index * interval * 100 / animationDuration;
     is(Math.round(left), Math.round(expectedPos),
--- a/devtools/client/netmonitor/src/actions/ui.js
+++ b/devtools/client/netmonitor/src/actions/ui.js
@@ -12,25 +12,33 @@ const {
   DISABLE_BROWSER_CACHE,
   OPEN_STATISTICS,
   RESET_COLUMNS,
   SELECT_DETAILS_PANEL_TAB,
   TOGGLE_COLUMN,
   WATERFALL_RESIZE,
 } = require("../constants");
 
+const { getDisplayedRequests } = require("../selectors/index");
+
 /**
  * Change network details panel.
  *
  * @param {boolean} open - expected network details panel open state
  */
 function openNetworkDetails(open) {
-  return {
-    type: OPEN_NETWORK_DETAILS,
-    open,
+  return (dispatch, getState) => {
+    const visibleRequestItems = getDisplayedRequests(getState());
+    let defaultSelectedId = visibleRequestItems.length ? visibleRequestItems[0].id : null;
+
+    return dispatch({
+      type: OPEN_NETWORK_DETAILS,
+      open,
+      defaultSelectedId,
+    });
   };
 }
 
 /**
  * Change network details panel size.
  *
  * @param {integer} width
  * @param {integer} height
--- a/devtools/client/netmonitor/src/reducers/requests.js
+++ b/devtools/client/netmonitor/src/reducers/requests.js
@@ -172,18 +172,18 @@ function requestsReducer(state = Request
     // Side bar with request details opened.
     case OPEN_NETWORK_DETAILS: {
       let nextState = { ...state };
       if (!action.open) {
         nextState.selectedId = null;
         return nextState;
       }
 
-      if (!state.selectedId && state.requests.size > 0) {
-        nextState.selectedId = [...state.requests.values()][0].id;
+      if (!state.selectedId && action.defaultSelectedId) {
+        nextState.selectedId = action.defaultSelectedId;
         return nextState;
       }
 
       return state;
     }
 
     default:
       return state;
--- a/devtools/client/netmonitor/test/browser.ini
+++ b/devtools/client/netmonitor/test/browser.ini
@@ -137,16 +137,17 @@ skip-if = (os == 'linux' && debug && bit
 [browser_net_json_text_mime.js]
 [browser_net_jsonp.js]
 [browser_net_large-response.js]
 [browser_net_leak_on_tab_close.js]
 [browser_net_open_in_debugger.js]
 [browser_net_open_in_style_editor.js]
 [browser_net_open_request_in_tab.js]
 [browser_net_pane-collapse.js]
+[browser_net_pane-network-details.js]
 [browser_net_pane-toggle.js]
 [browser_net_pause.js]
 [browser_net_params_sorted.js]
 [browser_net_persistent_logs.js]
 [browser_net_post-data-01.js]
 [browser_net_post-data-02.js]
 [browser_net_post-data-03.js]
 [browser_net_post-data-04.js]
new file mode 100644
--- /dev/null
+++ b/devtools/client/netmonitor/test/browser_net_pane-network-details.js
@@ -0,0 +1,127 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Test the action of request details panel when filters are applied.
+ * If there are any visible requests, the first request from the
+ * list of visible requests should be displayed in the network
+ * details panel
+ * If there are no visible requests the panel should remain closed
+ */
+
+const REQUESTS_WITH_MEDIA_AND_FLASH_AND_WS = [
+  { url: "sjs_content-type-test-server.sjs?fmt=html&res=undefined&text=Sample" },
+  { url: "sjs_content-type-test-server.sjs?fmt=css&text=sample" },
+  { url: "sjs_content-type-test-server.sjs?fmt=js&text=sample" },
+  { url: "sjs_content-type-test-server.sjs?fmt=font" },
+  { url: "sjs_content-type-test-server.sjs?fmt=image" },
+  { url: "sjs_content-type-test-server.sjs?fmt=audio" },
+  { url: "sjs_content-type-test-server.sjs?fmt=video" },
+  { url: "sjs_content-type-test-server.sjs?fmt=flash" },
+  { url: "sjs_content-type-test-server.sjs?fmt=ws" },
+];
+
+add_task(async function() {
+  let { monitor } = await initNetMonitor(FILTERING_URL);
+  let { document, store, windowRequire } = monitor.panelWin;
+  let Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
+  let {
+    getSelectedRequest,
+    getSortedRequests,
+  } = windowRequire("devtools/client/netmonitor/src/selectors/index");
+
+  store.dispatch(Actions.batchEnable(false));
+
+  function setFreetextFilter(value) {
+    store.dispatch(Actions.setRequestFilterText(value));
+  }
+
+  info("Starting test... ");
+
+  let wait = waitForNetworkEvents(monitor, 9);
+  loadFrameScriptUtils();
+  await performRequestsInContent(REQUESTS_WITH_MEDIA_AND_FLASH_AND_WS);
+  await wait;
+
+  let toggleButton = document.querySelector(".network-details-panel-toggle");
+
+  info("Test with the first request in the list visible");
+  EventUtils.sendMouseEvent({ type: "click" },
+      document.querySelector(".requests-list-filter-all-button"));
+  testDetailsPanel(true, 0);
+
+  info("Test with first request in the list not visible");
+  EventUtils.sendMouseEvent({ type: "click" },
+      document.querySelector(".requests-list-filter-all-button"));
+  EventUtils.sendMouseEvent({ type: "click" },
+      document.querySelector(".requests-list-filter-js-button"));
+  testFilterButtons(monitor, "js");
+  testDetailsPanel(true, 2);
+
+  info("Test with no request in the list visible i.e. no request match the filters");
+  EventUtils.sendMouseEvent({ type: "click" },
+      document.querySelector(".requests-list-filter-all-button"));
+  setFreetextFilter("foobar");
+  // The network details panel should not open as there are no available requests visible
+  testDetailsPanel(false);
+
+  await teardown(monitor);
+
+  function getSelectedIndex(state) {
+    if (!state.requests.selectedId) {
+      return -1;
+    }
+    return getSortedRequests(state).findIndex(r => r.id === state.requests.selectedId);
+  }
+
+  async function testDetailsPanel(shouldPanelOpen, selectedItemIndex = 0) {
+    // Expected default state should be panel closed
+    if (shouldPanelOpen) {
+      // Toggle switch should be enabled only when there are visible requests
+      is(toggleButton.hasAttribute("disabled"), false,
+          "The pane toggle button should be enabled.");
+    } else {
+      is(toggleButton.hasAttribute("disabled"), true,
+          "The pane toggle button should be disabled.");
+    }
+
+    is(toggleButton.classList.contains("pane-collapsed"), true,
+        "The pane toggle button should still indicate that the details pane is " +
+        "collapsed.");
+    is(!!document.querySelector(".network-details-panel"), false,
+        "The details pane should still be hidden.");
+    is(getSelectedRequest(store.getState()), null,
+        "There should still be no selected item in the requests menu.");
+
+    // Trigger the details panel toggle action
+    EventUtils.sendMouseEvent({ type: "click" }, toggleButton);
+
+    if (shouldPanelOpen) {
+      is(toggleButton.hasAttribute("disabled"), false,
+          "The pane toggle button should still be enabled after being pressed.");
+      is(toggleButton.classList.contains("pane-collapsed"), false,
+          "The pane toggle button should now indicate that the details pane is " +
+          "not collapsed anymore after being pressed.");
+      is(!!document.querySelector(".network-details-panel"), true,
+          "The details pane should not be hidden after toggle button was pressed.");
+      isnot(getSelectedRequest(store.getState()), null,
+          "There should be a selected item in the requests menu.");
+      is(getSelectedIndex(store.getState()), selectedItemIndex,
+          `The item index ${selectedItemIndex} should be selected in the requests menu.`);
+      // Close the panel
+      EventUtils.sendMouseEvent({ type: "click" }, toggleButton);
+    } else {
+      is(toggleButton.hasAttribute("disabled"), true,
+          "The pane toggle button should be disabled.");
+      is(toggleButton.classList.contains("pane-collapsed"), true,
+          "The pane toggle button should still indicate that the details pane is " +
+          "collapsed.");
+      is(!!document.querySelector(".network-details-panel"), false,
+          "The details pane should still be hidden.");
+      is(getSelectedRequest(store.getState()), null,
+          "There should still be no selected item in the requests menu.");
+    }
+  }
+});
--- a/devtools/client/themes/animation.css
+++ b/devtools/client/themes/animation.css
@@ -2,16 +2,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/. */
 
 /* Animation-inspector specific theme variables */
 
 :root {
   --animation-even-background-color: rgba(0, 0, 0, 0.05);
   --command-pick-image: url(chrome://devtools/skin/images/command-pick.svg);
+  --devtools-toolbar-height: 24px;
   --fast-track-image: url("images/animation-fast-track.svg");
   --fill-color-cssanimation: var(--theme-contrast-background);
   --fill-color-csstransition: var(--theme-highlight-blue);
   --fill-color-scriptanimation: var(--theme-graphs-green);
   --graph-right-offset: 10px;
   --keyframe-marker-shadow-color: #c4c4c4;
   --pause-image: url(chrome://devtools/skin/images/pause.svg);
   --progress-bar-color: #909090;
@@ -42,17 +43,17 @@
   overflow: hidden;
 }
 
 #animation-container:not(.animation-detail-visible) .controlled {
   display: none;
 }
 
 #animation-container .animation-container-splitter {
-  overflow: auto;
+  overflow: hidden;
 }
 
 /* Animation Toolbar */
 .animation-toolbar {
   display: flex;
 }
 
 .pause-resume-button::before {
@@ -81,59 +82,89 @@ select.playback-rate-selector.devtools-b
 }
 
 .rewind-button::before {
   background-image: var(--rewind-image);
 }
 
 /* Animation List Container */
 .animation-list-container {
-  display: flex;
-  flex-direction: column;
   height: 100%;
-  overflow: hidden;
+  overflow-y: auto;
+  overflow-x: hidden;
+  position: relative;
   width: 100%;
   -moz-user-select: none;
 }
 
 .animation-list-container.active-scrubber {
   cursor: col-resize;
 }
 
 /* Animation List Header */
 .animation-list-header {
   display: grid;
   grid-template-columns: var(--sidebar-width) calc(100% - var(--sidebar-width) - var(--graph-right-offset)) var(--graph-right-offset);
+  line-height: var(--devtools-toolbar-height);
+  min-height: 100%;
   padding: 0;
+  pointer-events: none;
+  position: sticky;
+  top: 0;
+  z-index: 2;
+}
+
+.animation-list-header .devtools-toolbar {
+  position: absolute;
+  width: 100%;
 }
 
 /* Animation Timeline Tick List */
 .animation-timeline-tick-list {
   grid-column: 2/3;
+  height: 100%;
   position: relative;
 }
 
 .animation-timeline-tick-item {
+  height: 100%;
+  position: absolute;
+}
+
+.animation-timeline-tick-item::before {
   border-left: var(--tick-line-style);
-  height: 100vh;
-  pointer-events: none;
+  content: "";
+  height: 100%;
   position: absolute;
 }
 
 /* Current Time Scrubber */
 .current-time-scrubber-controller {
+  grid-column: 2 / 3;
+  height: 100%;
+  padding: 0;
+  position: absolute;
+  width: 100%;
+}
+
+.current-time-scrubber-controller::before {
+  content: "";
   cursor: col-resize;
-  grid-column: 2 / 3;
-  padding: 0;
+  height: var(--devtools-toolbar-height);
+  pointer-events: auto;
+  position: absolute;
+  /* In order to click on edge of current-time-scrubber-controller element */
+  width: calc(100% + 1px);
 }
 
 .current-time-scrubber {
   cursor: col-resize;
-  height: 100vh;
+  height: 100%;
   margin-left: -6px;
+  pointer-events: auto;
   position: absolute;
   width: 12px;
   z-index: 1;
 }
 
 .current-time-scrubber::before {
   border-left: 5px solid transparent;
   border-right: 5px solid transparent;
@@ -151,21 +182,22 @@ select.playback-rate-selector.devtools-b
   left: 5px;
   position: absolute;
   top: 0;
   width: 0;
 }
 
 /* Animation List */
 .animation-list {
-  flex: 1;
   list-style-type: none;
   margin: 0;
-  overflow: auto;
   padding: 0;
+  position: absolute;
+  top: var(--devtools-toolbar-height);
+  width: 100%;
 }
 
 /* Animation Item */
 .animation-item {
   display: flex;
   height: 30px;
 }
 
@@ -229,18 +261,18 @@ select.playback-rate-selector.devtools-b
   content: "";
   display: block;
   fill: var(--theme-content-color3);
   height: 100%;
   position: absolute;
   right: 0;
   top: 5px;
   width: 15px;
+  -moz-context-properties: fill;
   z-index: 1;
-  -moz-context-properties: fill;
 }
 
 .animation-summary-graph-path {
   height: 100%;
   width: 100%;
 }
 
 .animation-computed-timing-path path {
@@ -358,56 +390,70 @@ select.playback-rate-selector.devtools-b
   background-image: url(chrome://devtools/skin/images/close.svg);
 }
 
 /* Animated Property List Container */
 .animated-property-list-container {
   display: flex;
   flex: 1;
   flex-direction: column;
-  overflow: hidden;
+  overflow-y: auto;
+  position: relative;
 }
 
 /* Animated Property List Header */
 .animated-property-list-header {
   display: grid;
   grid-template-columns: var(--sidebar-width) calc(100% - var(--sidebar-width) - var(--graph-right-offset)) var(--graph-right-offset);
+  line-height: var(--devtools-toolbar-height);
+  min-height: 100%;
   padding: 0;
+  pointer-events: none;
+  position: sticky;
+  top: 0;
+  z-index: 1;
+}
+
+.animated-property-list-header .devtools-toolbar {
+  position: absolute;
+  width: 100%;
 }
 
 /* Keyframes Progress Tick List */
 .keyframes-progress-tick-list {
   grid-column: 2 / 3;
-  position: relative;
+  height: 100%;
+  position: absolute;
+  width: 100%;
 }
 
 .keyframes-progress-tick-item {
-  height: 100vh;
   position: absolute;
 }
 
 .keyframes-progress-tick-item.left {
   border-left: var(--tick-line-style);
 }
 
 .keyframes-progress-tick-item.right {
   border-right: var(--tick-line-style);
 }
 
 /* Keyframes Progress Bar */
 .keyframes-progress-bar-area {
   background: none;
   grid-column: 2 / 3;
   padding: 0;
-  pointer-events: none;
-  position: relative;
+  height: 100%;
+  position: absolute;
+  width: 100%;
 }
 
 .keyframes-progress-bar {
-  height: 100vh;
+  height: 100%;
   position: absolute;
   z-index: 1;
 }
 
 .keyframes-progress-bar::before {
   border-left: 5px solid transparent;
   border-right: 5px solid transparent;
   border-top: 5px solid var(--progress-bar-color);
@@ -423,22 +469,42 @@ select.playback-rate-selector.devtools-b
   content: "";
   height: 100%;
   position: absolute;
   top: 0;
   width: 0;
 }
 
 /* Animated Property List */
+.animated-property-list-background {
+  border-left: var(--tick-line-style);
+  border-right: var(--tick-line-style);
+  bottom: 0;
+	left: var(--sidebar-width);
+  min-height: 100%;
+	position: sticky;
+  top: 0;
+	width: calc(100% - var(--sidebar-width) - var(--graph-right-offset));
+}
+
+.animated-property-list-background span {
+  border-left: var(--tick-line-style);
+	height: 100%;
+	left: 50%;
+	position: absolute;
+}
+
 .animated-property-list {
   flex: 1;
   list-style-type: none;
   margin: 0;
-  overflow-y: auto;
   padding: 0;
+  position: absolute;
+  top: var(--devtools-toolbar-height);
+  width: 100%;
 }
 
 /* Animated Property Item */
 .animated-property-item {
   display: flex;
   height: 30px;
 }
 
@@ -491,18 +557,18 @@ select.playback-rate-selector.devtools-b
 }
 
 .animated-property-name.warning span {
   text-decoration: underline dotted;
 }
 
 /* Keyframes Graph */
 .keyframes-graph {
+  padding-top: 3px;
   height: 100%;
-  padding-top: 3px;
   position: relative;
   width: calc(100% - var(--sidebar-width) - var(--graph-right-offset));
 }
 
 .keyframes-graph-path {
   height: 100%;
   width: 100%;
 }
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -3106,17 +3106,16 @@ exports.CSS_PROPERTIES = {
       "stroke",
       "stroke-dasharray",
       "stroke-dashoffset",
       "stroke-linecap",
       "stroke-linejoin",
       "stroke-miterlimit",
       "stroke-opacity",
       "stroke-width",
-      "-x-system-font",
       "-moz-tab-size",
       "table-layout",
       "text-align",
       "text-align-last",
       "text-anchor",
       "text-combine-upright",
       "text-decoration-color",
       "text-decoration-line",
@@ -5715,17 +5714,16 @@ exports.CSS_PROPERTIES = {
     "subproperties": [
       "font-family",
       "font-style",
       "font-weight",
       "font-size",
       "line-height",
       "font-size-adjust",
       "font-stretch",
-      "-x-system-font",
       "font-feature-settings",
       "font-language-override",
       "font-kerning",
       "font-optical-sizing",
       "font-variation-settings",
       "font-variant-alternates",
       "font-variant-caps",
       "font-variant-east-asian",
--- a/dom/animation/test/chrome/test_animation_properties.html
+++ b/dom/animation/test/chrome/test_animation_properties.html
@@ -151,19 +151,18 @@ var gTests = [
                             valueFormat(1, 'dashed', 'replace') ] },
                 { property: 'border-top-style',
                   values: [ valueFormat(0, 'dotted', 'replace', 'linear'),
                             valueFormat(1, 'dashed', 'replace') ] },
                 { property: 'border-image-outset',
                   values: [ valueFormat(0, '0', 'replace', 'linear'),
                             valueFormat(1, '0', 'replace') ] },
                 { property: 'border-image-repeat',
-                  values: [ valueFormat(0,
-                                        'stretch stretch', 'replace', 'linear'),
-                            valueFormat(1, 'stretch stretch', 'replace') ] },
+                  values: [ valueFormat(0, 'stretch', 'replace', 'linear'),
+                            valueFormat(1, 'stretch', 'replace') ] },
                 { property: 'border-image-slice',
                   values: [ valueFormat(0, '100%', 'replace', 'linear'),
                             valueFormat(1, '100%', 'replace') ] },
                 { property: 'border-image-source',
                   values: [ valueFormat(0, 'none', 'replace', 'linear'),
                             valueFormat(1, 'none', 'replace') ] },
                 { property: 'border-image-width',
                   values: [ valueFormat(0, '1', 'replace', 'linear'),
@@ -211,19 +210,18 @@ var gTests = [
                             valueFormat(1, 'dashed', 'replace') ] },
                 { property: 'border-top-style',
                   values: [ valueFormat(0, 'dotted', 'replace', 'linear'),
                             valueFormat(1, 'dashed', 'replace') ] },
                 { property: 'border-image-outset',
                   values: [ valueFormat(0, '0', 'replace', 'linear'),
                             valueFormat(1, '0', 'replace') ] },
                 { property: 'border-image-repeat',
-                  values: [ valueFormat(0,
-                                        'stretch stretch', 'replace', 'linear'),
-                            valueFormat(1, 'stretch stretch', 'replace') ] },
+                  values: [ valueFormat(0, 'stretch', 'replace', 'linear'),
+                            valueFormat(1, 'stretch', 'replace') ] },
                 { property: 'border-image-slice',
                   values: [ valueFormat(0, '100%', 'replace', 'linear'),
                             valueFormat(1, '100%', 'replace') ] },
                 { property: 'border-image-source',
                   values: [ valueFormat(0, 'none', 'replace', 'linear'),
                             valueFormat(1, 'none', 'replace') ] },
                 { property: 'border-image-width',
                   values: [ valueFormat(0, '1', 'replace', 'linear'),
@@ -480,19 +478,18 @@ var gTests = [
                             valueFormat(1, 'dashed', 'replace') ] },
                 { property: 'border-top-style',
                   values: [ valueFormat(0, 'dotted', 'replace', 'linear'),
                             valueFormat(1, 'dashed', 'replace') ] },
                 { property: 'border-image-outset',
                   values: [ valueFormat(0, '0', 'replace', 'linear'),
                             valueFormat(1, '0', 'replace') ] },
                 { property: 'border-image-repeat',
-                  values: [ valueFormat(0,
-                                        'stretch stretch', 'replace', 'linear'),
-                            valueFormat(1, 'stretch stretch', 'replace') ] },
+                  values: [ valueFormat(0, 'stretch', 'replace', 'linear'),
+                            valueFormat(1, 'stretch', 'replace') ] },
                 { property: 'border-image-slice',
                   values: [ valueFormat(0, '100%', 'replace', 'linear'),
                             valueFormat(1, '100%', 'replace') ] },
                 { property: 'border-image-source',
                   values: [ valueFormat(0, 'none', 'replace', 'linear'),
                             valueFormat(1, 'none', 'replace') ] },
                 { property: 'border-image-width',
                   values: [ valueFormat(0, '1', 'replace', 'linear'),
@@ -539,19 +536,18 @@ var gTests = [
                             valueFormat(1, 'dashed', 'replace') ] },
                 { property: 'border-top-style',
                   values: [ valueFormat(0, 'dotted', 'replace', 'linear'),
                             valueFormat(1, 'dashed', 'replace') ] },
                 { property: 'border-image-outset',
                   values: [ valueFormat(0, '0', 'replace', 'linear'),
                             valueFormat(1, '0', 'replace') ] },
                 { property: 'border-image-repeat',
-                  values: [ valueFormat(0,
-                                        'stretch stretch', 'replace', 'linear'),
-                            valueFormat(1, 'stretch stretch', 'replace') ] },
+                  values: [ valueFormat(0, 'stretch', 'replace', 'linear'),
+                            valueFormat(1, 'stretch', 'replace') ] },
                 { property: 'border-image-slice',
                   values: [ valueFormat(0, '100%', 'replace', 'linear'),
                             valueFormat(1, '100%', 'replace') ] },
                 { property: 'border-image-source',
                   values: [ valueFormat(0, 'none', 'replace', 'linear'),
                             valueFormat(1, 'none', 'replace') ] },
                 { property: 'border-image-width',
                   values: [ valueFormat(0, '1', 'replace', 'linear'),
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -2159,17 +2159,17 @@ Element::GetAttributeChangeHint(const ns
 bool
 Element::FindAttributeDependence(const nsAtom* aAttribute,
                                  const MappedAttributeEntry* const aMaps[],
                                  uint32_t aMapCount)
 {
   for (uint32_t mapindex = 0; mapindex < aMapCount; ++mapindex) {
     for (const MappedAttributeEntry* map = aMaps[mapindex];
          map->attribute; ++map) {
-      if (aAttribute == map->attribute) {
+      if (aAttribute == *map->attribute) {
         return true;
       }
     }
   }
 
   return false;
 }
 
@@ -2901,17 +2901,17 @@ Element::FindAttrValueIn(int32_t aNameSp
 {
   NS_ASSERTION(aName, "Must have attr name");
   NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown, "Must have namespace");
   NS_ASSERTION(aValues, "Null value array");
 
   const nsAttrValue* val = mAttrsAndChildren.GetAttr(aName, aNameSpaceID);
   if (val) {
     for (int32_t i = 0; aValues[i]; ++i) {
-      if (val->Equals(aValues[i], aCaseSensitive)) {
+      if (val->Equals(*aValues[i], aCaseSensitive)) {
         return i;
       }
     }
     return ATTR_VALUE_NO_MATCH;
   }
   return ATTR_MISSING;
 }
 
@@ -3413,40 +3413,40 @@ static void
 nsDOMTokenListPropertyDestructor(void *aObject, nsAtom *aProperty,
                                  void *aPropertyValue, void *aData)
 {
   nsDOMTokenList* list =
     static_cast<nsDOMTokenList*>(aPropertyValue);
   NS_RELEASE(list);
 }
 
-static nsStaticAtom* const sPropertiesToTraverseAndUnlink[] =
+static nsStaticAtom** sPropertiesToTraverseAndUnlink[] =
   {
-    nsGkAtoms::sandbox,
-    nsGkAtoms::sizes,
-    nsGkAtoms::dirAutoSetBy,
+    &nsGkAtoms::sandbox,
+    &nsGkAtoms::sizes,
+    &nsGkAtoms::dirAutoSetBy,
     nullptr
   };
 
 // static
-nsStaticAtom* const*
+nsStaticAtom***
 Element::HTMLSVGPropertiesToTraverseAndUnlink()
 {
   return sPropertiesToTraverseAndUnlink;
 }
 
 nsDOMTokenList*
 Element::GetTokenList(nsAtom* aAtom,
                       const DOMTokenListSupportedTokenArray aSupportedTokens)
 {
 #ifdef DEBUG
-  const nsStaticAtom* const* props = HTMLSVGPropertiesToTraverseAndUnlink();
+  nsStaticAtom*** props = HTMLSVGPropertiesToTraverseAndUnlink();
   bool found = false;
   for (uint32_t i = 0; props[i]; ++i) {
-    if (props[i] == aAtom) {
+    if (*props[i] == aAtom) {
       found = true;
       break;
     }
   }
   MOZ_ASSERT(found, "Trying to use an unknown tokenlist!");
 #endif
 
   nsDOMTokenList* list = nullptr;
--- a/dom/base/Element.h
+++ b/dom/base/Element.h
@@ -798,17 +798,17 @@ public:
    *                     be kNameSpaceID_Unknown.
    * @param aName The name atom of the attribute.  Must not be null.
    * @param aValues a nullptr-terminated array of pointers to atom values to test
    *                against.
    * @param aCaseSensitive Whether to do a case-sensitive compare on the values.
    * @return ATTR_MISSING, ATTR_VALUE_NO_MATCH or the non-negative index
    * indicating the first value of aValues that matched
    */
-  typedef nsStaticAtom* const AttrValuesArray;
+  typedef nsStaticAtom* const* const AttrValuesArray;
   int32_t FindAttrValueIn(int32_t aNameSpaceID,
                                   nsAtom* aName,
                                   AttrValuesArray* aValues,
                                   nsCaseTreatment aCaseSensitive) const;
 
   /**
    * Set attribute values. All attribute values are assumed to have a
    * canonical string representation that can be used for these
@@ -959,34 +959,34 @@ public:
    * describing the element.
    */
   void Describe(nsAString& aOutDescription) const;
 
   /*
    * Attribute Mapping Helpers
    */
   struct MappedAttributeEntry {
-    const nsStaticAtom* const attribute;
+    nsStaticAtom** attribute;
   };
 
   /**
    * A common method where you can just pass in a list of maps to check
    * for attribute dependence. Most implementations of
    * IsAttributeMapped should use this function as a default
    * handler.
    */
   template<size_t N>
   static bool
   FindAttributeDependence(const nsAtom* aAttribute,
                           const MappedAttributeEntry* const (&aMaps)[N])
   {
     return FindAttributeDependence(aAttribute, aMaps, N);
   }
 
-  static nsStaticAtom* const* HTMLSVGPropertiesToTraverseAndUnlink();
+  static nsStaticAtom*** HTMLSVGPropertiesToTraverseAndUnlink();
 
 private:
   void DescribeAttribute(uint32_t index, nsAString& aOutDescription) const;
 
   static bool
   FindAttributeDependence(const nsAtom* aAttribute,
                           const MappedAttributeEntry* const aMaps[],
                           uint32_t aMapCount);
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -1434,20 +1434,19 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Fr
 
   if (tmp->HasProperties()) {
     if (tmp->IsElement()) {
       Element* elem = tmp->AsElement();
       elem->UnlinkIntersectionObservers();
     }
 
     if (tmp->IsHTMLElement() || tmp->IsSVGElement()) {
-      nsStaticAtom* const* props =
-        Element::HTMLSVGPropertiesToTraverseAndUnlink();
+      nsStaticAtom*** props = Element::HTMLSVGPropertiesToTraverseAndUnlink();
       for (uint32_t i = 0; props[i]; ++i) {
-        tmp->DeleteProperty(props[i]);
+        tmp->DeleteProperty(*props[i]);
       }
       if (tmp->MayHaveAnimations()) {
         nsAtom** effectProps = EffectSet::GetEffectSetPropertyAtoms();
         for (uint32_t i = 0; effectProps[i]; ++i) {
           tmp->DeleteProperty(effectProps[i]);
         }
       }
     }
@@ -2000,21 +1999,20 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
       if (observers) {
         for (auto iter = observers->Iter(); !iter.Done(); iter.Next()) {
           DOMIntersectionObserver* observer = iter.Key();
           cb.NoteXPCOMChild(observer);
         }
       }
     }
     if (tmp->IsHTMLElement() || tmp->IsSVGElement()) {
-      nsStaticAtom* const* props =
-        Element::HTMLSVGPropertiesToTraverseAndUnlink();
+      nsStaticAtom*** props = Element::HTMLSVGPropertiesToTraverseAndUnlink();
       for (uint32_t i = 0; props[i]; ++i) {
         nsISupports* property =
-          static_cast<nsISupports*>(tmp->GetProperty(props[i]));
+          static_cast<nsISupports*>(tmp->GetProperty(*props[i]));
         cb.NoteXPCOMChild(property);
       }
       if (tmp->MayHaveAnimations()) {
         nsAtom** effectProps = EffectSet::GetEffectSetPropertyAtoms();
         for (uint32_t i = 0; effectProps[i]; ++i) {
           EffectSet* effectSet =
             static_cast<EffectSet*>(tmp->GetProperty(effectProps[i]));
           if (effectSet) {
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -4659,17 +4659,17 @@ nsContentUtils::UnregisterShutdownObserv
 }
 
 /* static */
 bool
 nsContentUtils::HasNonEmptyAttr(const nsIContent* aContent,
                                 int32_t aNameSpaceID,
                                 nsAtom* aName)
 {
-  static Element::AttrValuesArray strings[] = {nsGkAtoms::_empty, nullptr};
+  static Element::AttrValuesArray strings[] = {&nsGkAtoms::_empty, nullptr};
   return aContent->IsElement() &&
     aContent->AsElement()->FindAttrValueIn(aNameSpaceID, aName, strings, eCaseMatters)
       == Element::ATTR_VALUE_NO_MATCH;
 }
 
 /* static */
 bool
 nsContentUtils::HasMutationListeners(nsINode* aNode,
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -2959,17 +2959,17 @@ EventStateManager::DecideGestureEvent(Wi
 #ifdef XP_MACOSX
 static bool
 NodeAllowsClickThrough(nsINode* aNode)
 {
   while (aNode) {
     if (aNode->IsXULElement()) {
       mozilla::dom::Element* element = aNode->AsElement();
       static Element::AttrValuesArray strings[] =
-        {nsGkAtoms::always, nsGkAtoms::never, nullptr};
+        {&nsGkAtoms::always, &nsGkAtoms::never, nullptr};
       switch (element->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::clickthrough,
                                        strings, eCaseMatters)) {
         case 0:
           return true;
         case 1:
           return false;
       }
     }
--- a/dom/gamepad/windows/WindowsGamepad.cpp
+++ b/dom/gamepad/windows/WindowsGamepad.cpp
@@ -244,26 +244,26 @@ UnpackDpad(LONG dpad_value, const Gamepa
   }
 
   // Normalize value to start at 0.
   int value = dpad_value - gamepad->dpadCaps.LogicalMin;
 
   // Value will be in the range 0-7. The value represents the
   // position of the d-pad around a circle, with 0 being straight up,
   // 2 being right, 4 being straight down, and 6 being left.
-  if (value < 2 || value > 6) {
+  if ((value < 2 || value > 6) && buttons.Length() > kUp) {
     buttons[kUp] = true;
   }
-  if (value > 2 && value < 6) {
+  if ((value > 2 && value < 6) && buttons.Length() > kDown) {
     buttons[kDown] = true;
   }
-  if (value > 4) {
+  if (value > 4 && buttons.Length() > kLeft) {
     buttons[kLeft] = true;
   }
-  if (value > 0 && value < 4) {
+  if ((value > 0 && value < 4) && buttons.Length() > kRight) {
     buttons[kRight] = true;
   }
 }
 
 /*
  * Return true if this USB HID usage page and usage are of a type we
  * know how to handle.
  */
--- a/dom/html/HTMLBRElement.cpp
+++ b/dom/html/HTMLBRElement.cpp
@@ -62,17 +62,17 @@ HTMLBRElement::MapAttributesIntoRule(con
   }
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLBRElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::clear },
+    { &nsGkAtoms::clear },
     { nullptr }
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
   };
 
--- a/dom/html/HTMLBodyElement.cpp
+++ b/dom/html/HTMLBodyElement.cpp
@@ -227,26 +227,26 @@ HTMLBodyElement::GetAttributeMappingFunc
 {
   return &MapAttributesIntoRule;
 }
 
 NS_IMETHODIMP_(bool)
 HTMLBodyElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::link },
-    { nsGkAtoms::vlink },
-    { nsGkAtoms::alink },
-    { nsGkAtoms::text },
-    { nsGkAtoms::marginwidth },
-    { nsGkAtoms::marginheight },
-    { nsGkAtoms::topmargin },
-    { nsGkAtoms::rightmargin },
-    { nsGkAtoms::bottommargin },
-    { nsGkAtoms::leftmargin },
+    { &nsGkAtoms::link },
+    { &nsGkAtoms::vlink },
+    { &nsGkAtoms::alink },
+    { &nsGkAtoms::text },
+    { &nsGkAtoms::marginwidth },
+    { &nsGkAtoms::marginheight },
+    { &nsGkAtoms::topmargin },
+    { &nsGkAtoms::rightmargin },
+    { &nsGkAtoms::bottommargin },
+    { &nsGkAtoms::leftmargin },
     { nullptr },
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
     sBackgroundAttributeMap,
   };
--- a/dom/html/HTMLFontElement.cpp
+++ b/dom/html/HTMLFontElement.cpp
@@ -93,19 +93,19 @@ HTMLFontElement::MapAttributesIntoRule(c
 
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLFontElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::face },
-    { nsGkAtoms::size },
-    { nsGkAtoms::color },
+    { &nsGkAtoms::face },
+    { &nsGkAtoms::size },
+    { &nsGkAtoms::color },
     { nullptr }
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
   };
 
--- a/dom/html/HTMLHRElement.cpp
+++ b/dom/html/HTMLHRElement.cpp
@@ -166,21 +166,21 @@ HTMLHRElement::MapAttributesIntoRule(con
   nsGenericHTMLElement::MapWidthAttributeInto(aAttributes, aData);
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLHRElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::align },
-    { nsGkAtoms::width },
-    { nsGkAtoms::size },
-    { nsGkAtoms::color },
-    { nsGkAtoms::noshade },
+    { &nsGkAtoms::align },
+    { &nsGkAtoms::width },
+    { &nsGkAtoms::size },
+    { &nsGkAtoms::color },
+    { &nsGkAtoms::noshade },
     { nullptr },
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
   };
 
--- a/dom/html/HTMLIFrameElement.cpp
+++ b/dom/html/HTMLIFrameElement.cpp
@@ -104,19 +104,19 @@ HTMLIFrameElement::MapAttributesIntoRule
   nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData);
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLIFrameElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::width },
-    { nsGkAtoms::height },
-    { nsGkAtoms::frameborder },
+    { &nsGkAtoms::width },
+    { &nsGkAtoms::height },
+    { &nsGkAtoms::frameborder },
     { nullptr },
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sImageAlignAttributeMap,
     sCommonAttributeMap,
   };
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -5533,30 +5533,16 @@ HTMLInputElement::IsInputDateTimeOthersE
     Preferences::AddBoolVarCache(&sDateTimeOthersEnabled,
                                  "dom.forms.datetime.others", false);
   }
 
   return sDateTimeOthersEnabled;
 }
 
 /* static */ bool
-HTMLInputElement::IsInputNumberEnabled()
-{
-  static bool sInputNumberEnabled = false;
-  static bool sInputNumberPrefCached = false;
-  if (!sInputNumberPrefCached) {
-    sInputNumberPrefCached = true;
-    Preferences::AddBoolVarCache(&sInputNumberEnabled, "dom.forms.number",
-                                 false);
-  }
-
-  return sInputNumberEnabled;
-}
-
-/* static */ bool
 HTMLInputElement::IsInputColorEnabled()
 {
   static bool sInputColorEnabled = false;
   static bool sInputColorPrefCached = false;
   if (!sInputColorPrefCached) {
     sInputColorPrefCached = true;
     Preferences::AddBoolVarCache(&sInputColorEnabled, "dom.forms.color",
                                  false);
@@ -5582,18 +5568,17 @@ HTMLInputElement::ParseAttribute(int32_t
   MOZ_ASSERT(kInputTypeTable[ArrayLength(kInputTypeTable) - 2].value ==
                NS_FORM_INPUT_TEXT,
              "Next to last entry in the table must be the \"text\" entry");
 
   if (aNamespaceID == kNameSpaceID_None) {
     if (aAttribute == nsGkAtoms::type) {
       aResult.ParseEnumValue(aValue, kInputTypeTable, false, kInputDefaultType);
       int32_t newType = aResult.GetEnumValue();
-      if ((newType == NS_FORM_INPUT_NUMBER && !IsInputNumberEnabled()) ||
-          (newType == NS_FORM_INPUT_COLOR && !IsInputColorEnabled()) ||
+      if ((newType == NS_FORM_INPUT_COLOR && !IsInputColorEnabled()) ||
           (IsDateTimeInputType(newType) && !IsDateTimeTypeSupported(newType))) {
         // There's no public way to set an nsAttrValue to an enum value, but we
         // can just re-parse with a table that doesn't have any types other than
         // "text" in it.
         aResult.ParseEnumValue(aValue, kInputDefaultType, false, kInputDefaultType);
       }
 
       return true;
@@ -5690,18 +5675,18 @@ HTMLInputElement::GetAttributeChangeHint
   }
   return retval;
 }
 
 NS_IMETHODIMP_(bool)
 HTMLInputElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::align },
-    { nsGkAtoms::type },
+    { &nsGkAtoms::align },
+    { &nsGkAtoms::type },
     { nullptr },
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
     sImageMarginSizeAttributeMap,
     sImageBorderAttributeMap,
--- a/dom/html/HTMLInputElement.h
+++ b/dom/html/HTMLInputElement.h
@@ -1752,23 +1752,16 @@ private:
   /**
    * Checks preference "dom.forms.datetime.others" to determine if input week,
    * month and datetime-local should be supported.
    */
   static bool
   IsInputDateTimeOthersEnabled();
 
   /**
-   * Checks preference "dom.forms.number" to determine if input type=number
-   * should be supported.
-   */
-  static bool
-  IsInputNumberEnabled();
-
-  /**
    * Checks preference "dom.forms.color" to determine if date/time related
    * types should be supported.
    */
   static bool
   IsInputColorEnabled();
 
   struct nsFilePickerFilter {
     nsFilePickerFilter()
--- a/dom/html/HTMLLIElement.cpp
+++ b/dom/html/HTMLLIElement.cpp
@@ -78,17 +78,17 @@ HTMLLIElement::MapAttributesIntoRule(con
 
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLLIElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::type },
+    { &nsGkAtoms::type },
     { nullptr },
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
   };
 
--- a/dom/html/HTMLLinkElement.cpp
+++ b/dom/html/HTMLLinkElement.cpp
@@ -230,17 +230,17 @@ HTMLLinkElement::CreateAndDispatchEvent(
 
   // In the unlikely case that both rev is specified *and* rel=stylesheet,
   // this code will cause the event to fire, on the principle that maybe the
   // page really does want to specify that its author is a stylesheet. Since
   // this should never actually happen and the performance hit is minimal,
   // doing the "right" thing costs virtually nothing here, even if it doesn't
   // make much sense.
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::_empty, nsGkAtoms::stylesheet, nullptr};
+    {&nsGkAtoms::_empty, &nsGkAtoms::stylesheet, nullptr};
 
   if (!nsContentUtils::HasNonEmptyAttr(this, kNameSpaceID_None,
                                        nsGkAtoms::rev) &&
       FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::rel,
                       strings, eIgnoreCase) != ATTR_VALUE_NO_MATCH)
     return;
 
   RefPtr<AsyncEventDispatcher> asyncDispatcher =
--- a/dom/html/HTMLPreElement.cpp
+++ b/dom/html/HTMLPreElement.cpp
@@ -57,17 +57,17 @@ HTMLPreElement::MapAttributesIntoRule(co
 NS_IMETHODIMP_(bool)
 HTMLPreElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   if (!mNodeInfo->Equals(nsGkAtoms::pre)) {
     return nsGenericHTMLElement::IsAttributeMapped(aAttribute);
   }
 
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::wrap },
+    { &nsGkAtoms::wrap },
     { nullptr },
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
   };
 
--- a/dom/html/HTMLSharedElement.cpp
+++ b/dom/html/HTMLSharedElement.cpp
@@ -96,18 +96,18 @@ DirectoryMapAttributesIntoRule(const nsM
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLSharedElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   if (mNodeInfo->Equals(nsGkAtoms::dir)) {
     static const MappedAttributeEntry attributes[] = {
-      { nsGkAtoms::type },
-      // { nsGkAtoms::compact }, // XXX
+      { &nsGkAtoms::type },
+      // { &nsGkAtoms::compact }, // XXX
       { nullptr}
     };
 
     static const MappedAttributeEntry* const map[] = {
       attributes,
       sCommonAttributeMap,
     };
 
--- a/dom/html/HTMLSharedListElement.cpp
+++ b/dom/html/HTMLSharedListElement.cpp
@@ -95,17 +95,17 @@ HTMLSharedListElement::MapAttributesInto
 }
 
 NS_IMETHODIMP_(bool)
 HTMLSharedListElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   if (mNodeInfo->Equals(nsGkAtoms::ol) ||
       mNodeInfo->Equals(nsGkAtoms::ul)) {
     static const MappedAttributeEntry attributes[] = {
-      { nsGkAtoms::type },
+      { &nsGkAtoms::type },
       { nullptr }
     };
 
     static const MappedAttributeEntry* const map[] = {
       attributes,
       sCommonAttributeMap,
     };
 
--- a/dom/html/HTMLTableCaptionElement.cpp
+++ b/dom/html/HTMLTableCaptionElement.cpp
@@ -63,17 +63,17 @@ HTMLTableCaptionElement::MapAttributesIn
 
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLTableCaptionElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::align },
+    { &nsGkAtoms::align },
     { nullptr }
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
   };
 
--- a/dom/html/HTMLTableCellElement.cpp
+++ b/dom/html/HTMLTableCellElement.cpp
@@ -232,29 +232,29 @@ HTMLTableCellElement::MapAttributesIntoR
   nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLTableCellElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::align },
-    { nsGkAtoms::valign },
-    { nsGkAtoms::nowrap },
+    { &nsGkAtoms::align },
+    { &nsGkAtoms::valign },
+    { &nsGkAtoms::nowrap },
 #if 0
     // XXXldb If these are implemented, they might need to move to
     // GetAttributeChangeHint (depending on how, and preferably not).
-    { nsGkAtoms::abbr },
-    { nsGkAtoms::axis },
-    { nsGkAtoms::headers },
-    { nsGkAtoms::scope },
+    { &nsGkAtoms::abbr },
+    { &nsGkAtoms::axis },
+    { &nsGkAtoms::headers },
+    { &nsGkAtoms::scope },
 #endif
-    { nsGkAtoms::width },
-    { nsGkAtoms::height },
+    { &nsGkAtoms::width },
+    { &nsGkAtoms::height },
     { nullptr }
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
     sBackgroundAttributeMap,
   };
--- a/dom/html/HTMLTableColElement.cpp
+++ b/dom/html/HTMLTableColElement.cpp
@@ -86,20 +86,20 @@ HTMLTableColElement::MapAttributesIntoRu
   nsGenericHTMLElement::MapVAlignAttributeInto(aAttributes, aData);
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLTableColElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::width },
-    { nsGkAtoms::align },
-    { nsGkAtoms::valign },
-    { nsGkAtoms::span },
+    { &nsGkAtoms::width },
+    { &nsGkAtoms::align },
+    { &nsGkAtoms::valign },
+    { &nsGkAtoms::span },
     { nullptr }
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
   };
 
--- a/dom/html/HTMLTableElement.cpp
+++ b/dom/html/HTMLTableElement.cpp
@@ -1011,27 +1011,27 @@ HTMLTableElement::MapAttributesIntoRule(
   nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLTableElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::cellpadding },
-    { nsGkAtoms::cellspacing },
-    { nsGkAtoms::border },
-    { nsGkAtoms::width },
-    { nsGkAtoms::height },
-    { nsGkAtoms::hspace },
-    { nsGkAtoms::vspace },
+    { &nsGkAtoms::cellpadding },
+    { &nsGkAtoms::cellspacing },
+    { &nsGkAtoms::border },
+    { &nsGkAtoms::width },
+    { &nsGkAtoms::height },
+    { &nsGkAtoms::hspace },
+    { &nsGkAtoms::vspace },
 
-    { nsGkAtoms::bordercolor },
+    { &nsGkAtoms::bordercolor },
 
-    { nsGkAtoms::align },
+    { &nsGkAtoms::align },
     { nullptr }
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
     sBackgroundAttributeMap,
   };
--- a/dom/html/HTMLTableRowElement.cpp
+++ b/dom/html/HTMLTableRowElement.cpp
@@ -268,19 +268,19 @@ HTMLTableRowElement::MapAttributesIntoRu
   nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLTableRowElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::align },
-    { nsGkAtoms::valign },
-    { nsGkAtoms::height },
+    { &nsGkAtoms::align },
+    { &nsGkAtoms::valign },
+    { &nsGkAtoms::height },
     { nullptr }
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
     sBackgroundAttributeMap,
   };
--- a/dom/html/HTMLTableSectionElement.cpp
+++ b/dom/html/HTMLTableSectionElement.cpp
@@ -176,19 +176,19 @@ HTMLTableSectionElement::MapAttributesIn
   nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLTableSectionElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::align },
-    { nsGkAtoms::valign },
-    { nsGkAtoms::height },
+    { &nsGkAtoms::align },
+    { &nsGkAtoms::valign },
+    { &nsGkAtoms::height },
     { nullptr }
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
     sBackgroundAttributeMap,
   };
--- a/dom/html/HTMLTextAreaElement.cpp
+++ b/dom/html/HTMLTextAreaElement.cpp
@@ -479,17 +479,17 @@ HTMLTextAreaElement::GetAttributeChangeH
   }
   return retval;
 }
 
 NS_IMETHODIMP_(bool)
 HTMLTextAreaElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::wrap },
+    { &nsGkAtoms::wrap },
     { nullptr }
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sDivAlignAttributeMap,
     sCommonAttributeMap,
   };
--- a/dom/html/HTMLVideoElement.cpp
+++ b/dom/html/HTMLVideoElement.cpp
@@ -106,18 +106,18 @@ HTMLVideoElement::MapAttributesIntoRule(
   nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aData);
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
 HTMLVideoElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
-    { nsGkAtoms::width },
-    { nsGkAtoms::height },
+    { &nsGkAtoms::width },
+    { &nsGkAtoms::height },
     { nullptr }
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap
   };
 
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -310,17 +310,17 @@ nsGenericHTMLElement::GetOffsetRect(CSSI
 bool
 nsGenericHTMLElement::Spellcheck()
 {
   // Has the state has been explicitly set?
   nsIContent* node;
   for (node = this; node; node = node->GetParent()) {
     if (node->IsHTMLElement()) {
       static Element::AttrValuesArray strings[] =
-        {nsGkAtoms::_true, nsGkAtoms::_false, nullptr};
+        {&nsGkAtoms::_true, &nsGkAtoms::_false, nullptr};
       switch (node->AsElement()->FindAttrValueIn(kNameSpaceID_None,
                                                  nsGkAtoms::spellcheck, strings,
                                                  eCaseMatters)) {
         case 0:                         // spellcheck = "true"
           return true;
         case 1:                         // spellcheck = "false"
           return false;
       }
@@ -1216,59 +1216,59 @@ nsGenericHTMLElement::MapCommonAttribute
     if (aAttributes->IndexOfAttr(nsGkAtoms::hidden) >= 0) {
       aData->SetKeywordValue(eCSSProperty_display, StyleDisplay::None);
     }
   }
 }
 
 /* static */ const nsGenericHTMLElement::MappedAttributeEntry
 nsGenericHTMLElement::sCommonAttributeMap[] = {
-  { nsGkAtoms::contenteditable },
-  { nsGkAtoms::lang },
-  { nsGkAtoms::hidden },
+  { &nsGkAtoms::contenteditable },
+  { &nsGkAtoms::lang },
+  { &nsGkAtoms::hidden },
   { nullptr }
 };
 
 /* static */ const Element::MappedAttributeEntry
 nsGenericHTMLElement::sImageMarginSizeAttributeMap[] = {
-  { nsGkAtoms::width },
-  { nsGkAtoms::height },
-  { nsGkAtoms::hspace },
-  { nsGkAtoms::vspace },
+  { &nsGkAtoms::width },
+  { &nsGkAtoms::height },
+  { &nsGkAtoms::hspace },
+  { &nsGkAtoms::vspace },
   { nullptr }
 };
 
 /* static */ const Element::MappedAttributeEntry
 nsGenericHTMLElement::sImageAlignAttributeMap[] = {
-  { nsGkAtoms::align },
+  { &nsGkAtoms::align },
   { nullptr }
 };
 
 /* static */ const Element::MappedAttributeEntry
 nsGenericHTMLElement::sDivAlignAttributeMap[] = {
-  { nsGkAtoms::align },
+  { &nsGkAtoms::align },
   { nullptr }
 };
 
 /* static */ const Element::MappedAttributeEntry
 nsGenericHTMLElement::sImageBorderAttributeMap[] = {
-  { nsGkAtoms::border },
+  { &nsGkAtoms::border },
   { nullptr }
 };
 
 /* static */ const Element::MappedAttributeEntry
 nsGenericHTMLElement::sBackgroundAttributeMap[] = {
-  { nsGkAtoms::background },
-  { nsGkAtoms::bgcolor },
+  { &nsGkAtoms::background },
+  { &nsGkAtoms::bgcolor },
   { nullptr }
 };
 
 /* static */ const Element::MappedAttributeEntry
 nsGenericHTMLElement::sBackgroundColorAttributeMap[] = {
-  { nsGkAtoms::bgcolor },
+  { &nsGkAtoms::bgcolor },
   { nullptr }
 };
 
 void
 nsGenericHTMLElement::MapImageAlignAttributeInto(const nsMappedAttributes* aAttributes,
                                                  GenericSpecifiedValues* aData)
 {
   const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
--- a/dom/html/nsGenericHTMLElement.h
+++ b/dom/html/nsGenericHTMLElement.h
@@ -915,17 +915,17 @@ protected:
    * Returns eTrue if the element has a contentEditable attribute and its value
    * is "true" or an empty string. Returns eFalse if the element has a
    * contentEditable attribute and its value is "false". Otherwise returns
    * eInherit.
    */
   ContentEditableTristate GetContentEditableValue() const
   {
     static const Element::AttrValuesArray values[] =
-      { nsGkAtoms::_false, nsGkAtoms::_true, nsGkAtoms::_empty, nullptr };
+      { &nsGkAtoms::_false, &nsGkAtoms::_true, &nsGkAtoms::_empty, nullptr };
 
     if (!MayHaveContentEditableAttr())
       return eInherit;
 
     int32_t value = FindAttrValueIn(kNameSpaceID_None,
                                     nsGkAtoms::contenteditable, values,
                                     eIgnoreCase);
 
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -207,17 +207,17 @@ nsITextControlElement::GetWrapPropertyEn
   // browsers treat it that way and there is no real reason to maintain physical
   // and virtual as separate entities if no one else does.  Only hard and off
   // do anything different.
   aWrapProp = eHTMLTextWrap_Soft; // the default
 
   nsAutoString wrap;
   if (aContent->IsHTMLElement()) {
     static Element::AttrValuesArray strings[] =
-      {nsGkAtoms::HARD, nsGkAtoms::OFF, nullptr};
+      {&nsGkAtoms::HARD, &nsGkAtoms::OFF, nullptr};
 
     switch (aContent->AsElement()->FindAttrValueIn(kNameSpaceID_None,
                                                    nsGkAtoms::wrap, strings,
                                                    eIgnoreCase)) {
       case 0: aWrapProp = eHTMLTextWrap_Hard; break;
       case 1: aWrapProp = eHTMLTextWrap_Off; break;
     }
 
--- a/dom/html/reftests/autofocus/reftest.list
+++ b/dom/html/reftests/autofocus/reftest.list
@@ -1,9 +1,9 @@
-default-preferences pref(dom.forms.number,true) pref(dom.forms.datetime,true)
+default-preferences pref(dom.forms.datetime,true)
 fuzzy-if(skiaContent,1,3) needs-focus == input-load.html input-ref.html
 fuzzy-if(skiaContent,1,3) needs-focus == input-create.html input-ref.html
 fuzzy-if(skiaContent,1,3) needs-focus == input-number.html input-number-ref.html
 fuzzy-if(skiaContent,1,3) needs-focus == input-time.html input-time-ref.html
 fuzzy-if(skiaContent,1,3) needs-focus == button-load.html button-ref.html
 fuzzy-if(skiaContent,1,3) needs-focus == button-create.html button-ref.html
 fuzzy-if(skiaContent,1,3) needs-focus == textarea-load.html textarea-ref.html
 fuzzy-if(skiaContent,1,3) needs-focus == textarea-create.html textarea-ref.html
--- a/dom/html/test/forms/test_input_types_pref.html
+++ b/dom/html/test/forms/test_input_types_pref.html
@@ -15,24 +15,16 @@ https://bugzilla.mozilla.org/show_bug.cg
 </div>
 <pre id="test">
 <script type="application/javascript">
 
   var input = document.createElement("input");
 
   var testData = [
     {
-      prefs: [["dom.forms.number", false]],
-      inputType: "number",
-      expectedType: "text"
-    }, {
-      prefs: [["dom.forms.number", true]],
-      inputType: "number",
-      expectedType: "number"
-    }, {
       prefs: [["dom.forms.color", false]],
       inputType: "color",
       expectedType: "text"
     }, {
       prefs: [["dom.forms.color", true]],
       inputType: "color",
       expectedType: "color"
     }, {
--- a/dom/mathml/nsMathMLElement.cpp
+++ b/dom/mathml/nsMathMLElement.cpp
@@ -178,47 +178,47 @@ nsMathMLElement::ParseAttribute(int32_t 
 
   return nsMathMLElementBase::ParseAttribute(aNamespaceID, aAttribute,
                                              aValue,
                                              aMaybeScriptedPrincipal,
                                              aResult);
 }
 
 static Element::MappedAttributeEntry sMtableStyles[] = {
-  { nsGkAtoms::width },
+  { &nsGkAtoms::width },
   { nullptr }
 };
 
 static Element::MappedAttributeEntry sTokenStyles[] = {
-  { nsGkAtoms::mathsize_ },
-  { nsGkAtoms::fontsize_ },
-  { nsGkAtoms::color },
-  { nsGkAtoms::fontfamily_ },
-  { nsGkAtoms::fontstyle_ },
-  { nsGkAtoms::fontweight_ },
-  { nsGkAtoms::mathvariant_},
+  { &nsGkAtoms::mathsize_ },
+  { &nsGkAtoms::fontsize_ },
+  { &nsGkAtoms::color },
+  { &nsGkAtoms::fontfamily_ },
+  { &nsGkAtoms::fontstyle_ },
+  { &nsGkAtoms::fontweight_ },
+  { &nsGkAtoms::mathvariant_},
   { nullptr }
 };
 
 static Element::MappedAttributeEntry sEnvironmentStyles[] = {
-  { nsGkAtoms::scriptlevel_ },
-  { nsGkAtoms::scriptminsize_ },
-  { nsGkAtoms::scriptsizemultiplier_ },
-  { nsGkAtoms::background },
+  { &nsGkAtoms::scriptlevel_ },
+  { &nsGkAtoms::scriptminsize_ },
+  { &nsGkAtoms::scriptsizemultiplier_ },
+  { &nsGkAtoms::background },
   { nullptr }
 };
 
 static Element::MappedAttributeEntry sCommonPresStyles[] = {
-  { nsGkAtoms::mathcolor_ },
-  { nsGkAtoms::mathbackground_ },
+  { &nsGkAtoms::mathcolor_ },
+  { &nsGkAtoms::mathbackground_ },
   { nullptr }
 };
 
 static Element::MappedAttributeEntry sDirStyles[] = {
-  { nsGkAtoms::dir },
+  { &nsGkAtoms::dir },
   { nullptr }
 };
 
 bool
 nsMathMLElement::IsAttributeMapped(const nsAtom* aAttribute) const
 {
   MOZ_ASSERT(IsMathMLElement());
 
@@ -993,23 +993,23 @@ nsMathMLElement::IsLink(nsIURI** aURI) c
     //   xlink:type    - must be unset or set to "" or set to "simple"
     //   xlink:show    - must be unset or set to "", "new" or "replace"
     //   xlink:actuate - must be unset or set to "" or "onRequest"
     //
     // For any other values, we're either not a *clickable* XLink, or the end
     // result is poorly specified. Either way, we return false.
 
     static Element::AttrValuesArray sTypeVals[] =
-      { nsGkAtoms::_empty, nsGkAtoms::simple, nullptr };
+      { &nsGkAtoms::_empty, &nsGkAtoms::simple, nullptr };
 
     static Element::AttrValuesArray sShowVals[] =
-      { nsGkAtoms::_empty, nsGkAtoms::_new, nsGkAtoms::replace, nullptr };
+      { &nsGkAtoms::_empty, &nsGkAtoms::_new, &nsGkAtoms::replace, nullptr };
 
     static Element::AttrValuesArray sActuateVals[] =
-      { nsGkAtoms::_empty, nsGkAtoms::onRequest, nullptr };
+      { &nsGkAtoms::_empty, &nsGkAtoms::onRequest, nullptr };
 
     // Optimization: check for href first for early return
     href = mAttrsAndChildren.GetAttr(nsGkAtoms::href,
                                      kNameSpaceID_XLink);
     if (href &&
         FindAttrValueIn(kNameSpaceID_XLink, nsGkAtoms::type,
                         sTypeVals, eCaseMatters) !=
         Element::ATTR_VALUE_NO_MATCH &&
@@ -1045,17 +1045,17 @@ nsMathMLElement::GetLinkTarget(nsAString
                                                         kNameSpaceID_XLink);
   if (target) {
     target->ToString(aTarget);
   }
 
   if (aTarget.IsEmpty()) {
 
     static Element::AttrValuesArray sShowVals[] =
-      { nsGkAtoms::_new, nsGkAtoms::replace, nullptr };
+      { &nsGkAtoms::_new, &nsGkAtoms::replace, nullptr };
 
     switch (FindAttrValueIn(kNameSpaceID_XLink, nsGkAtoms::show,
                             sShowVals, eCaseMatters)) {
     case 0:
       aTarget.AssignLiteral("_blank");
       return;
     case 1:
       return;
--- a/dom/svg/SVGAElement.cpp
+++ b/dom/svg/SVGAElement.cpp
@@ -257,23 +257,23 @@ SVGAElement::IsLink(nsIURI** aURI) const
   //   xlink:type    - must be unset or set to "" or set to "simple"
   //   xlink:show    - must be unset or set to "", "new" or "replace"
   //   xlink:actuate - must be unset or set to "" or "onRequest"
   //
   // For any other values, we're either not a *clickable* XLink, or the end
   // result is poorly specified. Either way, we return false.
 
   static Element::AttrValuesArray sTypeVals[] =
-    { nsGkAtoms::_empty, nsGkAtoms::simple, nullptr };
+    { &nsGkAtoms::_empty, &nsGkAtoms::simple, nullptr };
 
   static Element::AttrValuesArray sShowVals[] =
-    { nsGkAtoms::_empty, nsGkAtoms::_new, nsGkAtoms::replace, nullptr };
+    { &nsGkAtoms::_empty, &nsGkAtoms::_new, &nsGkAtoms::replace, nullptr };
 
   static Element::AttrValuesArray sActuateVals[] =
-    { nsGkAtoms::_empty, nsGkAtoms::onRequest, nullptr };
+    { &nsGkAtoms::_empty, &nsGkAtoms::onRequest, nullptr };
 
   // Optimization: check for href first for early return
   bool useBareHref = mStringAttributes[HREF].IsExplicitlySet();
 
   if ((useBareHref || mStringAttributes[XLINK_HREF].IsExplicitlySet()) &&
       FindAttrValueIn(kNameSpaceID_XLink, nsGkAtoms::type,
                       sTypeVals, eCaseMatters) !=
                       Element::ATTR_VALUE_NO_MATCH &&
@@ -299,17 +299,17 @@ SVGAElement::IsLink(nsIURI** aURI) const
 
 void
 SVGAElement::GetLinkTarget(nsAString& aTarget)
 {
   mStringAttributes[TARGET].GetAnimValue(aTarget, this);
   if (aTarget.IsEmpty()) {
 
     static Element::AttrValuesArray sShowVals[] =
-      { nsGkAtoms::_new, nsGkAtoms::replace, nullptr };
+      { &nsGkAtoms::_new, &nsGkAtoms::replace, nullptr };
 
     switch (FindAttrValueIn(kNameSpaceID_XLink, nsGkAtoms::show,
                             sShowVals, eCaseMatters)) {
     case 0:
       aTarget.AssignLiteral("_blank");
       return;
     case 1:
       return;
--- a/dom/svg/SVGDocument.cpp
+++ b/dom/svg/SVGDocument.cpp
@@ -152,21 +152,16 @@ SVGDocument::EnsureNonSVGUserAgentStyleS
           }
         }
       }
     }
   }
 
   auto cache = nsLayoutStylesheetCache::Singleton();
 
-  StyleSheet* sheet = cache->NumberControlSheet();
-  if (sheet) {
-    // number-control.css can be behind a pref
-    EnsureOnDemandBuiltInUASheet(sheet);
-  }
   EnsureOnDemandBuiltInUASheet(cache->FormsSheet());
   EnsureOnDemandBuiltInUASheet(cache->CounterStylesSheet());
   EnsureOnDemandBuiltInUASheet(cache->HTMLSheet());
   if (nsLayoutUtils::ShouldUseNoFramesSheet(this)) {
     EnsureOnDemandBuiltInUASheet(cache->NoFramesSheet());
   }
   if (nsLayoutUtils::ShouldUseNoScriptSheet(this)) {
     EnsureOnDemandBuiltInUASheet(cache->NoScriptSheet());
--- a/dom/svg/nsSVGElement.cpp
+++ b/dom/svg/nsSVGElement.cpp
@@ -924,139 +924,139 @@ nsSVGElement::IsAttributeMapped(const ns
     return true;
   }
   return nsSVGElementBase::IsAttributeMapped(name);
 }
 
 // PresentationAttributes-FillStroke
 /* static */ const Element::MappedAttributeEntry
 nsSVGElement::sFillStrokeMap[] = {
-  { nsGkAtoms::fill },
-  { nsGkAtoms::fill_opacity },
-  { nsGkAtoms::fill_rule },
-  { nsGkAtoms::paint_order },
-  { nsGkAtoms::stroke },
-  { nsGkAtoms::stroke_dasharray },
-  { nsGkAtoms::stroke_dashoffset },
-  { nsGkAtoms::stroke_linecap },
-  { nsGkAtoms::stroke_linejoin },
-  { nsGkAtoms::stroke_miterlimit },
-  { nsGkAtoms::stroke_opacity },
-  { nsGkAtoms::stroke_width },
-  { nsGkAtoms::vector_effect },
+  { &nsGkAtoms::fill },
+  { &nsGkAtoms::fill_opacity },
+  { &nsGkAtoms::fill_rule },
+  { &nsGkAtoms::paint_order },
+  { &nsGkAtoms::stroke },
+  { &nsGkAtoms::stroke_dasharray },
+  { &nsGkAtoms::stroke_dashoffset },
+  { &nsGkAtoms::stroke_linecap },
+  { &nsGkAtoms::stroke_linejoin },
+  { &nsGkAtoms::stroke_miterlimit },
+  { &nsGkAtoms::stroke_opacity },
+  { &nsGkAtoms::stroke_width },
+  { &nsGkAtoms::vector_effect },
   { nullptr }
 };
 
 // PresentationAttributes-Graphics
 /* static */ const Element::MappedAttributeEntry
 nsSVGElement::sGraphicsMap[] = {
-  { nsGkAtoms::clip_path },
-  { nsGkAtoms::clip_rule },
-  { nsGkAtoms::colorInterpolation },
-  { nsGkAtoms::cursor },
-  { nsGkAtoms::display },
-  { nsGkAtoms::filter },
-  { nsGkAtoms::image_rendering },
-  { nsGkAtoms::mask },
-  { nsGkAtoms::opacity },
-  { nsGkAtoms::pointer_events },
-  { nsGkAtoms::shape_rendering },
-  { nsGkAtoms::text_rendering },
-  { nsGkAtoms::visibility },
+  { &nsGkAtoms::clip_path },
+  { &nsGkAtoms::clip_rule },
+  { &nsGkAtoms::colorInterpolation },
+  { &nsGkAtoms::cursor },
+  { &nsGkAtoms::display },
+  { &nsGkAtoms::filter },
+  { &nsGkAtoms::image_rendering },
+  { &nsGkAtoms::mask },
+  { &nsGkAtoms::opacity },
+  { &nsGkAtoms::pointer_events },
+  { &nsGkAtoms::shape_rendering },
+  { &nsGkAtoms::text_rendering },
+  { &nsGkAtoms::visibility },
   { nullptr }
 };
 
 // PresentationAttributes-TextContentElements
 /* static */ const Element::MappedAttributeEntry
 nsSVGElement::sTextContentElementsMap[] = {
   // Properties that we don't support are commented out.
-  // { nsGkAtoms::alignment_baseline },
-  // { nsGkAtoms::baseline_shift },
-  { nsGkAtoms::direction },
-  { nsGkAtoms::dominant_baseline },
-  { nsGkAtoms::letter_spacing },
-  { nsGkAtoms::text_anchor },
-  { nsGkAtoms::text_decoration },
-  { nsGkAtoms::unicode_bidi },
-  { nsGkAtoms::word_spacing },
-  { nsGkAtoms::writing_mode },
+  // { &nsGkAtoms::alignment_baseline },
+  // { &nsGkAtoms::baseline_shift },
+  { &nsGkAtoms::direction },
+  { &nsGkAtoms::dominant_baseline },
+  { &nsGkAtoms::letter_spacing },
+  { &nsGkAtoms::text_anchor },
+  { &nsGkAtoms::text_decoration },
+  { &nsGkAtoms::unicode_bidi },
+  { &nsGkAtoms::word_spacing },
+  { &nsGkAtoms::writing_mode },
   { nullptr }
 };
 
 // PresentationAttributes-FontSpecification
 /* static */ const Element::MappedAttributeEntry
 nsSVGElement::sFontSpecificationMap[] = {
-  { nsGkAtoms::font_family },
-  { nsGkAtoms::font_size },
-  { nsGkAtoms::font_size_adjust },
-  { nsGkAtoms::font_stretch },
-  { nsGkAtoms::font_style },
-  { nsGkAtoms::font_variant },
-  { nsGkAtoms::fontWeight },
+  { &nsGkAtoms::font_family },
+  { &nsGkAtoms::font_size },
+  { &nsGkAtoms::font_size_adjust },
+  { &nsGkAtoms::font_stretch },
+  { &nsGkAtoms::font_style },
+  { &nsGkAtoms::font_variant },
+  { &nsGkAtoms::fontWeight },
   { nullptr }
 };
 
 // PresentationAttributes-GradientStop
 /* static */ const Element::MappedAttributeEntry
 nsSVGElement::sGradientStopMap[] = {
-  { nsGkAtoms::stop_color },
-  { nsGkAtoms::stop_opacity },
+  { &nsGkAtoms::stop_color },
+  { &nsGkAtoms::stop_opacity },
   { nullptr }
 };
 
 // PresentationAttributes-Viewports
 /* static */ const Element::MappedAttributeEntry
 nsSVGElement::sViewportsMap[] = {
-  { nsGkAtoms::overflow },
-  { nsGkAtoms::clip },
+  { &nsGkAtoms::overflow },
+  { &nsGkAtoms::clip },
   { nullptr }
 };
 
 // PresentationAttributes-Makers
 /* static */ const Element::MappedAttributeEntry
 nsSVGElement::sMarkersMap[] = {
-  { nsGkAtoms::marker_end },
-  { nsGkAtoms::marker_mid },
-  { nsGkAtoms::marker_start },
+  { &nsGkAtoms::marker_end },
+  { &nsGkAtoms::marker_mid },
+  { &nsGkAtoms::marker_start },
   { nullptr }
 };
 
 // PresentationAttributes-Color
 /* static */ const Element::MappedAttributeEntry
 nsSVGElement::sColorMap[] = {
-  { nsGkAtoms::color },
+  { &nsGkAtoms::color },
   { nullptr }
 };
 
 // PresentationAttributes-Filters
 /* static */ const Element::MappedAttributeEntry
 nsSVGElement::sFiltersMap[] = {
-  { nsGkAtoms::colorInterpolationFilters },
+  { &nsGkAtoms::colorInterpolationFilters },
   { nullptr }
 };
 
 // PresentationAttributes-feFlood
 /* static */ const Element::MappedAttributeEntry
 nsSVGElement::sFEFloodMap[] = {
-  { nsGkAtoms::flood_color },
-  { nsGkAtoms::flood_opacity },
+  { &nsGkAtoms::flood_color },
+  { &nsGkAtoms::flood_opacity },
   { nullptr }
 };
 
 // PresentationAttributes-LightingEffects
 /* static */ const Element::MappedAttributeEntry
 nsSVGElement::sLightingEffectsMap[] = {
-  { nsGkAtoms::lighting_color },
+  { &nsGkAtoms::lighting_color },
   { nullptr }
 };
 
 // PresentationAttributes-mask
 /* static */ const Element::MappedAttributeEntry
 nsSVGElement::sMaskMap[] = {
-  { nsGkAtoms::mask_type },
+  { &nsGkAtoms::mask_type },
   { nullptr }
 };
 
 //----------------------------------------------------------------------
 // nsIDOMElement methods
 
 // forwarded to Element implementations
 
--- a/dom/xbl/nsXBLPrototypeBinding.cpp
+++ b/dom/xbl/nsXBLPrototypeBinding.cpp
@@ -1552,26 +1552,26 @@ nsXBLPrototypeBinding::WriteNamespace(ns
 
   return NS_OK;
 }
 
 
 bool CheckTagNameWhiteList(int32_t aNameSpaceID, nsAtom *aTagName)
 {
   static Element::AttrValuesArray kValidXULTagNames[] =  {
-    nsGkAtoms::autorepeatbutton, nsGkAtoms::box, nsGkAtoms::browser,
-    nsGkAtoms::button, nsGkAtoms::hbox, nsGkAtoms::image, nsGkAtoms::menu,
-    nsGkAtoms::menubar, nsGkAtoms::menuitem, nsGkAtoms::menupopup,
-    nsGkAtoms::row, nsGkAtoms::slider, nsGkAtoms::spacer,
-    nsGkAtoms::splitter, nsGkAtoms::text, nsGkAtoms::tree, nullptr};
+    &nsGkAtoms::autorepeatbutton, &nsGkAtoms::box, &nsGkAtoms::browser,
+    &nsGkAtoms::button, &nsGkAtoms::hbox, &nsGkAtoms::image, &nsGkAtoms::menu,
+    &nsGkAtoms::menubar, &nsGkAtoms::menuitem, &nsGkAtoms::menupopup,
+    &nsGkAtoms::row, &nsGkAtoms::slider, &nsGkAtoms::spacer,
+    &nsGkAtoms::splitter, &nsGkAtoms::text, &nsGkAtoms::tree, nullptr};
 
   uint32_t i;
   if (aNameSpaceID == kNameSpaceID_XUL) {
     for (i = 0; kValidXULTagNames[i]; ++i) {
-      if (aTagName == kValidXULTagNames[i]) {
+      if (aTagName == *(kValidXULTagNames[i])) {
         return true;
       }
     }
   }
   else if (aNameSpaceID == kNameSpaceID_SVG &&
            aTagName == nsGkAtoms::generic_) {
     return true;
   }
--- a/dom/xslt/xpath/txCoreFunctionCall.cpp
+++ b/dom/xslt/xpath/txCoreFunctionCall.cpp
@@ -16,56 +16,56 @@
 #include <math.h>
 #include "txStringUtils.h"
 #include "txXMLUtils.h"
 
 using namespace mozilla;
 
 struct txCoreFunctionDescriptor
 {
-    const int8_t mMinParams;
-    const int8_t mMaxParams;
-    const Expr::ResultType mReturnType;
-    const nsStaticAtom* const mName;
+    int8_t mMinParams;
+    int8_t mMaxParams;
+    Expr::ResultType mReturnType;
+    nsStaticAtom** mName;
 };
 
 // This must be ordered in the same order as txCoreFunctionCall::eType.
 // If you change one, change the other.
 static const txCoreFunctionDescriptor descriptTable[] =
 {
-    { 1, 1, Expr::NUMBER_RESULT,  nsGkAtoms::count }, // COUNT
-    { 1, 1, Expr::NODESET_RESULT, nsGkAtoms::id }, // ID
-    { 0, 0, Expr::NUMBER_RESULT,  nsGkAtoms::last }, // LAST
-    { 0, 1, Expr::STRING_RESULT,  nsGkAtoms::localName }, // LOCAL_NAME
-    { 0, 1, Expr::STRING_RESULT,  nsGkAtoms::namespaceUri }, // NAMESPACE_URI
-    { 0, 1, Expr::STRING_RESULT,  nsGkAtoms::name }, // NAME
-    { 0, 0, Expr::NUMBER_RESULT,  nsGkAtoms::position }, // POSITION
+    { 1, 1, Expr::NUMBER_RESULT,  &nsGkAtoms::count }, // COUNT
+    { 1, 1, Expr::NODESET_RESULT, &nsGkAtoms::id }, // ID
+    { 0, 0, Expr::NUMBER_RESULT,  &nsGkAtoms::last }, // LAST
+    { 0, 1, Expr::STRING_RESULT,  &nsGkAtoms::localName }, // LOCAL_NAME
+    { 0, 1, Expr::STRING_RESULT,  &nsGkAtoms::namespaceUri }, // NAMESPACE_URI
+    { 0, 1, Expr::STRING_RESULT,  &nsGkAtoms::name }, // NAME
+    { 0, 0, Expr::NUMBER_RESULT,  &nsGkAtoms::position }, // POSITION
 
-    { 2, -1, Expr::STRING_RESULT, nsGkAtoms::concat }, // CONCAT
-    { 2, 2, Expr::BOOLEAN_RESULT, nsGkAtoms::contains }, // CONTAINS
-    { 0, 1, Expr::STRING_RESULT,  nsGkAtoms::normalizeSpace }, // NORMALIZE_SPACE
-    { 2, 2, Expr::BOOLEAN_RESULT, nsGkAtoms::startsWith }, // STARTS_WITH
-    { 0, 1, Expr::STRING_RESULT,  nsGkAtoms::string }, // STRING
-    { 0, 1, Expr::NUMBER_RESULT,  nsGkAtoms::stringLength }, // STRING_LENGTH
-    { 2, 3, Expr::STRING_RESULT,  nsGkAtoms::substring }, // SUBSTRING
-    { 2, 2, Expr::STRING_RESULT,  nsGkAtoms::substringAfter }, // SUBSTRING_AFTER
-    { 2, 2, Expr::STRING_RESULT,  nsGkAtoms::substringBefore }, // SUBSTRING_BEFORE
-    { 3, 3, Expr::STRING_RESULT,  nsGkAtoms::translate }, // TRANSLATE
+    { 2, -1, Expr::STRING_RESULT, &nsGkAtoms::concat }, // CONCAT
+    { 2, 2, Expr::BOOLEAN_RESULT, &nsGkAtoms::contains }, // CONTAINS
+    { 0, 1, Expr::STRING_RESULT,  &nsGkAtoms::normalizeSpace }, // NORMALIZE_SPACE
+    { 2, 2, Expr::BOOLEAN_RESULT, &nsGkAtoms::startsWith }, // STARTS_WITH
+    { 0, 1, Expr::STRING_RESULT,  &nsGkAtoms::string }, // STRING
+    { 0, 1, Expr::NUMBER_RESULT,  &nsGkAtoms::stringLength }, // STRING_LENGTH
+    { 2, 3, Expr::STRING_RESULT,  &nsGkAtoms::substring }, // SUBSTRING
+    { 2, 2, Expr::STRING_RESULT,  &nsGkAtoms::substringAfter }, // SUBSTRING_AFTER
+    { 2, 2, Expr::STRING_RESULT,  &nsGkAtoms::substringBefore }, // SUBSTRING_BEFORE
+    { 3, 3, Expr::STRING_RESULT,  &nsGkAtoms::translate }, // TRANSLATE
 
-    { 0, 1, Expr::NUMBER_RESULT,  nsGkAtoms::number }, // NUMBER
-    { 1, 1, Expr::NUMBER_RESULT,  nsGkAtoms::round }, // ROUND
-    { 1, 1, Expr::NUMBER_RESULT,  nsGkAtoms::floor }, // FLOOR
-    { 1, 1, Expr::NUMBER_RESULT,  nsGkAtoms::ceiling }, // CEILING
-    { 1, 1, Expr::NUMBER_RESULT,  nsGkAtoms::sum }, // SUM
+    { 0, 1, Expr::NUMBER_RESULT,  &nsGkAtoms::number }, // NUMBER
+    { 1, 1, Expr::NUMBER_RESULT,  &nsGkAtoms::round }, // ROUND
+    { 1, 1, Expr::NUMBER_RESULT,  &nsGkAtoms::floor }, // FLOOR
+    { 1, 1, Expr::NUMBER_RESULT,  &nsGkAtoms::ceiling }, // CEILING
+    { 1, 1, Expr::NUMBER_RESULT,  &nsGkAtoms::sum }, // SUM
 
-    { 1, 1, Expr::BOOLEAN_RESULT, nsGkAtoms::boolean }, // BOOLEAN
-    { 0, 0, Expr::BOOLEAN_RESULT, nsGkAtoms::_false }, // _FALSE
-    { 1, 1, Expr::BOOLEAN_RESULT, nsGkAtoms::lang }, // LANG
-    { 1, 1, Expr::BOOLEAN_RESULT, nsGkAtoms::_not }, // _NOT
-    { 0, 0, Expr::BOOLEAN_RESULT, nsGkAtoms::_true } // _TRUE
+    { 1, 1, Expr::BOOLEAN_RESULT, &nsGkAtoms::boolean }, // BOOLEAN
+    { 0, 0, Expr::BOOLEAN_RESULT, &nsGkAtoms::_false }, // _FALSE
+    { 1, 1, Expr::BOOLEAN_RESULT, &nsGkAtoms::lang }, // LANG
+    { 1, 1, Expr::BOOLEAN_RESULT, &nsGkAtoms::_not }, // _NOT
+    { 0, 0, Expr::BOOLEAN_RESULT, &nsGkAtoms::_true } // _TRUE
 };
 
 
 /*
  * Evaluates this Expr based on the given context node and processor state
  * @param context the context node for evaluation of this Expr
  * @param ps the ContextState containing the stack information needed
  * for evaluation
@@ -718,25 +718,25 @@ txCoreFunctionCall::isSensitiveTo(Contex
 }
 
 // static
 bool
 txCoreFunctionCall::getTypeFromAtom(nsAtom* aName, eType& aType)
 {
     uint32_t i;
     for (i = 0; i < ArrayLength(descriptTable); ++i) {
-        if (aName == descriptTable[i].mName) {
+        if (aName == *descriptTable[i].mName) {
             aType = static_cast<eType>(i);
 
             return true;
         }
     }
 
     return false;
 }
 
 #ifdef TX_TO_STRING
 void
 txCoreFunctionCall::appendName(nsAString& aDest)
 {
-    aDest.Append(descriptTable[mType].mName->GetUTF16String());
+    aDest.Append((*descriptTable[mType].mName)->GetUTF16String());
 }
 #endif
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -4126,17 +4126,17 @@ XULDocument::GetWindowRoot()
 bool
 XULDocument::IsDocumentRightToLeft()
 {
     // setting the localedir attribute on the root element forces a
     // specific direction for the document.
     Element* element = GetRootElement();
     if (element) {
         static Element::AttrValuesArray strings[] =
-            {nsGkAtoms::ltr, nsGkAtoms::rtl, nullptr};
+            {&nsGkAtoms::ltr, &nsGkAtoms::rtl, nullptr};
         switch (element->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::localedir,
                                          strings, eCaseMatters)) {
             case 0: return false;
             case 1: return true;
             default: break; // otherwise, not a valid value, so fall through
         }
     }
 
--- a/image/test/reftest/downscaling/reftest.list
+++ b/image/test/reftest/downscaling/reftest.list
@@ -21,20 +21,20 @@
 # Also note that Mac OS X has its own system-level downscaling algorithm, so
 # tests here may need Mac-specific "fuzzy-if(cocoaWidget,...)" annotations.
 # Similarly, modern versions of Windows have slightly different downscaling
 # behavior than other platforms, and may require "fuzzy-if(winWidget,...)".
 
 
 # RUN TESTS NOT AFFECTED BY DOWNSCALE-DURING-DECODE:
 # ==================================================
-fuzzy-if(skiaContent,14,416) fuzzy-if(webrender,102-102,396-396) fails-if(webrender&&winWidget) == downscale-svg-1a.html downscale-svg-1-ref.html?80
-fuzzy(80,468) fuzzy-if(webrender,65-65,579-579) fails-if(webrender&&winWidget) == downscale-svg-1b.html downscale-svg-1-ref.html?72
+fuzzy-if(skiaContent,14,416) fuzzy-if(webrender,102-102,396-472) == downscale-svg-1a.html downscale-svg-1-ref.html?80
+fuzzy(80,468) fuzzy-if(webrender,65-65,579-580) == downscale-svg-1b.html downscale-svg-1-ref.html?72
 fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),1,62) fuzzy-if(skiaContent,8,292) fuzzy-if(webrender,14-14,316-316) == downscale-svg-1c.html downscale-svg-1-ref.html?64
-fuzzy(17,208) fuzzy-if(webrender,83-83,325-325) fails-if(webrender&&winWidget) == downscale-svg-1d.html downscale-svg-1-ref.html?53
+fuzzy(17,208) fuzzy-if(webrender,83-84,274-325) == downscale-svg-1d.html downscale-svg-1-ref.html?53
 fuzzy(80,216) fuzzy-if(skiaContent,110,181) fuzzy-if(webrender,84-84,216-216) == downscale-svg-1e.html downscale-svg-1-ref.html?40
 fuzzy(51,90) fuzzy-if(skiaContent,142,77) fuzzy-if(webrender,62-62,98-98) == downscale-svg-1f.html downscale-svg-1-ref.html?24
 
 # RUN TESTS WITH DOWNSCALE-DURING-DECODE DISABLED:
 # ================================================
 default-preferences pref(image.downscale-during-decode.enabled,false)
 
 fuzzy-if(winWidget,16,20) fuzzy-if(cocoaWidget,106,31) == downscale-1.html downscale-1-ref.html
--- a/layout/base/PositionedEventTargeting.cpp
+++ b/layout/base/PositionedEventTargeting.cpp
@@ -243,17 +243,17 @@ GetClickableAncestor(nsIFrame* aFrame, n
                                     nsGkAtoms::menuitem,
                                     nsGkAtoms::menulist,
                                     nsGkAtoms::scrollbarbutton,
                                     nsGkAtoms::resizer)) {
       return content;
     }
 
     static Element::AttrValuesArray clickableRoles[] =
-      { nsGkAtoms::button, nsGkAtoms::key, nullptr };
+      { &nsGkAtoms::button, &nsGkAtoms::key, nullptr };
     if (content->IsElement() &&
         content->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::role,
                                               clickableRoles, eIgnoreCase) >= 0) {
       return content;
     }
     if (content->IsEditable()) {
       return content;
     }
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -391,17 +391,17 @@ GetFieldSetBlockFrame(nsIFrame* aFieldse
   nsIFrame* inner = firstChild && firstChild->GetNextSibling() ? firstChild->GetNextSibling() : firstChild;
   return inner ? inner->GetContentInsertionFrame() : nullptr;
 }
 
 #define FCDATA_DECL(_flags, _func)                            \
   { _flags, { (FrameCreationFunc)_func }, nullptr, nullptr }
 #define FCDATA_WITH_WRAPPING_BLOCK(_flags, _func, _anon_box)  \
   { _flags | FCDATA_CREATE_BLOCK_WRAPPER_FOR_ALL_KIDS,        \
-      { (FrameCreationFunc)_func }, nullptr, _anon_box }
+      { (FrameCreationFunc)_func }, nullptr, &_anon_box }
 
 #define UNREACHABLE_FCDATA()                                  \
   { 0, { (FrameCreationFunc)nullptr }, nullptr, nullptr }
 //----------------------------------------------------------------------
 
 /**
  * True if aFrame is an actual inline frame in the sense of non-replaced
  * display:inline CSS boxes.  In other words, it can be affected by {ib}
@@ -3504,17 +3504,17 @@ nsCSSFrameConstructor::FindDataByTag(nsA
 {
   if (aTagFound) {
     *aTagFound = false;
   }
   for (const FrameConstructionDataByTag *curData = aDataPtr,
          *endData = aDataPtr + aDataLength;
        curData != endData;
        ++curData) {
-    if (curData->mTag == aTag) {
+    if (*curData->mTag == aTag) {
       if (aTagFound) {
         *aTagFound = true;
       }
       const FrameConstructionData* data = &curData->mData;
       if (data->mBits & FCDATA_FUNC_IS_DATA_GETTER) {
         return data->mFunc.mDataGetter(aElement, aComputedStyle);
       }
 
@@ -3528,21 +3528,21 @@ nsCSSFrameConstructor::FindDataByTag(nsA
 #define SUPPRESS_FCDATA() FCDATA_DECL(FCDATA_SUPPRESS_FRAME, nullptr)
 #define SIMPLE_INT_CREATE(_int, _func) { _int, SIMPLE_FCDATA(_func) }
 #define SIMPLE_INT_CHAIN(_int, _func)                       \
   { _int, FCDATA_DECL(FCDATA_FUNC_IS_DATA_GETTER, _func) }
 #define COMPLEX_INT_CREATE(_int, _func)         \
   { _int, FULL_CTOR_FCDATA(0, _func) }
 
 #define SIMPLE_TAG_CREATE(_tag, _func)          \
-  { nsGkAtoms::_tag, SIMPLE_FCDATA(_func) }
+  { &nsGkAtoms::_tag, SIMPLE_FCDATA(_func) }
 #define SIMPLE_TAG_CHAIN(_tag, _func)                                   \
-  { nsGkAtoms::_tag, FCDATA_DECL(FCDATA_FUNC_IS_DATA_GETTER,  _func) }
+  { &nsGkAtoms::_tag, FCDATA_DECL(FCDATA_FUNC_IS_DATA_GETTER,  _func) }
 #define COMPLEX_TAG_CREATE(_tag, _func)             \
-  { nsGkAtoms::_tag, FULL_CTOR_FCDATA(0, _func) }
+  { &nsGkAtoms::_tag, FULL_CTOR_FCDATA(0, _func) }
 
 static bool
 IsFrameForFieldSet(nsIFrame* aFrame)
 {
   nsAtom* pseudo = aFrame->Style()->GetPseudo();
   if (pseudo == nsCSSAnonBoxes::fieldsetContent ||
       pseudo == nsCSSAnonBoxes::scrolledContent ||
       pseudo == nsCSSAnonBoxes::columnContent) {
@@ -3582,33 +3582,33 @@ nsCSSFrameConstructor::FindHTMLData(Elem
     // not do special legend stuff.
     return nullptr;
   }
 
   static const FrameConstructionDataByTag sHTMLData[] = {
     SIMPLE_TAG_CHAIN(img, nsCSSFrameConstructor::FindImgData),
     SIMPLE_TAG_CHAIN(mozgeneratedcontentimage,
                      nsCSSFrameConstructor::FindImgData),
-    { nsGkAtoms::br,
+    { &nsGkAtoms::br,
       FCDATA_DECL(FCDATA_IS_LINE_PARTICIPANT | FCDATA_IS_LINE_BREAK,
                   NS_NewBRFrame) },
     SIMPLE_TAG_CREATE(wbr, NS_NewWBRFrame),
     SIMPLE_TAG_CHAIN(input, nsCSSFrameConstructor::FindInputData),
     SIMPLE_TAG_CREATE(textarea, NS_NewTextControlFrame),
     COMPLEX_TAG_CREATE(select, &nsCSSFrameConstructor::ConstructSelectFrame),
     SIMPLE_TAG_CHAIN(object, nsCSSFrameConstructor::FindObjectData),
     SIMPLE_TAG_CHAIN(embed, nsCSSFrameConstructor::FindObjectData),
     COMPLEX_TAG_CREATE(fieldset,
                        &nsCSSFrameConstructor::ConstructFieldSetFrame),
-    { nsGkAtoms::legend,
+    { &nsGkAtoms::legend,
       FCDATA_DECL(FCDATA_ALLOW_BLOCK_STYLES | FCDATA_MAY_NEED_SCROLLFRAME,
                   NS_NewLegendFrame) },
     SIMPLE_TAG_CREATE(frameset, NS_NewHTMLFramesetFrame),
     SIMPLE_TAG_CREATE(iframe, NS_NewSubDocumentFrame),
-    { nsGkAtoms::button,
+    { &nsGkAtoms::button,
       FCDATA_WITH_WRAPPING_BLOCK(FCDATA_ALLOW_BLOCK_STYLES |
                                  FCDATA_ALLOW_GRID_FLEX_COLUMNSET,
                                  NS_NewHTMLButtonControlFrame,
                                  nsCSSAnonBoxes::buttonContent) },
     SIMPLE_TAG_CHAIN(canvas, nsCSSFrameConstructor::FindCanvasData),
     SIMPLE_TAG_CREATE(video, NS_NewHTMLVideoFrame),
     SIMPLE_TAG_CREATE(audio, NS_NewHTMLVideoFrame),
     SIMPLE_TAG_CREATE(progress, NS_NewProgressFrame),
@@ -3890,17 +3890,18 @@ nsCSSFrameConstructor::ConstructFrameFro
     // If we need to create a block formatting context to wrap our
     // kids, do it now.
     const nsStyleDisplay* maybeAbsoluteContainingBlockDisplay = display;
     nsIFrame* maybeAbsoluteContainingBlockStyleFrame = primaryFrame;
     nsIFrame* maybeAbsoluteContainingBlock = newFrame;
     nsIFrame* possiblyLeafFrame = newFrame;
     if (bits & FCDATA_CREATE_BLOCK_WRAPPER_FOR_ALL_KIDS) {
       RefPtr<ComputedStyle> outerSC = mPresShell->StyleSet()->
-        ResolveInheritingAnonymousBoxStyle(data->mAnonBoxPseudo, computedStyle);
+        ResolveInheritingAnonymousBoxStyle(*data->mAnonBoxPseudo,
+                                           computedStyle);
 #ifdef DEBUG
       nsContainerFrame* containerFrame = do_QueryFrame(newFrame);
       MOZ_ASSERT(containerFrame);
 #endif
       nsContainerFrame* container = static_cast<nsContainerFrame*>(newFrame);
       nsContainerFrame* outerFrame;
       nsContainerFrame* innerFrame;
       if (bits & FCDATA_ALLOW_GRID_FLEX_COLUMNSET) {
@@ -4269,19 +4270,19 @@ bool IsXULDisplayType(const nsStyleDispl
               FCDATA_MAY_NEED_SCROLLFRAME, _func)
 // .. but we allow some XUL frames to be _containers_ for out-of-flow content
 // (This is the same as SCROLLABLE_XUL_FCDATA, but w/o FCDATA_SKIP_ABSPOS_PUSH)
 #define SCROLLABLE_ABSPOS_CONTAINER_XUL_FCDATA(_func)                   \
   FCDATA_DECL(FCDATA_DISALLOW_OUT_OF_FLOW |                             \
               FCDATA_MAY_NEED_SCROLLFRAME, _func)
 
 #define SIMPLE_XUL_CREATE(_tag, _func)            \
-  { nsGkAtoms::_tag, SIMPLE_XUL_FCDATA(_func) }
+  { &nsGkAtoms::_tag, SIMPLE_XUL_FCDATA(_func) }
 #define SCROLLABLE_XUL_CREATE(_tag, _func)            \
-  { nsGkAtoms::_tag, SCROLLABLE_XUL_FCDATA(_func) }
+  { &nsGkAtoms::_tag, SCROLLABLE_XUL_FCDATA(_func) }
 #define SIMPLE_XUL_DISPLAY_CREATE(_display, _func)      \
   FCDATA_FOR_DISPLAY(_display, SIMPLE_XUL_FCDATA(_func))
 #define SCROLLABLE_XUL_DISPLAY_CREATE(_display, _func)                          \
   FCDATA_FOR_DISPLAY(_display, SCROLLABLE_XUL_FCDATA(_func))
 #define SCROLLABLE_ABSPOS_CONTAINER_XUL_DISPLAY_CREATE(_display, _func)         \
   FCDATA_FOR_DISPLAY(_display, SCROLLABLE_ABSPOS_CONTAINER_XUL_FCDATA(_func))
 
 static
@@ -5059,20 +5060,20 @@ nsCSSFrameConstructor::FlushAccumulatedB
   NS_ASSERTION(aBlockItems.IsEmpty(), "What happened?");
   aBlockItems.Clear();
   aNewItems.AddChild(blockFrame);
 }
 
 // Only <math> elements can be floated or positioned.  All other MathML
 // should be in-flow.
 #define SIMPLE_MATHML_CREATE(_tag, _func)                               \
-  { nsGkAtoms::_tag,                                                    \
-    FCDATA_DECL(FCDATA_DISALLOW_OUT_OF_FLOW |                           \
-                FCDATA_FORCE_NULL_ABSPOS_CONTAINER |                    \
-                FCDATA_WRAP_KIDS_IN_BLOCKS, _func) }
+  { &nsGkAtoms::_tag,                                                   \
+      FCDATA_DECL(FCDATA_DISALLOW_OUT_OF_FLOW |                         \
+                  FCDATA_FORCE_NULL_ABSPOS_CONTAINER |                  \
+                  FCDATA_WRAP_KIDS_IN_BLOCKS, _func) }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindMathMLData(Element* aElement,
                                       nsAtom* aTag,
                                       int32_t aNameSpaceID,
                                       ComputedStyle* aComputedStyle)
 {
@@ -5237,17 +5238,17 @@ nsCSSFrameConstructor::ConstructMarker(n
 
 // Only outer <svg> elements can be floated or positioned.  All other SVG
 // should be in-flow.
 #define SIMPLE_SVG_FCDATA(_func)                                        \
   FCDATA_DECL(FCDATA_DISALLOW_OUT_OF_FLOW |                             \
               FCDATA_SKIP_ABSPOS_PUSH |                                 \
               FCDATA_DISALLOW_GENERATED_CONTENT,  _func)
 #define SIMPLE_SVG_CREATE(_tag, _func)            \
-  { nsGkAtoms::_tag, SIMPLE_SVG_FCDATA(_func) }
+  { &nsGkAtoms::_tag, SIMPLE_SVG_FCDATA(_func) }
 
 static bool
 IsFilterPrimitiveChildTag(const nsAtom* aTag)
 {
   return aTag == nsGkAtoms::feDistantLight ||
          aTag == nsGkAtoms::fePointLight ||
          aTag == nsGkAtoms::feSpotLight ||
          aTag == nsGkAtoms::feFuncR ||
@@ -5440,22 +5441,22 @@ nsCSSFrameConstructor::FindSVGData(Eleme
     SIMPLE_SVG_CREATE(polyline, NS_NewSVGGeometryFrame),
     SIMPLE_SVG_CREATE(circle, NS_NewSVGGeometryFrame),
     SIMPLE_SVG_CREATE(ellipse, NS_NewSVGGeometryFrame),
     SIMPLE_SVG_CREATE(line, NS_NewSVGGeometryFrame),
     SIMPLE_SVG_CREATE(rect, NS_NewSVGGeometryFrame),
     SIMPLE_SVG_CREATE(path, NS_NewSVGGeometryFrame),
     SIMPLE_SVG_CREATE(defs, NS_NewSVGContainerFrame),
     SIMPLE_SVG_CREATE(generic_, NS_NewSVGGenericContainerFrame),
-    { nsGkAtoms::text,
+    { &nsGkAtoms::text,
       FCDATA_WITH_WRAPPING_BLOCK(FCDATA_DISALLOW_OUT_OF_FLOW |
                                  FCDATA_ALLOW_BLOCK_STYLES,
                                  NS_NewSVGTextFrame,
                                  nsCSSAnonBoxes::mozSVGText) },
-    { nsGkAtoms::foreignObject,
+    { &nsGkAtoms::foreignObject,
       FCDATA_WITH_WRAPPING_BLOCK(FCDATA_DISALLOW_OUT_OF_FLOW,
                                  NS_NewSVGForeignObjectFrame,
                                  nsCSSAnonBoxes::mozSVGForeignContent) },
     SIMPLE_SVG_CREATE(a, NS_NewSVGAFrame),
     SIMPLE_SVG_CREATE(linearGradient, NS_NewSVGLinearGradientFrame),
     SIMPLE_SVG_CREATE(radialGradient, NS_NewSVGRadialGradientFrame),
     SIMPLE_SVG_CREATE(stop, NS_NewSVGStopFrame),
     SIMPLE_SVG_CREATE(use, NS_NewSVGUseFrame),
@@ -9325,92 +9326,92 @@ nsCSSFrameConstructor::ShouldHaveSpecial
 const nsCSSFrameConstructor::PseudoParentData
 nsCSSFrameConstructor::sPseudoParentData[eParentTypeCount] = {
   { // Cell
     FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
                      FCDATA_USE_CHILD_ITEMS |
                      FCDATA_IS_WRAPPER_ANON_BOX |
                      FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRow),
                      &nsCSSFrameConstructor::ConstructTableCell),
-    nsCSSAnonBoxes::tableCell
+    &nsCSSAnonBoxes::tableCell
   },
   { // Row
     FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
                      FCDATA_USE_CHILD_ITEMS |
                      FCDATA_IS_WRAPPER_ANON_BOX |
                      FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRowGroup),
                      &nsCSSFrameConstructor::ConstructTableRowOrRowGroup),
-    nsCSSAnonBoxes::tableRow
+    &nsCSSAnonBoxes::tableRow
   },
   { // Row group
     FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
                      FCDATA_USE_CHILD_ITEMS |
                      FCDATA_IS_WRAPPER_ANON_BOX |
                      FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
                      &nsCSSFrameConstructor::ConstructTableRowOrRowGroup),
-    nsCSSAnonBoxes::tableRowGroup
+    &nsCSSAnonBoxes::tableRowGroup
   },
   { // Column group
     FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
                 FCDATA_DISALLOW_OUT_OF_FLOW | FCDATA_USE_CHILD_ITEMS |
                 FCDATA_SKIP_ABSPOS_PUSH |
                 // Not FCDATA_IS_WRAPPER_ANON_BOX, because we don't need to
                 // restyle these: they have non-inheriting styles.
                 FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
                 NS_NewTableColGroupFrame),
-    nsCSSAnonBoxes::tableColGroup
+    &nsCSSAnonBoxes::tableColGroup
   },
   { // Table
     FULL_CTOR_FCDATA(FCDATA_SKIP_FRAMESET | FCDATA_USE_CHILD_ITEMS |
                      FCDATA_IS_WRAPPER_ANON_BOX,
                      &nsCSSFrameConstructor::ConstructTable),
-    nsCSSAnonBoxes::table
+    &nsCSSAnonBoxes::table
   },
   { // Ruby
     FCDATA_DECL(FCDATA_IS_LINE_PARTICIPANT |
                 FCDATA_USE_CHILD_ITEMS |
                 FCDATA_IS_WRAPPER_ANON_BOX |
                 FCDATA_SKIP_FRAMESET,
                 NS_NewRubyFrame),
-    nsCSSAnonBoxes::ruby
+    &nsCSSAnonBoxes::ruby
   },
   { // Ruby Base
     FCDATA_DECL(FCDATA_USE_CHILD_ITEMS |
                 FCDATA_IS_LINE_PARTICIPANT |
                 FCDATA_IS_WRAPPER_ANON_BOX |
                 FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRubyBaseContainer) |
                 FCDATA_SKIP_FRAMESET,
                 NS_NewRubyBaseFrame),
-    nsCSSAnonBoxes::rubyBase
+    &nsCSSAnonBoxes::rubyBase
   },
   { // Ruby Base Container
     FCDATA_DECL(FCDATA_USE_CHILD_ITEMS |
                 FCDATA_IS_LINE_PARTICIPANT |
                 FCDATA_IS_WRAPPER_ANON_BOX |
                 FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRuby) |
                 FCDATA_SKIP_FRAMESET,
                 NS_NewRubyBaseContainerFrame),
-    nsCSSAnonBoxes::rubyBaseContainer
+    &nsCSSAnonBoxes::rubyBaseContainer
   },
   { // Ruby Text
     FCDATA_DECL(FCDATA_USE_CHILD_ITEMS |
                 FCDATA_IS_LINE_PARTICIPANT |
                 FCDATA_IS_WRAPPER_ANON_BOX |
                 FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRubyTextContainer) |
                 FCDATA_SKIP_FRAMESET,
                 NS_NewRubyTextFrame),
-    nsCSSAnonBoxes::rubyText
+    &nsCSSAnonBoxes::rubyText
   },
   { // Ruby Text Container
     FCDATA_DECL(FCDATA_USE_CHILD_ITEMS |
                 FCDATA_IS_WRAPPER_ANON_BOX |
                 FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRuby) |
                 FCDATA_SKIP_FRAMESET,
                 NS_NewRubyTextContainerFrame),
-    nsCSSAnonBoxes::rubyTextContainer
+    &nsCSSAnonBoxes::rubyTextContainer
   }
 };
 
 void
 nsCSSFrameConstructor::CreateNeededAnonFlexOrGridItems(
   nsFrameConstructorState& aState,
   FrameConstructionItemList& aItems,
   nsIFrame* aParentFrame)
@@ -9969,17 +9970,17 @@ nsCSSFrameConstructor::CreateNeededPseud
 void
 nsCSSFrameConstructor::WrapItemsInPseudoParent(nsIContent* aParentContent,
                                                ComputedStyle* aParentStyle,
                                                ParentType aWrapperType,
                                                FCItemIterator& aIter,
                                                const FCItemIterator& aEndIter)
 {
   const PseudoParentData& pseudoData = sPseudoParentData[aWrapperType];
-  nsICSSAnonBoxPseudo* pseudoType = pseudoData.mPseudoType;
+  nsAtom* pseudoType = *pseudoData.mPseudoType;
   StyleDisplay parentDisplay = aParentStyle->StyleDisplay()->mDisplay;
 
   if (pseudoType == nsCSSAnonBoxes::table &&
       (parentDisplay == StyleDisplay::Inline ||
        parentDisplay == StyleDisplay::RubyBase ||
        parentDisplay == StyleDisplay::RubyText)) {
     pseudoType = nsCSSAnonBoxes::inlineTable;
   }
@@ -10052,17 +10053,17 @@ nsCSSFrameConstructor::CreateNeededPseud
     return;
   }
   NS_ASSERTION(firstDisplay == StyleDisplay::RubyTextContainer,
                "Child of ruby frame should either a rbc or a rtc");
 
   const PseudoParentData& pseudoData =
     sPseudoParentData[eTypeRubyBaseContainer];
   already_AddRefed<ComputedStyle> pseudoStyle = mPresShell->StyleSet()->
-    ResolveInheritingAnonymousBoxStyle(pseudoData.mPseudoType,
+    ResolveInheritingAnonymousBoxStyle(*pseudoData.mPseudoType,
                                        aParentFrame->Style());
   FrameConstructionItem* newItem =
     new (this) FrameConstructionItem(&pseudoData.mFCData,
                                      // Use the content of the parent frame
                                      aParentFrame->GetContent(),
                                      // no pending binding
                                      nullptr,
                                      pseudoStyle,
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -734,25 +734,27 @@ private:
     // FrameFullConstructor to see what the functions would do.
     union Func {
       FrameCreationFunc mCreationFunc;
       FrameConstructionDataGetter mDataGetter;
     } mFunc;
     FrameFullConstructor mFullConstructor;
     // For cases when FCDATA_CREATE_BLOCK_WRAPPER_FOR_ALL_KIDS is set, the
     // anonymous box type to use for that wrapper.
-    nsICSSAnonBoxPseudo* const mAnonBoxPseudo;
+    nsICSSAnonBoxPseudo * const * const mAnonBoxPseudo;
   };
 
   /* Structure representing a mapping of an atom to a FrameConstructionData.
      This can be used with non-static atoms, assuming that the nsAtom* is
      stored somewhere that this struct can point to (that is, a static
      nsAtom*) and that it's allocated before the struct is ever used. */
   struct FrameConstructionDataByTag {
-    const nsStaticAtom* const mTag;
+    // Pointer to nsStaticAtom* is used because we want to initialize this
+    // statically, so before our atom tables are set up.
+    const nsStaticAtom * const * const mTag;
     const FrameConstructionData mData;
   };
 
   /* Structure representing a mapping of an integer to a
      FrameConstructionData. There are no magic integer values here. */
   struct FrameConstructionDataByInt {
     /* Could be used for display or whatever else */
     const int32_t mInt;
@@ -773,17 +775,17 @@ private:
 #define FCDATA_FOR_DISPLAY(_display, _fcdata) \
   { _fcdata }
 #endif
 
   /* Structure that has a FrameConstructionData and style pseudo-type
      for a table pseudo-frame */
   struct PseudoParentData {
     const FrameConstructionData mFCData;
-    nsICSSAnonBoxPseudo* const mPseudoType;
+    nsICSSAnonBoxPseudo * const * const mPseudoType;
   };
   /* Array of such structures that we use to properly construct table
      pseudo-frames as needed */
   static const PseudoParentData sPseudoParentData[eParentTypeCount];
 
   /* A function that takes an integer, content, style, and array of
      FrameConstructionDataByInts and finds the appropriate frame construction
      data to use and returns it.  This can return null if none of the integers
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -2402,21 +2402,16 @@ nsDocumentViewer::CreateStyleSet(nsIDocu
     // !!! SVGDocument::EnsureNonSVGUserAgentStyleSheetsLoaded.
 
     // SVGForeignObjectElement::BindToTree calls SVGDocument::
     // EnsureNonSVGUserAgentStyleSheetsLoaded to loads these UA sheet
     // on-demand. (Excluding the quirks sheet, which should never be loaded for
     // an SVG document, and excluding xul.css which will be loaded on demand by
     // nsXULElement::BindToTree.)
 
-    sheet = cache->NumberControlSheet();
-    if (sheet) {
-      styleSet->PrependStyleSheet(SheetType::Agent, sheet->AsServo());
-    }
-
     sheet = cache->FormsSheet();
     if (sheet) {
       styleSet->PrependStyleSheet(SheetType::Agent, sheet->AsServo());
     }
 
     if (aDocument->LoadsFullXULStyleSheetUpFront()) {
       // This is the only place components.css gets loaded, unlike xul.css
       sheet = cache->XULComponentsSheet();
--- a/layout/generic/nsImageMap.cpp
+++ b/layout/generic/nsImageMap.cpp
@@ -788,20 +788,20 @@ nsImageMap::UpdateAreas()
   }
 #endif
 }
 
 void
 nsImageMap::AddArea(HTMLAreaElement* aArea)
 {
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::rect, nsGkAtoms::rectangle,
-     nsGkAtoms::circle, nsGkAtoms::circ,
-     nsGkAtoms::_default,
-     nsGkAtoms::poly, nsGkAtoms::polygon,
+    {&nsGkAtoms::rect, &nsGkAtoms::rectangle,
+     &nsGkAtoms::circle, &nsGkAtoms::circ,
+     &nsGkAtoms::_default,
+     &nsGkAtoms::poly, &nsGkAtoms::polygon,
      nullptr};
 
   UniquePtr<Area> area;
   switch (aArea->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::shape,
                                  strings, eIgnoreCase)) {
   case Element::ATTR_VALUE_NO_MATCH:
   case Element::ATTR_MISSING:
   case 0:
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -401,27 +401,31 @@ static void InsertNoDuplicates(nsTArray<
     return;
   }
   aArray.InsertElementAt(i, aString);
 }
 
 static void GetKeywordsForProperty(const nsCSSPropertyID aProperty,
                                    nsTArray<nsString>& aArray)
 {
+  const nsCSSProps::KTableEntry* keywordTable;
   if (nsCSSProps::IsShorthand(aProperty)) {
-    // Shorthand props have no keywords.
-    return;
-  }
-  const nsCSSProps::KTableEntry* keywordTable =
-    nsCSSProps::kKeywordTableTable[aProperty];
-
-  // Special cases where nsCSSPropList.h doesn't hold the table.
-  if (keywordTable == nullptr) {
-    if (aProperty == eCSSProperty_clip_path) {
-      keywordTable = nsCSSProps::kClipPathGeometryBoxKTable;
+    if (aProperty == eCSSProperty_font) {
+      keywordTable = nsCSSProps::kFontKTable;
+    } else {
+      // Other shorthand props have no keywords.
+      return;
+    }
+  } else {
+    keywordTable = nsCSSProps::kKeywordTableTable[aProperty];
+    // Special cases where nsCSSPropList.h doesn't hold the table.
+    if (keywordTable == nullptr) {
+      if (aProperty == eCSSProperty_clip_path) {
+        keywordTable = nsCSSProps::kClipPathGeometryBoxKTable;
+      }
     }
   }
 
   if (keywordTable) {
     for (size_t i = 0; !keywordTable[i].IsSentinel(); ++i) {
       nsCSSKeyword word = keywordTable[i].mKeyword;
 
       // These are extra -moz values which are added while rebuilding
@@ -793,16 +797,18 @@ InspectorUtils::GetCSSValuesForProperty(
                                          CSSEnabledState::eForAllContent) {
       // Get colors (once) first.
       uint32_t propertyParserVariant = nsCSSProps::ParserVariant(*subproperty);
       if (propertyParserVariant & VARIANT_COLOR) {
         GetColorsForProperty(propertyParserVariant, aResult);
         break;
       }
     }
+    // Some shorthands may have keywords not available in subproperties.
+    GetKeywordsForProperty(propertyID, aResult);
     CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(subproperty, propertyID,
                                          CSSEnabledState::eForAllContent) {
       uint32_t propertyParserVariant = nsCSSProps::ParserVariant(*subproperty);
       GetKeywordsForProperty(*subproperty, aResult);
       GetOtherValuesForProperty(propertyParserVariant, aResult);
     }
   }
   // All CSS properties take initial, inherit and unset.
--- a/layout/reftests/backgrounds/gradient/reftest.list
+++ b/layout/reftests/backgrounds/gradient/reftest.list
@@ -1,3 +1,3 @@
 == scaled-color-stop-position.html scaled-color-stop-position-ref.html
 == color-stop-clamp-interpolation.html color-stop-clamp-interpolation-ref.html
-fails-if(webrender&&winWidget) == linear-gradient-repeated.html linear-gradient-repeated-ref.html
+fuzzy-if(webrender&&winWidget,2-2,72-72) == linear-gradient-repeated.html linear-gradient-repeated-ref.html
--- a/layout/reftests/backgrounds/reftest.list
+++ b/layout/reftests/backgrounds/reftest.list
@@ -173,15 +173,15 @@ fuzzy(80,500) fuzzy-if(skiaContent,109,9
 
 fuzzy-if(skiaContent,1,8) fuzzy-if(webrender,1,84) == background-multiple-with-border-radius.html background-multiple-with-border-radius-ref.html
 == background-repeat-large-area.html background-repeat-large-area-ref.html
 
 fuzzy(30,474) fuzzy-if(skiaContent,31,474) == background-tiling-zoom-1.html background-tiling-zoom-1-ref.html
 
 skip-if(!cocoaWidget) == background-repeat-resampling.html background-repeat-resampling-ref.html
 
-fuzzy-if(winWidget,102,2032) fuzzy-if(skiaContent,102,2811) fails-if(webrender&&winWidget) == background-clip-text-1a.html background-clip-text-1-ref.html
-fuzzy-if(winWidget,102,2032) fuzzy-if(skiaContent,102,2811) fails-if(webrender&&winWidget) == background-clip-text-1b.html background-clip-text-1-ref.html
-fuzzy-if(winWidget,102,2032) fuzzy-if(skiaContent,102,2811) fails-if(webrender&&winWidget) == background-clip-text-1c.html background-clip-text-1-ref.html
-fuzzy-if(winWidget,102,2032) fuzzy-if(skiaContent,102,2811) fails-if(webrender&&winWidget) == background-clip-text-1d.html background-clip-text-1-ref.html
-fuzzy-if(winWidget,102,2032) fuzzy-if(skiaContent,102,2811) fails-if(webrender&&winWidget) == background-clip-text-1e.html background-clip-text-1-ref.html
+fuzzy-if(winWidget,102,2032) fuzzy-if(skiaContent,102,2811) fuzzy-if(webrender&&winWidget,153-153,2866-2866) == background-clip-text-1a.html background-clip-text-1-ref.html
+fuzzy-if(winWidget,102,2032) fuzzy-if(skiaContent,102,2811) fuzzy-if(webrender&&winWidget,153-153,2866-2866) == background-clip-text-1b.html background-clip-text-1-ref.html
+fuzzy-if(winWidget,102,2032) fuzzy-if(skiaContent,102,2811) fuzzy-if(webrender&&winWidget,153-153,2866-2866) == background-clip-text-1c.html background-clip-text-1-ref.html
+fuzzy-if(winWidget,102,2032) fuzzy-if(skiaContent,102,2811) fuzzy-if(webrender&&winWidget,153-153,2866-2866) == background-clip-text-1d.html background-clip-text-1-ref.html
+fuzzy-if(winWidget,102,2032) fuzzy-if(skiaContent,102,2811) fuzzy-if(webrender&&winWidget,153-153,2866-2866) == background-clip-text-1e.html background-clip-text-1-ref.html
 
 == background-clip-text-2.html background-clip-text-2-ref.html
--- a/layout/reftests/border-image/reftest.list
+++ b/layout/reftests/border-image/reftest.list
@@ -6,18 +6,18 @@
 # This is fuzzy temporarily until bug 1044702 makes it possible to use source
 # clipping on Windows. (Any other fix would have a significant perf cost.)
 fuzzy-if(winWidget,1,1) == multicolor-image-2.html multicolor-image-2-ref.html
 == multicolor-image-3.html multicolor-image-3-ref.html
 == multicolor-image-4.html multicolor-image-4-ref.html
 == multicolor-image-5.html multicolor-image-5-ref.html
 == transparent-image-1.html transparent-image-1-ref.html
 != repeat-image-1.html repeat-image-1-ref.html
-fuzzy-if(webrender,15-15,975-975) fails-if(webrender&&winWidget) == 470250-1.html 470250-1-ref.html
-fuzzy-if(webrender,15-15,975-975) fails-if(webrender&&winWidget) == 470250-2.html 470250-2-ref.html
+fuzzy-if(webrender,15-15,975-986) == 470250-1.html 470250-1-ref.html
+fuzzy-if(webrender,15-15,975-986) == 470250-2.html 470250-2-ref.html
 != different-h-v-1.html different-h-v-ref.html
 != different-h-v-2.html different-h-v-ref.html
 != different-h-v-1.html different-h-v-2.html
 == center-scaling-1.html center-scaling-1-ref.html
 fails-if(Android) fails-if(usesRepeatResampling) == center-scaling-2.html center-scaling-2-ref.html # Android: very different scaling (blurriness) on some sides
 fails-if(Android) fails-if(usesRepeatResampling) == center-scaling-3.html center-scaling-3-ref.html # Android: very different scaling (blurriness) on some sides
 == center-scaling-4t.html center-scaling-4t-ref.html
 == center-scaling-4r.html center-scaling-4r-ref.html
@@ -38,48 +38,48 @@ fails-if(Android) fails-if(usesRepeatRes
 == border-image-outset-resize-1.html border-image-outset-resize-1-ref.html
 fuzzy-if(asyncPan&&!layersGPUAccelerated,140,514) fuzzy-if(winWidget&&stylo,144,448) == border-image-outset-move-1.html border-image-outset-move-1-ref.html
 == border-image-style-none.html border-image-style-none-ref.html
 == border-image-style-none-length.html border-image-style-none-length-ref.html
 == border-image-style-none-auto.html border-image-style-none-auto-ref.html
 
 # border images with gradients
 fuzzy-if(webrender,1-1,1488-1804) == border-image-linear-gradient.html border-image-linear-gradient-ref.html
-fuzzy(1,98) fuzzy-if(skiaContent,1,350) fuzzy-if(webrender,1-1,37537-37537) fails-if(webrender&&winWidget) == border-image-linear-gradient-slice-1.html border-image-linear-gradient-slice-1-ref.html
-fuzzy(1,149) fuzzy-if(OSX,1,10595) fuzzy-if(webrender,1,25007) fails-if(webrender&&winWidget) == border-image-linear-gradient-slice-2.html border-image-linear-gradient-slice-2-ref.html
-fuzzy(1,433) fuzzy-if(skiaContent,1,2500) fuzzy-if(webrender,1,85584) fails-if(webrender&&winWidget) == border-image-linear-gradient-slice-fill-1.html border-image-linear-gradient-slice-fill-1-ref.html
-fuzzy(1,177) fuzzy-if(OSX,1,25771) fuzzy-if(skiaContent&&!Android,1,400) fuzzy-if(Android,1,6093) fuzzy-if(webrender,1,57412) fails-if(webrender&&winWidget) == border-image-linear-gradient-slice-fill-2.html border-image-linear-gradient-slice-fill-2-ref.html
-fuzzy(1,48)  fuzzy-if(OSX,5,1676) fuzzy-if(webrender,1,4479) fails-if(webrender&&winWidget) == border-image-linear-gradient-width.html border-image-linear-gradient-width-ref.html
-fuzzy(1,5000) fuzzy-if(OSX,1,15000) fuzzy-if(webrender,2,58670) == border-image-linear-gradient-slice-width.html border-image-linear-gradient-slice-width-ref.html
-fuzzy(1,3000) fuzzy-if(OSX,1,6000) fuzzy-if(webrender,1,26302) fails-if(webrender&&winWidget) == border-image-linear-gradient-outset.html border-image-linear-gradient-outset-ref.html
-fuzzy(1,12) fuzzy-if(skiaContent,1,400) fuzzy-if(webrender,1-1,26872-26872) fails-if(webrender&&winWidget) == border-image-linear-gradient-repeat-repeat-1.html border-image-linear-gradient-repeat-repeat-1-ref.html
-fuzzy(1,13) fuzzy-if(skiaContent,1,300) fuzzy-if(webrender,1-1,27131-27131) fails-if(webrender&&winWidget) == border-image-linear-gradient-repeat-round-1.html border-image-linear-gradient-repeat-round-1-ref.html
-fuzzy-if(webrender,1-1,65098-65098) fails-if(webrender&&winWidget) == border-image-linear-gradient-repeat-repeat-2.html border-image-linear-gradient-repeat-repeat-2-ref.html
-fuzzy(1,576) fuzzy-if(skiaContent,1,2000) fuzzy-if(webrender,1-1,64806-64806) fails-if(webrender&&winWidget) == border-image-linear-gradient-repeat-round-2.html border-image-linear-gradient-repeat-round-2-ref.html
-fuzzy(1,8533) fuzzy-if(webrender,1,85925) fails-if(webrender&&winWidget) == border-image-linear-gradient-repeat-repeat-3.html border-image-linear-gradient-repeat-repeat-3-ref.html
-fuzzy(1,7161) fuzzy-if(webrender,2,107112) fails-if(webrender&&winWidget) == border-image-linear-gradient-repeat-round-3.html border-image-linear-gradient-repeat-round-3-ref.html
+fuzzy(1,98) fuzzy-if(skiaContent,1,350) fuzzy-if(webrender,1-2,37234-37537) == border-image-linear-gradient-slice-1.html border-image-linear-gradient-slice-1-ref.html
+fuzzy(1,149) fuzzy-if(OSX,1,10595) fuzzy-if(webrender,1-3,24999-25007) == border-image-linear-gradient-slice-2.html border-image-linear-gradient-slice-2-ref.html
+fuzzy(1,433) fuzzy-if(skiaContent,1,2500) fuzzy-if(webrender,1-3,84860-85584) == border-image-linear-gradient-slice-fill-1.html border-image-linear-gradient-slice-fill-1-ref.html
+fuzzy(1,177) fuzzy-if(OSX,1,25771) fuzzy-if(skiaContent&&!Android,1,400) fuzzy-if(Android,1,6093) fuzzy-if(webrender,1-3,57249-57412) == border-image-linear-gradient-slice-fill-2.html border-image-linear-gradient-slice-fill-2-ref.html
+fuzzy(1,48)  fuzzy-if(OSX,5,1676) fuzzy-if(webrender,1-1,4479-4530) == border-image-linear-gradient-width.html border-image-linear-gradient-width-ref.html
+fuzzy(1,5000) fuzzy-if(OSX,1,15000) fuzzy-if(webrender,2-2,58629-58667) == border-image-linear-gradient-slice-width.html border-image-linear-gradient-slice-width-ref.html
+fuzzy(1,3000) fuzzy-if(OSX,1,6000) fuzzy-if(webrender,1-1,26067-26353) == border-image-linear-gradient-outset.html border-image-linear-gradient-outset-ref.html
+fuzzy(1,12) fuzzy-if(skiaContent,1,400) fuzzy-if(webrender,1-2,26394-26872) == border-image-linear-gradient-repeat-repeat-1.html border-image-linear-gradient-repeat-repeat-1-ref.html
+fuzzy(1,13) fuzzy-if(skiaContent,1,300) fuzzy-if(webrender,1-2,26265-27131) == border-image-linear-gradient-repeat-round-1.html border-image-linear-gradient-repeat-round-1-ref.html
+fuzzy-if(webrender,1-2,65098-66334) == border-image-linear-gradient-repeat-repeat-2.html border-image-linear-gradient-repeat-repeat-2-ref.html
+fuzzy(1,576) fuzzy-if(skiaContent,1,2000) fuzzy-if(webrender,1-2,64806-66821) == border-image-linear-gradient-repeat-round-2.html border-image-linear-gradient-repeat-round-2-ref.html
+fuzzy(1,8533) fuzzy-if(webrender,1-2,84604-85925) == border-image-linear-gradient-repeat-repeat-3.html border-image-linear-gradient-repeat-repeat-3-ref.html
+fuzzy(1,7161) fuzzy-if(webrender,2-3,92540-92746) == border-image-linear-gradient-repeat-round-3.html border-image-linear-gradient-repeat-round-3-ref.html
 
 fuzzy-if(webrender,1,2096) == border-image-radial-gradient.html border-image-radial-gradient-ref.html
 fuzzy(1,42) fuzzy-if(skiaContent,2,20) fuzzy-if(webrender,1,37818) == border-image-radial-gradient-slice-1.html border-image-radial-gradient-slice-1-ref.html
 fuzzy(1,46) fuzzy-if(OSX,2,4472) fuzzy-if(webrender,1,26363) == border-image-radial-gradient-slice-2.html border-image-radial-gradient-slice-2-ref.html
 fuzzy(1,105) fuzzy-if(webrender,1,90873) == border-image-radial-gradient-slice-fill-1.html border-image-radial-gradient-slice-fill-1-ref.html
 fuzzy(1,139) fuzzy-if(OSX,2,4478) fuzzy-if(skiaContent,2,120) fuzzy-if(webrender,1,61729) == border-image-radial-gradient-slice-fill-2.html border-image-radial-gradient-slice-fill-2-ref.html
 fuzzy-if(skiaContent,1,2) fuzzy-if(webrender,1,4894) == border-image-radial-gradient-width.html border-image-radial-gradient-width-ref.html
 fuzzy(1,9000) fuzzy-if(webrender,3,66698) == border-image-radial-gradient-slice-width.html border-image-radial-gradient-slice-width-ref.html
 
 # OS X failures tracked in bug 957025
-fuzzy-if(webrender,1-1,1766-1766) fails-if(webrender&&winWidget) == border-image-repeating-linear-gradient.html border-image-repeating-linear-gradient-ref.html
+fuzzy-if(webrender,1-1,1766-1800) == border-image-repeating-linear-gradient.html border-image-repeating-linear-gradient-ref.html
 fuzzy(1,5608) fails-if(OSX) fuzzy-if(skiaContent,1,6093) fuzzy-if(webrender,3,95449) == border-image-repeating-linear-gradient-slice-fill-2.html border-image-repeating-linear-gradient-slice-fill-2-ref.html
 fuzzy(1,19200) fails-if(OSX) fuzzy-if(skiaContent,3,20000) fuzzy-if(webrender,3-3,18896-18896) fuzzy-if(webrender,2,112082) == border-image-repeating-linear-gradient-repeat-round-2.html border-image-repeating-linear-gradient-repeat-round-2-ref.html
 
 fuzzy(1,657) fuzzy-if(webrender,3,3008) == border-image-repeating-radial-gradient.html border-image-repeating-radial-gradient-ref.html
 fuzzy(1,510) fuzzy-if(skiaContent,3,362) fuzzy-if(webrender,3,62078) == border-image-repeating-radial-gradient-slice-1.html border-image-repeating-radial-gradient-slice-1-ref.html
 fuzzy(1,438) fuzzy-if(skiaContent,3,437) fuzzy-if(webrender,3,40536) == border-image-repeating-radial-gradient-slice-2.html border-image-repeating-radial-gradient-slice-2-ref.html
-fuzzy(1,1357) fuzzy-if(skiaContent,3,964) fuzzy-if(webrender,3,143220) fails-if(webrender&&winWidget) == border-image-repeating-radial-gradient-slice-fill-1.html border-image-repeating-radial-gradient-slice-fill-1-ref.html
-fuzzy(1,1058) fails-if(OSX) fuzzy-if(skiaContent,3,887) fuzzy-if(webrender,3,94677) fails-if(webrender&&winWidget) == border-image-repeating-radial-gradient-slice-fill-2.html border-image-repeating-radial-gradient-slice-fill-2-ref.html
+fuzzy(1,1357) fuzzy-if(skiaContent,3,964) fuzzy-if(webrender,1-4,85742-85800) == border-image-repeating-radial-gradient-slice-fill-1.html border-image-repeating-radial-gradient-slice-fill-1-ref.html
+fuzzy(1,1058) fails-if(OSX) fuzzy-if(skiaContent,3,887) fuzzy-if(webrender,1-4,57087-57193) == border-image-repeating-radial-gradient-slice-fill-2.html border-image-repeating-radial-gradient-slice-fill-2-ref.html
 fuzzy(1,602) fuzzy-if(webrender,3,7441) == border-image-repeating-radial-gradient-width.html border-image-repeating-radial-gradient-width-ref.html
 fuzzy(3,18000) fails-if(OSX) fuzzy-if(skiaContent,4,16462) fuzzy-if(webrender,5,99728) == border-image-repeating-radial-gradient-slice-width.html border-image-repeating-radial-gradient-slice-width-ref.html
 fuzzy-if(webrender,3,117768) == border-image-repeating-radial-gradient-repeat-repeat-2.html border-image-repeating-radial-gradient-repeat-repeat-2-ref.html
 fuzzy(1,1054) fails-if(OSX) fuzzy-if(skiaContent,2,952) fuzzy-if(webrender,3,116185) == border-image-repeating-radial-gradient-repeat-round-2.html border-image-repeating-radial-gradient-repeat-round-2-ref.html
 
 # border-image-source (-moz-)element
 fuzzy(125,5808) == border-image-element.html border-image-element-ref.html
 
--- a/layout/reftests/box-shadow/reftest.list
+++ b/layout/reftests/box-shadow/reftest.list
@@ -6,17 +6,17 @@ random != boxshadow-blur-2.html boxshado
 == boxshadow-multiple.html boxshadow-multiple-ref.html
 == boxshadow-spread.html boxshadow-spread-ref.html
 == tableboxshadow-basic.html tableboxshadow-basic-ref.html
 == tableboxshadow-trshadow.html tableboxshadow-trshadow-ref.html
 == tableboxshadow-tdshadow.html tableboxshadow-tdshadow-ref.html
 == boxshadow-rounding.html boxshadow-rounding-ref.html
 # One uses old path, one uses WR box shadow.
 fails-if(Android) == boxshadow-button.html boxshadow-button-ref.html
-fuzzy-if(OSX==1010,1,24) fuzzy-if(d2d,16,999) fuzzy-if(skiaContent,1,12) fuzzy-if(webrender,7-7,1560-1680) fails-if(webrender&&winWidget) == boxshadow-large-border-radius.html boxshadow-large-border-radius-ref.html # Bug 1209649
+fuzzy-if(OSX==1010,1,24) fuzzy-if(d2d,16,999) fuzzy-if(skiaContent,1,12) fuzzy-if(webrender,5-7,1560-1680) == boxshadow-large-border-radius.html boxshadow-large-border-radius-ref.html # Bug 1209649
 
 fails-if(Android) == boxshadow-fileupload.html boxshadow-fileupload-ref.html
 fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),98,152) fuzzy-if(skiaContent,13,28) fuzzy-if(webrender,19-19,50-50) == boxshadow-inner-basic.html boxshadow-inner-basic-ref.svg
 random-if(layersGPUAccelerated) == boxshadow-mixed.html boxshadow-mixed-ref.html
 == boxshadow-mixed-2.html boxshadow-mixed-2-ref.html
 random-if(d2d) fuzzy-if(skiaContent,1,100) fuzzy-if(webrender,127,3528) == boxshadow-rounded-spread.html boxshadow-rounded-spread-ref.html
 fuzzy-if(skiaContent,1,50) == boxshadow-dynamic.xul boxshadow-dynamic-ref.xul
 random-if(d2d) == boxshadow-onecorner.html boxshadow-onecorner-ref.html
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -407,17 +407,17 @@ fuzzy-if(Android,2,18) == 315920-17.html
 == 315920-28c.html 315920-28-ref.html
 == 315920-29a.html 315920-29-ref.html
 == 315920-29b.html 315920-29-ref.html
 == 315920-30.html 315920-30-ref.html
 == 316057-1.html 316057-1-ref.html
 == 320979-1.html 320979-1-ref.html
 != 321402-1.html about:blank
 != 321402-2.html about:blank
-fails-if(webrender&&winWidget) == 321402-3.xul 321402-3-ref.xul
+fuzzy-if(webrender&&winWidget,35-35,1-1) == 321402-3.xul 321402-3-ref.xul
 == 321402-4.xul 321402-4-ref.xul
 == 321402-5.xul 321402-5-ref.xul
 == 321402-6.xul 321402-6-ref.xul
 == 321738-1.html 321738-1-ref.html
 == 322436-1.html 322436-1-ref.html
 == 322461-1.xml 322461-1-ref.html
 == 323656-1.html 323656-1-ref.html
 == 323656-2.html 323656-2-ref.html
@@ -551,19 +551,19 @@ fuzzy-if(skiaContent,2,4) == 362594-2c.h
 skip-if(Android) == 363706-1.html 363706-1-ref.html
 != 363706-1.html about:blank
 == 363728-1.html 363728-1-ref.html
 == 363728-2.html 363728-2-ref.html
 fuzzy-if(skiaContent||Android,4,11) == 363858-1.html 363858-1-ref.html
 == 363858-2.html 363858-2-ref.html
 == 363858-3.html 363858-3-ref.html
 == 363858-4.html 363858-4-ref.html
-# fuzzy-if(OSX,45,2) fuzzy-if(winWidget,114,1) fails-if(webrender&&winWidget) == 363858-5a.html 363858-5-ref.html # bug 1452797
+# fuzzy-if(OSX,45,2) fuzzy-if(winWidget,116,1) == 363858-5a.html 363858-5-ref.html # bug 1452797
 == 363858-5b.html 363858-5-ref.html
-# fuzzy-if(OSX,45,2) fuzzy-if(winWidget,114,1) fails-if(webrender&&winWidget) == 363858-6a.html 363858-6-ref.html # bug 1452797
+# fuzzy-if(OSX,45,2) fuzzy-if(winWidget,116,1) == 363858-6a.html 363858-6-ref.html # bug 1452797
 == 363858-6b.html 363858-6-ref.html
 == 363874.html 363874-ref.html
 == 363874-max-width.html 363874-max-width-ref.html
 == 364066-1.html 364066-1-ref.html
 == 364079-1.html 364079-1-ref.html
 == 364318-1.xhtml 364318-1-ref.xhtml
 == 364861-1.html 364861-1-ref.html
 == 364862-1.html 364862-1-ref.html
@@ -649,17 +649,17 @@ fails-if(Android&&!asyncPan) == 371561-1
 == 371925-1b.html 371925-1-ref.html
 == 372037-1.html 372037-1-ref.html
 == 372062-1.html 372062-1-ref.html
 == 372063-1.html 372063-1-ref.html
 == 372323-1.xhtml 372323-1-ref.xhtml
 == 372553-1.html 372553-1-ref.html
 == 372632-1.html 372632-1-ref.html
 == 372768-1.html 372768-1-ref.html
-fails-if(webrender&&winWidget) == 373295-1.html 373295-1-ref.html
+fuzzy-if(webrender&&winWidget,83-83,2-2) == 373295-1.html 373295-1-ref.html
 == 373298-1.html 373298-1-ref.html
 == 373381-1.html 373381-1-ref.html
 fuzzy-if(skiaContent&&!Android,2,40) == 373381-2.html 373381-2-ref.html
 random-if(d2d) == 373381-3.html 373381-3-ref.html
 == 373381-4.html 373381-4-ref.html
 == 373383-1.html 373383-1-ref.html
 == 373433-1.html 373433-1-ref.html
 == 373533-1.xhtml about:blank
@@ -723,18 +723,18 @@ fuzzy-if(skiaContent,2,5) == 381507-1.ht
 == 383883-4.html 383883-4-ref.html
 == 383884-1.html 383884-1-ref.html
 == 383885-1.html 383885-1-ref.html
 == 384322-1.html 384322-1-ref.html
 == 384576-1.html 384576-1-ref.html
 == 384762-1.html about:blank
 == 384876-1.html 384876-1-ref.html
 == 385533-1.html about:blank # assertion test
-fails-if(webrender&&winWidget) == 385569-1a.html 385569-1-ref.html
-fails-if(webrender&&winWidget) == 385569-1b.html 385569-1-ref.html
+fuzzy-if(webrender&&winWidget,137-137,303-303) == 385569-1a.html 385569-1-ref.html
+fuzzy-if(webrender&&winWidget,137-137,303-303) == 385569-1b.html 385569-1-ref.html
 == 385607-1.html 385607-1-ref.html
 == 385823-1.html 385823-1-ref.html
 fuzzy-if(webrender,0-1,0-600) == 385823-2a.html 385823-2-ref.html
 fails == 385823-2b.html 385823-2-ref.html
 fuzzy-if(webrender,0-1,0-600) == 385823-2c.html 385823-2-ref.html
 fuzzy-if(skiaContent,2,11) == 385870-1.html 385870-1-ref.html
 fuzzy-if(skiaContent,2,3) == 385870-2.html 385870-2-ref.html
 == 386014-1a.html 386014-1-ref.html
@@ -936,17 +936,17 @@ fuzzy-if(Android,13,9) == 407111-1.html 
 == 409089-2.html 409089-2-ref.html
 == 409089-3.html 409089-3-ref.html
 fuzzy-if(winWidget,123,1600) == 409659-1a.html 409659-1-ref.html  # Bug 1128229
 != 409659-1b.html 409659-1-ref.html
 != 409659-1c.html 409659-1-ref.html
 fuzzy-if(winWidget,123,1900) == 409659-1d.html 409659-1-ref.html  # Bug 1128229
 == 410621-1.html 410621-1-ref.html
 == 411059-1.html 411059-1-ref.html
-fails-if(webrender&&winWidget) == 411334-1.xml 411334-1-ref.xml
+fuzzy-if(webrender&&winWidget,129-129,770-770) == 411334-1.xml 411334-1-ref.xml
 == 411367-1.html 411367-1-ref.html
 == 411367-2.html 411367-2-ref.html
 == 411367-3.html 411367-3-ref.html
 == 411585-1.html 411585-1-ref.html
 == 411585-2.html 411585-2-ref.html
 fails == 411585-3.html 411585-3-ref.html # bug 426909
 == 411792-1.html 411792-1-ref.html
 == 412093-1.html 412093-1-ref.html
@@ -997,17 +997,17 @@ asserts(1) == 418574-2.html 418574-2-ref
 == 420069-2.html 420069-2-ref.html
 == 420351-1.html 420351-1-ref.html
 == 420790-1.xhtml 420790-1-ref.xhtml
 == 421069.html 421069-ref.html
 == 421069.html 421069-ref2.html
 == 421069-ref.html 421069-ref2.html
 == 421203-1.xul 421203-1-ref.html
 == 421203-2.xul 421203-1-ref.html
-fails-if(webrender&&winWidget) == 421203-3.xul 321402-3-ref.xul
+fuzzy-if(webrender&&winWidget,35-35,1-1) == 421203-3.xul 321402-3-ref.xul
 == 421203-4.xul 321402-4-ref.xul
 == 421203-5.xul 321402-5-ref.xul
 == 421203-6.xul 321402-6-ref.xul
 == 421234-1.html 421234-1-ref.html
 == 421239-1.html 421239-1-ref.html
 == 421239-2.html 421239-2-ref.html
 == 421419-1.html 421419-1-ref.html
 == 421436-1a.html 421436-1-ref.html
@@ -1190,17 +1190,17 @@ fuzzy-if(webrender,4,361) == 449519-1.ht
 == 452915-1.html 452915-1-ref.html
 == 452964-1.html 452964-1-ref.html
 == 454361.html about:blank
 == 455105-1.html 455105-ref.html
 == 455105-2.html 455105-ref.html
 == 455171-5.html 455171-5-ref.html
 == 455280-1.xhtml 455280-1-ref.xhtml
 == 455826-1.html 455826-1-ref.html
-fails-if(Android||cocoaWidget) fails-if(webrender&&winWidget) == 456147.xul 456147-ref.html # bug 458047
+fails-if(Android||cocoaWidget) fuzzy-if(webrender&&winWidget,222-222,2806-2806) == 456147.xul 456147-ref.html # bug 458047
 fuzzy-if(Android,11,41) fuzzy-if(winWidget||gtkWidget,4,6) fuzzy-if(d2d,15,69) fuzzy-if(skiaContent,42,150) == 456219-1a.html 456219-1-ref.html # bug 1128229
 fuzzy-if(Android,11,41) fuzzy-if(winWidget||gtkWidget,4,6) fuzzy-if(d2d,15,69) fuzzy-if(skiaContent,42,150) == 456219-1b.html 456219-1-ref.html # bug 1128229
 fuzzy-if(Android,11,41) fuzzy-if(winWidget||gtkWidget,4,6) fuzzy-if(d2d,15,69) fuzzy-if(skiaContent,42,150) == 456219-1c.html 456219-1-ref.html # bug 1128229
 fuzzy-if(skiaContent,1,45) == 456219-2.html 456219-2-ref.html
 == 456330-1.gif 456330-1-ref.png
 == 456484-1.html 456484-1-ref.html
 == 457398-1.html 457398-1-ref.html
 == 457398-2.html 457398-2-ref.html
@@ -1228,17 +1228,17 @@ fuzzy-if(skiaContent,1,5) == 459443-1.ht
 == 460012-1.html 460012-1-ref.html
 == 461266-1.html 461266-1-ref.html
 fuzzy-if(skiaContent,1,12000) fails-if(webrender) == 461512-1.html 461512-1-ref.html # bug 1382896 for webrender
 == 462844-1.html 462844-ref.html
 == 462844-2.html 462844-ref.html
 == 462844-3.html 462844-ref.html
 == 462844-4.html 462844-ref.html
 == 463204-1.html 463204-1-ref.html
-fuzzy-if(webrender,16-16,3425-3425) fails-if(webrender&&winWidget) == 463217-1.xul 463217-1-ref.xul
+fuzzy-if(webrender,16-16,3425-3483) == 463217-1.xul 463217-1-ref.xul
 == 463952-1.html 463952-1-ref.html
 == 464811-1.html 464811-1-ref.html
 == 465574-1.html 465574-1-ref.html # bug 421436
 == 466258-1.html 466258-1-ref.html
 == 466395-1.html 466395-1-ref.html
 == 466395-2.html 466395-2-ref.html
 == 467084-1.html 467084-1-ref.html
 == 467084-2.html 467084-2-ref.html
@@ -1682,17 +1682,17 @@ HTTP == 652991-3.html 652991-3-ref.html
 HTTP == 652991-4.html 652991-4-ref.html
 fuzzy-if(skiaContent,1,5) == 653930-1.html 653930-1-ref.html
 == 654057-1.html 654057-1-ref.html
 fuzzy-if(skiaContent,1,4500) == 654950-1.html 654950-1-ref.html # Quartz alpha blending doesn't match GL alpha blending
 == 655549-1.html 655549-1-ref.html
 == 655836-1.html 655836-1-ref.html
 != 656875.html about:blank
 == 658952.html 658952-ref.html
-fuzzy-if(skiaContent,7,3500) fails-if(webrender&&winWidget) == 660682-1.html 660682-1-ref.html
+fuzzy-if(skiaContent,7,3500) fuzzy-if(webrender&&winWidget,37-37,777-777) == 660682-1.html 660682-1-ref.html
 fuzzy-if(d2d,1,256) skip-if(Android) fuzzy-if(skiaContent,1,68000) == 664127-1.xul 664127-1-ref.xul # Android: Intermittent failures - bug 1019131
 == 665597-1.html 665597-1-ref.html
 == 665597-2.html 665597-2-ref.html
 == 667079-1.html 667079-1-ref.html
 == 668319-1.xul about:blank
 != 669015-1.xul 669015-1-notref.xul
 skip-if(azureSkiaGL) == 670442-1.html 670442-1-ref.html
 == 670467-1.html 670467-1-ref.html
--- a/layout/reftests/css-blending/reftest.list
+++ b/layout/reftests/css-blending/reftest.list
@@ -1,13 +1,13 @@
 pref(layout.css.mix-blend-mode.enabled,true) == blend-canvas.html blend-canvas-ref.html
 pref(layout.css.mix-blend-mode.enabled,true) == blend-constant-background-color.html blend-constant-background-color-ref.html
 pref(layout.css.mix-blend-mode.enabled,true) fuzzy-if(webrender,1-1,1411-7875) == blend-gradient-background-color.html blend-gradient-background-color-ref.html
 pref(layout.css.mix-blend-mode.enabled,true) == blend-image.html blend-image-ref.html
-pref(layout.css.mix-blend-mode.enabled,true) fails-if(webrender&&winWidget) == blend-difference-stacking.html blend-difference-stacking-ref.html
+pref(layout.css.mix-blend-mode.enabled,true) fuzzy-if(webrender&&winWidget,36-36,4-4) == blend-difference-stacking.html blend-difference-stacking-ref.html
 
 fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),1,10000) fuzzy-if(skiaContent,1,30000) pref(layout.css.background-blend-mode.enabled,true) == background-blending-alpha.html background-blending-alpha-ref.html
 pref(layout.css.background-blend-mode.enabled,true) fuzzy-if(webrender,1-1,1411-7875) == background-blending-gradient-color.html background-blending-gradient-color-ref.html
 fuzzy-if(azureSkiaGL,3,7597) fuzzy-if(cocoaWidget,3,7597) fuzzy-if(d2d,1,3800) fuzzy-if(d3d11,1,4200) fuzzy-if(skiaContent,2,9450) fuzzy-if(webrender,1-1,3938-23625) pref(layout.css.background-blend-mode.enabled,true) == background-blending-gradient-gradient.html background-blending-gradient-gradient-ref.html
 fuzzy-if(azureSkiaGL,2,7174) fuzzy-if(webrender,1-1,1312-7875) pref(layout.css.background-blend-mode.enabled,true) == background-blending-gradient-image.html background-blending-gradient-color-ref.html
 fuzzy-if(azureSkia||d2d||gtkWidget,1,10000) pref(layout.css.background-blend-mode.enabled,true) == background-blending-image-color-jpg.html background-blending-image-color-ref.html
 pref(layout.css.background-blend-mode.enabled,true) == background-blending-image-color-png.html background-blending-image-color-ref.html
 pref(layout.css.background-blend-mode.enabled,true) == background-blending-image-color-svg.html background-blending-image-color-ref.html
--- a/layout/reftests/css-break/reftest.list
+++ b/layout/reftests/css-break/reftest.list
@@ -1,12 +1,12 @@
 default-preferences pref(layout.css.box-decoration-break.enabled,true)
 
 == box-decoration-break-1.html box-decoration-break-1-ref.html
-fuzzy(1,20) fuzzy-if(skiaContent,1,700) fuzzy-if(webrender,21-21,12245-12245) fails-if(webrender&&winWidget) == box-decoration-break-with-inset-box-shadow-1.html box-decoration-break-with-inset-box-shadow-1-ref.html
+fuzzy(1,20) fuzzy-if(skiaContent,1,700) fuzzy-if(webrender,21-21,12245-12245) fuzzy-if(webrender&&winWidget,26-26,9123-9123) == box-decoration-break-with-inset-box-shadow-1.html box-decoration-break-with-inset-box-shadow-1-ref.html
 fuzzy(45,460) fuzzy-if(skiaContent,57,439) fuzzy-if(Android,57,1330) == box-decoration-break-with-outset-box-shadow-1.html box-decoration-break-with-outset-box-shadow-1-ref.html # Bug 1386543
 random-if(!gtkWidget) == box-decoration-break-border-image.html box-decoration-break-border-image-ref.html
 == box-decoration-break-block-border-padding.html box-decoration-break-block-border-padding-ref.html
 == box-decoration-break-block-margin.html box-decoration-break-block-margin-ref.html
 fuzzy-if(!Android,1,62) fuzzy-if(Android,8,6627) == box-decoration-break-first-letter.html box-decoration-break-first-letter-ref.html #Bug 1313773
 == box-decoration-break-with-bidi.html box-decoration-break-with-bidi-ref.html
 == box-decoration-break-bug-1235152.html box-decoration-break-bug-1235152-ref.html
 == box-decoration-break-bug-1249913.html box-decoration-break-bug-1249913-ref.html
--- a/layout/reftests/forms/input/number/reftest.list
+++ b/layout/reftests/forms/input/number/reftest.list
@@ -1,10 +1,8 @@
-default-preferences pref(dom.forms.number,true)
-
 # sanity checks:
 # not valid on Android where type=number looks like type=text
 skip-if(Android) != not-other-type-unthemed-1.html not-other-type-unthemed-1a-notref.html
 skip-if(Android) != not-other-type-unthemed-1.html not-other-type-unthemed-1b-notref.html
 # only valid on Android where type=number looks the same as type=text
 skip-if(!Android) == number-same-as-text-unthemed.html number-same-as-text-unthemed-ref.html
 
 # should look the same as type=text, except for the spin box
--- a/layout/reftests/image-element/reftest.list
+++ b/layout/reftests/image-element/reftest.list
@@ -2,27 +2,27 @@ random == bug-364968.html bug-364968-ref
 == bug-463204.html bug-463204-ref.html
 == canvas-outside-document.html canvas-inside-document.html
 == mozsetimageelement-01.html mozsetimageelement-01-ref.html
 == mozsetimageelement-02.html about:blank
 == image-outside-document-invalidate.html about:blank
 == canvas-outside-document-invalidate-01.html about:blank
 fails-if(azureSkia) fails-if(cocoaWidget) == canvas-outside-document-invalidate-02.html about:blank # See bug 666800
 #fails with Skia due to Skia bug http://code.google.com/p/skia/issues/detail?id=568
-fails-if(webrender&&winWidget) == element-paint-simple.html element-paint-simple-ref.html
+fuzzy-if(webrender&&winWidget,117-117,54-54) == element-paint-simple.html element-paint-simple-ref.html
 == element-paint-repeated.html element-paint-repeated-ref.html
 == element-paint-recursion.html element-paint-recursion-ref.html
 == element-paint-continuation.html element-paint-continuation-ref.html
 == element-paint-transform-01.html element-paint-transform-01-ref.html
 random-if(d2d) == element-paint-transform-02.html element-paint-transform-02-ref.html # bug 587133
 fuzzy-if(d2d&&/^Windows\x20NT\x206\.1/.test(http.oscpu),16,90) == element-paint-background-size-01.html element-paint-background-size-01-ref.html
 == element-paint-background-size-02.html element-paint-background-size-02-ref.html
 fuzzy-if(skiaContent,255,4) == element-paint-transform-repeated.html element-paint-transform-repeated-ref.html
 fuzzy-if(d2d,255,24) == element-paint-transform-03.html element-paint-transform-03-ref.html
-fuzzy-if(asyncPan,2,140) fuzzy-if(skiaContent,3,106) fails-if(webrender&&winWidget) == element-paint-native-widget.html element-paint-native-widget-ref.html   # in -ref the scrollframe is active and layerized differently with APZ
+fuzzy-if(asyncPan,2,140) fuzzy-if(skiaContent,3,106) fuzzy-if(webrender&&winWidget,222-222,1323-1323) == element-paint-native-widget.html element-paint-native-widget-ref.html   # in -ref the scrollframe is active and layerized differently with APZ
 fails-if(usesRepeatResampling&&!(webrender&&winWidget)) == element-paint-subimage-sampling-restriction.html about:blank
 == element-paint-clippath.html element-paint-clippath-ref.html
 fuzzy-if(webrender,35-35,706-706) == element-paint-sharpness-01a.html element-paint-sharpness-01b.html
 fuzzy-if(skiaContent,1,326) == element-paint-sharpness-01b.html element-paint-sharpness-01c.html
 fuzzy-if(webrender,35-35,706-706) == element-paint-sharpness-01c.html element-paint-sharpness-01d.html
 == element-paint-sharpness-02a.html element-paint-sharpness-02b.html
 == element-paint-sharpness-02b.html element-paint-sharpness-02c.html
 == element-paint-paintserversize-rounding-01.html element-paint-paintserversize-rounding-01-ref.html
--- a/layout/reftests/mathml/reftest.list
+++ b/layout/reftests/mathml/reftest.list
@@ -12,17 +12,17 @@ fails == dir-9.html dir-9-ref.html # Bug
 == dir-11.html dir-11-ref.html
 == css-spacing-1.html css-spacing-1-ref.html
 pref(mathml.disabled,true) == disabled-scriptlevel-1.html disabled-scriptlevel-1-ref.html
 pref(mathml.disabled,true) == disabled-scriptlevel-1.xhtml disabled-scriptlevel-1-ref.xhtml
 == displaystyle-1.html displaystyle-1-ref.html
 == displaystyle-2.html displaystyle-2-ref.html
 == displaystyle-3.html displaystyle-3-ref.html
 == displaystyle-4.html displaystyle-4-ref.html
-random-if(smallScreen&&Android) fuzzy(255,200) fails-if(webrender&&winWidget) == mirror-op-1.html mirror-op-1-ref.html
+random-if(smallScreen&&Android) fuzzy(255,200) fuzzy-if(webrender&&winWidget,255-255,265-265) == mirror-op-1.html mirror-op-1-ref.html
 != mirror-op-2.html mirror-op-2-ref.html
 != mirror-op-3.html mirror-op-3-ref.html
 != mirror-op-4.html mirror-op-4-ref.html
 == dynamic-mi.xhtml dynamic-mi-ref.xhtml
 == mphantom-1.html mphantom-1-ref.html
 == mphantom-2.html mphantom-2-ref.html
 == mfenced-1.xhtml mfenced-1-ref.xhtml
 == mfenced-2a.xhtml mfenced-2-ref.xhtml
--- a/layout/reftests/position-sticky/reftest.list
+++ b/layout/reftests/position-sticky/reftest.list
@@ -35,17 +35,17 @@ fuzzy-if(Android,2,3) == stacking-contex
 == left-right-3.html left-right-3-ref.html
 fuzzy-if(Android,4,810) == containing-block-1.html containing-block-1-ref.html
 == overconstrained-1.html overconstrained-1-ref.html
 == overconstrained-2.html overconstrained-2-ref.html
 == overconstrained-3.html overconstrained-3-ref.html
 == inline-1.html inline-1-ref.html
 == inline-2.html inline-2-ref.html
 fuzzy-if(OSX,99,210) == inline-3.html inline-3-ref.html
-skip-if(!asyncPan) fails-if(webrender&&winWidget) == inline-4.html inline-4-ref.html
+skip-if(!asyncPan) fuzzy-if(webrender&&winWidget,126-126,4-4) == inline-4.html inline-4-ref.html
 fails == column-contain-1a.html column-contain-1-ref.html
 == column-contain-1b.html column-contain-1-ref.html
 == column-contain-2.html column-contain-2-ref.html
 == block-in-inline-1.html block-in-inline-1-ref.html
 fuzzy-if(skiaContent,1,22) fuzzy-if(winWidget&&!layersGPUAccelerated,116,1320) fuzzy-if(Android,8,1533) == block-in-inline-2.html block-in-inline-2-ref.html
 fuzzy-if(Android,8,630) fuzzy-if(OSX,1,11) fuzzy-if(skiaContent,1,220) fuzzy-if(winWidget&&!layersGPUAccelerated,116,1320) == block-in-inline-3.html block-in-inline-3-ref.html
 == block-in-inline-continuations.html block-in-inline-continuations-ref.html
 == iframe-1.html iframe-1-ref.html
--- a/layout/reftests/svg/as-image/reftest.list
+++ b/layout/reftests/svg/as-image/reftest.list
@@ -41,17 +41,17 @@ include zoom/reftest.list
 == canvas-drawImage-scale-1b.html lime100x100-ref.html
 == canvas-drawImage-scale-1c.html lime100x100-ref.html
 
 fuzzy(1,2) fuzzy-if(skiaContent,1,529) == canvas-drawImage-scale-2a.html canvas-drawImage-scale-2-ref.html
 fuzzy(1,2) fuzzy-if(skiaContent,1,529) == canvas-drawImage-scale-2b.html canvas-drawImage-scale-2-ref.html
 
 fuzzy-if(winWidget&&!d2d,1,10000) fuzzy-if(azureSkia,1,10000) fuzzy-if(Android,1,10000) == canvas-drawImage-alpha-1.html canvas-drawImage-alpha-1-ref.html
 #Same as scale-2a but with globalAlpha:
-fuzzy(1,2) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),1,7018) fuzzy-if(azureSkia,1,40000) fails-if(webrender&&winWidget) == canvas-drawImage-alpha-2.html canvas-drawImage-alpha-2-ref.html
+fuzzy(1,2) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),1,7018) fuzzy-if(azureSkia,1,40000) fuzzy-if(webrender&&winWidget,1-1,39743-39743) == canvas-drawImage-alpha-2.html canvas-drawImage-alpha-2-ref.html
 
 == canvas-drawImage-slice-1a.html lime100x100-ref.html
 == canvas-drawImage-slice-1b.html lime100x100-ref.html
 
 == canvas-drawImage-origin-clean-1.html lime100x100-ref.html
 == canvas-drawImage-transform-restored.html canvas-drawImage-transform-restored-ref.html
 
 # Context paint tests (this feature is currently not part of any spec.)
--- a/layout/reftests/svg/filters/css-filter-chains/reftest.list
+++ b/layout/reftests/svg/filters/css-filter-chains/reftest.list
@@ -1,9 +1,9 @@
 # These tests verify that CSS filter chains behave properly.
 # e.g. filter: blur(3px) grayscale(0.5) invert(0.2);
 
 default-preferences pref(layout.css.filters.enabled,true)
 
 # Some platforms render this complex filter chain a little differently, and that's ok.
-fuzzy(5,13000) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&layersGPUAccelerated,35,13269) fuzzy-if(webrender,6-6,18006-18006) fails-if(webrender&&winWidget) == long-chain.html long-chain-ref.html # Win10: Bug 1258241
+fuzzy(5,13000) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&layersGPUAccelerated,35,13269) fuzzy-if(webrender,5-6,18006-18071) == long-chain.html long-chain-ref.html # Win10: Bug 1258241
 == moz-element.html moz-element-ref.html
 fuzzy-if(webrender,15-15,7958-8262) == same-filter.html same-filter-ref.html
--- a/layout/reftests/svg/filters/css-filters/reftest.list
+++ b/layout/reftests/svg/filters/css-filters/reftest.list
@@ -1,39 +1,39 @@
 # These tests verify that CSS filters behave properly.
 # e.g. filter: blur(3px)
 
 default-preferences pref(layout.css.filters.enabled,true)
 
-fuzzy-if(webrender,9-9,4780-4780) fails-if(webrender&&winWidget) == blur.html blur-ref.html
+fuzzy-if(webrender,9-9,4780-4784) == blur.html blur-ref.html
 == blur.svg blur-ref.svg
 == blur-calc.html blur-calc-ref.html
 == blur-calc-negative.html blur-calc-negative-ref.html
 skip-if(d2d) == blur-cap-large-radius-on-software.html blur-cap-large-radius-on-software-ref.html
-fuzzy-if(webrender,9-9,4780-4780) fails-if(webrender&&winWidget) == blur-em-radius.html blur-em-radius-ref.html
+fuzzy-if(webrender,9-9,4780-4784) == blur-em-radius.html blur-em-radius-ref.html
 == blur-invalid-radius.html blur-invalid-radius-ref.html
-fuzzy-if(webrender,9-9,4780-4780) fails-if(webrender&&winWidget) == blur-rem-radius.html blur-rem-radius-ref.html
+fuzzy-if(webrender,9-9,4780-4784) == blur-rem-radius.html blur-rem-radius-ref.html
 == blur-zero-radius.html blur-zero-radius-ref.html
-fuzzy-if(webrender,6-6,21308-21308) fails-if(webrender&&winWidget) == blur-zoomed-page.html blur-zoomed-page-ref.html
+fuzzy-if(webrender,6-7,20420-21308) == blur-zoomed-page.html blur-zoomed-page-ref.html
 == brightness.html brightness-ref.html
 == brightness-darken.html brightness-darken-ref.html
 == brightness-extreme.html brightness-extreme-ref.html
 == brightness-one.html brightness-one-ref.html
 == brightness-percent.html brightness-percent-ref.html
 == brightness-zero.html brightness-zero-ref.html
 == containing-block-1.html containing-block-1-ref.html
 == contrast.html contrast-ref.html
 == contrast-extreme.html contrast-extreme-ref.html
 == contrast-one.html contrast-one-ref.html
 == contrast-percent.html contrast-percent-ref.html
 == contrast-reduce.html contrast-reduce-ref.html
 == contrast-zero.html contrast-zero-ref.html
-fuzzy-if(webrender,9-9,2625-2625) fails-if(webrender&&winWidget) == drop-shadow.html drop-shadow-ref.html
-fuzzy-if(webrender,9-9,2625-2625) fails-if(webrender&&winWidget) == drop-shadow-default-color.html drop-shadow-default-color-ref.html
-fuzzy-if(webrender,9-9,2625-2625) fails-if(webrender&&winWidget) == drop-shadow-negative-offset.html drop-shadow-negative-offset-ref.html
+fuzzy-if(webrender,9-9,2625-2628) == drop-shadow.html drop-shadow-ref.html
+fuzzy-if(webrender,9-9,2625-2628) fails-if(webrender&&winWidget) == drop-shadow-default-color.html drop-shadow-default-color-ref.html
+fuzzy-if(webrender,9-9,2625-2628) fails-if(webrender&&winWidget) == drop-shadow-negative-offset.html drop-shadow-negative-offset-ref.html
 == filter-on-huge-bbox.html pass.svg
 == filter-on-outer-svg.html pass.svg
 fuzzy-if(webrender,1,10000) fuzzy-if(d2d,1,10000) == grayscale.html grayscale-ref.html
 fuzzy-if(webrender,1,10000) fuzzy-if(d2d,1,10000) == grayscale-one.html grayscale-one-ref.html
 fuzzy-if(webrender,1,10000) fuzzy-if(d2d,1,10000) == grayscale-over-one.html grayscale-over-one-ref.html
 fuzzy-if(webrender,1,10000) fuzzy-if(d2d,1,10000) == grayscale-percent.html grayscale-percent-ref.html
 fuzzy-if(webrender,1,10000) == grayscale-zero.html grayscale-zero-ref.html
 == hue-rotate.html hue-rotate-ref.html
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -211,17 +211,17 @@ fuzzy-if(skiaContent,1,500) == filter-sc
 == filter-use-element-01.svg pass.svg
 fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)||skiaContent,1,800000) == filters-and-group-opacity-01.svg filters-and-group-opacity-01-ref.svg
 
 == foreignObject-01.svg pass.svg
 == foreignObject-02.svg foreignObject-02-ref.svg
 == foreignObject-ancestor-style-change-01.svg foreignObject-ancestor-style-change-01-ref.svg
 == foreignObject-change-transform-01.svg pass.svg
 == foreignObject-display-01.svg pass.svg
-fuzzy-if(webrender,190,229) fails-if(webrender&&winWidget) == foreignObject-form-theme.svg foreignObject-form-theme-ref.html # Bug 1439980
+fuzzy-if(webrender,190-255,229-1552) == foreignObject-form-theme.svg foreignObject-form-theme-ref.html # Bug 1439980
 == foreignObject-img.html foreignObject-img-ref.html
 == foreignObject-img-form-theme.html foreignObject-img-form-theme-ref.html
 == foreignObject-move-repaint-01.svg pass.svg
 == foreignObject-overflow-01.svg pass.svg
 == foreignObject-start-hidden-01.svg pass.svg # followup from Bug 596765
 == foreignObject-start-hidden-02.svg pass.svg
 == foreignObject-style-change-01.svg pass.svg
 == foreignObject-dynamic-abspos-01.html foreignObject-dynamic-abspos-01-ref.html
--- a/layout/reftests/svg/text/reftest.list
+++ b/layout/reftests/svg/text/reftest.list
@@ -1,54 +1,54 @@
-fails-if(webrender&&winWidget) == simple.svg simple-ref.html
+fuzzy-if(webrender&&winWidget,122-122,254-254) == simple.svg simple-ref.html
 == simple-2.svg simple.svg
-fails-if(webrender&&winWidget) == simple-underline.svg simple-underline-ref.html
+fuzzy-if(webrender&&winWidget,122-122,254-254) == simple-underline.svg simple-underline-ref.html
 == simple-underline-scaled.svg simple-underline-scaled-ref.svg
-fails-if(webrender&&winWidget) == simple-anchor-end-bidi.svg simple-anchor-end-bidi-ref.html
-fails-if(webrender&&winWidget) == simple-anchor-end-rtl.svg simple-anchor-end-rtl-ref.html
-fails-if(webrender&&winWidget) == simple-anchor-end.svg simple-anchor-end-ref.html
-fuzzy-if(skiaContent&&dwrite,104,131) fails-if(webrender&&winWidget) == simple-anchor-middle-bidi.svg simple-anchor-middle-bidi-ref.html
-fails-if(webrender&&winWidget) == simple-anchor-middle-rtl.svg simple-anchor-middle-rtl-ref.html
-fuzzy-if(skiaContent,111,81) fails-if(webrender&&winWidget) == simple-anchor-middle.svg simple-anchor-middle-ref.html
-fails-if(webrender&&winWidget) == simple-bidi.svg simple-bidi-ref.html
+fuzzy-if(webrender&&winWidget,166-166,318-318) == simple-anchor-end-bidi.svg simple-anchor-end-bidi-ref.html
+fuzzy-if(webrender&&winWidget,132-132,204-204) == simple-anchor-end-rtl.svg simple-anchor-end-rtl-ref.html
+fuzzy-if(webrender&&winWidget,122-122,250-250) == simple-anchor-end.svg simple-anchor-end-ref.html
+fuzzy-if(skiaContent&&dwrite,104,131) fuzzy-if(webrender&&winWidget,194-194,319-319) == simple-anchor-middle-bidi.svg simple-anchor-middle-bidi-ref.html
+fuzzy-if(webrender&&winWidget,132-132,207-207) == simple-anchor-middle-rtl.svg simple-anchor-middle-rtl-ref.html
+fuzzy-if(skiaContent,111,81) fuzzy-if(webrender&&winWidget,122-122,254-254) == simple-anchor-middle.svg simple-anchor-middle-ref.html
+fuzzy-if(webrender&&winWidget,132-132,319-319) == simple-bidi.svg simple-bidi-ref.html
 == simple-bidi-2.svg simple-bidi.svg
 
 == simple-dx.svg simple.svg
 == simple-dx-2.svg simple-dx-2-ref.svg
 == simple-dx-anchor-end-bidi.svg simple-dx-anchor-end-bidi-ref.svg
 == simple-dx-anchor-end-rtl.svg simple-dx-anchor-end-rtl-ref.svg
 == simple-dx-anchor-end.svg simple-dx-anchor-end-ref.svg
 == simple-dx-anchor-middle-bidi.svg simple-dx-anchor-middle-bidi-ref.svg
 == simple-dx-anchor-middle-rtl.svg simple-dx-anchor-middle-rtl-ref.svg
 == simple-dx-anchor-middle.svg simple-dx-anchor-middle-ref.svg
 == simple-dx-bidi.svg simple-dx-bidi-ref.svg
 == simple-dx-bidi-2.svg simple-dx-bidi-2-ref.svg
 == simple-dx-rtl.svg simple-dx-rtl-ref.svg
 == simple-dx-rtl-2.svg simple-dx-rtl-2-ref.svg
 
 == simple-fill-color-dynamic.svg simple-fill-color-dynamic-ref.svg
-fails-if(webrender&&winWidget) == simple-fill-color.svg simple-fill-color-ref.html
+fuzzy-if(webrender&&winWidget,125-125,254-254) == simple-fill-color.svg simple-fill-color-ref.html
 == simple-fill-gradient.svg simple-fill-gradient-ref.svg
 == simple-fill-none.svg simple.svg
 == simple-pointer-events.svg simple.svg
 
-fails-if(webrender&&winWidget) == simple-multiple-dx.svg simple-multiple-dx-ref.html
+fuzzy-if(webrender&&winWidget,122-122,254-254) == simple-multiple-dx.svg simple-multiple-dx-ref.html
 == simple-multiple-dx-2.svg simple-multiple-dx.svg
 == simple-multiple-dx-anchor-end-bidi.svg simple-multiple-dx-anchor-end-bidi-ref.svg
 == simple-multiple-dx-anchor-middle-bidi.svg simple-multiple-dx-anchor-middle-bidi-ref.svg
 == simple-multiple-dx-anchor-end-rtl.svg simple-multiple-dx-anchor-end-rtl-ref.svg
 == simple-multiple-dx-anchor-end.svg simple-multiple-dx-anchor-end-ref.svg
 fuzzy-if(skiaContent,1,2) == simple-multiple-dx-anchor-middle-rtl.svg simple-multiple-dx-anchor-middle-rtl-ref.svg
 == simple-multiple-dx-anchor-middle.svg simple-multiple-dx-anchor-middle-ref.svg
 == simple-multiple-dx-bidi.svg simple-multiple-dx-bidi-ref.svg
 == simple-multiple-dx-bidi-2.svg simple-multiple-dx-bidi.svg
 == simple-multiple-dx-rtl.svg simple-multiple-dx-rtl-ref.svg
 == simple-multiple-dx-rtl-2.svg simple-multiple-dx-rtl.svg
 
-fails-if(webrender&&winWidget) == simple-rtl.svg simple-rtl-ref.html
+fuzzy-if(webrender&&winWidget,132-132,206-206) == simple-rtl.svg simple-rtl-ref.html
 == simple-rtl-2.svg simple-rtl.svg
 == simple-transform-rotate.svg simple-transform-rotate-ref.svg
 
 == multiple-x.svg multiple-x-ref.svg
 == multiple-x-bidi.svg multiple-x-bidi-ref.svg
 == multiple-x-rtl.svg multiple-x-rtl-ref.svg
 == multiple-x-anchor-end-bidi.svg multiple-x-anchor-end-bidi-ref.svg
 == multiple-x-anchor-end-rtl.svg multiple-x-anchor-end-rtl-ref.svg
@@ -191,15 +191,15 @@ fuzzy-if(skiaContent&&winWidget,126,336)
 # vertical text
 fuzzy-if(skiaContent,1,80) == textpath-vertical-dx.svg textpath-vertical-dx-ref.svg
 
 # selection
 needs-focus == deselectAll.svg deselectAll-ref.svg
 fuzzy-if(skiaContent,1,250) needs-focus == selectSubString.svg selectSubString-ref.svg
 fuzzy-if(skiaContent,1,600) needs-focus == selectSubString-2.svg selectSubString-2-ref.svg
 fuzzy-if(skiaContent,1,250) needs-focus == selectSubString-3.svg selectSubString-3-ref.svg
-fuzzy-if(webrender,1-1,237-237) needs-focus fails-if(webrender&&winWidget) == simple-selection.svg simple-selection-ref.html
-fuzzy-if(skiaContent,1,100) fuzzy-if(webrender,1-1,575-575) needs-focus fails-if(webrender&&winWidget) == simple-bidi-selection.svg simple-bidi-selection-ref.html
-fuzzy-if(skiaContent,1,50) fuzzy-if(webrender,1-1,237-237) needs-focus fails-if(webrender&&winWidget) == simple-fill-color-selection.svg simple-fill-color-selection-ref.html
-fuzzy-if(skiaContent,1,150) fuzzy-if(webrender,1-1,222-222) needs-focus fails-if(webrender&&winWidget) == simple-underline-selection.svg simple-underline-selection-ref.html
-fuzzy-if(skiaContent,1,300) fuzzy-if(webrender,1-1,934-934) needs-focus fails-if(webrender&&winWidget) == multiple-text-selection.svg multiple-text-selection-ref.html
+fuzzy-if(webrender,1-1,237-237) needs-focus fuzzy-if(webrender&&winWidget,148-148,254-254) == simple-selection.svg simple-selection-ref.html
+fuzzy-if(skiaContent,1,100) fuzzy-if(webrender,1-1,575-575) needs-focus fuzzy-if(webrender&&winWidget,148-148,318-318) == simple-bidi-selection.svg simple-bidi-selection-ref.html
+fuzzy-if(skiaContent,1,50) fuzzy-if(webrender,1-1,237-237) needs-focus fuzzy-if(webrender&&winWidget,148-148,254-254) == simple-fill-color-selection.svg simple-fill-color-selection-ref.html
+fuzzy-if(skiaContent,1,150) fuzzy-if(webrender,1-1,222-222) needs-focus fuzzy-if(webrender&&winWidget,148-148,254-254) == simple-underline-selection.svg simple-underline-selection-ref.html
+fuzzy-if(skiaContent,1,300) fuzzy-if(webrender,1-1,934-934) needs-focus fuzzy-if(webrender&&winWidget,152-152,494-494) == multiple-text-selection.svg multiple-text-selection-ref.html
 needs-focus == multiple-chunks-selection.svg multiple-chunks-selection-ref.svg
 fuzzy-if(skiaContent,1,200) needs-focus == textpath-selection.svg textpath-selection-ref.svg
--- a/layout/reftests/text-overflow/reftest.list
+++ b/layout/reftests/text-overflow/reftest.list
@@ -1,16 +1,16 @@
 == ellipsis-font-fallback.html ellipsis-font-fallback-ref.html
 == line-clipping.html line-clipping-ref.html
 fuzzy-if(Android,16,244) == marker-basic.html marker-basic-ref.html  # Bug 1128229
 == marker-string.html marker-string-ref.html
 skip-if(Android) == bidi-simple.html bidi-simple-ref.html # Fails on Android due to anti-aliasing
 skip-if(!gtkWidget) fuzzy-if(gtkWidget,2,289) == bidi-simple-scrolled.html bidi-simple-scrolled-ref.html # Fails on Windows and OSX due to anti-aliasing
 fuzzy-if(Android,24,4000) fuzzy-if(cocoaWidget,1,40) fuzzy-if(asyncPan&&!layersGPUAccelerated,149,1836) == scroll-rounding.html scroll-rounding-ref.html # bug 760264
-fuzzy(2,453) fuzzy-if(skiaContent,9,2100) fails-if(gtkWidget) fails-if(webrender&&winWidget) == anonymous-block.html anonymous-block-ref.html # gtkWidget:bug 1309103
+fuzzy(2,453) fuzzy-if(skiaContent,9,2100) fails-if(gtkWidget) fuzzy-if(webrender&&winWidget,50-50,499-499) == anonymous-block.html anonymous-block-ref.html # gtkWidget:bug 1309103
 == false-marker-overlap.html false-marker-overlap-ref.html
 == visibility-hidden.html visibility-hidden-ref.html
 fuzzy-if(asyncPan&&!layersGPUAccelerated,102,1724) fuzzy-if(gtkWidget,10,8) == block-padding.html block-padding-ref.html
 fuzzy-if(webrender,3,825) == quirks-decorations.html quirks-decorations-ref.html
 == quirks-line-height.html quirks-line-height-ref.html
 == standards-decorations.html standards-decorations-ref.html
 == standards-line-height.html standards-line-height-ref.html
 fuzzy-if(skiaContent,1,4200) == selection.html selection-ref.html
--- a/layout/reftests/text-shadow/reftest.list
+++ b/layout/reftests/text-shadow/reftest.list
@@ -1,15 +1,15 @@
 == 723669.html 723669-ref.html
 
-fails-if(webrender&&winWidget) == basic.xul basic-ref.xul
-random-if(Android) fails-if(webrender&&winWidget) == basic-negcoord.xul basic-negcoord-ref.xul
+fuzzy-if(webrender&&winWidget,1-1,7-7) == basic.xul basic-ref.xul
+random-if(Android) fuzzy-if(webrender&&winWidget,1-1,6-6) == basic-negcoord.xul basic-negcoord-ref.xul
 != blur.xul blur-notref.xul
-fails-if(webrender&&winWidget) == color-inherit.xul color-inherit-ref.xul
-fails-if(webrender&&winWidget) == multiple-noblur.xul multiple-noblur-ref.xul
+fuzzy-if(webrender&&winWidget,1-1,6-6) == color-inherit.xul color-inherit-ref.xul
+fuzzy-if(webrender&&winWidget,1-1,44-44) == multiple-noblur.xul multiple-noblur-ref.xul
 == blur-opacity.html blur-opacity-ref.html
 
 == basic.html basic-ref.html
 == basic-negcoord.html basic-negcoord-ref.html
 == basic-opacity.html basic-opacity-ref.html
 != blur.html blur-notref.html
 == color-inherit.html color-inherit-ref.html
 == color-parserorder.html color-parserorder-ref.html
--- a/layout/reftests/text-svgglyphs/reftest.list
+++ b/layout/reftests/text-svgglyphs/reftest.list
@@ -1,16 +1,16 @@
 pref(gfx.font_rendering.opentype_svg.enabled,false)   != svg-glyph-basic.svg svg-glyph-basic-ref.svg
 pref(gfx.font_rendering.opentype_svg.enabled,true)    fuzzy-if(skiaContent,1,200) == svg-glyph-basic.svg svg-glyph-basic-ref.svg
 pref(gfx.font_rendering.opentype_svg.enabled,true)    == svg-glyph-invalid-ids.svg svg-glyph-invalid-ids-ref.svg
 pref(gfx.font_rendering.opentype_svg.enabled,false)   != svg-glyph-positioning.svg svg-glyph-positioning-ref.svg
 pref(gfx.font_rendering.opentype_svg.enabled,true)    fuzzy-if(skiaContent,2,350) == svg-glyph-positioning.svg svg-glyph-positioning-ref.svg
 pref(gfx.font_rendering.opentype_svg.enabled,true)    == svg-glyph-html.html svg-glyph-html-ref.svg
 pref(gfx.font_rendering.opentype_svg.enabled,true)    == svg-glyph-direct.svg svg-glyph-direct-ref.svg
-pref(gfx.font_rendering.opentype_svg.enabled,true)    fails-if(webrender&&winWidget) == svg-glyph-invalid.html svg-glyph-invalid-ref.html
+pref(gfx.font_rendering.opentype_svg.enabled,true)    fuzzy-if(webrender&&winWidget,138-138,2461-2461) == svg-glyph-invalid.html svg-glyph-invalid-ref.html
 pref(gfx.font_rendering.opentype_svg.enabled,true)    == svg-glyph-objectfill-solid.svg svg-glyph-objectfill-solid-ref.svg
 pref(gfx.font_rendering.opentype_svg.enabled,true)    fuzzy-if(skiaContent,2,200) == svg-glyph-objectstroke-solid.svg svg-glyph-objectstroke-solid-ref.svg
 pref(gfx.font_rendering.opentype_svg.enabled,true)    fuzzy(1,7) fuzzy-if(gtkWidget&&/^Linux\x20x86_64/.test(http.oscpu),1,79) fuzzy-if(skiaContent,1,300) == svg-glyph-objectgradient.svg svg-glyph-objectgradient-ref.svg # see bug 871961#c5
 pref(gfx.font_rendering.opentype_svg.enabled,true)    fuzzy-if(cocoaWidget,1,7028) fuzzy-if(gtkWidget&&/^Linux\x20x86_64/.test(http.oscpu),1,23) fuzzy-if(skiaContent,1,250) fuzzy-if(webrender,128-128,90-94) == svg-glyph-objectgradient-zoom.svg svg-glyph-objectgradient-zoom-ref.svg
 pref(gfx.font_rendering.opentype_svg.enabled,true)    fuzzy-if(gtkWidget,1,1438) fuzzy-if(winWidget,1,1954) fuzzy-if(Android,8,3795) fuzzy-if(skiaContent,14,13000) == svg-glyph-objectpattern.svg svg-glyph-objectpattern-ref.svg
 pref(gfx.font_rendering.opentype_svg.enabled,true)    == clip.html clip-ref.html
 pref(gfx.font_rendering.opentype_svg.enabled,true)    fuzzy(1,13) fuzzy-if(gtkWidget&&/^Linux\x20x86_64/.test(http.oscpu),1,62) fuzzy-if(skiaContent,1,350) == svg-glyph-objectopacity.svg svg-glyph-objectopacity-ref.svg # see bug 871961#c5
 pref(gfx.font_rendering.opentype_svg.enabled,true)    fuzzy-if(gtkWidget,1,2268) fuzzy-if(winWidget,1,3074) fuzzy-if(Android,5,4715) fuzzy-if(skiaContent,8,13000) == svg-glyph-objectopacity2.svg svg-glyph-objectopacity2-ref.svg
--- a/layout/reftests/transform-3d/reftest.list
+++ b/layout/reftests/transform-3d/reftest.list
@@ -75,18 +75,18 @@ fuzzy-if(cocoaWidget,128,9) == animate-p
 == animate-backface-hidden.html about:blank
 == 1245450-1.html green-rect.html
 fuzzy(1,2000) == opacity-preserve3d-1.html opacity-preserve3d-1-ref.html
 fuzzy(1,15000) == opacity-preserve3d-2.html opacity-preserve3d-2-ref.html
 fuzzy(1,10000) == opacity-preserve3d-3.html opacity-preserve3d-3-ref.html
 fuzzy(1,10000) == opacity-preserve3d-4.html opacity-preserve3d-4-ref.html
 == opacity-preserve3d-5.html opacity-preserve3d-5-ref.html
 == snap-perspective-1.html snap-perspective-1-ref.html
-fails-if(webrender&&winWidget) == mask-layer-1.html mask-layer-ref.html
-fails-if(webrender&&winWidget) == mask-layer-2.html mask-layer-ref.html
+fuzzy-if(webrender&&winWidget,1-1,16-16) == mask-layer-1.html mask-layer-ref.html
+fuzzy-if(webrender&&winWidget,1-1,16-16) == mask-layer-2.html mask-layer-ref.html
 fails-if(webrender) == mask-layer-3.html mask-layer-ref.html
 == split-intersect1.html split-intersect1-ref.html
 fuzzy(255,150) == split-intersect2.html split-intersect2-ref.html
 fuzzy(255,100) == split-non-ortho1.html split-non-ortho1-ref.html
 fuzzy-if(winWidget,150,120) == component-alpha-1.html component-alpha-1-ref.html
 == nested-transform-1.html nested-transform-1-ref.html
 == transform-geometry-1.html transform-geometry-1-ref.html
 == intermediate-1.html intermediate-1-ref.html
--- a/layout/reftests/w3c-css/failures.list
+++ b/layout/reftests/w3c-css/failures.list
@@ -87,31 +87,31 @@ fails-if(Android) css-writing-modes/sizi
 # Fuzzy
 fuzzy-if(OSX||winWidget,255,480)  css-writing-modes/abs-pos-non-replaced-v??-???.xht
 fuzzy-if(OSX||winWidget,93,600)   css-writing-modes/baseline-inline-non-replaced-00?.xht
 fuzzy-if(OSX||winWidget,213,1540) css-writing-modes/block-flow-direction-???-0??.xht
 fuzzy-if(OSX,255,200)  css-writing-modes/box-offsets-rel-pos-vlr-005.xht
 fuzzy-if(OSX,255,200)  css-writing-modes/box-offsets-rel-pos-vrl-004.xht
 fuzzy-if(OSX||winWidget,93,300)   css-writing-modes/caption-side-v??-00?.xht
 fuzzy-if(OSX||winWidget,215,780)  css-writing-modes/central-baseline-alignment-00?.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) css-writing-modes/direction-v??-00?.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) css-writing-modes/direction-v??-00?.xht
 fuzzy-if(OSX||winWidget,135,902)  css-writing-modes/float-contiguous-v??-01?.xht
 fuzzy-if(OSX||winWidget,93,300)   css-writing-modes/float-shrink-to-fit-vlr-009.xht
 fuzzy-if(OSX||winWidget,93,300)   css-writing-modes/float-shrink-to-fit-vrl-008.xht
 fuzzy-if(OSX||winWidget,93,300)   css-writing-modes/float-v??-0??.xht
-fuzzy-if(OSX||winWidget,62,404) fails-if(webrender&&winWidget) css-writing-modes/height-width-inline-non-replaced-v??-00?.xht
+fuzzy-if(OSX||winWidget,62,404) fuzzy-if(webrender&&winWidget,92-92,100-100) css-writing-modes/height-width-inline-non-replaced-v??-00?.xht
 fuzzy-if(OSX||winWidget,218,621)  css-writing-modes/inline-block-alignment-orthogonal-v??-00?.xht
 fuzzy-if(OSX||winWidget,135,1080) css-writing-modes/inline-block-alignment-slr-009.xht
 fuzzy-if(OSX||winWidget,111,960)  css-writing-modes/inline-block-alignment-srl-008.xht
 fuzzy-if(OSX||winWidget,213,1540) css-writing-modes/line-box-direction-???-0??.xht
 fuzzy-if(OSX||winWidget,110,1200) css-writing-modes/row-progression-???-0??.xht
 fuzzy-if(OSX||winWidget,110,1200) css-writing-modes/table-column-order-00?.xht
 fuzzy-if(winWidget,110,1200) css-writing-modes/table-column-order-slr-007.xht
 fuzzy-if(OSX||winWidget,110,1200) css-writing-modes/table-column-order-srl-006.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) css-writing-modes/text-align-v??-0??.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) css-writing-modes/text-align-v??-0??.xht
 fuzzy-if(OSX||winWidget,215,780)  css-writing-modes/text-baseline-???-00?.xht
 fuzzy-if(OSX,15,16) css-writing-modes/text-combine-upright-decorations-001.html
 fuzzy-if(OSX||winWidget,255,480)  css-writing-modes/text-indent-v??-0??.xht
 fuzzy-if(OSX||winWidget,226,960)  css-writing-modes/text-orientation-016.xht
 fuzzy-if(OSX||winWidget,223,720)  css-writing-modes/vertical-alignment-*.xht
 fuzzy-if(OSX||winWidget,153,612)  css-writing-modes/writing-mode-vertical-??-00?.*
 fuzzy(255,960) css-writing-modes/text-combine-upright-value-all-00?.html
 
--- a/layout/reftests/w3c-css/received/reftest.list
+++ b/layout/reftests/w3c-css/received/reftest.list
@@ -709,20 +709,20 @@ fails == css-writing-modes/contiguous-fl
 fails == css-writing-modes/contiguous-floated-table-vlr-007.xht reference/ref-filled-green-100px-square.xht
 fails == css-writing-modes/contiguous-floated-table-vlr-009.xht reference/ref-filled-green-100px-square.xht
 fails == css-writing-modes/contiguous-floated-table-vrl-002.xht reference/ref-filled-green-100px-square.xht
 fails == css-writing-modes/contiguous-floated-table-vrl-004.xht reference/ref-filled-green-100px-square.xht
 fails == css-writing-modes/contiguous-floated-table-vrl-006.xht reference/ref-filled-green-100px-square.xht
 fails == css-writing-modes/contiguous-floated-table-vrl-008.xht reference/ref-filled-green-100px-square.xht
 == css-writing-modes/different-block-flow-dir-001.xht reference/ref-filled-green-100px-square.xht
 == css-writing-modes/different-block-flow-dir-002.xht reference/ref-filled-green-100px-square.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/direction-vlr-003.xht css-writing-modes/direction-vlr-003-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/direction-vlr-005.xht reference/ref-filled-green-100px-square.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/direction-vrl-002.xht css-writing-modes/direction-vrl-002-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/direction-vrl-004.xht css-writing-modes/direction-vrl-004-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/direction-vlr-003.xht css-writing-modes/direction-vlr-003-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/direction-vlr-005.xht reference/ref-filled-green-100px-square.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/direction-vrl-002.xht css-writing-modes/direction-vrl-002-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/direction-vrl-004.xht css-writing-modes/direction-vrl-004-ref.xht
 == css-writing-modes/flexbox_align-items-stretch-writing-modes.html css-writing-modes/flexbox_align-items-stretch-writing-modes-ref.html
 == css-writing-modes/float-clear-vlr-003.xht reference/ref-filled-green-100px-square.xht
 == css-writing-modes/float-clear-vlr-005.xht reference/ref-filled-green-100px-square.xht
 == css-writing-modes/float-clear-vlr-007.xht reference/ref-filled-green-100px-square.xht
 == css-writing-modes/float-clear-vlr-009.xht reference/ref-filled-green-100px-square.xht
 == css-writing-modes/float-clear-vrl-002.xht reference/ref-filled-green-100px-square.xht
 == css-writing-modes/float-clear-vrl-004.xht reference/ref-filled-green-100px-square.xht
 == css-writing-modes/float-clear-vrl-006.xht reference/ref-filled-green-100px-square.xht
@@ -769,18 +769,18 @@ fuzzy-if(OSX||winWidget,93,300) == css-w
 fuzzy-if(OSX||winWidget,93,300) == css-writing-modes/float-vrl-010.xht reference/ref-filled-green-100px-square.xht
 fuzzy-if(OSX||winWidget,93,300) == css-writing-modes/float-vrl-012.xht reference/ref-filled-green-100px-square.xht
 != css-writing-modes/full-width-001.html css-writing-modes/reference/full-width-001-horizontal-notref.html
 != css-writing-modes/full-width-001.html css-writing-modes/reference/full-width-001-nofullwidth-notref.html
 != css-writing-modes/full-width-002.html css-writing-modes/reference/full-width-002-notcu-notref.html
 != css-writing-modes/full-width-002.html css-writing-modes/reference/full-width-002-horizontal-notref.html
 skip != css-writing-modes/full-width-003.html css-writing-modes/reference/full-width-002-notcu-notref.html
 skip != css-writing-modes/full-width-003.html css-writing-modes/reference/full-width-002-horizontal-notref.html
-fuzzy-if(OSX||winWidget,62,404) fails-if(webrender&&winWidget) == css-writing-modes/height-width-inline-non-replaced-vlr-003.xht reference/ref-filled-green-100px-square.xht
-fuzzy-if(OSX||winWidget,62,404) fails-if(webrender&&winWidget) == css-writing-modes/height-width-inline-non-replaced-vrl-002.xht css-writing-modes/abs-pos-non-replaced-icb-vrl-008-ref.xht
+fuzzy-if(OSX||winWidget,62,404) fuzzy-if(webrender&&winWidget,92-92,100-100) == css-writing-modes/height-width-inline-non-replaced-vlr-003.xht reference/ref-filled-green-100px-square.xht
+fuzzy-if(OSX||winWidget,62,404) fuzzy-if(webrender&&winWidget,92-92,100-100) == css-writing-modes/height-width-inline-non-replaced-vrl-002.xht css-writing-modes/abs-pos-non-replaced-icb-vrl-008-ref.xht
 == css-writing-modes/horizontal-rule-vlr-003.xht css-writing-modes/horizontal-rule-vlr-003-ref.xht
 == css-writing-modes/horizontal-rule-vlr-005.xht css-writing-modes/horizontal-rule-vrl-004-ref.xht
 == css-writing-modes/horizontal-rule-vrl-002.xht css-writing-modes/horizontal-rule-vrl-002-ref.xht
 == css-writing-modes/horizontal-rule-vrl-004.xht css-writing-modes/horizontal-rule-vrl-004-ref.xht
 fails == css-writing-modes/inline-block-alignment-002.xht css-writing-modes/inline-block-alignment-002-ref.xht
 fails == css-writing-modes/inline-block-alignment-003.xht css-writing-modes/inline-block-alignment-003-ref.xht
 fails == css-writing-modes/inline-block-alignment-004.xht css-writing-modes/inline-block-alignment-002-ref.xht
 fails == css-writing-modes/inline-block-alignment-005.xht css-writing-modes/inline-block-alignment-003-ref.xht
@@ -1043,34 +1043,34 @@ fails == css-writing-modes/table-progres
 == css-writing-modes/table-progression-vlr-001.html css-writing-modes/table-progression-001-ref.html
 fails == css-writing-modes/table-progression-vlr-002.html css-writing-modes/table-progression-002-ref.html
 fails == css-writing-modes/table-progression-vlr-003.html css-writing-modes/table-progression-001-ref.html
 fails == css-writing-modes/table-progression-vlr-004.html css-writing-modes/table-progression-002-ref.html
 == css-writing-modes/table-progression-vrl-001.html css-writing-modes/table-progression-001-ref.html
 fails == css-writing-modes/table-progression-vrl-002.html css-writing-modes/table-progression-002-ref.html
 fails == css-writing-modes/table-progression-vrl-003.html css-writing-modes/table-progression-001-ref.html
 fails == css-writing-modes/table-progression-vrl-004.html css-writing-modes/table-progression-002-ref.html
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vlr-003.xht reference/ref-filled-green-100px-square.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vlr-005.xht reference/ref-filled-green-100px-square.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vlr-007.xht reference/ref-filled-green-100px-square.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vlr-009.xht css-writing-modes/text-align-vlr-009-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vlr-011.xht css-writing-modes/text-align-vlr-009-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vlr-013.xht css-writing-modes/text-align-vlr-009-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vlr-015.xht css-writing-modes/direction-vlr-003-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vlr-017.xht css-writing-modes/direction-vlr-003-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vlr-019.xht css-writing-modes/direction-vlr-003-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vrl-002.xht css-writing-modes/direction-vrl-004-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vrl-004.xht css-writing-modes/direction-vrl-004-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vrl-006.xht css-writing-modes/direction-vrl-004-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vrl-008.xht css-writing-modes/text-align-vrl-008-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vrl-010.xht css-writing-modes/text-align-vrl-008-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vrl-012.xht css-writing-modes/text-align-vrl-008-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vrl-014.xht css-writing-modes/direction-vrl-002-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vrl-016.xht css-writing-modes/direction-vrl-002-ref.xht
-fuzzy-if(OSX||winWidget,75,404) fails-if(webrender&&winWidget) == css-writing-modes/text-align-vrl-018.xht css-writing-modes/direction-vrl-002-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vlr-003.xht reference/ref-filled-green-100px-square.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vlr-005.xht reference/ref-filled-green-100px-square.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vlr-007.xht reference/ref-filled-green-100px-square.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vlr-009.xht css-writing-modes/text-align-vlr-009-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vlr-011.xht css-writing-modes/text-align-vlr-009-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vlr-013.xht css-writing-modes/text-align-vlr-009-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vlr-015.xht css-writing-modes/direction-vlr-003-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vlr-017.xht css-writing-modes/direction-vlr-003-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vlr-019.xht css-writing-modes/direction-vlr-003-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vrl-002.xht css-writing-modes/direction-vrl-004-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vrl-004.xht css-writing-modes/direction-vrl-004-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vrl-006.xht css-writing-modes/direction-vrl-004-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vrl-008.xht css-writing-modes/text-align-vrl-008-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vrl-010.xht css-writing-modes/text-align-vrl-008-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vrl-012.xht css-writing-modes/text-align-vrl-008-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vrl-014.xht css-writing-modes/direction-vrl-002-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vrl-016.xht css-writing-modes/direction-vrl-002-ref.xht
+fuzzy-if(OSX||winWidget,75,404) fuzzy-if(webrender&&winWidget,92-92,300-300) == css-writing-modes/text-align-vrl-018.xht css-writing-modes/direction-vrl-002-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes/text-baseline-slr-009.xht css-writing-modes/text-baseline-slr-009-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes/text-baseline-srl-008.xht css-writing-modes/text-baseline-vrl-006-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes/text-baseline-vlr-003.xht css-writing-modes/text-baseline-vrl-002-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes/text-baseline-vlr-005.xht css-writing-modes/text-baseline-vrl-002-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes/text-baseline-vlr-007.xht css-writing-modes/text-baseline-vrl-006-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes/text-baseline-vrl-002.xht css-writing-modes/text-baseline-vrl-002-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes/text-baseline-vrl-004.xht css-writing-modes/text-baseline-vrl-002-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes/text-baseline-vrl-006.xht css-writing-modes/text-baseline-vrl-006-ref.xht
--- a/layout/reftests/w3c-css/submitted/background/reftest.list
+++ b/layout/reftests/w3c-css/submitted/background/reftest.list
@@ -17,17 +17,17 @@
 == background-repeat-round-1d.html background-repeat-round-1-ref.html
 == background-repeat-round-1e.html background-repeat-round-1-ref.html
 == background-repeat-round-2.html background-repeat-round-2-ref.html
 == background-repeat-round-3.html background-repeat-round-3-ref.html
 == background-repeat-round-4.html background-repeat-round-4-ref.html
 
 #border-image test cases
 fuzzy-if(webrender,9-10,572-576) == border-image-repeat-round-1.html border-image-repeat-round-1-ref.html
-fuzzy-if(webrender,7-7,216-216) fails-if(webrender&&winWidget) == border-image-repeat-round-2.html border-image-repeat-round-2-ref.html
+fuzzy-if(webrender,7-7,216-224) == border-image-repeat-round-2.html border-image-repeat-round-2-ref.html
 == border-image-repeat-space-1.html border-image-repeat-space-1-ref.html
 == border-image-repeat-space-2.html border-image-repeat-space-2-ref.html
 == border-image-repeat-space-3.html border-image-repeat-space-3-ref.html
 == border-image-repeat-space-4.html border-image-repeat-space-4-ref-1.html
 == border-image-repeat-space-4-ref-1.html border-image-repeat-space-4-ref-2.html
 == border-image-repeat-space-5.html border-image-repeat-space-5-ref-1.html
 == border-image-repeat-space-5-ref-1.html border-image-repeat-space-5-ref-2.html
 == border-image-repeat-space-6.html border-image-repeat-space-6-ref.html
--- a/layout/reftests/writing-mode/reftest.list
+++ b/layout/reftests/writing-mode/reftest.list
@@ -145,17 +145,17 @@ test-pref(dom.meta-viewport.enabled,true
 == 1188061-1-nsChangeHint_ClearAncestorIntrinsics.html 1188061-1-nsChangeHint_ClearAncestorIntrinsics-ref.html
 == 1188061-2-nsChangeHint_UpdateComputedBSize.html 1188061-2-nsChangeHint_UpdateComputedBSize-ref.html
 
 # tests involving sideways-lr mode
 == 1193519-sideways-lr-1.html 1193519-sideways-lr-1-ref.html
 == 1193519-sideways-lr-2.html 1193519-sideways-lr-2-ref.html
 fuzzy-if(winWidget,3,84) fails-if(webrender&&winWidget) == 1193519-sideways-lr-3.html 1193519-sideways-lr-3-ref.html
 fuzzy-if(winWidget,3,112) fails-if(webrender) == 1193519-sideways-lr-4.html 1193519-sideways-lr-4-ref.html # see bug 1366692. Rounding error with WR enabled.
-fuzzy-if(gtkWidget,255,6) fuzzy-if(cocoaWidget,65,69) fails-if(webrender&&winWidget) == 1193519-sideways-lr-decoration-1.html 1193519-sideways-lr-decoration-1-ref.html
+fuzzy-if(gtkWidget,255,6) fuzzy-if(cocoaWidget,65,69) fuzzy-if(webrender&&winWidget,255-255,608-608) == 1193519-sideways-lr-decoration-1.html 1193519-sideways-lr-decoration-1-ref.html
 
 == 1196887-1-computed-display-inline-block.html 1196887-1-computed-display-inline-block-ref.html
 == 1205787-legacy-svg-values-1.html 1205787-legacy-svg-values-1-ref.html
 
 == 1216747-1.html 1216747-1-ref.html
 != 1216747-1.html 1216747-1-notref.html
 
 == 1243125-1-floats-overflowing.html 1243125-1-floats-overflowing-ref.html
--- a/layout/style/ErrorReporter.cpp
+++ b/layout/style/ErrorReporter.cpp
@@ -20,19 +20,18 @@
 #include "nsIScriptError.h"
 #include "nsISensitiveInfoHiddenURI.h"
 #include "nsIStringBundle.h"
 #include "nsServiceManagerUtils.h"
 #include "nsStyleUtil.h"
 #include "nsThreadUtils.h"
 #include "nsNetUtil.h"
 
-#ifdef CSS_REPORT_PARSE_ERRORS
-
 using namespace mozilla;
+using namespace mozilla::css;
 
 namespace {
 class ShortTermURISpecCache : public Runnable {
 public:
   ShortTermURISpecCache()
    : Runnable("ShortTermURISpecCache")
    , mPending(false) {}
 
@@ -62,73 +61,65 @@ public:
 private:
   nsCOMPtr<nsIURI> mURI;
   nsString mSpec;
   bool mPending;
 };
 
 } // namespace
 
-static bool sReportErrors;
+bool ErrorReporter::sReportErrors = false;
+bool ErrorReporter::sInitialized = false;
+
 static nsIConsoleService *sConsoleService;
 static nsIFactory *sScriptErrorFactory;
 static nsIStringBundle *sStringBundle;
 static ShortTermURISpecCache *sSpecCache;
 
 #define CSS_ERRORS_PREF "layout.css.report_errors"
 
-static bool
-InitGlobals()
+void
+ErrorReporter::InitGlobals()
 {
-  MOZ_ASSERT(!sConsoleService && !sScriptErrorFactory && !sStringBundle,
-             "should not have been called");
+  MOZ_RELEASE_ASSERT(NS_IsMainThread());
+  MOZ_ASSERT(!sInitialized, "should not have been called");
+
+  sInitialized = true;
 
-  if (NS_FAILED(Preferences::AddBoolVarCache(&sReportErrors, CSS_ERRORS_PREF,
+  if (NS_FAILED(Preferences::AddBoolVarCache(&sReportErrors,
+                                             CSS_ERRORS_PREF,
                                              true))) {
-    return false;
+    return;
   }
 
   nsCOMPtr<nsIConsoleService> cs = do_GetService(NS_CONSOLESERVICE_CONTRACTID);
   if (!cs) {
-    return false;
+    return;
   }
 
   nsCOMPtr<nsIFactory> sf = do_GetClassObject(NS_SCRIPTERROR_CONTRACTID);
   if (!sf) {
-    return false;
+    return;
   }
 
   nsCOMPtr<nsIStringBundleService> sbs = services::GetStringBundleService();
   if (!sbs) {
-    return false;
+    return;
   }
 
   nsCOMPtr<nsIStringBundle> sb;
   nsresult rv = sbs->CreateBundle("chrome://global/locale/css.properties",
                                   getter_AddRefs(sb));
   if (NS_FAILED(rv) || !sb) {
-    return false;
+    return;
   }
 
   cs.forget(&sConsoleService);
   sf.forget(&sScriptErrorFactory);
   sb.forget(&sStringBundle);
-
-  return true;
-}
-
-static inline bool
-ShouldReportErrors()
-{
-  if (!sConsoleService) {
-    if (!InitGlobals()) {
-      return false;
-    }
-  }
-  return sReportErrors;
 }
 
 namespace mozilla {
 namespace css {
 
 /* static */ void
 ErrorReporter::ReleaseGlobals()
 {
@@ -165,23 +156,22 @@ ErrorReporter::~ErrorReporter()
       sSpecCache->SetPending();
     }
   }
 }
 
 void
 ErrorReporter::OutputError()
 {
+  MOZ_ASSERT(NS_IsMainThread());
+  MOZ_ASSERT(ShouldReportErrors());
+
   if (mError.IsEmpty()) {
     return;
   }
-  if (!ShouldReportErrors()) {
-    ClearError();
-    return;
-  }
 
   if (mInnerWindowID == 0 && (mSheet || mLoader)) {
     if (mSheet) {
       mInnerWindowID = mSheet->FindOwningWindowInnerID();
     }
     if (mInnerWindowID == 0 && mLoader) {
       nsIDocument* doc = mLoader->GetDocument();
       if (doc) {
@@ -224,24 +214,16 @@ ErrorReporter::OutputError()
     if (NS_SUCCEEDED(rv)) {
       sConsoleService->LogMessage(errorObject);
     }
   }
 
   ClearError();
 }
 
-void
-ErrorReporter::OutputError(uint32_t aLineNumber, uint32_t aColNumber)
-{
-  mErrorLineNumber = aLineNumber;
-  mErrorColNumber = aColNumber;
-  OutputError();
-}
-
 // When Stylo's CSS parser is in use, this reporter does not have access to the CSS parser's
 // state. The users of ErrorReporter need to provide:
 // - the line number of the error
 // - the column number of the error
 // - the complete source line containing the invalid CSS
 
 void
 ErrorReporter::OutputError(uint32_t aLineNumber,
@@ -292,118 +274,23 @@ ErrorReporter::ReportUnexpected(const ch
   if (!ShouldReportErrors()) return;
 
   nsAutoString str;
   sStringBundle->GetStringFromName(aMessage, str);
   AddToError(str);
 }
 
 void
-ErrorReporter::ReportUnexpected(const char *aMessage,
-                                const nsString &aParam)
-{
-  if (!ShouldReportErrors()) return;
-
-  nsAutoString qparam;
-  nsStyleUtil::AppendEscapedCSSIdent(aParam, qparam);
-  const char16_t *params[1] = { qparam.get() };
-
-  nsAutoString str;
-  sStringBundle->FormatStringFromName(aMessage, params, ArrayLength(params),
-                                      str);
-  AddToError(str);
-}
-
-void
 ErrorReporter::ReportUnexpectedUnescaped(const char *aMessage,
                                          const nsAutoString& aParam)
 {
   if (!ShouldReportErrors()) return;
 
   const char16_t *params[1] = { aParam.get() };
 
   nsAutoString str;
   sStringBundle->FormatStringFromName(aMessage, params, ArrayLength(params),
                                       str);
   AddToError(str);
 }
 
-void
-ErrorReporter::ReportUnexpected(const char *aMessage,
-                                const nsCSSToken &aToken)
-{
-  if (!ShouldReportErrors()) return;
-
-  nsAutoString tokenString;
-  aToken.AppendToString(tokenString);
-  ReportUnexpectedUnescaped(aMessage, tokenString);
-}
-
-void
-ErrorReporter::ReportUnexpected(const char *aMessage,
-                                const nsCSSToken &aToken,
-                                char16_t aChar)
-{
-  if (!ShouldReportErrors()) return;
-
-  nsAutoString tokenString;
-  aToken.AppendToString(tokenString);
-  const char16_t charStr[2] = { aChar, 0 };
-  const char16_t *params[2] = { tokenString.get(), charStr };
-
-  nsAutoString str;
-  sStringBundle->FormatStringFromName(aMessage, params, ArrayLength(params),
-                                      str);
-  AddToError(str);
-}
-
-void
-ErrorReporter::ReportUnexpected(const char *aMessage,
-                                const nsString &aParam,
-                                const nsString &aValue)
-{
-  if (!ShouldReportErrors()) return;
-
-  nsAutoString qparam;
-  nsStyleUtil::AppendEscapedCSSIdent(aParam, qparam);
-  const char16_t *params[2] = { qparam.get(), aValue.get() };
-
-  nsAutoString str;
-  sStringBundle->FormatStringFromName(aMessage, params, ArrayLength(params),
-                                      str);
-  AddToError(str);
-}
-
-void
-ErrorReporter::ReportUnexpectedEOF(const char *aMessage)
-{
-  if (!ShouldReportErrors()) return;
-
-  nsAutoString innerStr;
-  sStringBundle->GetStringFromName(aMessage, innerStr);
-  const char16_t *params[1] = { innerStr.get() };
-
-  nsAutoString str;
-  sStringBundle->FormatStringFromName("PEUnexpEOF2", params,
-                                      ArrayLength(params), str);
-  AddToError(str);
-}
-
-void
-ErrorReporter::ReportUnexpectedEOF(char16_t aExpected)
-{
-  if (!ShouldReportErrors()) return;
-
-  const char16_t expectedStr[] = {
-    char16_t('\''), aExpected, char16_t('\''), char16_t(0)
-  };
-  const char16_t *params[1] = { expectedStr };
-
-  nsAutoString str;
-  sStringBundle->FormatStringFromName("PEUnexpEOF2", params,
-                                      ArrayLength(params), str);
-  AddToError(str);
-}
-
 } // namespace css
 } // namespace mozilla
-
-#endif
--- a/layout/style/ErrorReporter.h
+++ b/layout/style/ErrorReporter.h
@@ -4,112 +4,81 @@
  * 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/. */
 
 /* diagnostic reporting for CSS style sheet parser */
 
 #ifndef mozilla_css_ErrorReporter_h_
 #define mozilla_css_ErrorReporter_h_
 
-// XXX turn this off for minimo builds
-#define CSS_REPORT_PARSE_ERRORS
-
 #include "nsString.h"
 
 struct nsCSSToken;
 class nsIURI;
 
 namespace mozilla {
 class ServoStyleSheet;
 class StyleSheet;
 
 namespace css {
 
 class Loader;
 
-// If CSS_REPORT_PARSE_ERRORS is not defined, all of this class's
-// methods become inline stubs.
 class ErrorReporter {
 public:
   ErrorReporter(const StyleSheet* aSheet,
                 const Loader* aLoader,
                 nsIURI* aURI);
   ~ErrorReporter();
 
   static void ReleaseGlobals();
+  static void EnsureGlobalsInitialized()
+  {
+    if (MOZ_UNLIKELY(!sInitialized)) {
+      InitGlobals();
+    }
+  }
 
-  void OutputError();
-  void OutputError(uint32_t aLineNumber, uint32_t aLineOffset);
-  void OutputError(uint32_t aLineNumber, uint32_t aLineOffset, const nsACString& aSource);
+  bool ShouldReportErrors() const
+  {
+    EnsureGlobalsInitialized();
+    return sReportErrors;
+  }
+
+  void OutputError(uint32_t aLineNumber,
+                   uint32_t aLineOffset,
+                   const nsACString& aSource);
   void ClearError();
 
   // In all overloads of ReportUnexpected, aMessage is a stringbundle
   // name, which will be processed as a format string with the
   // indicated number of parameters.
 
   // no parameters
   void ReportUnexpected(const char *aMessage);
-  // one parameter, a string
-  void ReportUnexpected(const char *aMessage, const nsString& aParam);
-  // one parameter, a token
-  void ReportUnexpected(const char *aMessage, const nsCSSToken& aToken);
   // one parameter which has already been escaped appropriately
   void ReportUnexpectedUnescaped(const char *aMessage,
                                  const nsAutoString& aParam);
-  // two parameters, a token and a character, in that order
-  void ReportUnexpected(const char *aMessage, const nsCSSToken& aToken,
-                        char16_t aChar);
-  // two parameters, a param and a value
-  void ReportUnexpected(const char *aMessage, const nsString& aParam,
-                        const nsString& aValue);
-
-  // for ReportUnexpectedEOF, aExpected can be either a stringbundle
-  // name or a single character.  In the former case there may not be
-  // any format parameters.
-  void ReportUnexpectedEOF(const char *aExpected);
-  void ReportUnexpectedEOF(char16_t aExpected);
 
 private:
+  void OutputError();
   void AddToError(const nsString &aErrorText);
+  static void InitGlobals();
 
-#ifdef CSS_REPORT_PARSE_ERRORS
+  static bool sInitialized;
+  static bool sReportErrors;
+
   nsAutoString mError;
   nsString mErrorLine;
   nsString mFileName;
   const StyleSheet *mSheet;
   const Loader *mLoader;
   nsIURI *mURI;
   uint64_t mInnerWindowID;
   uint32_t mErrorLineNumber;
   uint32_t mPrevErrorLineNumber;
   uint32_t mErrorColNumber;
-#endif
 };
 
-#ifndef CSS_REPORT_PARSE_ERRORS
-inline ErrorReporter::ErrorReporter(const StyleSheet*,
-                                    const Loader*,
-                                    nsIURI*) {}
-inline ErrorReporter::~ErrorReporter() {}
-
-inline void ErrorReporter::ReleaseGlobals() {}
-
-inline void ErrorReporter::OutputError() {}
-inline void ErrorReporter::ClearError() {}
-
-inline void ErrorReporter::ReportUnexpected(const char *) {}
-inline void ErrorReporter::ReportUnexpected(const char *, const nsString &) {}
-inline void ErrorReporter::ReportUnexpected(const char *, const nsCSSToken &) {}
-inline void ErrorReporter::ReportUnexpected(const char *, const nsCSSToken &,
-                                            char16_t) {}
-inline void ErrorReporter::ReportUnexpected(const char *, const nsString &,
-                                            const nsString &) {}
-
-inline void ErrorReporter::ReportUnexpectedEOF(const char *) {}
-inline void ErrorReporter::ReportUnexpectedEOF(char16_t) {}
-
-inline void ErrorReporter::AddToError(const nsString &) {}
-#endif
-
 } // namespace css
 } // namespace mozilla
 
 #endif // mozilla_css_ErrorReporter_h_
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -2676,17 +2676,21 @@ Gecko_ReportUnexpectedCSSError(ErrorRepo
                                const char* prefixParam,
                                uint32_t prefixParamLen,
                                const char* suffix,
                                const char* source,
                                uint32_t sourceLen,
                                uint32_t lineNumber,
                                uint32_t colNumber)
 {
-  MOZ_ASSERT(NS_IsMainThread());
+  if (!reporter->ShouldReportErrors()) {
+    return;
+  }
+
+  MOZ_RELEASE_ASSERT(NS_IsMainThread());
 
   if (prefix) {
     if (prefixParam) {
       nsDependentCSubstring paramValue(prefixParam, prefixParamLen);
       nsAutoString wideParam = NS_ConvertUTF8toUTF16(paramValue);
       reporter->ReportUnexpectedUnescaped(prefix, wideParam);
     } else {
       reporter->ReportUnexpected(prefix);
--- a/layout/style/jar.mn
+++ b/layout/style/jar.mn
@@ -5,17 +5,16 @@
 toolkit.jar:
 *  res/ua.css                                (res/ua.css)
 *  res/html.css                              (res/html.css)
    res/quirk.css                             (res/quirk.css)
    res/counterstyles.css                     (res/counterstyles.css)
    res/noscript.css                          (res/noscript.css)
    res/noframes.css                          (res/noframes.css)
 *  res/forms.css                             (res/forms.css)
-   res/number-control.css                    (res/number-control.css)
    res/arrow.gif                             (res/arrow.gif)
    res/arrow-left.gif                        (res/arrow-left.gif)
    res/arrow-right.gif                       (res/arrow-right.gif)
    res/arrowd.gif                            (res/arrowd.gif)
    res/arrowd-left.gif                       (res/arrowd-left.gif)
    res/arrowd-right.gif                      (res/arrowd-right.gif)
    res/accessiblecaret-normal@1x.png         (res/accessiblecaret-normal@1x.png)
    res/accessiblecaret-normal@1.5x.png       (res/accessiblecaret-normal@1.5x.png)
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -2953,28 +2953,16 @@ CSS_PROP_(
     stroke-width,
     stroke_width,
     StrokeWidth,
     0,
     "",
     VARIANT_HLPN | VARIANT_OPENTYPE_SVG_KEYWORD,
     kStrokeContextValueKTable,
     eStyleAnimType_Coord)
-#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
-CSS_PROP_(
-    -x-system-font,
-    _x_system_font,
-    CSS_PROP_DOMPROP_PREFIXED(SystemFont),
-    CSS_PROPERTY_INTERNAL |
-        CSS_PROPERTY_PARSE_INACCESSIBLE,
-    "",
-    0,
-    kFontKTable,
-    eStyleAnimType_None)
-#endif // CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_(
     -moz-tab-size,
     _moz_tab_size,
     CSS_PROP_DOMPROP_PREFIXED(TabSize),
     0,
     "",
     VARIANT_INHERIT | VARIANT_LNCALC,
     nullptr,
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -2486,17 +2486,16 @@ static const nsCSSPropertyID gBorderWidt
 static const nsCSSPropertyID gFontSubpropTable[] = {
   eCSSProperty_font_family,
   eCSSProperty_font_style,
   eCSSProperty_font_weight,
   eCSSProperty_font_size,
   eCSSProperty_line_height,
   eCSSProperty_font_size_adjust,
   eCSSProperty_font_stretch,
-  eCSSProperty__x_system_font,
   eCSSProperty_font_feature_settings,
   eCSSProperty_font_language_override,
   eCSSProperty_font_kerning,
   eCSSProperty_font_optical_sizing,
   eCSSProperty_font_variation_settings,
   eCSSProperty_font_variant_alternates,
   eCSSProperty_font_variant_caps,
   eCSSProperty_font_variant_east_asian,
--- a/layout/style/nsCSSScanner.cpp
+++ b/layout/style/nsCSSScanner.cpp
@@ -347,17 +347,16 @@ nsCSSScanner::nsCSSScanner(const nsAStri
   , mCount(aBuffer.Length())
   , mLineNumber(aLineNumber)
   , mLineOffset(0)
   , mTokenLineNumber(aLineNumber)
   , mTokenLineOffset(0)
   , mTokenOffset(0)
   , mRecordStartOffset(0)
   , mEOFCharacters(eEOFCharacters_None)
-  , mReporter(nullptr)
   , mRecording(false)
   , mSeenBadToken(false)
   , mSeenVariableReference(false)
 {
   MOZ_COUNT_CTOR(nsCSSScanner);
 }
 
 nsCSSScanner::~nsCSSScanner()
@@ -587,30 +586,26 @@ nsCSSScanner::SkipComment()
       mSourceURL.Truncate();
       directive = &mSourceURL;
     }
   }
 
   for (;;) {
     int32_t ch = Peek();
     if (ch < 0) {
-      if (mReporter)
-        mReporter->ReportUnexpectedEOF("PECommentEOF");
       SetEOFCharacters(eEOFCharacters_Asterisk | eEOFCharacters_Slash);
       return;
     }
 
     if (ch == '*') {
       Advance();
       ch = Peek();
       if (ch < 0) {
         // In this case, even if we saw a source map directive, leave
         // the "*" out of it.
-        if (mReporter)
-          mReporter->ReportUnexpectedEOF("PECommentEOF");
         SetEOFCharacters(eEOFCharacters_Slash);
         return;
       }
       if (ch == '/') {
         Advance();
         return;
       }
       if (directive != nullptr) {
@@ -1041,18 +1036,16 @@ nsCSSScanner::ScanString(nsCSSToken& aTo
     if (ch == '"' || ch == '\'') {
       aToken.mIdent.Append(ch);
       Advance();
       continue;
     }
 
     mSeenBadToken = true;
     aToken.mType = eCSSToken_Bad_String;
-    if (mReporter)
-      mReporter->ReportUnexpected("SEUnterminatedString", aToken);
     break;
   }
   return true;
 }
 
 /**
  * Scan a unicode-range token.  These match the regular expression
  *
--- a/layout/style/nsCSSScanner.h
+++ b/layout/style/nsCSSScanner.h
@@ -201,20 +201,16 @@ class nsCSSScanner {
   public:
   // |aLineNumber == 1| is the beginning of a file, use |aLineNumber == 0|
   // when the line number is unknown.  The scanner does not take
   // ownership of |aBuffer|, so the caller must be sure to keep it
   // alive for the lifetime of the scanner.
   nsCSSScanner(const nsAString& aBuffer, uint32_t aLineNumber);
   ~nsCSSScanner();
 
-  void SetErrorReporter(mozilla::css::ErrorReporter* aReporter) {
-    mReporter = aReporter;
-  }
-
   // Reset or check whether a BAD_URL or BAD_STRING token has been seen.
   void ClearSeenBadToken() { mSeenBadToken = false; }
   bool SeenBadToken() const { return mSeenBadToken; }
 
   // Reset or check whether a "var(" FUNCTION token has been seen.
   void ClearSeenVariableReference() { mSeenVariableReference = false; }
   bool SeenVariableReference() const { return mSeenVariableReference; }
 
@@ -359,18 +355,16 @@ protected:
 
   uint32_t mTokenLineNumber;
   uint32_t mTokenLineOffset;
   uint32_t mTokenOffset;
 
   uint32_t mRecordStartOffset;
   EOFCharacters mEOFCharacters;
 
-  mozilla::css::ErrorReporter *mReporter;
-
   bool mRecording;
   bool mSeenBadToken;
   bool mSeenVariableReference;
 
   nsString mSourceMapURL;
   nsString mSourceURL;
 };
 
--- a/layout/style/nsLayoutStylesheetCache.cpp
+++ b/layout/style/nsLayoutStylesheetCache.cpp
@@ -35,20 +35,16 @@
 #include "nsXULAppAPI.h"
 #include "nsZipArchive.h"
 
 #include "zlib.h"
 
 using namespace mozilla;
 using namespace mozilla::css;
 
-static bool sNumberControlEnabled;
-
-#define NUMBER_CONTROL_PREF "dom.forms.number"
-
 NS_IMPL_ISUPPORTS(
   nsLayoutStylesheetCache, nsIObserver, nsIMemoryReporter)
 
 nsresult
 nsLayoutStylesheetCache::Observe(nsISupports* aSubject,
                             const char* aTopic,
                             const char16_t* aData)
 {
@@ -58,17 +54,16 @@ nsLayoutStylesheetCache::Observe(nsISupp
   }
   else if (!strcmp(aTopic, "profile-do-change")) {
     InitFromProfile();
   }
   else if (strcmp(aTopic, "chrome-flush-skin-caches") == 0 ||
            strcmp(aTopic, "chrome-flush-caches") == 0) {
     mScrollbarsSheet = nullptr;
     mFormsSheet = nullptr;
-    mNumberControlSheet = nullptr;
   }
   else {
     NS_NOTREACHED("Unexpected observer topic.");
   }
   return NS_OK;
 }
 
 StyleSheet*
@@ -91,31 +86,16 @@ nsLayoutStylesheetCache::FormsSheet()
     LoadSheetURL("resource://gre-resources/forms.css",
                  &mFormsSheet, eAgentSheetFeatures, eCrash);
   }
 
   return mFormsSheet;
 }
 
 StyleSheet*
-nsLayoutStylesheetCache::NumberControlSheet()
-{
-  if (!sNumberControlEnabled) {
-    return nullptr;
-  }
-
-  if (!mNumberControlSheet) {
-    LoadSheetURL("resource://gre-resources/number-control.css",
-                 &mNumberControlSheet, eAgentSheetFeatures, eCrash);
-  }
-
-  return mNumberControlSheet;
-}
-
-StyleSheet*
 nsLayoutStylesheetCache::UserContentSheet()
 {
   return mUserContentSheet;
 }
 
 StyleSheet*
 nsLayoutStylesheetCache::UserChromeSheet()
 {
@@ -305,17 +285,16 @@ nsLayoutStylesheetCache::SizeOfIncluding
   MEASURE(mCounterStylesSheet);
   MEASURE(mDesignModeSheet);
   MEASURE(mFormsSheet);
   MEASURE(mHTMLSheet);
   MEASURE(mMathMLSheet);
   MEASURE(mMinimalXULSheet);
   MEASURE(mNoFramesSheet);
   MEASURE(mNoScriptSheet);
-  MEASURE(mNumberControlSheet);
   MEASURE(mQuirkSheet);
   MEASURE(mSVGSheet);
   MEASURE(mScrollbarsSheet);
   MEASURE(mUASheet);
   MEASURE(mUserChromeSheet);
   MEASURE(mUserContentSheet);
   MEASURE(mXULSheet);
   MEASURE(mXULComponentsSheet);
@@ -387,19 +366,16 @@ nsLayoutStylesheetCache::InitMemoryRepor
 nsLayoutStylesheetCache::Singleton()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!gStyleCache) {
     gStyleCache = new nsLayoutStylesheetCache;
     gStyleCache->InitMemoryReporter();
 
-    Preferences::AddBoolVarCache(&sNumberControlEnabled, NUMBER_CONTROL_PREF,
-                                 true);
-
     // For each pref that controls a CSS feature that a UA style sheet depends
     // on (such as a pref that enables a property that a UA style sheet uses),
     // register DependentPrefChanged as a callback to ensure that the relevant
     // style sheets will be re-parsed.
     // Preferences::RegisterCallback(&DependentPrefChanged,
     //                               "layout.css.example-pref.enabled");
   }
 
--- a/layout/style/nsLayoutStylesheetCache.h
+++ b/layout/style/nsLayoutStylesheetCache.h
@@ -40,19 +40,16 @@ class nsLayoutStylesheetCache final
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
   NS_DECL_NSIMEMORYREPORTER
 
   static nsLayoutStylesheetCache* Singleton();
 
   mozilla::StyleSheet* ScrollbarsSheet();
   mozilla::StyleSheet* FormsSheet();
-  // This function is expected to return nullptr when the dom.forms.number
-  // pref is disabled.
-  mozilla::StyleSheet* NumberControlSheet();
   mozilla::StyleSheet* UserContentSheet();
   mozilla::StyleSheet* UserChromeSheet();
   mozilla::StyleSheet* UASheet();
   mozilla::StyleSheet* HTMLSheet();
   mozilla::StyleSheet* MinimalXULSheet();
   mozilla::StyleSheet* XULSheet();
   mozilla::StyleSheet* XULComponentsSheet();
   mozilla::StyleSheet* QuirkSheet();
@@ -103,17 +100,16 @@ private:
   RefPtr<mozilla::StyleSheet> mCounterStylesSheet;
   RefPtr<mozilla::StyleSheet> mDesignModeSheet;
   RefPtr<mozilla::StyleSheet> mFormsSheet;
   RefPtr<mozilla::StyleSheet> mHTMLSheet;
   RefPtr<mozilla::StyleSheet> mMathMLSheet;
   RefPtr<mozilla::StyleSheet> mMinimalXULSheet;
   RefPtr<mozilla::StyleSheet> mNoFramesSheet;
   RefPtr<mozilla::StyleSheet> mNoScriptSheet;
-  RefPtr<mozilla::StyleSheet> mNumberControlSheet;
   RefPtr<mozilla::StyleSheet> mQuirkSheet;
   RefPtr<mozilla::StyleSheet> mSVGSheet;
   RefPtr<mozilla::StyleSheet> mScrollbarsSheet;
   RefPtr<mozilla::StyleSheet> mUASheet;
   RefPtr<mozilla::StyleSheet> mUserChromeSheet;
   RefPtr<mozilla::StyleSheet> mUserContentSheet;
   RefPtr<mozilla::StyleSheet> mXULSheet;
   RefPtr<mozilla::StyleSheet> mXULComponentsSheet;
--- a/layout/style/res/forms.css
+++ b/layout/style/res/forms.css
@@ -1029,19 +1029,24 @@ input[type=range]::-moz-range-thumb {
   height: 1em;
   border: 0.1em solid #999;
   border-radius: 0.5em;
   background-color: #F0F0F0;
   /* Prevent nsFrame::HandlePress setting mouse capture to this element. */
   -moz-user-select: none ! important;
 }
 
-/* As a temporary workaround until bug 677302 the rule for input[type=number]
- * has moved to number-control.css
- */
+input[type="number"] {
+  -moz-appearance: number-input;
+  /* Has to revert some properties applied by the generic input rule. */
+  -moz-binding: none;
+  inline-size: 20ch; /* It'd be nice if this matched the default inline-size
+                        of <input type=text>, but that's not easy to achieve
+                        due to platform differences. */
+}
 
 input[type=number]::-moz-number-wrapper {
   /* Prevent styling that would change the type of frame we construct. */
   display: flex;
   float: none !important;
   position: static !important;
   block-size: 100%;
 }
deleted file mode 100644
--- a/layout/style/res/number-control.css
+++ /dev/null
@@ -1,18 +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/. */
-
-/* This file exists purely because we need the styling for input[type=number]
- * to apply only if the pref dom.forms.number is true. Once bug 677302 is
- * fixed this rule can move back to forms.css.
- */
-
-input[type="number"] {
-  -moz-appearance: number-input;
-  /* Has to revert some properties applied by the generic input rule. */
-  -moz-binding: none;
-  inline-size: 20ch; /* It'd be nice if this matched the default inline-size
-                        of <input type=text>, but that's not easy to achieve
-                        due to platform differences. */
-}
-
--- a/layout/style/test/ListCSSProperties.cpp
+++ b/layout/style/test/ListCSSProperties.cpp
@@ -96,17 +96,16 @@ const char* gShorthandPropertiesWithDOMP
 };
 
 const char *gInaccessibleProperties[] = {
     // Don't print the properties that aren't accepted by the parser, per
     // CSSParserImpl::ParseProperty
     "-x-cols",
     "-x-lang",
     "-x-span",
-    "-x-system-font",
     "-x-text-zoom",
     "-moz-context-properties",
     "-moz-control-character-visibility",
     "-moz-script-level", // parsed by UA sheets only
     "-moz-script-size-multiplier",
     "-moz-script-min-size",
     "-moz-math-variant",
     "-moz-math-display", // parsed by UA sheets only
--- a/layout/style/test/test_shorthand_property_getters.html
+++ b/layout/style/test/test_shorthand_property_getters.html
@@ -232,17 +232,17 @@ is(e.style.animation, "", "should not ha
 e.setAttribute("style", "animation-name: bounce, roll; animation-duration: 1s, 200ms; animation-timing-function: ease-in, linear; animation-delay: 0s, 1s; animation-direction: normal, reverse; animation-fill-mode: forwards, backwards; animation-iteration-count: infinite, 2; animation-play-state: paused, running, running;");
 is(e.style.animation, "", "should not have animation shorthand (lists different lengths)");
 
 // Check that the 'border' shorthand resets 'border-image' and
 // but that other 'border-*' shorthands don't
 // (bug 482692).
 e.setAttribute("style", 'border-image: url("foo.png") 5 5 5 5 / 5 5 5 5 / 5 5 5 5 repeat repeat; border-left: medium solid green');
 is(e.style.cssText,
-   'border-image: url("foo.png") 5 / 5 / 5 repeat repeat; border-left: medium solid green;',
+   'border-image: url("foo.png") 5 / 5 / 5 repeat; border-left: medium solid green;',
    "border-left does NOT reset border-image");
 e.setAttribute("style", 'border-image: url("foo.png") 5 5 5 5; border: medium solid green');
 is(e.style.cssText,
    'border: medium solid green;',
    "border DOES reset border-image");
 
 // Test that the color goes at the beginning of the last item of the
 // background shorthand.
--- a/layout/style/test/test_variables.html
+++ b/layout/style/test/test_variables.html
@@ -85,29 +85,16 @@ var tests = [
     var element = document.getElementById("t5");
     var cs = window.getComputedStyle(element);
 
     is(cs.item(cs.length - 1), "--SomeVariableName", "custom property name returned by item() on computed style");
     is(cs[cs.length - 1], "--SomeVariableName", "custom property name returned by indexed getter on style declaration");
   },
 
   function() {
-    // https://bugzilla.mozilla.org/show_bug.cgi?id=969756
-    if (SpecialPowers.DOMWindowUtils.isStyledByServo) {
-      // This test is irrelevant when using stylo.
-      return;
-    }
-    var test6 = document.getElementById("test6");
-    test6.textContent = "p { font: var(--var6) hangul mongolian; font-size-adjust: none; }";
-    var declaration = test6.sheet.cssRules[0].style;
-    test6.style.color = "white";
-    is(declaration.getPropertyValue("-x-system-font"), " var(--var6) hangul mongolian");
-  },
-
-  function() {
     // https://bugzilla.mozilla.org/show_bug.cgi?id=1154356
     var test7 = document.getElementById("test7");
     test7.textContent = "p { --weird\\;name: green; }";
     is(test7.sheet.cssRules[0].style.cssText, "--weird\\;name: green;");
     test7.textContent = "p { --0: green; }";
     is(test7.sheet.cssRules[0].style.cssText, "--0: green;");
   },
 
--- a/layout/tools/reftest/reftest.jsm
+++ b/layout/tools/reftest/reftest.jsm
@@ -158,17 +158,17 @@ function OnRefTestLoad(win)
               getService(Ci.nsIEnvironment);
 
     var prefs = Cc["@mozilla.org/preferences-service;1"].
                 getService(Ci.nsIPrefBranch);
     g.browserIsRemote = prefs.getBoolPref("browser.tabs.remote.autostart", false);
 
     g.browserIsIframe = prefs.getBoolPref("reftest.browser.iframe.enabled", false);
 
-    g.logLevel = prefs.getCharPref("reftest.logLevel", "info");
+    g.logLevel = prefs.getStringPref("reftest.logLevel", "info");
 
     if (win === undefined || win == null) {
       win = window;
     }
     if (g.containingWindow == null && win != null) {
       g.containingWindow = win;
     }
 
@@ -232,17 +232,17 @@ function InitAndStartRefTests()
     try {
         g.loadTimeout = prefs.getIntPref("reftest.timeout");
     } catch(e) {
         g.loadTimeout = 5 * 60 * 1000; //5 minutes as per bug 479518
     }
 
     /* Get the logfile for android tests */
     try {
-        var logFile = prefs.getCharPref("reftest.logFile");
+        var logFile = prefs.getStringPref("reftest.logFile");
         if (logFile) {
             var f = FileUtils.File(logFile);
             g.logFile = FileUtils.openFileOutputStream(f, FileUtils.MODE_WRONLY | FileUtils.MODE_CREATE);
         }
     } catch(e) {}
 
     g.remote = prefs.getBoolPref("reftest.remote", false);
 
@@ -254,17 +254,17 @@ function InitAndStartRefTests()
         g.thisChunk = prefs.getIntPref("reftest.thisChunk");
     }
     catch(e) {
         g.totalChunks = 0;
         g.thisChunk = 0;
     }
 
     try {
-        g.focusFilterMode = prefs.getCharPref("reftest.focusFilterMode");
+        g.focusFilterMode = prefs.getStringPref("reftest.focusFilterMode");
     } catch(e) {}
 
     try {
         g.compareRetainedDisplayLists = prefs.getBoolPref("reftest.compareRetainedDisplayLists");
     } catch (e) {}
 
 #ifdef MOZ_ENABLE_SKIA_PDF
     try {
@@ -348,19 +348,19 @@ function ReadTests() {
          * The first will parse the specified manifests, then immediately
          * run the tests. The second will parse the manifests, save the test
          * objects to a file and exit. The third will load a file of test
          * objects and run them.
          *
          * The latter two modes are used to pass test data back and forth
          * with python harness.
         */
-        let manifests = prefs.getCharPref("reftest.manifests", null);
-        let dumpTests = prefs.getCharPref("reftest.manifests.dumpTests", null);
-        let testList = prefs.getCharPref("reftest.tests", null);
+        let manifests = prefs.getStringPref("reftest.manifests", null);
+        let dumpTests = prefs.getStringPref("reftest.manifests.dumpTests", null);
+        let testList = prefs.getStringPref("reftest.tests", null);
 
         if ((testList && manifests) || !(testList || manifests)) {
             logger.error("Exactly one of reftest.manifests or reftest.tests must be specified.");
             DoneTests();
         }
 
         if (testList) {
             logger.debug("Reading test objects from: " + testList);
@@ -495,17 +495,17 @@ function StartTests()
 
             g.urls = g.urls.slice(start, end);
         }
 
         if (g.manageSuite && !g.suiteStarted) {
             var ids = g.urls.map(function(obj) {
                 return obj.identifier;
             });
-            var suite = prefs.getCharPref('reftest.suite', 'reftest');
+            var suite = prefs.getStringPref('reftest.suite', 'reftest');
             logger.suiteStart(ids, suite, {"skipped": g.urls.length - numActiveTests});
             g.suiteStarted = true
         }
 
         if (g.shuffle) {
             Shuffle(g.urls);
         }
 
@@ -667,17 +667,17 @@ function StartCurrentURI(aURLTargetType)
                     try {
                         oldVal = prefs.getBoolPref(ps.name);
                     } catch (e) {
                         badPref = "boolean preference '" + ps.name + "'";
                         throw "bad pref";
                     }
                 } else if (ps.type == PREF_STRING) {
                     try {
-                        oldVal = prefs.getCharPref(ps.name);
+                        oldVal = prefs.getStringPref(ps.name);
                     } catch (e) {
                         badPref = "string preference '" + ps.name + "'";
                         throw "bad pref";
                     }
                 } else if (ps.type == PREF_INTEGER) {
                     try {
                         oldVal = prefs.getIntPref(ps.name);
                     } catch (e) {
@@ -690,17 +690,17 @@ function StartCurrentURI(aURLTargetType)
                 if (oldVal != ps.value) {
                     g.prefsToRestore.push( { name: ps.name,
                                             type: ps.type,
                                             value: oldVal } );
                     var value = ps.value;
                     if (ps.type == PREF_BOOLEAN) {
                         prefs.setBoolPref(ps.name, value);
                     } else if (ps.type == PREF_STRING) {
-                        prefs.setCharPref(ps.name, value);
+                        prefs.setStringPref(ps.name, value);
                         value = '"' + value + '"';
                     } else if (ps.type == PREF_INTEGER) {
                         prefs.setIntPref(ps.name, value);
                     }
                     logger.info("SET PREFERENCE pref(" + ps.name + "," + value + ")");
                 }
             });
         } catch (e) {
@@ -1359,17 +1359,17 @@ function RestoreChangedPreferences()
         var prefs = Cc["@mozilla.org/preferences-service;1"].
                     getService(Ci.nsIPrefBranch);
         g.prefsToRestore.reverse();
         g.prefsToRestore.forEach(function(ps) {
             var value = ps.value;
             if (ps.type == PREF_BOOLEAN) {
                 prefs.setBoolPref(ps.name, value);
             } else if (ps.type == PREF_STRING) {
-                prefs.setCharPref(ps.name, value);
+                prefs.setStringPref(ps.name, value);
                 value = '"' + value + '"';
             } else if (ps.type == PREF_INTEGER) {
                 prefs.setIntPref(ps.name, value);
             }
             logger.info("RESTORE PREFERENCE pref(" + ps.name + "," + value + ")");
         });
         g.prefsToRestore = [];
     }
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -199,17 +199,17 @@ nsBoxFrame::Init(nsIContent*       aCont
 
   // register access key
   RegUnregAccessKey(true);
 }
 
 void nsBoxFrame::UpdateMouseThrough()
 {
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::never, nsGkAtoms::always, nullptr};
+    {&nsGkAtoms::never, &nsGkAtoms::always, nullptr};
   switch (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None,
             nsGkAtoms::mousethrough, strings, eCaseMatters)) {
     case 0: AddStateBits(NS_FRAME_MOUSE_THROUGH_NEVER); break;
     case 1: AddStateBits(NS_FRAME_MOUSE_THROUGH_ALWAYS); break;
     case 2: {
       RemoveStateBits(NS_FRAME_MOUSE_THROUGH_ALWAYS);
       RemoveStateBits(NS_FRAME_MOUSE_THROUGH_NEVER);
       break;
@@ -279,17 +279,17 @@ nsBoxFrame::CacheAttributes()
 #ifdef DEBUG_LAYOUT
 bool
 nsBoxFrame::GetInitialDebug(bool& aDebug)
 {
   if (!GetContent() || !GetContent()->IsElement())
     return false;
 
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::_false, nsGkAtoms::_true, nullptr};
+    {&nsGkAtoms::_false, &nsGkAtoms::_true, nullptr};
   int32_t index = GetContent()->FindAttrValueIn(kNameSpaceID_None,
       nsGkAtoms::debug, strings, eCaseMatters);
   if (index >= 0) {
     aDebug = index == 1;
     return true;
   }
 
   return false;
@@ -300,31 +300,31 @@ bool
 nsBoxFrame::GetInitialHAlignment(nsBoxFrame::Halignment& aHalign)
 {
   if (!GetContent() || !GetContent()->IsElement())
     return false;
 
   Element* element = GetContent()->AsElement();
   // XXXdwh Everything inside this if statement is deprecated code.
   static Element::AttrValuesArray alignStrings[] =
-    {nsGkAtoms::left, nsGkAtoms::right, nullptr};
+    {&nsGkAtoms::left, &nsGkAtoms::right, nullptr};
   static const Halignment alignValues[] = {hAlign_Left, hAlign_Right};
   int32_t index = element->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::align,
       alignStrings, eCaseMatters);
   if (index >= 0) {
     aHalign = alignValues[index];
     return true;
   }
 
   // Now that the deprecated stuff is out of the way, we move on to check the appropriate
   // attribute.  For horizontal boxes, we are checking the PACK attribute.  For vertical boxes
   // we are checking the ALIGN attribute.
   nsAtom* attrName = IsXULHorizontal() ? nsGkAtoms::pack : nsGkAtoms::align;
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::_empty, nsGkAtoms::start, nsGkAtoms::center, nsGkAtoms::end, nullptr};
+    {&nsGkAtoms::_empty, &nsGkAtoms::start, &nsGkAtoms::center, &nsGkAtoms::end, nullptr};
   static const Halignment values[] =
     {hAlign_Left/*not used*/, hAlign_Left, hAlign_Center, hAlign_Right};
   index = element->FindAttrValueIn(kNameSpaceID_None, attrName,
       strings, eCaseMatters);
 
   if (index == Element::ATTR_VALUE_NO_MATCH) {
     // The attr was present but had a nonsensical value. Revert to the default.
     return false;
@@ -376,33 +376,33 @@ bool
 nsBoxFrame::GetInitialVAlignment(nsBoxFrame::Valignment& aValign)
 {
   if (!GetContent() || !GetContent()->IsElement())
     return false;
 
   Element* element = GetContent()->AsElement();
 
   static Element::AttrValuesArray valignStrings[] =
-    {nsGkAtoms::top, nsGkAtoms::baseline, nsGkAtoms::middle, nsGkAtoms::bottom, nullptr};
+    {&nsGkAtoms::top, &nsGkAtoms::baseline, &nsGkAtoms::middle, &nsGkAtoms::bottom, nullptr};
   static const Valignment valignValues[] =
     {vAlign_Top, vAlign_BaseLine, vAlign_Middle, vAlign_Bottom};
   int32_t index = element->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::valign,
       valignStrings, eCaseMatters);
   if (index >= 0) {
     aValign = valignValues[index];
     return true;
   }
 
   // Now that the deprecated stuff is out of the way, we move on to check the appropriate
   // attribute.  For horizontal boxes, we are checking the ALIGN attribute.  For vertical boxes
   // we are checking the PACK attribute.
   nsAtom* attrName = IsXULHorizontal() ? nsGkAtoms::align : nsGkAtoms::pack;
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::_empty, nsGkAtoms::start, nsGkAtoms::center,
-     nsGkAtoms::baseline, nsGkAtoms::end, nullptr};
+    {&nsGkAtoms::_empty, &nsGkAtoms::start, &nsGkAtoms::center,
+     &nsGkAtoms::baseline, &nsGkAtoms::end, nullptr};
   static const Valignment values[] =
     {vAlign_Top/*not used*/, vAlign_Top, vAlign_Middle, vAlign_BaseLine, vAlign_Bottom};
   index = element->FindAttrValueIn(kNameSpaceID_None, attrName,
       strings, eCaseMatters);
   if (index == Element::ATTR_VALUE_NO_MATCH) {
     // The attr was present but had a nonsensical value. Revert to the default.
     return false;
   }
@@ -468,17 +468,17 @@ nsBoxFrame::GetInitialOrientation(bool& 
   }
 
   // Now see if we have an attribute.  The attribute overrides
   // the style system value.
   if (!GetContent()->IsElement())
     return;
 
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::vertical, nsGkAtoms::horizontal, nullptr};
+    {&nsGkAtoms::vertical, &nsGkAtoms::horizontal, nullptr};
   int32_t index =
     GetContent()->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::orient,
                                                strings, eCaseMatters);
   if (index >= 0) {
     aIsHorizontal = index == 1;
   }
 }
 
@@ -507,17 +507,17 @@ nsBoxFrame::GetInitialDirection(bool& aI
   }
 
   Element* element = GetContent()->AsElement();
 
   // Now see if we have an attribute.  The attribute overrides
   // the style system value.
   if (IsXULHorizontal()) {
     static Element::AttrValuesArray strings[] =
-      {nsGkAtoms::reverse, nsGkAtoms::ltr, nsGkAtoms::rtl, nullptr};
+      {&nsGkAtoms::reverse, &nsGkAtoms::ltr, &nsGkAtoms::rtl, nullptr};
     int32_t index = element->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::dir,
         strings, eCaseMatters);
     if (index >= 0) {
       bool values[] = {!aIsNormal, true, false};
       aIsNormal = values[index];
     }
   } else if (element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::dir,
                                   nsGkAtoms::reverse, eCaseMatters)) {
@@ -550,17 +550,17 @@ bool
 nsBoxFrame::GetInitialAutoStretch(bool& aStretch)
 {
   if (!GetContent())
      return false;
 
   // Check the align attribute.
   if (GetContent()->IsElement()) {
     static Element::AttrValuesArray strings[] =
-      {nsGkAtoms::_empty, nsGkAtoms::stretch, nullptr};
+      {&nsGkAtoms::_empty, &nsGkAtoms::stretch, nullptr};
     int32_t index =
       GetContent()->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::align,
                                                  strings, eCaseMatters);
     if (index != Element::ATTR_MISSING && index != 0) {
       aStretch = index == 1;
       return true;
     }
   }
--- a/layout/xul/nsImageBoxFrame.cpp
+++ b/layout/xul/nsImageBoxFrame.cpp
@@ -295,17 +295,17 @@ nsImageBoxFrame::UpdateImage()
     oldImageRequest->UnlockImage();
   }
 }
 
 void
 nsImageBoxFrame::UpdateLoadFlags()
 {
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::always, nsGkAtoms::never, nullptr};
+    {&nsGkAtoms::always, &nsGkAtoms::never, nullptr};
   switch (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None,
                                                  nsGkAtoms::validate, strings,
                                                  eCaseMatters)) {
     case 0:
       mLoadFlags = nsIRequest::VALIDATE_ALWAYS;
       break;
     case 1:
       mLoadFlags = nsIRequest::VALIDATE_NEVER|nsIRequest::LOAD_FROM_CACHE;
--- a/layout/xul/nsLeafBoxFrame.cpp
+++ b/layout/xul/nsLeafBoxFrame.cpp
@@ -79,17 +79,17 @@ nsLeafBoxFrame::AttributeChanged(int32_t
     UpdateMouseThrough();
 
   return rv;
 }
 
 void nsLeafBoxFrame::UpdateMouseThrough()
 {
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::never, nsGkAtoms::always, nullptr};
+    {&nsGkAtoms::never, &nsGkAtoms::always, nullptr};
   switch (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None,
                                                  nsGkAtoms::mousethrough,
                                                  strings, eCaseMatters)) {
     case 0: AddStateBits(NS_FRAME_MOUSE_THROUGH_NEVER); break;
     case 1: AddStateBits(NS_FRAME_MOUSE_THROUGH_ALWAYS); break;
     case 2: {
         RemoveStateBits(NS_FRAME_MOUSE_THROUGH_ALWAYS);
         RemoveStateBits(NS_FRAME_MOUSE_THROUGH_NEVER);
--- a/layout/xul/nsMenuFrame.cpp
+++ b/layout/xul/nsMenuFrame.cpp
@@ -939,17 +939,17 @@ nsMenuFrame::IsDisabled()
                                             nsGkAtoms::disabled,
                                             nsGkAtoms::_true, eCaseMatters);
 }
 
 void
 nsMenuFrame::UpdateMenuType()
 {
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::checkbox, nsGkAtoms::radio, nullptr};
+    {&nsGkAtoms::checkbox, &nsGkAtoms::radio, nullptr};
   switch (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None,
                                                  nsGkAtoms::type,
                                                  strings, eCaseMatters)) {
     case 0: mType = eMenuType_Checkbox; break;
     case 1:
       mType = eMenuType_Radio;
       mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::name, mGroupName);
       break;
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -221,17 +221,17 @@ nsMenuPopupFrame::PopupLevel(bool aIsNoA
   //   5. use the platform-specific default level
 
   // If this is not a panel, this is always a top-most popup.
   if (mPopupType != ePopupTypePanel)
     return ePopupLevelTop;
 
   // If the level attribute has been set, use that.
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::top, nsGkAtoms::parent, nsGkAtoms::floating, nullptr};
+    {&nsGkAtoms::top, &nsGkAtoms::parent, &nsGkAtoms::floating, nullptr};
   switch (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None,
                                                  nsGkAtoms::level, strings,
                                                  eCaseMatters)) {
     case 0:
       return ePopupLevelTop;
     case 1:
       return ePopupLevelParent;
     case 2:
--- a/layout/xul/nsResizerFrame.cpp
+++ b/layout/xul/nsResizerFrame.cpp
@@ -489,20 +489,20 @@ nsResizerFrame::RestoreOriginalSize(nsIC
 }
 
 /* returns a Direction struct containing the horizontal and vertical direction
  */
 nsResizerFrame::Direction
 nsResizerFrame::GetDirection()
 {
   static const Element::AttrValuesArray strings[] =
-    {nsGkAtoms::topleft,    nsGkAtoms::top,    nsGkAtoms::topright,
-     nsGkAtoms::left,                          nsGkAtoms::right,
-     nsGkAtoms::bottomleft, nsGkAtoms::bottom, nsGkAtoms::bottomright,
-     nsGkAtoms::bottomstart,                   nsGkAtoms::bottomend,
+    {&nsGkAtoms::topleft,    &nsGkAtoms::top,    &nsGkAtoms::topright,
+     &nsGkAtoms::left,                           &nsGkAtoms::right,
+     &nsGkAtoms::bottomleft, &nsGkAtoms::bottom, &nsGkAtoms::bottomright,
+     &nsGkAtoms::bottomstart,                    &nsGkAtoms::bottomend,
      nullptr};
 
   static const Direction directions[] =
     {{-1, -1}, {0, -1}, {1, -1},
      {-1,  0},          {1,  0},
      {-1,  1}, {0,  1}, {1,  1},
      {-1,  1},          {1,  1}
     };
--- a/layout/xul/nsScrollbarButtonFrame.cpp
+++ b/layout/xul/nsScrollbarButtonFrame.cpp
@@ -108,18 +108,18 @@ nsScrollbarButtonFrame::HandleButtonPres
 
   // get the scrollbar control
   nsIFrame* scrollbar;
   GetParentWithTag(nsGkAtoms::scrollbar, this, scrollbar);
 
   if (scrollbar == nullptr)
     return false;
 
-  static Element::AttrValuesArray strings[] = { nsGkAtoms::increment,
-                                                nsGkAtoms::decrement,
+  static Element::AttrValuesArray strings[] = { &nsGkAtoms::increment,
+                                                &nsGkAtoms::decrement,
                                                 nullptr };
   int32_t index = mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None,
                                                          nsGkAtoms::type,
                                                          strings, eCaseMatters);
   int32_t direction;
   if (index == 0)
     direction = 1;
   else if (index == 1)
--- a/layout/xul/nsSplitterFrame.cpp
+++ b/layout/xul/nsSplitterFrame.cpp
@@ -131,17 +131,17 @@ public:
 };
 
 NS_IMPL_ISUPPORTS(nsSplitterFrameInner, nsIDOMEventListener)
 
 nsSplitterFrameInner::ResizeType
 nsSplitterFrameInner::GetResizeBefore()
 {
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::farthest, nsGkAtoms::flex, nullptr};
+    {&nsGkAtoms::farthest, &nsGkAtoms::flex, nullptr};
   switch (SplitterElement()->FindAttrValueIn(kNameSpaceID_None,
                                              nsGkAtoms::resizebefore,
                                              strings, eCaseMatters)) {
     case 0: return Farthest;
     case 1: return Flex;
   }
   return Closest;
 }
@@ -149,34 +149,34 @@ nsSplitterFrameInner::GetResizeBefore()
 nsSplitterFrameInner::~nsSplitterFrameInner()
 {
 }
 
 nsSplitterFrameInner::ResizeType
 nsSplitterFrameInner::GetResizeAfter()
 {
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::farthest, nsGkAtoms::flex, nsGkAtoms::grow, nullptr};
+    {&nsGkAtoms::farthest, &nsGkAtoms::flex, &nsGkAtoms::grow, nullptr};
   switch (SplitterElement()->FindAttrValueIn(kNameSpaceID_None,
                                              nsGkAtoms::resizeafter,
                                              strings, eCaseMatters)) {
     case 0: return Farthest;
     case 1: return Flex;
     case 2: return Grow;
   }
   return Closest;
 }
 
 nsSplitterFrameInner::State
 nsSplitterFrameInner::GetState()
 {
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::dragging, nsGkAtoms::collapsed, nullptr};
+    {&nsGkAtoms::dragging, &nsGkAtoms::collapsed, nullptr};
   static Element::AttrValuesArray strings_substate[] =
-    {nsGkAtoms::before, nsGkAtoms::after, nullptr};
+    {&nsGkAtoms::before, &nsGkAtoms::after, nullptr};
   switch (SplitterElement()->FindAttrValueIn(kNameSpaceID_None,
                                              nsGkAtoms::state,
                                              strings, eCaseMatters)) {
     case 0: return Dragging;
     case 1:
       switch (SplitterElement()->FindAttrValueIn(kNameSpaceID_None,
                                                  nsGkAtoms::substate,
                                                  strings_substate,
@@ -794,17 +794,17 @@ nsSplitterFrameInner::Reverse(UniquePtr<
 
 bool
 nsSplitterFrameInner::SupportsCollapseDirection
 (
   nsSplitterFrameInner::CollapseDirection aDirection
 )
 {
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::before, nsGkAtoms::after, nsGkAtoms::both, nullptr};
+    {&nsGkAtoms::before, &nsGkAtoms::after, &nsGkAtoms::both, nullptr};
 
   switch (SplitterElement()->FindAttrValueIn(kNameSpaceID_None,
                                              nsGkAtoms::collapse,
                                              strings, eCaseMatters)) {
     case 0:
       return (aDirection == Before);
     case 1:
       return (aDirection == After);
--- a/layout/xul/nsTextBoxFrame.cpp
+++ b/layout/xul/nsTextBoxFrame.cpp
@@ -230,18 +230,18 @@ nsTextBoxFrame::UpdateAttributes(nsAtom*
                                  bool&          aRedraw)
 {
     bool doUpdateTitle = false;
     aResize = false;
     aRedraw = false;
 
     if (aAttribute == nullptr || aAttribute == nsGkAtoms::crop) {
         static Element::AttrValuesArray strings[] =
-          {nsGkAtoms::left, nsGkAtoms::start, nsGkAtoms::center,
-           nsGkAtoms::right, nsGkAtoms::end, nsGkAtoms::none, nullptr};
+          {&nsGkAtoms::left, &nsGkAtoms::start, &nsGkAtoms::center,
+           &nsGkAtoms::right, &nsGkAtoms::end, &nsGkAtoms::none, nullptr};
         CroppingStyle cropType;
         switch (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None,
                                                        nsGkAtoms::crop, strings,
                                                        eCaseMatters)) {
           case 0:
           case 1:
             cropType = CropLeft;
             break;
--- a/layout/xul/nsXULPopupManager.cpp
+++ b/layout/xul/nsXULPopupManager.cpp
@@ -1370,17 +1370,17 @@ nsXULPopupManager::UpdateFollowAnchor(ns
 }
 
 void
 nsXULPopupManager::ExecuteMenu(nsIContent* aMenu, nsXULMenuCommandEvent* aEvent)
 {
   CloseMenuMode cmm = CloseMenuMode_Auto;
 
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::none, nsGkAtoms::single, nullptr};
+    {&nsGkAtoms::none, &nsGkAtoms::single, nullptr};
 
   if (aMenu->IsElement()) {
     switch (aMenu->AsElement()->FindAttrValueIn(kNameSpaceID_None,
                                                 nsGkAtoms::closemenu,
                                                 strings,
                                                 eCaseMatters)) {
       case 0:
         cmm = CloseMenuMode_None;
--- a/layout/xul/tree/nsTreeColumns.cpp
+++ b/layout/xul/tree/nsTreeColumns.cpp
@@ -314,29 +314,30 @@ nsTreeColumn::Invalidate()
 
   mOverflow =
     mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::overflow,
                                        nsGkAtoms::_true, eCaseMatters);
 
   // Figure out our column type. Default type is text.
   mType = nsITreeColumn::TYPE_TEXT;
   static Element::AttrValuesArray typestrings[] =
-    {nsGkAtoms::checkbox, nsGkAtoms::password, nullptr};
+    {&nsGkAtoms::checkbox, &nsGkAtoms::password,
+     nullptr};
   switch (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None,
                                                  nsGkAtoms::type,
                                                  typestrings,
                                                  eCaseMatters)) {
     case 0: mType = nsITreeColumn::TYPE_CHECKBOX; break;
     case 1: mType = nsITreeColumn::TYPE_PASSWORD; break;
   }
 
   // Fetch the crop style.
   mCropStyle = 0;
   static Element::AttrValuesArray cropstrings[] =
-    {nsGkAtoms::center, nsGkAtoms::left, nsGkAtoms::start, nullptr};
+    {&nsGkAtoms::center, &nsGkAtoms::left, &nsGkAtoms::start, nullptr};
   switch (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None,
                                                  nsGkAtoms::crop, cropstrings,
                                                  eCaseMatters)) {
     case 0:
       mCropStyle = 1;
       break;
     case 1:
     case 2:
--- a/layout/xul/tree/nsTreeContentView.cpp
+++ b/layout/xul/tree/nsTreeContentView.cpp
@@ -664,17 +664,17 @@ nsTreeContentView::CycleHeader(nsTreeCol
     nsCOMPtr<Element> column = do_QueryInterface(element);
     nsAutoString sort;
     column->GetAttr(kNameSpaceID_None, nsGkAtoms::sort, sort);
     if (!sort.IsEmpty()) {
       nsCOMPtr<nsIXULSortService> xs = do_GetService("@mozilla.org/xul/xul-sort-service;1");
       if (xs) {
         nsAutoString sortdirection;
         static Element::AttrValuesArray strings[] =
-          {nsGkAtoms::ascending, nsGkAtoms::descending, nullptr};
+          {&nsGkAtoms::ascending, &nsGkAtoms::descending, nullptr};
         switch (column->FindAttrValueIn(kNameSpaceID_None,
                                         nsGkAtoms::sortDirection,
                                         strings, eCaseMatters)) {
           case 0: sortdirection.AssignLiteral("descending"); break;
           case 1: sortdirection.AssignLiteral("natural"); break;
           default: sortdirection.AssignLiteral("ascending"); break;
         }
 
--- a/layout/xul/tree/nsTreeSelection.cpp
+++ b/layout/xul/tree/nsTreeSelection.cpp
@@ -286,17 +286,17 @@ NS_IMETHODIMP nsTreeSelection::SetTree(n
   mTree = do_QueryInterface(bo);
   NS_ENSURE_STATE(mTree == aTree);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsTreeSelection::GetSingle(bool* aSingle)
 {
   static Element::AttrValuesArray strings[] =
-    {nsGkAtoms::single, nsGkAtoms::cell, nsGkAtoms::text, nullptr};
+    {&nsGkAtoms::single, &nsGkAtoms::cell, &nsGkAtoms::text, nullptr};
 
   nsCOMPtr<nsIContent> content = GetContent();
   if (!content) {
     return NS_ERROR_NULL_POINTER;
   }
 
   *aSingle = content->IsElement() &&
     content->AsElement()->FindAttrValueIn(kNameSpaceID_None,
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -176,17 +176,16 @@ pref("findhelper.autozoom", true);
 pref("browser.formfill.enable", true);
 
 /* spellcheck */
 pref("layout.spellcheckDefault", 0);
 
 /* new html5 forms */
 pref("dom.forms.datetime", true);
 pref("dom.forms.datetime.others", true);
-pref("dom.forms.number", true);
 
 /* extension manager and xpinstall */
 pref("xpinstall.whitelist.directRequest", false);
 pref("xpinstall.whitelist.fileRequest", false);
 pref("xpinstall.whitelist.add", "https://addons.mozilla.org,https://testpilot.firefox.com");
 
 pref("xpinstall.signatures.required", true);
 
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -1367,16 +1367,18 @@ public class BrowserApp extends GeckoApp
                 final SharedPreferences sharedPrefs = GeckoSharedPrefs.forProfileName(BrowserApp.this, profile.getName());
                 FileCleanupController.startIfReady(BrowserApp.this, sharedPrefs, profile.getDir().getAbsolutePath());
             }
         });
 
         for (final BrowserAppDelegate delegate : delegates) {
             delegate.onStart(this);
         }
+
+        MmaDelegate.track(MmaDelegate.RESUMED_FROM_BACKGROUND);
     }
 
     @Override
     public void onStop() {
         super.onStop();
         if (mIsAbortingAppLaunch) {
             return;
         }
--- a/mobile/android/base/java/org/mozilla/gecko/mma/MmaDelegate.java
+++ b/mobile/android/base/java/org/mozilla/gecko/mma/MmaDelegate.java
@@ -42,16 +42,17 @@ public class MmaDelegate {
     public static final String CLEARED_PRIVATE_DATA = "E_Cleared_Private_Data";
     public static final String SAVED_BOOKMARK = "E_Saved_Bookmark";
     public static final String OPENED_BOOKMARK = "E_Opened_Bookmark";
     public static final String INTERACT_WITH_SEARCH_URL_AREA = "E_Interact_With_Search_URL_Area";
     public static final String SCREENSHOT = "E_Screenshot";
     public static final String SAVED_LOGIN_AND_PASSWORD = "E_Saved_Login_And_Password";
     public static final String LAUNCH_BUT_NOT_DEFAULT_BROWSER = "E_Launch_But_Not_Default_Browser";
     public static final String LAUNCH_BROWSER = "E_Launch_Browser";
+    public static final String RESUMED_FROM_BACKGROUND = "E_Resumed_From_Background";
     public static final String NEW_TAB = "E_Opened_New_Tab";
     public static final String DISMISS_ONBOARDING = "E_Dismiss_Onboarding";
 
 
     public static final String USER_ATT_FOCUS_INSTALLED = "Focus Installed";
     public static final String USER_ATT_KLAR_INSTALLED = "Klar Installed";
     public static final String USER_ATT_POCKET_INSTALLED = "Pocket Installed";
     public static final String USER_ATT_DEFAULT_BROWSER = "Default Browser";
--- a/mobile/android/docs/mma.rst
+++ b/mobile/android/docs/mma.rst
@@ -59,16 +59,17 @@ following parameters::
   // Sent when the app starts
   "action" -> "start"                   // start: Leanplum SDK starts. heartbeat
   "userAttributes" -> "{                // A set of key-value pairs used to describe the user.
     "Focus Installed" -> true           // If Focus for Android is installed.
     "Klar Installed" -> true            // If Klar for Android is installed.
     "Pocket Installed" -> true          // If Pocket for Android is installed.
     "Signed In Sync" -> true            // If the user has signed in to Mozilla account.
     "Default Browser" -> true           // If the user has set Fennec as default browser.
+    "Pocket in Top Sites" -> true       // If Top Sites home panel contain websites recommended by Pocket
   }
   "appId" -> "app_6Ao...."              // Leanplum App ID.
   "clientKey" -> "dev_srwDUNZR...."     // Leanplum client access key.
   "systemName" -> "Android OS"          // Fixed String in SDK.
   "locale" -> "zh_TW"                   // System Locale.
   "timezone" -> "Asia/Taipei"           // System Timezone.
   "versionName" -> "55.0a1"             // Fennec version.
   "systemVersion" -> "7.1.2"            // System version.
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/GeckoBundle.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/GeckoBundle.java
@@ -244,59 +244,59 @@ public final class GeckoBundle implement
      */
     public int[] getIntArray(final String key) {
         final Object value = mMap.get(key);
         return value == null ? null : Array.getLength(value) == 0 ? EMPTY_INT_ARRAY :
                value instanceof double[] ? getIntArray((double[]) value) : (int[]) value;
     }
 
     /**
-     * Returns the value associated with a long mapping, or defaultValue if the mapping
-     * does not exist.
+     * Returns the value associated with an int/double mapping as a long value, or
+     * defaultValue if the mapping does not exist.
      *
      * @param key Key to look for.
      * @param defaultValue Value to return if mapping does not exist.
-     * @return long value
+     * @return Long value
      */
     public long getLong(final String key, final long defaultValue) {
         final Object value = mMap.get(key);
         return value == null ? defaultValue : ((Number) value).longValue();
     }
 
     /**
-     * Returns the value associated with a long mapping, or defaultValue if the mapping
-     * does not exist.
+     * Returns the value associated with an int/double mapping as a long value, or
+     * 0 if the mapping does not exist.
      *
      * @param key Key to look for.
-     * @return long value
+     * @return Long value
      */
     public long getLong(final String key) {
         return getLong(key, 0L);
     }
 
-    private static long[] getLongArray(final double[] array) {
-        final int len = array.length;
+    private static long[] getLongArray(final Object array) {
+        final int len = Array.getLength(array);
         final long[] ret = new long[len];
         for (int i = 0; i < len; i++) {
-            ret[i] = (long) array[i];
+            ret[i] = ((Number) Array.get(array, i)).longValue();
         }
         return ret;
     }
 
     /**
-     * Returns the value associated with a long array mapping, or null if the mapping does
-     * not exist.
+     * Returns the value associated with an int/double array mapping as a long array, or
+     * null if the mapping does not exist.
      *
      * @param key Key to look for.
-     * @return long array value
+     * @return Long array value
      */
     public long[] getLongArray(final String key) {
         final Object value = mMap.get(key);
-        return value == null ? null : Array.getLength(value) == 0 ? EMPTY_LONG_ARRAY :
-                value instanceof double[] ? getLongArray((double[]) value) : (long[]) value;
+        return value == null ? null :
+               Array.getLength(value) == 0 ? EMPTY_LONG_ARRAY : getLongArray(value);
     }
 
     /**
      * Returns the value associated with a String mapping, or defaultValue if the mapping
      * does not exist.
      *
      * @param key Key to look for.
      * @param defaultValue Value to return if mapping value is null or mapping does not exist.
@@ -502,25 +502,17 @@ public final class GeckoBundle implement
 
     /**
      * Map a key to a double array value.
      *
      * @param key Key to map.
      * @param value Value to map to.
      */
     public void putDoubleArray(final String key, final Double[] value) {
-        if (value == null) {
-            mMap.put(key, null);
-            return;
-        }
-        final double[] array = new double[value.length];
-        for (int i = 0; i < value.length; i++) {
-            array[i] = value[i];
-        }
-        mMap.put(key, array);
+        putDoubleArray(key, Arrays.asList(value));
     }
 
     /**
      * Map a key to a double array value.
      *
      * @param key Key to map.
      * @param value Value to map to.
      */
@@ -559,25 +551,17 @@ public final class GeckoBundle implement
 
     /**
      * Map a key to a int array value.
      *
      * @param key Key to map.
      * @param value Value to map to.
      */
     public void putIntArray(final String key, final Integer[] value) {
-        if (value == null) {
-            mMap.put(key, null);
-            return;
-        }
-        final int[] array = new int[value.length];
-        for (int i = 0; i < value.length; i++) {
-            array[i] = value[i];
-        }
-        mMap.put(key, array);
+        putIntArray(key, Arrays.asList(value));
     }
 
     /**
      * Map a key to a int array value.
      *
      * @param key Key to map.
      * @param value Value to map to.
      */
@@ -590,16 +574,73 @@ public final class GeckoBundle implement
         int i = 0;
         for (final Integer element : value) {
             array[i++] = element;
         }
         mMap.put(key, array);
     }
 
     /**
+     * Map a key to a long value stored as a double value.
+     *
+     * @param key Key to map.
+     * @param value Value to map to.
+     */
+    public void putLong(final String key, final long value) {
+        mMap.put(key, (double) value);
+    }
+
+    /**
+     * Map a key to a long array value stored as a double array value.
+     *
+     * @param key Key to map.
+     * @param value Value to map to.
+     */
+    public void putLongArray(final String key, final long[] value) {
+        if (value == null) {
+            mMap.put(key, null);
+            return;
+        }
+        final double[] array = new double[value.length];
+        for (int i = 0; i < value.length; i++) {
+            array[i] = (double) value[i];
+        }
+        mMap.put(key, array);
+    }
+
+    /**
+     * Map a key to a long array value stored as a double array value.
+     *
+     * @param key Key to map.
+     * @param value Value to map to.
+     */
+    public void putLongArray(final String key, final Long[] value) {
+        putLongArray(key, Arrays.asList(value));
+    }
+
+    /**
+     * Map a key to a long array value stored as a double array value.
+     *
+     * @param key Key to map.
+     * @param value Value to map to.
+     */
+    public void putLongArray(final String key, final Collection<Long> value) {
+        if (value == null) {
+            mMap.put(key, null);
+            return;
+        }
+        final double[] array = new double[value.size()];
+        int i = 0;
+        for (final Long element : value) {
+            array[i++] = (double) element;
+        }
+        mMap.put(key, array);
+    }
+
+    /**
      * Map a key to a String value.
      *
      * @param key Key to map.
      * @param value Value to map to.
      */
     public void putString(final String key, final String value) {
         mMap.put(key, value);
     }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/BasicSelectionActionDelegate.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/BasicSelectionActionDelegate.java
@@ -3,49 +3,74 @@
  * 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/. */
 
 package org.mozilla.geckoview;
 
 import android.annotation.TargetApi;
 import android.app.Activity;
+import android.content.ActivityNotFoundException;
+import android.content.Intent;
+import android.content.pm.PackageManager;
 import android.graphics.Matrix;
 import android.graphics.Rect;
 import android.graphics.RectF;
 import android.os.Build;
+import android.support.annotation.NonNull;
+import android.util.Log;
 import android.view.ActionMode;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
 
 import java.util.Arrays;
 import java.util.List;
 
+/**
+ * Class that implements a basic SelectionActionDelegate. This class is used by GeckoView by
+ * default if the consumer does not explicitly set a SelectionActionDelegate.
+ *
+ * To provide custom actions, extend this class and override the following methods,
+ *
+ * 1) Override {@link #getAllActions} to include custom action IDs in the returned array. This
+ * array must include all actions, available or not, and must not change over the class lifetime.
+ *
+ * 2) Override {@link #isActionAvailable} to return whether a custom action is currently available.
+ *
+ * 3) Override {@link #prepareAction} to set custom title and/or icon for a custom action.
+ *
+ * 4) Override {@link #performAction} to perform a custom action when used.
+ */
 public class BasicSelectionActionDelegate implements ActionMode.Callback,
-                                             GeckoSession.SelectionActionDelegate {
+                                                     GeckoSession.SelectionActionDelegate {
     private static final String LOGTAG = "GeckoBasicSelectionAction";
 
+    protected static final String ACTION_PROCESS_TEXT = Intent.ACTION_PROCESS_TEXT;
+
     private static final String[] FLOATING_TOOLBAR_ACTIONS = new String[] {
-            ACTION_CUT, ACTION_COPY, ACTION_PASTE, ACTION_SELECT_ALL
+        ACTION_CUT, ACTION_COPY, ACTION_PASTE, ACTION_SELECT_ALL, ACTION_PROCESS_TEXT
     };
     private static final String[] FIXED_TOOLBAR_ACTIONS = new String[] {
-            ACTION_SELECT_ALL, ACTION_CUT, ACTION_COPY, ACTION_PASTE
+        ACTION_SELECT_ALL, ACTION_CUT, ACTION_COPY, ACTION_PASTE
     };
 
     protected final Activity mActivity;
     protected final boolean mUseFloatingToolbar;
     protected final Matrix mTempMatrix = new Matrix();
     protected final RectF mTempRect = new RectF();
 
+    private boolean mExternalActionsEnabled;
+
     protected ActionMode mActionMode;
     protected GeckoSession mSession;
     protected Selection mSelection;
     protected List<String> mActions;
     protected GeckoSession.Response<String> mResponse;
+    protected boolean mRepopulatedMenu;
 
     @TargetApi(Build.VERSION_CODES.M)
     private class Callback2Wrapper extends ActionMode.Callback2 {
         @Override
         public boolean onCreateActionMode(final ActionMode actionMode, final Menu menu) {
             return BasicSelectionActionDelegate.this.onCreateActionMode(actionMode, menu);
         }
 
@@ -66,104 +91,160 @@ public class BasicSelectionActionDelegat
 
         @Override
         public void onGetContentRect(final ActionMode mode, final View view, final Rect outRect) {
             super.onGetContentRect(mode, view, outRect);
             BasicSelectionActionDelegate.this.onGetContentRect(mode, view, outRect);
         }
     }
 
-    public BasicSelectionActionDelegate(final Activity activity) {
+    public BasicSelectionActionDelegate(final @NonNull Activity activity) {
         this(activity, Build.VERSION.SDK_INT >= 23);
     }
 
-    public BasicSelectionActionDelegate(final Activity activity, final boolean useFloatingToolbar) {
+    public BasicSelectionActionDelegate(final @NonNull Activity activity,
+                                        final boolean useFloatingToolbar) {
         mActivity = activity;
         mUseFloatingToolbar = useFloatingToolbar;
+        mExternalActionsEnabled = true;
+    }
+
+    /**
+     * Set whether to include text actions from other apps in the floating toolbar.
+     *
+     * @param enable True if external actions should be enabled.
+     */
+    public void enableExternalActions(final boolean enable) {
+        mExternalActionsEnabled = enable;
+
+        if (mActionMode != null) {
+            mActionMode.invalidate();
+        }
+    }
+
+    /**
+     * Get whether text actions from other apps are enabled.
+     *
+     * @return True if external actions are enabled.
+     */
+    public boolean areExternalActionsEnabled() {
+        return mExternalActionsEnabled;
     }
 
     /**
      * Return list of all actions in proper order, regardless of their availability at present.
      * Override to add to or remove from the default set.
      *
      * @return Array of action IDs in proper order.
      */
-    protected String[] getAllActions() {
+    protected @NonNull String[] getAllActions() {
         return mUseFloatingToolbar ? FLOATING_TOOLBAR_ACTIONS
                                    : FIXED_TOOLBAR_ACTIONS;
     }
 
     /**
      * Return whether an action is presently available. Override to indicate
      * availability for custom actions.
      *
      * @param id Action ID.
      * @return True if the action is presently available.
      */
-    protected boolean isActionAvailable(final String id) {
+    protected boolean isActionAvailable(final @NonNull String id) {
+        if (mExternalActionsEnabled && !mSelection.text.isEmpty() &&
+                ACTION_PROCESS_TEXT.equals(id)) {
+            final PackageManager pm = mActivity.getPackageManager();
+            return pm.resolveActivity(getProcessTextIntent(),
+                                      PackageManager.MATCH_DEFAULT_ONLY) != null;
+        }
         return mActions.contains(id);
     }
 
     /**
      * Prepare a menu item corresponding to a certain action. Override to prepare
      * menu item for custom action.
      *
      * @param id Action ID.
      * @param item New menu item to prepare.
      */
-    protected void prepareAction(final String id, final MenuItem item) {
+    protected void prepareAction(final @NonNull String id, final @NonNull MenuItem item) {
         switch (id) {
             case ACTION_CUT:
                 item.setTitle(android.R.string.cut);
                 break;
             case ACTION_COPY:
                 item.setTitle(android.R.string.copy);
                 break;
             case ACTION_PASTE:
                 item.setTitle(android.R.string.paste);
                 break;
             case ACTION_SELECT_ALL:
                 item.setTitle(android.R.string.selectAll);
                 break;
+            case ACTION_PROCESS_TEXT:
+                throw new IllegalStateException("Unexpected action");
         }
     }
 
     /**
      * Perform the specified action. Override to perform custom actions.
      *
      * @param id Action ID.
+     * @param item Nenu item for the action.
      * @return True if the action was performed.
      */
-    protected boolean performAction(final String id) {
+    protected boolean performAction(final @NonNull String id, final @NonNull MenuItem item) {
+        if (ACTION_PROCESS_TEXT.equals(id)) {
+            try {
+                mActivity.startActivity(item.getIntent());
+            } catch (final ActivityNotFoundException e) {
+                Log.e(LOGTAG, "Cannot perform action", e);
+                return false;
+            }
+            return true;
+        }
+
         if (mResponse == null) {
             return false;
         }
         mResponse.respond(id);
 
         // Android behavior is to clear selection on copy.
         if (ACTION_COPY.equals(id)) {
             if (mUseFloatingToolbar) {
                 clearSelection();
             } else {
                 mActionMode.finish();
             }
         }
         return true;
     }
 
+    /**
+     * Clear the current selection, if possible.
+     */
     protected void clearSelection() {
         if (mResponse != null) {
             if (isActionAvailable(ACTION_COLLAPSE_TO_END)) {
                 mResponse.respond(ACTION_COLLAPSE_TO_END);
             } else {
                 mResponse.respond(ACTION_UNSELECT);
             }
         }
     }
 
+    private Intent getProcessTextIntent() {
+        final Intent intent = new Intent(Intent.ACTION_PROCESS_TEXT);
+        intent.addCategory(Intent.CATEGORY_DEFAULT);
+        intent.setType("text/plain");
+        intent.putExtra(Intent.EXTRA_PROCESS_TEXT, mSelection.text);
+        // TODO: implement ability to replace text in Gecko for editable selection (bug 1453137).
+        intent.putExtra(Intent.EXTRA_PROCESS_TEXT_READONLY, true);
+        return intent;
+    }
+
     @Override
     public boolean onCreateActionMode(final ActionMode actionMode, final Menu menu) {
         final String[] allActions = getAllActions();
         for (final String actionId : allActions) {
             if (isActionAvailable(actionId)) {
                 if (!mUseFloatingToolbar && (
                         Build.VERSION.SDK_INT == 22 || Build.VERSION.SDK_INT == 23)) {
                     // Android bug where onPrepareActionMode is not called initially.
@@ -175,38 +256,78 @@ public class BasicSelectionActionDelegat
         return false;
     }
 
     @Override
     public boolean onPrepareActionMode(final ActionMode actionMode, final Menu menu) {
         final String[] allActions = getAllActions();
         boolean changed = false;
 
+        // Whether we are repopulating an existing menu.
+        mRepopulatedMenu = menu.size() != 0;
+
         // For each action, see if it's available at present, and if necessary,
         // add to or remove from menu.
-        for (int menuId = 0; menuId < allActions.length; menuId++) {
-            final String actionId = allActions[menuId];
+        for (int i = 0; i < allActions.length; i++) {
+            final String actionId = allActions[i];
+            final int menuId = i + Menu.FIRST;
+
+            if (ACTION_PROCESS_TEXT.equals(actionId)) {
+                if (mExternalActionsEnabled && !mSelection.text.isEmpty()) {
+                    menu.addIntentOptions(menuId, menuId, menuId,
+                                          mActivity.getComponentName(),
+                                          /* specifiec */ null, getProcessTextIntent(),
+                                          /* flags */ 0, /* items */ null);
+                    changed = true;
+                } else if (menu.findItem(menuId) != null) {
+                    menu.removeGroup(menuId);
+                    changed = true;
+                }
+                continue;
+            }
+
             if (isActionAvailable(actionId)) {
                 if (menu.findItem(menuId) == null) {
                     prepareAction(actionId, menu.add(/* group */ Menu.NONE, menuId,
                                                      menuId, /* title */ ""));
                     changed = true;
                 }
             } else if (menu.findItem(menuId) != null) {
                 menu.removeItem(menuId);
                 changed = true;
             }
         }
         return changed;
     }
 
     @Override
     public boolean onActionItemClicked(final ActionMode actionMode, final MenuItem menuItem) {
+        MenuItem realMenuItem = null;
+        if (mRepopulatedMenu) {
+            // When we repopulate an existing menu, Android can sometimes give us an old,
+            // deleted MenuItem. Find the current MenuItem that corresponds to the old one.
+            final Menu menu = actionMode.getMenu();
+            final int size = menu.size();
+            for (int i = 0; i < size; i++) {
+                final MenuItem item = menu.getItem(i);
+                if (item == menuItem || (item.getItemId() == menuItem.getItemId() &&
+                        item.getTitle().equals(menuItem.getTitle()))) {
+                    realMenuItem = item;
+                    break;
+                }
+            }
+        } else {
+            realMenuItem = menuItem;
+        }
+
+        if (realMenuItem == null) {
+            return false;
+        }
         final String[] allActions = getAllActions();
-        return performAction(allActions[menuItem.getItemId()]);
+        return performAction(allActions[realMenuItem.getItemId() - Menu.FIRST], realMenuItem);
     }
 
     @Override
     public void onDestroyActionMode(final ActionMode actionMode) {
         if (!mUseFloatingToolbar) {
             clearSelection();
         }
         mSession = null;
--- a/mobile/android/geckoview/src/test/java/org/mozilla/gecko/util/GeckoBundleTest.java
+++ b/mobile/android/geckoview/src/test/java/org/mozilla/gecko/util/GeckoBundleTest.java
@@ -15,53 +15,57 @@ import org.junit.runner.RunWith;
 import org.robolectric.RobolectricTestRunner;
 
 import java.util.Arrays;
 import java.util.List;
 
 @RunWith(RobolectricTestRunner.class)
 @SmallTest
 public class GeckoBundleTest {
-    private static final int INNER_BUNDLE_SIZE = 25;
+    private static final int INNER_BUNDLE_SIZE = 28;
     private static final int OUTER_BUNDLE_SIZE = INNER_BUNDLE_SIZE + 6;
 
     private static GeckoBundle createInnerBundle() {
         final GeckoBundle bundle = new GeckoBundle();
 
         bundle.putBoolean("boolean", true);
         bundle.putBooleanArray("booleanArray", new boolean[] {false, true});
 
         bundle.putInt("int", 1);
         bundle.putIntArray("intArray", new int[] {2, 3});
 
         bundle.putDouble("double", 0.5);
         bundle.putDoubleArray("doubleArray", new double[] {1.5, 2.5});
 
+        bundle.putLong("long", 1L);
+        bundle.putLongArray("longArray", new long[] {2L, 3L});
+
         bundle.putString("string", "foo");
         bundle.putString("nullString", null);
         bundle.putString("emptyString", "");
         bundle.putStringArray("stringArray", new String[] {"bar", "baz"});
         bundle.putStringArray("stringArrayOfNull", new String[2]);
 
         bundle.putBooleanArray("emptyBooleanArray", new boolean[0]);
         bundle.putIntArray("emptyIntArray", new int[0]);
         bundle.putDoubleArray("emptyDoubleArray", new double[0]);
+        bundle.putLongArray("emptyLongArray", new long[0]);
         bundle.putStringArray("emptyStringArray", new String[0]);
 
         bundle.putBooleanArray("nullBooleanArray", (boolean[]) null);
         bundle.putIntArray("nullIntArray", (int[]) null);
         bundle.putDoubleArray("nullDoubleArray", (double[]) null);
+        bundle.putLongArray("nullLongArray", (long[]) null);
         bundle.putStringArray("nullStringArray", (String[]) null);
 
         bundle.putDoubleArray("mixedArray", new double[] {1.0, 1.5});
 
         bundle.putInt("byte", 1);
         bundle.putInt("short", 1);
         bundle.putDouble("float", 0.5);
-        bundle.putDouble("long", 1.0);
         bundle.putString("char", "f");
 
         return bundle;
     }
 
     private static GeckoBundle createBundle() {
         final GeckoBundle outer = createInnerBundle();
         final GeckoBundle inner = createInnerBundle();
@@ -83,38 +87,42 @@ public class GeckoBundleTest {
         assertArrayEquals(new boolean[] {false, true}, bundle.getBooleanArray("booleanArray"));
 
         assertEquals(1, bundle.getInt("int"));
         assertArrayEquals(new int[] {2, 3}, bundle.getIntArray("intArray"));
 
         assertEquals(0.5, bundle.getDouble("double"), 0.0);
         assertArrayEquals(new double[] {1.5, 2.5}, bundle.getDoubleArray("doubleArray"), 0.0);
 
+        assertEquals(1L, bundle.getLong("long"));
+        assertArrayEquals(new long[] {2L, 3L}, bundle.getLongArray("longArray"));
+
         assertEquals("foo", bundle.getString("string"));
         assertEquals(null, bundle.getString("nullString"));
         assertEquals("", bundle.getString("emptyString"));
         assertArrayEquals(new String[] {"bar", "baz"}, bundle.getStringArray("stringArray"));
         assertArrayEquals(new String[2], bundle.getStringArray("stringArrayOfNull"));
 
         assertArrayEquals(new boolean[0], bundle.getBooleanArray("emptyBooleanArray"));
         assertArrayEquals(new int[0], bundle.getIntArray("emptyIntArray"));
         assertArrayEquals(new double[0], bundle.getDoubleArray("emptyDoubleArray"), 0.0);
+        assertArrayEquals(new long[0], bundle.getLongArray("emptyLongArray"));
         assertArrayEquals(new String[0], bundle.getStringArray("emptyStringArray"));
 
         assertArrayEquals(null, bundle.getBooleanArray("nullBooleanArray"));
         assertArrayEquals(null, bundle.getIntArray("nullIntArray"));
         assertArrayEquals(null, bundle.getDoubleArray("nullDoubleArray"), 0.0);
+        assertArrayEquals(null, bundle.getLongArray("nullLongArray"));
         assertArrayEquals(null, bundle.getStringArray("nullStringArray"));
 
         assertArrayEquals(new double[] {1.0, 1.5}, bundle.getDoubleArray("mixedArray"), 0.0);
 
         assertEquals(1, bundle.getInt("byte"));
         assertEquals(1, bundle.getInt("short"));
         assertEquals(0.5, bundle.getDouble("float"), 0.0);
-        assertEquals(1.0, bundle.getDouble("long"), 0.0);
         assertEquals("f", bundle.getString("char"));
     }
 
     private static void checkBundle(final GeckoBundle bundle) {
         checkInnerBundle(bundle, OUTER_BUNDLE_SIZE);
 
         checkInnerBundle(bundle.getBundle("object"), INNER_BUNDLE_SIZE);
         assertEquals(null, bundle.getBundle("nullObject"));
@@ -204,34 +212,37 @@ public class GeckoBundleTest {
 
         testRemove(test, "nonexistent");
         testRemove(test, "boolean");
         testRemove(test, "booleanArray");
         testRemove(test, "int");
         testRemove(test, "intArray");
         testRemove(test, "double");
         testRemove(test, "doubleArray");
+        testRemove(test, "long");
+        testRemove(test, "longArray");
         testRemove(test, "string");
         testRemove(test, "nullString");
         testRemove(test, "emptyString");
         testRemove(test, "stringArray");
         testRemove(test, "stringArrayOfNull");
         testRemove(test, "emptyBooleanArray");
         testRemove(test, "emptyIntArray");
         testRemove(test, "emptyDoubleArray");
+        testRemove(test, "emptyLongArray");
         testRemove(test, "emptyStringArray");
         testRemove(test, "nullBooleanArray");
         testRemove(test, "nullIntArray");
         testRemove(test, "nullDoubleArray");
+        testRemove(test, "nullLongArray");
         testRemove(test, "nullStringArray");
         testRemove(test, "mixedArray");
         testRemove(test, "byte");
         testRemove(test, "short");
         testRemove(test, "float");
-        testRemove(test, "long");
         testRemove(test, "char");
         testRemove(test, "object");
         testRemove(test, "nullObject");
         testRemove(test, "objectArray");
         testRemove(test, "objectArrayOfNull");
         testRemove(test, "emptyObjectArray");
         testRemove(test, "nullObjectArray");
 
@@ -245,22 +256,23 @@ public class GeckoBundleTest {
         test.clear();
         assertEquals(0, test.size());
     }
 
     @Test
     public void keysShouldReturnCorrectResult() {
         final String[] actual = reference.keys();
         final String[] expected = new String[] {
-            "boolean", "booleanArray", "int", "intArray", "double", "doubleArray", "string",
-            "nullString", "emptyString", "stringArray", "stringArrayOfNull",
-            "emptyBooleanArray", "emptyIntArray", "emptyDoubleArray", "emptyStringArray",
-            "nullBooleanArray", "nullIntArray", "nullDoubleArray", "nullStringArray",
-            "mixedArray", "byte", "short", "float", "long", "char", "object", "nullObject",
-            "objectArray", "objectArrayOfNull", "emptyObjectArray", "nullObjectArray"
+            "boolean", "booleanArray", "int", "intArray", "double", "doubleArray", "long",
+            "longArray", "string", "nullString", "emptyString", "stringArray", "stringArrayOfNull",
+            "emptyBooleanArray", "emptyIntArray", "emptyDoubleArray", "emptyLongArray",
+            "emptyStringArray", "nullBooleanArray", "nullIntArray", "nullDoubleArray",
+            "nullLongArray", "nullStringArray", "mixedArray", "byte", "short", "float", "char",
+            "object", "nullObject", "objectArray", "objectArrayOfNull", "emptyObjectArray",
+            "nullObjectArray"
         };
 
         Arrays.sort(expected);
         Arrays.sort(actual);
 
         assertArrayEquals(expected, actual);
     }
 
@@ -270,16 +282,17 @@ public class GeckoBundleTest {
         assertTrue(new GeckoBundle().isEmpty());
     }
 
     @Test
     public void getExistentKeysShouldNotReturnDefaultValues() {
         assertNotEquals(false, reference.getBoolean("boolean", false));
         assertNotEquals(0, reference.getInt("int", 0));
         assertNotEquals(0.0, reference.getDouble("double", 0.0), 0.0);
+        assertNotEquals(0L, reference.getLong("long", 0L));
         assertNotEquals("", reference.getString("string", ""));
     }
 
     private static void testDefaultValueForNull(final GeckoBundle bundle, final String key) {
         // We return default values for null values.
         assertEquals(true, bundle.getBoolean(key, true));
         assertEquals(1, bundle.getInt(key, 1));
         assertEquals(0.5, bundle.getDouble(key, 0.5), 0.0);
@@ -298,25 +311,27 @@ public class GeckoBundleTest {
         assertEquals(0.5, reference.getDouble("nonexistent", 0.5), 0.0);
         assertEquals(null, reference.getString("nonexistent"));
         assertEquals("foo", reference.getString("nonexistent", "foo"));
         assertEquals(null, reference.getBundle("nonexistent"));
 
         assertArrayEquals(null, reference.getBooleanArray("nonexistent"));
         assertArrayEquals(null, reference.getIntArray("nonexistent"));
         assertArrayEquals(null, reference.getDoubleArray("nonexistent"), 0.0);
+        assertArrayEquals(null, reference.getLongArray("nonexistent"));
         assertArrayEquals(null, reference.getStringArray("nonexistent"));
         assertArrayEquals(null, reference.getBundleArray("nonexistent"));
 
         // We return default values for null values.
         testDefaultValueForNull(reference, "nullObject");
         testDefaultValueForNull(reference, "nullString");
         testDefaultValueForNull(reference, "nullBooleanArray");
         testDefaultValueForNull(reference, "nullIntArray");
         testDefaultValueForNull(reference, "nullDoubleArray");
+        testDefaultValueForNull(reference, "nullLongArray");
         testDefaultValueForNull(reference, "nullStringArray");
         testDefaultValueForNull(reference, "nullObjectArray");
     }
 
     @Test
     public void bundleConversionShouldWork() {
         assertEquals(reference, GeckoBundle.fromBundle(reference.toBundle()));
     }
@@ -405,16 +420,35 @@ public class GeckoBundleTest {
             try {
                 bundle.getDoubleArray(key);
                 fail(String.format("%s should not coerce to double array", key));
             } catch (final Exception e) {
                 assertTrue(true);
             }
         }
 
+        if (!allowed.contains("long")) {
+            try {
+                bundle.getLong(key);
+                fail(String.format("%s should not coerce to long", key));
+            } catch (final Exception e) {
+                assertTrue(true);
+            }
+        }
+
+        if (!allowed.contains("longArray") && !allowed.contains("emptyLongArray") &&
+            !allowed.contains("nullLongArray")) {
+            try {
+                bundle.getLongArray(key);
+                fail(String.format("%s should not coerce to long array", key));
+            } catch (final Exception e) {
+                assertTrue(true);
+            }
+        }
+
         if (!allowed.contains("string") && !allowed.contains("nullString")) {
             try {
                 bundle.getString(key);
                 fail(String.format("%s should not coerce to string", key));
             } catch (final Exception e) {
                 assertTrue(true);
             }
         }
@@ -461,31 +495,64 @@ public class GeckoBundleTest {
 
     @Test
     public void intShouldCoerceToDouble() {
         assertEquals(1.0, reference.getDouble("int"), 0.0);
         assertArrayEquals(new double[] {2.0, 3.0}, reference.getDoubleArray("intArray"), 0.0);
     }
 
     @Test
+    public void intShouldCoerceToLong() {
+        assertEquals(1L, reference.getLong("int"));
+        assertArrayEquals(new long[] {2L, 3L}, reference.getLongArray("intArray"));
+    }
+
+    @Test
     public void intShouldNotCoerceToOtherTypes() {
-        testInvalidCoercions(reference, "int", /* except */ "double");
-        testInvalidCoercions(reference, "intArray", /* except */ "doubleArray");
+        testInvalidCoercions(reference, "int", /* except */ "double", "long");
+        testInvalidCoercions(reference, "intArray",
+                             /* except */ "doubleArray", "longArray");
     }
 
     @Test
     public void doubleShouldCoerceToInt() {
         assertEquals(0, reference.getInt("double"));
         assertArrayEquals(new int[] {1, 2}, reference.getIntArray("doubleArray"));
     }
 
     @Test
+    public void doubleShouldCoerceToLong() {
+        assertEquals(0L, reference.getLong("double"));
+        assertArrayEquals(new long[] {1L, 2L}, reference.getLongArray("doubleArray"));
+    }
+
+    @Test
     public void doubleShouldNotCoerceToOtherTypes() {
-        testInvalidCoercions(reference, "double", /* except */ "int");
-        testInvalidCoercions(reference, "doubleArray", /* except */ "intArray");
+        testInvalidCoercions(reference, "double", /* except */ "int", "long");
+        testInvalidCoercions(reference, "doubleArray",
+                             /* except */ "intArray", "longArray");
+    }
+
+    @Test
+    public void longShouldCoerceToInt() {
+        assertEquals(1, reference.getInt("long"));
+        assertArrayEquals(new int[] {2, 3}, reference.getIntArray("longArray"));
+    }
+
+    @Test
+    public void longShouldCoerceToDouble() {
+        assertEquals(1.0, reference.getDouble("long"), 0.0);
+        assertArrayEquals(new double[] {2.0, 3.0}, reference.getDoubleArray("longArray"), 0.0);
+    }
+
+    @Test
+    public void longShouldNotCoerceToOtherTypes() {
+        testInvalidCoercions(reference, "long", /* except */ "int", "double");
+        testInvalidCoercions(reference, "longArray",
+                             /* except */ "intArray", "doubleArray");
     }
 
     @Test
     public void nullStringShouldCoerceToBundle() {
         assertEquals(null, reference.getBundle("nullString"));
         assertArrayEquals(new GeckoBundle[2], reference.getBundleArray("stringArrayOfNull"));
     }
 
@@ -514,74 +581,98 @@ public class GeckoBundleTest {
     public void nonNullBundleShouldNotCoerceToOtherTypes() {
         testInvalidCoercions(reference, "object");
     }
 
     @Test
     public void emptyArrayShouldCoerceToAnyArray() {
         assertArrayEquals(new int[0], reference.getIntArray("emptyBooleanArray"));
         assertArrayEquals(new double[0], reference.getDoubleArray("emptyBooleanArray"), 0.0);
+        assertArrayEquals(new long[0], reference.getLongArray("emptyBooleanArray"));
         assertArrayEquals(new String[0], reference.getStringArray("emptyBooleanArray"));
         assertArrayEquals(new GeckoBundle[0], reference.getBundleArray("emptyBooleanArray"));
 
         assertArrayEquals(new boolean[0], reference.getBooleanArray("emptyIntArray"));
         assertArrayEquals(new double[0], reference.getDoubleArray("emptyIntArray"), 0.0);
+        assertArrayEquals(new long[0], reference.getLongArray("emptyIntArray"));
         assertArrayEquals(new String[0], reference.getStringArray("emptyIntArray"));
         assertArrayEquals(new GeckoBundle[0], reference.getBundleArray("emptyIntArray"));
 
         assertArrayEquals(new boolean[0], reference.getBooleanArray("emptyDoubleArray"));
         assertArrayEquals(new int[0], reference.getIntArray("emptyDoubleArray"));
+        assertArrayEquals(new long[0], reference.getLongArray("emptyDoubleArray"));
         assertArrayEquals(new String[0], reference.getStringArray("emptyDoubleArray"));
         assertArrayEquals(new GeckoBundle[0], reference.getBundleArray("emptyDoubleArray"));
 
+        assertArrayEquals(new boolean[0], reference.getBooleanArray("emptyLongArray"));
+        assertArrayEquals(new int[0], reference.getIntArray("emptyLongArray"));
+        assertArrayEquals(new double[0], reference.getDoubleArray("emptyLongArray"), 0.0);
+        assertArrayEquals(new String[0], reference.getStringArray("emptyLongArray"));
+        assertArrayEquals(new GeckoBundle[0], reference.getBundleArray("emptyLongArray"));
+
         assertArrayEquals(new boolean[0], reference.getBooleanArray("emptyStringArray"));
         assertArrayEquals(new int[0], reference.getIntArray("emptyStringArray"));
         assertArrayEquals(new double[0], reference.getDoubleArray("emptyStringArray"), 0.0);
+        assertArrayEquals(new long[0], reference.getLongArray("emptyStringArray"));
         assertArrayEquals(new GeckoBundle[0], reference.getBundleArray("emptyStringArray"));
 
         assertArrayEquals(new boolean[0], reference.getBooleanArray("emptyObjectArray"));
         assertArrayEquals(new int[0], reference.getIntArray("emptyObjectArray"));
         assertArrayEquals(new double[0], reference.getDoubleArray("emptyObjectArray"), 0.0);
+        assertArrayEquals(new long[0], reference.getLongArray("emptyObjectArray"));
         assertArrayEquals(new String[0], reference.getStringArray("emptyObjectArray"));
     }
 
     @Test
     public void emptyArrayShouldNotCoerceToOtherTypes() {
         testInvalidCoercions(reference, "emptyBooleanArray", /* except */ "intArray",
-                             "doubleArray", "stringArray", "objectArray");
+                             "doubleArray", "longArray", "stringArray", "objectArray");
         testInvalidCoercions(reference, "emptyIntArray", /* except */ "booleanArray",
-                             "doubleArray", "stringArray", "objectArray");
+                             "doubleArray", "longArray", "stringArray", "objectArray");
         testInvalidCoercions(reference, "emptyDoubleArray", /* except */ "booleanArray",
-                             "intArray", "stringArray", "objectArray");
+                             "intArray", "longArray", "stringArray", "objectArray");
+        testInvalidCoercions(reference, "emptyLongArray", /* except */ "booleanArray",
+                             "intArray", "doubleArray", "stringArray", "objectArray");
         testInvalidCoercions(reference, "emptyStringArray", /* except */ "booleanArray",
-                             "intArray", "doubleArray", "objectArray");
+                             "intArray", "doubleArray", "longArray", "objectArray");
         testInvalidCoercions(reference, "emptyObjectArray", /* except */ "booleanArray",
-                             "intArray", "doubleArray", "stringArray");
+                             "intArray", "doubleArray", "longArray", "stringArray");
     }
 
     @Test
     public void nullArrayShouldCoerceToAnyArray() {
         assertArrayEquals(null, reference.getIntArray("nullBooleanArray"));
         assertArrayEquals(null, reference.getDoubleArray("nullBooleanArray"), 0.0);
+        assertArrayEquals(null, reference.getLongArray("nullBooleanArray"));
         assertArrayEquals(null, reference.getStringArray("nullBooleanArray"));
         assertArrayEquals(null, reference.getBundleArray("nullBooleanArray"));
 
         assertArrayEquals(null, reference.getBooleanArray("nullIntArray"));
         assertArrayEquals(null, reference.getDoubleArray("nullIntArray"), 0.0);
+        assertArrayEquals(null, reference.getLongArray("nullIntArray"));
         assertArrayEquals(null, reference.getStringArray("nullIntArray"));
         assertArrayEquals(null, reference.getBundleArray("nullIntArray"));
 
         assertArrayEquals(null, reference.getBooleanArray("nullDoubleArray"));
         assertArrayEquals(null, reference.getIntArray("nullDoubleArray"));
+        assertArrayEquals(null, reference.getLongArray("nullDoubleArray"));
         assertArrayEquals(null, reference.getStringArray("nullDoubleArray"));
         assertArrayEquals(null, reference.getBundleArray("nullDoubleArray"));
 
+        assertArrayEquals(null, reference.getBooleanArray("nullLongArray"));
+        assertArrayEquals(null, reference.getIntArray("nullLongArray"));
+        assertArrayEquals(null, reference.getDoubleArray("nullLongArray"), 0.0);
+        assertArrayEquals(null, reference.getStringArray("nullLongArray"));
+        assertArrayEquals(null, reference.getBundleArray("nullLongArray"));
+
         assertArrayEquals(null, reference.getBooleanArray("nullStringArray"));
         assertArrayEquals(null, reference.getIntArray("nullStringArray"));
         assertArrayEquals(null, reference.getDoubleArray("nullStringArray"), 0.0);
+        assertArrayEquals(null, reference.getLongArray("nullStringArray"));
         assertArrayEquals(null, reference.getBundleArray("nullStringArray"));
 
         assertArrayEquals(null, reference.getBooleanArray("nullObjectArray"));
         assertArrayEquals(null, reference.getIntArray("nullObjectArray"));
         assertArrayEquals(null, reference.getDoubleArray("nullObjectArray"), 0.0);
+        assertArrayEquals(null, reference.getLongArray("nullObjectArray"));
         assertArrayEquals(null, reference.getStringArray("nullObjectArray"));
     }
 }
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1266,19 +1266,16 @@ pref("dom.timeout.foreground_throttling_
 // The maximum amount a timeout can be delayed by budget throttling
 pref("dom.timeout.budget_throttling_max_delay", 15000);
 // Turn on budget throttling by default
 pref("dom.timeout.enable_budget_timer_throttling", true);
 
 // Don't use new input types
 pref("dom.experimental_forms", false);
 
-// Enable <input type=number>:
-pref("dom.forms.number", true);
-
 // Enable <input type=color> by default. It will be turned off for remaining
 // platforms which don't have a color picker implemented yet.
 pref("dom.forms.color", true);
 
 // Support for input type=date and type=time.
 pref("dom.forms.datetime", true);
 
 // Support for input type=month, type=week and type=datetime-local. By default,
--- a/servo/components/script/dom/dissimilaroriginwindow.rs
+++ b/servo/components/script/dom/dissimilaroriginwindow.rs
@@ -187,14 +187,18 @@ impl DissimilarOriginWindowMethods for D
     // https://html.spec.whatwg.org/multipage/#dom-location
     fn Location(&self) -> DomRoot<DissimilarOriginLocation> {
         self.location.or_init(|| DissimilarOriginLocation::new(self))
     }
 }
 
 impl DissimilarOriginWindow {
     pub fn post_message(&self, origin: Option<ImmutableOrigin>, data: StructuredCloneData) {
+        let incumbent = match GlobalScope::incumbent() {
+            None => return warn!("postMessage called with no incumbent global"),
+            Some(incumbent) => incumbent,
+        };
         let msg = ScriptMsg::PostMessage(self.window_proxy.browsing_context_id(),
                                                 origin,
                                                 data.move_to_arraybuffer());
-        let _ = self.upcast::<GlobalScope>().script_to_constellation_chan().send(msg);
+        let _ = incumbent.script_to_constellation_chan().send(msg);
     }
 }
--- a/servo/components/selectors/attr.rs
+++ b/servo/components/selectors/attr.rs
@@ -14,19 +14,17 @@ pub struct AttrSelectorWithNamespace<Imp
     pub operation: ParsedAttrSelectorOperation<Impl::AttrValue>,
     pub never_matches: bool,
 }
 
 impl<Impl: SelectorImpl> AttrSelectorWithNamespace<Impl> {
     pub fn namespace(&self) -> NamespaceConstraint<&Impl::NamespaceUrl> {
         match self.namespace {
             NamespaceConstraint::Any => NamespaceConstraint::Any,
-            NamespaceConstraint::Specific((_, ref url)) => {
-                NamespaceConstraint::Specific(url)
-            }
+            NamespaceConstraint::Specific((_, ref url)) => NamespaceConstraint::Specific(url),
         }
     }
 }
 
 #[derive(Clone, Eq, PartialEq)]
 pub enum NamespaceConstraint<NamespaceUrl> {
     Any,
 
@@ -36,94 +34,102 @@ pub enum NamespaceConstraint<NamespaceUr
 
 #[derive(Clone, Eq, PartialEq)]
 pub enum ParsedAttrSelectorOperation<AttrValue> {
     Exists,
     WithValue {
         operator: AttrSelectorOperator,
         case_sensitivity: ParsedCaseSensitivity,
         expected_value: AttrValue,
-    }
+    },
 }
 
 #[derive(Clone, Eq, PartialEq)]
 pub enum AttrSelectorOperation<AttrValue> {
     Exists,
     WithValue {
         operator: AttrSelectorOperator,
         case_sensitivity: CaseSensitivity,
         expected_value: AttrValue,
-    }
+    },
 }
 
 impl<AttrValue> AttrSelectorOperation<AttrValue> {
-    pub fn eval_str(&self, element_attr_value: &str) -> bool where AttrValue: AsRef<str> {
+    pub fn eval_str(&self, element_attr_value: &str) -> bool
+    where
+        AttrValue: AsRef<str>,
+    {
         match *self {
             AttrSelectorOperation::Exists => true,
-            AttrSelectorOperation::WithValue { operator, case_sensitivity, ref expected_value } => {
-                operator.eval_str(element_attr_value, expected_value.as_ref(), case_sensitivity)
-            }
+            AttrSelectorOperation::WithValue {
+                operator,
+                case_sensitivity,
+                ref expected_value,
+            } => operator.eval_str(
+                element_attr_value,
+                expected_value.as_ref(),
+                case_sensitivity,
+            ),
         }
     }
 }
 
 #[derive(Clone, Copy, Eq, PartialEq)]
 pub enum AttrSelectorOperator {
     Equal,
     Includes,
     DashMatch,
     Prefix,
     Substring,
     Suffix,
 }
 
 impl ToCss for AttrSelectorOperator {
-    fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
+    fn to_css<W>(&self, dest: &mut W) -> fmt::Result
+    where
+        W: fmt::Write,
+    {
         // https://drafts.csswg.org/cssom/#serializing-selectors
         // See "attribute selector".
         dest.write_str(match *self {
             AttrSelectorOperator::Equal => "=",
             AttrSelectorOperator::Includes => "~=",
             AttrSelectorOperator::DashMatch => "|=",
             AttrSelectorOperator::Prefix => "^=",
             AttrSelectorOperator::Substring => "*=",
             AttrSelectorOperator::Suffix => "$=",
         })
     }
 }
 
 impl AttrSelectorOperator {
-    pub fn eval_str(self, element_attr_value: &str, attr_selector_value: &str,
-                    case_sensitivity: CaseSensitivity) -> bool {
+    pub fn eval_str(
+        self,
+        element_attr_value: &str,
+        attr_selector_value: &str,
+        case_sensitivity: CaseSensitivity,
+    ) -> bool {
         let e = element_attr_value.as_bytes();
         let s = attr_selector_value.as_bytes();
         let case = case_sensitivity;
         match self {
-            AttrSelectorOperator::Equal => {
-                case.eq(e, s)
-            }
-            AttrSelectorOperator::Prefix => {
-                e.len() >= s.len() && case.eq(&e[..s.len()], s)
-            }
+            AttrSelectorOperator::Equal => case.eq(e, s),
+            AttrSelectorOperator::Prefix => e.len() >= s.len() && case.eq(&e[..s.len()], s),
             AttrSelectorOperator::Suffix => {
                 e.len() >= s.len() && case.eq(&e[(e.len() - s.len())..], s)
-            }
+            },
             AttrSelectorOperator::Substring => {
                 case.contains(element_attr_value, attr_selector_value)
-            }
-            AttrSelectorOperator::Includes => {
-                element_attr_value.split(SELECTOR_WHITESPACE)
-                                  .any(|part| case.eq(part.as_bytes(), s))
-            }
+            },
+            AttrSelectorOperator::Includes => element_attr_value
+                .split(SELECTOR_WHITESPACE)
+                .any(|part| case.eq(part.as_bytes(), s)),
             AttrSelectorOperator::DashMatch => {
-                case.eq(e, s) || (
-                    e.get(s.len()) == Some(&b'-') &&
-                    case.eq(&e[..s.len()], s)
-                )
-            }
+                case.eq(e, s) || (e.get(s.len()) == Some(&b'-') && case.eq(&e[..s.len()], s))
+            },
         }
     }
 }
 
 /// The definition of whitespace per CSS Selectors Level 3 § 4.
 pub static SELECTOR_WHITESPACE: &'static [char] = &[' ', '\t', '\n', '\r', '\x0C'];
 
 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
@@ -132,22 +138,23 @@ pub enum ParsedCaseSensitivity {
     AsciiCaseInsensitive,
     AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument,
 }
 
 impl ParsedCaseSensitivity {
     pub fn to_unconditional(self, is_html_element_in_html_document: bool) -> CaseSensitivity {
         match self {
             ParsedCaseSensitivity::AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument
-            if is_html_element_in_html_document => {
+                if is_html_element_in_html_document =>
+            {
                 CaseSensitivity::AsciiCaseInsensitive
-            }
+            },
             ParsedCaseSensitivity::AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument => {
                 CaseSensitivity::CaseSensitive
-            }
+            },
             ParsedCaseSensitivity::CaseSensitive => CaseSensitivity::CaseSensitive,
             ParsedCaseSensitivity::AsciiCaseInsensitive => CaseSensitivity::AsciiCaseInsensitive,
         }
     }
 }
 
 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub enum CaseSensitivity {
@@ -165,27 +172,25 @@ impl CaseSensitivity {
 
     pub fn contains(self, haystack: &str, needle: &str) -> bool {
         match self {
             CaseSensitivity::CaseSensitive => haystack.contains(needle),
             CaseSensitivity::AsciiCaseInsensitive => {
                 if let Some((&n_first_byte, n_rest)) = needle.as_bytes().split_first() {
                     haystack.bytes().enumerate().any(|(i, byte)| {
                         if !byte.eq_ignore_ascii_case(&n_first_byte) {
-                            return false
+                            return false;
                         }
                         let after_this_byte = &haystack.as_bytes()[i + 1..];
                         match after_this_byte.get(..n_rest.len()) {
                             None => false,
-                            Some(haystack_slice) => {
-                                haystack_slice.eq_ignore_ascii_case(n_rest)
-                            }
+                            Some(haystack_slice) => haystack_slice.eq_ignore_ascii_case(n_rest),
                         }
                     })
                 } else {
                     // any_str.contains("") == true,
                     // though these cases should be handled with *NeverMatches and never go here.
                     true
                 }
-            }
+            },
         }
     }
 }
--- a/servo/components/selectors/bloom.rs
+++ b/servo/components/selectors/bloom.rs
@@ -67,21 +67,27 @@ pub type NonCountingBloomFilter = Counti
 ///
 /// What this means in practice is that for a few hundred keys using a
 /// KeySize of 12 gives false positive rates on the order of 0.25-4%.
 ///
 /// Similarly, using a KeySize of 10 would lead to a 4% false
 /// positive rate for N == 100 and to quite bad false positive
 /// rates for larger N.
 #[derive(Clone)]
-pub struct CountingBloomFilter<S> where S: BloomStorage {
+pub struct CountingBloomFilter<S>
+where
+    S: BloomStorage,
+{
     storage: S,
 }
 
-impl<S> CountingBloomFilter<S> where S: BloomStorage {
+impl<S> CountingBloomFilter<S>
+where
+    S: BloomStorage,
+{
     /// Creates a new bloom filter.
     #[inline]
     pub fn new() -> Self {
         CountingBloomFilter {
             storage: Default::default(),
         }
     }
 
@@ -123,43 +129,45 @@ impl<S> CountingBloomFilter<S> where S: 
     /// Removes an item from the bloom filter.
     #[inline]
     pub fn remove<T: Hash>(&mut self, elem: &T) {
         self.remove_hash(hash(elem))
     }
 
     #[inline]
     pub fn might_contain_hash(&self, hash: u32) -> bool {
-        !self.storage.first_slot_is_empty(hash) &&
-            !self.storage.second_slot_is_empty(hash)
+        !self.storage.first_slot_is_empty(hash) && !self.storage.second_slot_is_empty(hash)
     }
 
     /// Check whether the filter might contain an item.  This can
     /// sometimes return true even if the item is not in the filter,
     /// but will never return false for items that are actually in the
     /// filter.
     #[inline]
     pub fn might_contain<T: Hash>(&self, elem: &T) -> bool {
         self.might_contain_hash(hash(elem))
     }
 }
 
-impl<S> Debug for CountingBloomFilter<S> where S: BloomStorage {
+impl<S> Debug for CountingBloomFilter<S>
+where
+    S: BloomStorage,
+{
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         let mut slots_used = 0;
         for i in 0..ARRAY_SIZE {
             if !self.storage.slot_is_empty(i) {
                 slots_used += 1;
             }
         }
         write!(f, "BloomFilter({}/{})", slots_used, ARRAY_SIZE)
     }
 }
 
-pub trait BloomStorage : Clone + Default {
+pub trait BloomStorage: Clone + Default {
     fn slot_is_empty(&self, index: usize) -> bool;
     fn adjust_slot(&mut self, index: usize, increment: bool);
     fn is_zeroed(&self) -> bool;
 
     #[inline]
     fn first_slot_is_empty(&self, hash: u32) -> bool {
         self.slot_is_empty(Self::first_slot_index(hash))
     }
@@ -194,17 +202,18 @@ pub trait BloomStorage : Clone + Default
 pub struct BloomStorageU8 {
     counters: [u8; ARRAY_SIZE],
 }
 
 impl BloomStorage for BloomStorageU8 {
     #[inline]
     fn adjust_slot(&mut self, index: usize, increment: bool) {
         let slot = &mut self.counters[index];
-        if *slot != 0xff {  // full
+        if *slot != 0xff {
+            // full
             if increment {
                 *slot += 1;
             } else {
                 *slot -= 1;
             }
         }
     }
 
@@ -244,18 +253,20 @@ impl BloomStorage for BloomStorageBool {
     #[inline]
     fn adjust_slot(&mut self, index: usize, increment: bool) {
         let bit = 1 << (index % 8);
         let byte = &mut self.counters[index / 8];
 
         // Since we have only one bit for storage, decrementing it
         // should never do anything.  Assert against an accidental
         // decrementing of a bit that was never set.
-        assert!(increment || (*byte & bit) != 0,
-                "should not decrement if slot is already false");
+        assert!(
+            increment || (*byte & bit) != 0,
+            "should not decrement if slot is already false"
+        );
 
         if increment {
             *byte |= bit;
         }
     }
 
     #[inline]
     fn slot_is_empty(&self, index: usize) -> bool {
@@ -309,44 +320,43 @@ fn create_and_insert_some_stuff() {
     let mut bf = BloomFilter::new();
 
     // Statically assert that ARRAY_SIZE is a multiple of 8, which
     // BloomStorageBool relies on.
     unsafe {
         transmute::<[u8; ARRAY_SIZE % 8], [u8; 0]>([]);
     }
 
-    for i in 0_usize .. 1000 {
+    for i in 0_usize..1000 {
         bf.insert(&i);
     }
 
-    for i in 0_usize .. 1000 {
+    for i in 0_usize..1000 {
         assert!(bf.might_contain(&i));
     }
 
-    let false_positives =
-        (1001_usize .. 2000).filter(|i| bf.might_contain(i)).count();
+    let false_positives = (1001_usize..2000).filter(|i| bf.might_contain(i)).count();
 
     assert!(false_positives < 150, "{} is not < 150", false_positives); // 15%.
 
-    for i in 0_usize .. 100 {
+    for i in 0_usize..100 {
         bf.remove(&i);
     }
 
-    for i in 100_usize .. 1000 {
+    for i in 100_usize..1000 {
         assert!(bf.might_contain(&i));
     }
 
-    let false_positives = (0_usize .. 100).filter(|i| bf.might_contain(i)).count();
+    let false_positives = (0_usize..100).filter(|i| bf.might_contain(i)).count();
 
     assert!(false_positives < 20, "{} is not < 20", false_positives); // 20%.
 
     bf.clear();
 
-    for i in 0_usize .. 2000 {
+    for i in 0_usize..2000 {
         assert!(!bf.might_contain(&i));
     }
 }
 
 #[cfg(feature = "bench")]
 #[cfg(test)]
 mod bench {
     extern crate test;
@@ -371,54 +381,60 @@ mod bench {
     }
 
     #[bench]
     fn create_insert_1000_remove_100_lookup_100(b: &mut test::Bencher) {
         b.iter(|| {
             let mut gen1 = HashGenerator::default();
             let mut gen2 = HashGenerator::default();
             let mut bf = BloomFilter::new();
-            for _ in 0_usize .. 1000 {
+            for _ in 0_usize..1000 {
                 bf.insert_hash(gen1.next());
             }
-            for _ in 0_usize .. 100 {
+            for _ in 0_usize..100 {
                 bf.remove_hash(gen2.next());
             }
-            for _ in 100_usize .. 200 {
+            for _ in 100_usize..200 {
                 test::black_box(bf.might_contain_hash(gen2.next()));
             }
         });
     }
 
     #[bench]
     fn might_contain_10(b: &mut test::Bencher) {
         let bf = BloomFilter::new();
         let mut gen = HashGenerator::default();
-        b.iter(|| for _ in 0..10 {
-            test::black_box(bf.might_contain_hash(gen.next()));
+        b.iter(|| {
+            for _ in 0..10 {
+                test::black_box(bf.might_contain_hash(gen.next()));
+            }
         });
     }
 
     #[bench]
     fn clear(b: &mut test::Bencher) {
         let mut bf = Box::new(BloomFilter::new());
         b.iter(|| test::black_box(&mut bf).clear());
     }
 
     #[bench]
     fn insert_10(b: &mut test::Bencher) {
         let mut bf = BloomFilter::new();
         let mut gen = HashGenerator::default();
-        b.iter(|| for _ in 0..10 {
-            test::black_box(bf.insert_hash(gen.next()));
+        b.iter(|| {
+            for _ in 0..10 {
+                test::black_box(bf.insert_hash(gen.next()));
+            }
         });
     }
 
     #[bench]
     fn remove_10(b: &mut test::Bencher) {
         let mut bf = BloomFilter::new();
         let mut gen = HashGenerator::default();
         // Note: this will underflow, and that's ok.
-        b.iter(|| for _ in 0..10 {
-            bf.remove_hash(gen.next())
+        b.iter(|| {
+            for _ in 0..10 {
+                bf.remove_hash(gen.next())
+            }
         });
     }
 }
--- a/servo/components/selectors/build.rs
+++ b/servo/components/selectors/build.rs
@@ -9,18 +9,17 @@ use std::fs::File;
 use std::io::{BufWriter, Write};
 use std::path::Path;
 
 fn main() {
     let path = Path::new(&env::var_os("OUT_DIR").unwrap())
         .join("ascii_case_insensitive_html_attributes.rs");
     let mut file = BufWriter::new(File::create(&path).unwrap());
 
-    write!(&mut file, "{{ static SET: ::phf::Set<&'static str> = ",
-    ).unwrap();
+    write!(&mut file, "{{ static SET: ::phf::Set<&'static str> = ").unwrap();
     let mut set = phf_codegen::Set::new();
     for name in ASCII_CASE_INSENSITIVE_HTML_ATTRIBUTES.split_whitespace() {
         set.entry(name);
     }
     set.build(&mut file).unwrap();
     write!(&mut file, "; &SET }}").unwrap();
 }
 
--- a/servo/components/selectors/builder.rs
+++ b/servo/components/selectors/builder.rs
@@ -111,22 +111,23 @@ impl<Impl: SelectorImpl> SelectorBuilder
 
         if parsed_slotted {
             spec.0 |= HAS_SLOTTED_BIT;
         }
 
         self.build_with_specificity_and_flags(spec)
     }
 
-
     /// Builds with an explicit SpecificityAndFlags. This is separated from build() so
     /// that unit tests can pass an explicit specificity.
     #[inline(always)]
-    pub fn build_with_specificity_and_flags(&mut self, spec: SpecificityAndFlags)
-                                            -> ThinArc<SpecificityAndFlags, Component<Impl>> {
+    pub fn build_with_specificity_and_flags(
+        &mut self,
+        spec: SpecificityAndFlags,
+    ) -> ThinArc<SpecificityAndFlags, Component<Impl>> {
         // First, compute the total number of Components we'll need to allocate
         // space for.
         let full_len = self.simple_selectors.len() + self.combinators.len();
 
         // Create the header.
         let header = HeaderWithLength::new(spec, full_len);
 
         // Create the Arc using an iterator that drains our buffers.
@@ -154,33 +155,30 @@ impl<Impl: SelectorImpl> SelectorBuilder
 struct SelectorBuilderIter<'a, Impl: SelectorImpl> {
     current_simple_selectors: slice::Iter<'a, Component<Impl>>,
     rest_of_simple_selectors: &'a [Component<Impl>],
     combinators: iter::Rev<smallvec::Drain<'a, (Combinator, usize)>>,
 }
 
 impl<'a, Impl: SelectorImpl> ExactSizeIterator for SelectorBuilderIter<'a, Impl> {
     fn len(&self) -> usize {
-        self.current_simple_selectors.len() +
-        self.rest_of_simple_selectors.len() +
-        self.combinators.len()
+        self.current_simple_selectors.len() + self.rest_of_simple_selectors.len() +
+            self.combinators.len()
     }
 }
 
 impl<'a, Impl: SelectorImpl> Iterator for SelectorBuilderIter<'a, Impl> {
     type Item = Component<Impl>;
     #[inline(always)]
     fn next(&mut self) -> Option<Self::Item> {
         if let Some(simple_selector_ref) = self.current_simple_selectors.next() {
             // Move a simple selector out of this slice iterator.
             // This is safe because we’ve called SmallVec::set_len(0) above,
             // so SmallVec::drop won’t drop this simple selector.
-            unsafe {
-                Some(ptr::read(simple_selector_ref))
-            }
+            unsafe { Some(ptr::read(simple_selector_ref)) }
         } else {
             self.combinators.next().map(|(combinator, len)| {
                 let (rest, current) = split_from_end(self.rest_of_simple_selectors, len);
                 self.rest_of_simple_selectors = rest;
                 self.current_simple_selectors = current.iter();
                 Component::Combinator(combinator)
             })
         }
@@ -230,20 +228,18 @@ struct Specificity {
 }
 
 impl Add for Specificity {
     type Output = Specificity;
 
     fn add(self, rhs: Specificity) -> Specificity {
         Specificity {
             id_selectors: self.id_selectors + rhs.id_selectors,
-            class_like_selectors:
-                self.class_like_selectors + rhs.class_like_selectors,
-            element_selectors:
-                self.element_selectors + rhs.element_selectors,
+            class_like_selectors: self.class_like_selectors + rhs.class_like_selectors,
+            element_selectors: self.element_selectors + rhs.element_selectors,
         }
     }
 }
 
 impl Default for Specificity {
     fn default() -> Specificity {
         Specificity {
             id_selectors: 0,
@@ -261,86 +257,83 @@ impl From<u32> for Specificity {
             class_like_selectors: (value >> 10) & MAX_10BIT,
             element_selectors: value & MAX_10BIT,
         }
     }
 }
 
 impl From<Specificity> for u32 {
     fn from(specificity: Specificity) -> u32 {
-        cmp::min(specificity.id_selectors, MAX_10BIT) << 20
-        | cmp::min(specificity.class_like_selectors, MAX_10BIT) << 10
-        | cmp::min(specificity.element_selectors, MAX_10BIT)
+        cmp::min(specificity.id_selectors, MAX_10BIT) << 20 |
+            cmp::min(specificity.class_like_selectors, MAX_10BIT) << 10 |
+            cmp::min(specificity.element_selectors, MAX_10BIT)
     }
 }
 
 fn specificity<Impl>(iter: slice::Iter<Component<Impl>>) -> u32
-    where Impl: SelectorImpl
+where
+    Impl: SelectorImpl,
 {
     complex_selector_specificity(iter).into()
 }
 
-fn complex_selector_specificity<Impl>(mut iter: slice::Iter<Component<Impl>>)
-                                      -> Specificity
-    where Impl: SelectorImpl
+fn complex_selector_specificity<Impl>(mut iter: slice::Iter<Component<Impl>>) -> Specificity
+where
+    Impl: SelectorImpl,
 {
     fn simple_selector_specificity<Impl>(
         simple_selector: &Component<Impl>,
         specificity: &mut Specificity,
-    )
-    where
-        Impl: SelectorImpl
+    ) where
+        Impl: SelectorImpl,
     {
         match *simple_selector {
             Component::Combinator(..) => unreachable!(),
             // FIXME(emilio): Spec doesn't define any particular specificity for
             // ::slotted(), so apply the general rule for pseudos per:
             //
             // https://github.com/w3c/csswg-drafts/issues/1915
             //
             // Though other engines compute it dynamically, so maybe we should
             // do that instead, eventually.
-            Component::Slotted(..) |
-            Component::PseudoElement(..) |
-            Component::LocalName(..) => {
+            Component::Slotted(..) | Component::PseudoElement(..) | Component::LocalName(..) => {
                 specificity.element_selectors += 1
-            }
-            Component::ID(..) => {
-                specificity.id_selectors += 1
-            }
+            },
+            Component::ID(..) => specificity.id_selectors += 1,
             Component::Class(..) |
             Component::AttributeInNoNamespace { .. } |
             Component::AttributeInNoNamespaceExists { .. } |
             Component::AttributeOther(..) |
-
-            Component::FirstChild | Component::LastChild |
-            Component::OnlyChild | Component::Root |
-            Component::Empty | Component::Scope |
+            Component::FirstChild |
+            Component::LastChild |
+            Component::OnlyChild |
+            Component::Root |
+            Component::Empty |
+            Component::Scope |
             Component::Host(..) |
             Component::NthChild(..) |
             Component::NthLastChild(..) |
             Component::NthOfType(..) |
             Component::NthLastOfType(..) |
-            Component::FirstOfType | Component::LastOfType |
+            Component::FirstOfType |
+            Component::LastOfType |
             Component::OnlyOfType |
-            Component::NonTSPseudoClass(..) => {
-                specificity.class_like_selectors += 1
-            }
+            Component::NonTSPseudoClass(..) => specificity.class_like_selectors += 1,
             Component::ExplicitUniversalType |
             Component::ExplicitAnyNamespace |
             Component::ExplicitNoNamespace |
             Component::DefaultNamespace(..) |
             Component::Namespace(..) => {
                 // Does not affect specificity
-            }
+            },
             Component::Negation(ref negated) => {
                 for ss in negated.iter() {
                     simple_selector_specificity(&ss, specificity);
                 }
-            }
+            },
         }
     }
 
     let mut specificity = Default::default();
     for simple_selector in &mut iter {
         simple_selector_specificity(&simple_selector, &mut specificity);
     }
     specificity
--- a/servo/components/selectors/context.rs
+++ b/servo/components/selectors/context.rs
@@ -49,26 +49,26 @@ pub enum VisitedHandlingMode {
 }
 
 impl VisitedHandlingMode {
     #[inline]
     pub fn matches_visited(&self) -> bool {
         matches!(
             *self,
             VisitedHandlingMode::RelevantLinkVisited |
-            VisitedHandlingMode::AllLinksVisitedAndUnvisited
+                VisitedHandlingMode::AllLinksVisitedAndUnvisited
         )
     }
 
     #[inline]
     pub fn matches_unvisited(&self) -> bool {
         matches!(
             *self,
             VisitedHandlingMode::AllLinksUnvisited |
-            VisitedHandlingMode::AllLinksVisitedAndUnvisited
+                VisitedHandlingMode::AllLinksVisitedAndUnvisited
         )
     }
 }
 
 /// Which quirks mode is this document in.
 ///
 /// See: https://quirks.spec.whatwg.org/
 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
@@ -80,18 +80,17 @@ pub enum QuirksMode {
     /// No quirks mode.
     NoQuirks,
 }
 
 impl QuirksMode {
     #[inline]
     pub fn classes_and_ids_case_sensitivity(self) -> CaseSensitivity {
         match self {
-            QuirksMode::NoQuirks |
-            QuirksMode::LimitedQuirks => CaseSensitivity::CaseSensitive,
+            QuirksMode::NoQuirks | QuirksMode::LimitedQuirks => CaseSensitivity::CaseSensitive,
             QuirksMode::Quirks => CaseSensitivity::AsciiCaseInsensitive,
         }
     }
 }
 
 /// Data associated with the matching process for a element.  This context is
 /// used across many selectors for an element, so it's not appropriate for
 /// transient data that applies to only a single selector.
@@ -156,17 +155,17 @@ where
         nth_index_cache: Option<&'a mut NthIndexCache>,
         quirks_mode: QuirksMode,
     ) -> Self {
         Self::new_for_visited(
             matching_mode,
             bloom_filter,
             nth_index_cache,
             VisitedHandlingMode::AllLinksUnvisited,
-            quirks_mode
+            quirks_mode,
         )
     }
 
     /// Constructs a new `MatchingContext` for use in visited matching.
     pub fn new_for_visited(
         matching_mode: MatchingMode,
         bloom_filter: Option<&'a BloomFilter>,
         nth_index_cache: Option<&'a mut NthIndexCache>,
@@ -191,18 +190,17 @@ where
     }
 
     /// Override the quirks mode we're matching against.
     ///
     /// FIXME(emilio): This is a hack for XBL quirks-mode mismatches.
     #[inline]
     pub fn set_quirks_mode(&mut self, quirks_mode: QuirksMode) {
         self.quirks_mode = quirks_mode;
-        self.classes_and_ids_case_sensitivity =
-            quirks_mode.classes_and_ids_case_sensitivity();
+        self.classes_and_ids_case_sensitivity = quirks_mode.classes_and_ids_case_sensitivity();
     }
 
     /// Whether we're matching a nested selector.
     #[inline]
     pub fn is_nested(&self) -> bool {
         self.nesting_level != 0
     }
 
@@ -244,20 +242,17 @@ where
 
     /// Runs F with a deeper nesting level, and marking ourselves in a negation,
     /// for a :not(..) selector, for example.
     #[inline]
     pub fn nest_for_negation<F, R>(&mut self, f: F) -> R
     where
         F: FnOnce(&mut Self) -> R,
     {
-        debug_assert!(
-            !self.in_negation,
-            "Someone messed up parsing?"
-        );
+        debug_assert!(!self.in_negation, "Someone messed up parsing?");
         self.in_negation = true;
         let result = self.nest(f);
         self.in_negation = false;
         result
     }
 
     #[inline]
     pub fn visited_handling(&self) -> VisitedHandlingMode {
@@ -279,21 +274,17 @@ where
         let result = f(self);
         self.visited_handling = original_handling_mode;
         result
     }
 
     /// Runs F with a given shadow host which is the root of the tree whose
     /// rules we're matching.
     #[inline]
-    pub fn with_shadow_host<F, E, R>(
-        &mut self,
-        host: Option<E>,
-        f: F,
-    ) -> R
+    pub fn with_shadow_host<F, E, R>(&mut self, host: Option<E>, f: F) -> R
     where
         E: Element,
         F: FnOnce(&mut Self) -> R,
     {
         let original_host = self.current_host.take();
         self.current_host = host.map(|h| h.opaque());
         let result = f(self);
         self.current_host = original_host;
--- a/servo/components/selectors/lib.rs
+++ b/servo/components/selectors/lib.rs
@@ -1,20 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Make |cargo bench| work.
 #![cfg_attr(feature = "bench", feature(test))]
 
-#[macro_use] extern crate bitflags;
-#[macro_use] extern crate cssparser;
-#[macro_use] extern crate log;
-#[macro_use] extern crate matches;
+#[macro_use]
+extern crate bitflags;
+#[macro_use]
+extern crate cssparser;
 extern crate fnv;
+#[macro_use]
+extern crate log;
+#[macro_use]
+extern crate matches;
 extern crate phf;
 extern crate precomputed_hash;
 extern crate servo_arc;
 extern crate smallvec;
 
 pub mod attr;
 pub mod bloom;
 mod builder;
@@ -22,10 +26,10 @@ pub mod context;
 pub mod matching;
 mod nth_index_cache;
 pub mod parser;
 pub mod sink;
 mod tree;
 pub mod visitor;
 
 pub use nth_index_cache::NthIndexCache;
-pub use parser::{SelectorImpl, Parser, SelectorList};
+pub use parser::{Parser, SelectorImpl, SelectorList};
 pub use tree::{Element, OpaqueElement};
--- a/servo/components/selectors/matching.rs
+++ b/servo/components/selectors/matching.rs
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-use attr::{ParsedAttrSelectorOperation, AttrSelectorOperation, NamespaceConstraint};
-use bloom::{BLOOM_HASH_MASK, BloomFilter};
+use attr::{AttrSelectorOperation, NamespaceConstraint, ParsedAttrSelectorOperation};
+use bloom::{BloomFilter, BLOOM_HASH_MASK};
 use nth_index_cache::NthIndexCacheInner;
 use parser::{AncestorHashes, Combinator, Component, LocalName};
-use parser::{Selector, SelectorImpl, SelectorIter, SelectorList, NonTSPseudoClass};
+use parser::{NonTSPseudoClass, Selector, SelectorImpl, SelectorIter, SelectorList};
 use std::borrow::Borrow;
 use std::iter;
 use tree::Element;
 
 pub use context::*;
 
 // The bloom filter for descendant CSS selectors will have a <1% false
 // positive rate until it has this many selectors in it, then it will
@@ -47,47 +47,40 @@ impl ElementSelectorFlags {
     /// Returns the subset of flags that apply to the element.
     pub fn for_self(self) -> ElementSelectorFlags {
         self & (ElementSelectorFlags::HAS_EMPTY_SELECTOR)
     }
 
     /// Returns the subset of flags that apply to the parent.
     pub fn for_parent(self) -> ElementSelectorFlags {
         self & (ElementSelectorFlags::HAS_SLOW_SELECTOR |
-                ElementSelectorFlags::HAS_SLOW_SELECTOR_LATER_SIBLINGS |
-                ElementSelectorFlags::HAS_EDGE_CHILD_SELECTOR)
+            ElementSelectorFlags::HAS_SLOW_SELECTOR_LATER_SIBLINGS |
+            ElementSelectorFlags::HAS_EDGE_CHILD_SELECTOR)
     }
 }
 
 /// Holds per-compound-selector data.
 struct LocalMatchingContext<'a, 'b: 'a, Impl: SelectorImpl> {
     shared: &'a mut MatchingContext<'b, Impl>,
     matches_hover_and_active_quirk: MatchesHoverAndActiveQuirk,
 }
 
 #[inline(always)]
 pub fn matches_selector_list<E>(
     selector_list: &SelectorList<E::Impl>,
     element: &E,
     context: &mut MatchingContext<E::Impl>,
 ) -> bool
 where
-    E: Element
+    E: Element,
 {
     // This is pretty much any(..) but manually inlined because the compiler
     // refuses to do so from querySelector / querySelectorAll.
     for selector in &selector_list.0 {
-        let matches = matches_selector(
-            selector,
-            0,
-            None,
-            element,
-            context,
-            &mut |_, _| {},
-        );
+        let matches = matches_selector(selector, 0, None, element, context, &mut |_, _| {});
 
         if matches {
             return true;
         }
     }
 
     false
 }
@@ -214,17 +207,17 @@ where
 
 /// Whether a compound selector matched, and whether it was the rightmost
 /// selector inside the complex selector.
 pub enum CompoundSelectorMatchingResult {
     /// The selector was fully matched.
     FullyMatched,
     /// The compound selector matched, and the next combinator offset is
     /// `next_combinator_offset`.
-    Matched { next_combinator_offset: usize, },
+    Matched { next_combinator_offset: usize },
     /// The selector didn't match.
     NotMatched,
 }
 
 /// Matches a compound selector belonging to `selector`, starting at offset
 /// `from_offset`, matching left to right.
 ///
 /// Requires that `from_offset` points to a `Combinator`.
@@ -233,17 +226,17 @@ pub enum CompoundSelectorMatchingResult 
 /// complex selector, but it happens to be the case we don't need it.
 pub fn matches_compound_selector_from<E>(
     selector: &Selector<E::Impl>,
     mut from_offset: usize,
     context: &mut MatchingContext<E::Impl>,
     element: &E,
 ) -> CompoundSelectorMatchingResult
 where
-    E: Element
+    E: Element,
 {
     if cfg!(debug_assertions) && from_offset != 0 {
         selector.combinator_at_parse_order(from_offset - 1); // This asserts.
     }
 
     let mut local_context = LocalMatchingContext {
         shared: context,
         matches_hover_and_active_quirk: MatchesHoverAndActiveQuirk::No,
@@ -262,44 +255,39 @@ where
         from_offset += 1;
     }
 
     debug_assert!(from_offset >= 1);
     debug_assert!(from_offset <= selector.len());
 
     let iter = selector.iter_from(selector.len() - from_offset);
     debug_assert!(
-        iter.clone().next().is_some() || (
-            from_offset != selector.len() && matches!(
-                selector.combinator_at_parse_order(from_offset),
-                Combinator::SlotAssignment | Combinator::PseudoElement
-            )
-        ),
+        iter.clone().next().is_some() ||
+            (from_offset != selector.len() &&
+                matches!(
+                    selector.combinator_at_parse_order(from_offset),
+                    Combinator::SlotAssignment | Combinator::PseudoElement
+                )),
         "Got the math wrong: {:?} | {:?} | {} {}",
         selector,
         selector.iter_raw_match_order().as_slice(),
         from_offset,
         start_offset
     );
 
     for component in iter {
-        if !matches_simple_selector(
-            component,
-            element,
-            &mut local_context,
-            &mut |_, _| {}
-        ) {
+        if !matches_simple_selector(component, element, &mut local_context, &mut |_, _| {}) {
             return CompoundSelectorMatchingResult::NotMatched;
         }
     }
 
     if from_offset != selector.len() {
         return CompoundSelectorMatchingResult::Matched {
             next_combinator_offset: from_offset,
-        }
+        };
     }
 
     CompoundSelectorMatchingResult::FullyMatched
 }
 
 /// Matches a complex selector.
 #[inline(always)]
 pub fn matches_complex_selector<E, F>(
@@ -309,60 +297,58 @@ pub fn matches_complex_selector<E, F>(
     flags_setter: &mut F,
 ) -> bool
 where
     E: Element,
     F: FnMut(&E, ElementSelectorFlags),
 {
     // If this is the special pseudo-element mode, consume the ::pseudo-element
     // before proceeding, since the caller has already handled that part.
-    if context.matching_mode() == MatchingMode::ForStatelessPseudoElement &&
-        !context.is_nested() {
+    if context.matching_mode() == MatchingMode::ForStatelessPseudoElement && !context.is_nested() {
         // Consume the pseudo.
         match *iter.next().unwrap() {
             Component::PseudoElement(ref pseudo) => {
                 if let Some(ref f) = context.pseudo_element_matching_fn {
                     if !f(pseudo) {
                         return false;
                     }
                 }
-            }
+            },
             _ => {
-                debug_assert!(false,
-                              "Used MatchingMode::ForStatelessPseudoElement \
-                               in a non-pseudo selector");
-            }
+                debug_assert!(
+                    false,
+                    "Used MatchingMode::ForStatelessPseudoElement \
+                     in a non-pseudo selector"
+                );
+            },
         }
 
         // The only other parser-allowed Component in this sequence is a state
         // class. We just don't match in that case.
         if let Some(s) = iter.next() {
-            debug_assert!(matches!(*s, Component::NonTSPseudoClass(..)),
-                          "Someone messed up pseudo-element parsing");
+            debug_assert!(
+                matches!(*s, Component::NonTSPseudoClass(..)),
+                "Someone messed up pseudo-element parsing"
+            );
             return false;
         }
 
         // Advance to the non-pseudo-element part of the selector, but let the
         // context note that .
         if iter.next_sequence().is_none() {
             return true;
         }
     }
 
-    let result = matches_complex_selector_internal(
-        iter,
-        element,
-        context,
-        flags_setter,
-        Rightmost::Yes,
-    );
+    let result =
+        matches_complex_selector_internal(iter, element, context, flags_setter, Rightmost::Yes);
 
     match result {
         SelectorMatchingResult::Matched => true,
-        _ => false
+        _ => false,
     }
 }
 
 #[inline]
 fn matches_hover_and_active_quirk<Impl: SelectorImpl>(
     selector_iter: &SelectorIter<Impl>,
     context: &MatchingContext<Impl>,
     rightmost: Rightmost,
@@ -373,46 +359,43 @@ fn matches_hover_and_active_quirk<Impl: 
 
     if context.is_nested() {
         return MatchesHoverAndActiveQuirk::No;
     }
 
     // This compound selector had a pseudo-element to the right that we
     // intentionally skipped.
     if rightmost == Rightmost::Yes &&
-        context.matching_mode() == MatchingMode::ForStatelessPseudoElement {
+        context.matching_mode() == MatchingMode::ForStatelessPseudoElement
+    {
         return MatchesHoverAndActiveQuirk::No;
     }
 
-    let all_match = selector_iter.clone().all(|simple| {
-        match *simple {
-            Component::LocalName(_) |
-            Component::AttributeInNoNamespaceExists { .. } |
-            Component::AttributeInNoNamespace { .. } |
-            Component::AttributeOther(_) |
-            Component::ID(_) |
-            Component::Class(_) |
-            Component::PseudoElement(_) |
-            Component::Negation(_) |
-            Component::FirstChild |
-            Component::LastChild |
-            Component::OnlyChild |
-            Component::Empty |
-            Component::NthChild(_, _) |
-            Component::NthLastChild(_, _) |
-            Component::NthOfType(_, _) |
-            Component::NthLastOfType(_, _) |
-            Component::FirstOfType |
-            Component::LastOfType |
-            Component::OnlyOfType => false,
-            Component::NonTSPseudoClass(ref pseudo_class) => {
-                pseudo_class.is_active_or_hover()
-            },
-            _ => true,
-        }
+    let all_match = selector_iter.clone().all(|simple| match *simple {
+        Component::LocalName(_) |
+        Component::AttributeInNoNamespaceExists { .. } |
+        Component::AttributeInNoNamespace { .. } |
+        Component::AttributeOther(_) |
+        Component::ID(_) |
+        Component::Class(_) |
+        Component::PseudoElement(_) |
+        Component::Negation(_) |
+        Component::FirstChild |
+        Component::LastChild |
+        Component::OnlyChild |
+        Component::Empty |
+        Component::NthChild(_, _) |
+        Component::NthLastChild(_, _) |
+        Component::NthOfType(_, _) |
+        Component::NthLastOfType(_, _) |
+        Component::FirstOfType |
+        Component::LastOfType |
+        Component::OnlyOfType => false,
+        Component::NonTSPseudoClass(ref pseudo_class) => pseudo_class.is_active_or_hover(),
+        _ => true,
     });
 
     if all_match {
         MatchesHoverAndActiveQuirk::Yes
     } else {
         MatchesHoverAndActiveQuirk::No
     }
 }
@@ -428,29 +411,25 @@ fn next_element_for_combinator<E>(
     element: &E,
     combinator: Combinator,
     selector: &SelectorIter<E::Impl>,
 ) -> Option<E>
 where
     E: Element,
 {
     match combinator {
-        Combinator::NextSibling |
-        Combinator::LaterSibling => {
-            element.prev_sibling_element()
-        }
-        Combinator::Child |
-        Combinator::Descendant => {
+        Combinator::NextSibling | Combinator::LaterSibling => element.prev_sibling_element(),
+        Combinator::Child | Combinator::Descendant => {
             if element.blocks_ancestor_combinators() {
                 return None;
             }
 
             match element.parent_element() {
                 Some(e) => return Some(e),
-                None => {}
+                None => {},
             }
 
             if !element.parent_node_is_shadow_root() {
                 return None;
             }
 
             // https://drafts.csswg.org/css-scoping/#host-element-in-tree:
             //
@@ -468,156 +447,157 @@ where
             // Since we know that the parent is a shadow root, we necessarily
             // are in a shadow tree of the host, and the next selector will only
             // match if the selector is a featureless :host selector.
             if !selector.clone().is_featureless_host_selector() {
                 return None;
             }
 
             element.containing_shadow_host()
-        }
+        },
         Combinator::SlotAssignment => {
-            debug_assert!(element.assigned_slot().map_or(true, |s| s.is_html_slot_element()));
+            debug_assert!(
+                element
+                    .assigned_slot()
+                    .map_or(true, |s| s.is_html_slot_element())
+            );
             element.assigned_slot()
-        }
-        Combinator::PseudoElement => {
-            element.pseudo_element_originating_element()
-        }
+        },
+        Combinator::PseudoElement => element.pseudo_element_originating_element(),
     }
 }
 
 fn matches_complex_selector_internal<E, F>(
     mut selector_iter: SelectorIter<E::Impl>,
     element: &E,
     context: &mut MatchingContext<E::Impl>,
     flags_setter: &mut F,
     rightmost: Rightmost,
 ) -> SelectorMatchingResult
 where
     E: Element,
     F: FnMut(&E, ElementSelectorFlags),
 {
-    debug!("Matching complex selector {:?} for {:?}", selector_iter, element);
+    debug!(
+        "Matching complex selector {:?} for {:?}",
+        selector_iter, element
+    );
 
     let matches_compound_selector = matches_compound_selector(
         &mut selector_iter,
         element,
         context,
         flags_setter,
-        rightmost
+        rightmost,
     );
 
     let combinator = selector_iter.next_sequence();
     if combinator.map_or(false, |c| c.is_sibling()) {
-        flags_setter(element, ElementSelectorFlags::HAS_SLOW_SELECTOR_LATER_SIBLINGS);
+        flags_setter(
+            element,
+            ElementSelectorFlags::HAS_SLOW_SELECTOR_LATER_SIBLINGS,
+        );
     }
 
     if !matches_compound_selector {
         return SelectorMatchingResult::NotMatchedAndRestartFromClosestLaterSibling;
     }
 
     let combinator = match combinator {
         None => return SelectorMatchingResult::Matched,
         Some(c) => c,
     };
 
     let candidate_not_found = match combinator {
-        Combinator::NextSibling |
-        Combinator::LaterSibling => {
+        Combinator::NextSibling | Combinator::LaterSibling => {
             SelectorMatchingResult::NotMatchedAndRestartFromClosestDescendant
-        }
+        },
         Combinator::Child |
         Combinator::Descendant |
         Combinator::SlotAssignment |
-        Combinator::PseudoElement => {
-            SelectorMatchingResult::NotMatchedGlobally
-        }
+        Combinator::PseudoElement => SelectorMatchingResult::NotMatchedGlobally,
     };
 
-    let mut next_element =
-        next_element_for_combinator(element, combinator, &selector_iter);
+    let mut next_element = next_element_for_combinator(element, combinator, &selector_iter);
 
     // Stop matching :visited as soon as we find a link, or a combinator for
     // something that isn't an ancestor.
     let mut visited_handling = if element.is_link() || combinator.is_sibling() {
         VisitedHandlingMode::AllLinksUnvisited
     } else {
         context.visited_handling()
     };
 
     loop {
         let element = match next_element {
             None => return candidate_not_found,
             Some(next_element) => next_element,
         };
 
-        let result =
-            context.with_visited_handling_mode(visited_handling, |context| {
-                matches_complex_selector_internal(
-                    selector_iter.clone(),
-                    &element,
-                    context,
-                    flags_setter,
-                    Rightmost::No,
-                )
-            });
+        let result = context.with_visited_handling_mode(visited_handling, |context| {
+            matches_complex_selector_internal(
+                selector_iter.clone(),
+                &element,
+                context,
+                flags_setter,
+                Rightmost::No,
+            )
+        });
 
         match (result, combinator) {
             // Return the status immediately.
             (SelectorMatchingResult::Matched, _) |
             (SelectorMatchingResult::NotMatchedGlobally, _) |
             (_, Combinator::NextSibling) => {
                 return result;
-            }
+            },
 
             // Upgrade the failure status to
             // NotMatchedAndRestartFromClosestDescendant.
-            (_, Combinator::PseudoElement) |
-            (_, Combinator::Child) => {
+            (_, Combinator::PseudoElement) | (_, Combinator::Child) => {
                 return SelectorMatchingResult::NotMatchedAndRestartFromClosestDescendant;
-            }
+            },
 
             // If the failure status is
             // NotMatchedAndRestartFromClosestDescendant and combinator is
             // Combinator::LaterSibling, give up this Combinator::LaterSibling
             // matching and restart from the closest descendant combinator.
-            (SelectorMatchingResult::NotMatchedAndRestartFromClosestDescendant, Combinator::LaterSibling) => {
+            (
+                SelectorMatchingResult::NotMatchedAndRestartFromClosestDescendant,
+                Combinator::LaterSibling,
+            ) => {
                 return result;
-            }
+            },
 
             // The Combinator::Descendant combinator and the status is
             // NotMatchedAndRestartFromClosestLaterSibling or
             // NotMatchedAndRestartFromClosestDescendant, or the
             // Combinator::LaterSibling combinator and the status is
             // NotMatchedAndRestartFromClosestDescendant, we can continue to
             // matching on the next candidate element.
             _ => {},
         }
 
         if element.is_link() || combinator.is_sibling() {
             visited_handling = VisitedHandlingMode::AllLinksUnvisited;
         }
 
-        next_element =
-            next_element_for_combinator(&element, combinator, &selector_iter);
+        next_element = next_element_for_combinator(&element, combinator, &selector_iter);
     }
 }
 
 #[inline]
-fn matches_local_name<E>(
-    element: &E,
-    local_name: &LocalName<E::Impl>
-) -> bool
+fn matches_local_name<E>(element: &E, local_name: &LocalName<E::Impl>) -> bool
 where
     E: Element,
 {
     let name = select_name(
         element.is_html_element_in_html_document(),
         &local_name.name,
-        &local_name.lower_name
+        &local_name.lower_name,
     ).borrow();
     element.local_name() == name
 }
 
 /// Determines whether the given element matches the given compound selector.
 #[inline]
 fn matches_compound_selector<E, F>(
     selector_iter: &mut SelectorIter<E::Impl>,
@@ -656,29 +636,23 @@ where
         }
         selector = selector_iter.next();
     }
     let selector = match selector {
         Some(s) => s,
         None => return true,
     };
 
-    let mut local_context =
-        LocalMatchingContext {
-            shared: context,
-            matches_hover_and_active_quirk,
-        };
-    iter::once(selector).chain(selector_iter).all(|simple| {
-        matches_simple_selector(
-            simple,
-            element,
-            &mut local_context,
-            flags_setter,
-        )
-    })
+    let mut local_context = LocalMatchingContext {
+        shared: context,
+        matches_hover_and_active_quirk,
+    };
+    iter::once(selector)
+        .chain(selector_iter)
+        .all(|simple| matches_simple_selector(simple, element, &mut local_context, flags_setter))
 }
 
 /// Determines whether the given element matches the given single selector.
 fn matches_simple_selector<E, F>(
     selector: &Component<E::Impl>,
     element: &E,
     context: &mut LocalMatchingContext<E::Impl>,
     flags_setter: &mut F,
@@ -688,194 +662,160 @@ where
     F: FnMut(&E, ElementSelectorFlags),
 {
     debug_assert!(context.shared.is_nested() || !context.shared.in_negation());
 
     match *selector {
         Component::Combinator(_) => unreachable!(),
         Component::Slotted(ref selector) => {
             // <slots> are never flattened tree slottables.
-            !element.is_html_slot_element() &&
-            element.assigned_slot().is_some() &&
-            context.shared.nest(|context| {
-                matches_complex_selector(
-                    selector.iter(),
-                    element,
-                    context,
-                    flags_setter,
-                )
-            })
-        }
+            !element.is_html_slot_element() && element.assigned_slot().is_some() &&
+                context.shared.nest(|context| {
+                    matches_complex_selector(selector.iter(), element, context, flags_setter)
+                })
+        },
         Component::PseudoElement(ref pseudo) => {
             element.match_pseudo_element(pseudo, context.shared)
-        }
-        Component::LocalName(ref local_name) => {
-            matches_local_name(element, local_name)
-        }
-        Component::ExplicitUniversalType |
-        Component::ExplicitAnyNamespace => {
-            true
-        }
-        Component::Namespace(_, ref url) |
-        Component::DefaultNamespace(ref url) => {
+        },
+        Component::LocalName(ref local_name) => matches_local_name(element, local_name),
+        Component::ExplicitUniversalType | Component::ExplicitAnyNamespace => true,
+        Component::Namespace(_, ref url) | Component::DefaultNamespace(ref url) => {
             element.namespace() == url.borrow()
-        }
+        },
         Component::ExplicitNoNamespace => {
             let ns = ::parser::namespace_empty_string::<E::Impl>();
             element.namespace() == ns.borrow()
-        }
+        },
         Component::ID(ref id) => {
             element.has_id(id, context.shared.classes_and_ids_case_sensitivity())
-        }
+        },
         Component::Class(ref class) => {
             element.has_class(class, context.shared.classes_and_ids_case_sensitivity())
-        }
-        Component::AttributeInNoNamespaceExists { ref local_name, ref local_name_lower } => {
+        },
+        Component::AttributeInNoNamespaceExists {
+            ref local_name,
+            ref local_name_lower,
+        } => {
             let is_html = element.is_html_element_in_html_document();
             element.attr_matches(
                 &NamespaceConstraint::Specific(&::parser::namespace_empty_string::<E::Impl>()),
                 select_name(is_html, local_name, local_name_lower),
-                &AttrSelectorOperation::Exists
+                &AttrSelectorOperation::Exists,
             )
-        }
+        },
         Component::AttributeInNoNamespace {
             ref local_name,
             ref local_name_lower,
             ref value,
             operator,
             case_sensitivity,
             never_matches,
         } => {
             if never_matches {
-                return false
+                return false;
             }
             let is_html = element.is_html_element_in_html_document();
             element.attr_matches(
                 &NamespaceConstraint::Specific(&::parser::namespace_empty_string::<E::Impl>()),
                 select_name(is_html, local_name, local_name_lower),
                 &AttrSelectorOperation::WithValue {
                     operator: operator,
                     case_sensitivity: case_sensitivity.to_unconditional(is_html),
                     expected_value: value,
-                }
+                },
             )
-        }
+        },
         Component::AttributeOther(ref attr_sel) => {
             if attr_sel.never_matches {
-                return false
+                return false;
             }
             let is_html = element.is_html_element_in_html_document();
             element.attr_matches(
                 &attr_sel.namespace(),
                 select_name(is_html, &attr_sel.local_name, &attr_sel.local_name_lower),
                 &match attr_sel.operation {
                     ParsedAttrSelectorOperation::Exists => AttrSelectorOperation::Exists,
                     ParsedAttrSelectorOperation::WithValue {
                         operator,
                         case_sensitivity,
                         ref expected_value,
-                    } => {
-                        AttrSelectorOperation::WithValue {
-                            operator: operator,
-                            case_sensitivity: case_sensitivity.to_unconditional(is_html),
-                            expected_value: expected_value,
-                        }
-                    }
-                }
+                    } => AttrSelectorOperation::WithValue {
+                        operator: operator,
+                        case_sensitivity: case_sensitivity.to_unconditional(is_html),
+                        expected_value: expected_value,
+                    },
+                },
             )
-        }
+        },
         Component::NonTSPseudoClass(ref pc) => {
             if context.matches_hover_and_active_quirk == MatchesHoverAndActiveQuirk::Yes &&
-               !context.shared.is_nested() &&
-               pc.is_active_or_hover() &&
-               !element.is_link()
+                !context.shared.is_nested() && pc.is_active_or_hover() &&
+                !element.is_link()
             {
                 return false;
             }
 
-            element.match_non_ts_pseudo_class(
-                pc,
-                &mut context.shared,
-                flags_setter
-            )
-        }
-        Component::FirstChild => {
-            matches_first_child(element, flags_setter)
-        }
-        Component::LastChild => {
-            matches_last_child(element, flags_setter)
-        }
+            element.match_non_ts_pseudo_class(pc, &mut context.shared, flags_setter)
+        },
+        Component::FirstChild => matches_first_child(element, flags_setter),
+        Component::LastChild => matches_last_child(element, flags_setter),
         Component::OnlyChild => {
-            matches_first_child(element, flags_setter) &&
-            matches_last_child(element, flags_setter)
-        }
-        Component::Root => {
-            element.is_root()
-        }
+            matches_first_child(element, flags_setter) && matches_last_child(element, flags_setter)
+        },
+        Component::Root => element.is_root(),
         Component::Empty => {
             flags_setter(element, ElementSelectorFlags::HAS_EMPTY_SELECTOR);
             element.is_empty()
-        }
+        },
         Component::Host(ref selector) => {
-            context.shared.shadow_host().map_or(false, |host| host == element.opaque()) &&
-            selector.as_ref().map_or(true, |selector| {
-                context.shared.nest(|context| {
-                    matches_complex_selector(
-                        selector.iter(),
-                        element,
-                        context,
-                        flags_setter,
-                    )
+            context
+                .shared
+                .shadow_host()
+                .map_or(false, |host| host == element.opaque()) &&
+                selector.as_ref().map_or(true, |selector| {
+                    context.shared.nest(|context| {
+                        matches_complex_selector(selector.iter(), element, context, flags_setter)
+                    })
                 })
-            })
-        }
-        Component::Scope => {
-            match context.shared.scope_element {
-                Some(ref scope_element) => element.opaque() == *scope_element,
-                None => element.is_root(),
-            }
-        }
+        },
+        Component::Scope => match context.shared.scope_element {
+            Some(ref scope_element) => element.opaque() == *scope_element,
+            None => element.is_root(),
+        },
         Component::NthChild(a, b) => {
             matches_generic_nth_child(element, context, a, b, false, false, flags_setter)
-        }
+        },
         Component::NthLastChild(a, b) => {
             matches_generic_nth_child(element, context, a, b, false, true, flags_setter)
-        }
+        },
         Component::NthOfType(a, b) => {
             matches_generic_nth_child(element, context, a, b, true, false, flags_setter)
-        }
+        },
         Component::NthLastOfType(a, b) => {
             matches_generic_nth_child(element, context, a, b, true, true, flags_setter)
-        }
+        },
         Component::FirstOfType => {
             matches_generic_nth_child(element, context, 0, 1, true, false, flags_setter)
-        }
+        },
         Component::LastOfType => {
             matches_generic_nth_child(element, context, 0, 1, true, true, flags_setter)
-        }
+        },
         Component::OnlyOfType => {
             matches_generic_nth_child(element, context, 0, 1, true, false, flags_setter) &&
-            matches_generic_nth_child(element, context, 0, 1, true, true, flags_setter)
-        }
-        Component::Negation(ref negated) => {
-            context.shared.nest_for_negation(|context| {
-                let mut local_context = LocalMatchingContext {
-                    matches_hover_and_active_quirk: MatchesHoverAndActiveQuirk::No,
-                    shared: context,
-                };
-                !negated.iter().all(|ss| {
-                    matches_simple_selector(
-                        ss,
-                        element,
-                        &mut local_context,
-                        flags_setter,
-                    )
-                })
-            })
-        }
+                matches_generic_nth_child(element, context, 0, 1, true, true, flags_setter)
+        },
+        Component::Negation(ref negated) => context.shared.nest_for_negation(|context| {
+            let mut local_context = LocalMatchingContext {
+                matches_hover_and_active_quirk: MatchesHoverAndActiveQuirk::No,
+                shared: context,
+            };
+            !negated
+                .iter()
+                .all(|ss| matches_simple_selector(ss, element, &mut local_context, flags_setter))
+        }),
     }
 }
 
 #[inline(always)]
 fn select_name<'a, T>(is_html: bool, local_name: &'a T, local_name_lower: &'a T) -> &'a T {
     if is_html {
         local_name_lower
     } else {
@@ -896,51 +836,64 @@ fn matches_generic_nth_child<E, F>(
 where
     E: Element,
     F: FnMut(&E, ElementSelectorFlags),
 {
     if element.ignores_nth_child_selectors() {
         return false;
     }
 
-    flags_setter(element, if is_from_end {
-        ElementSelectorFlags::HAS_SLOW_SELECTOR
-    } else {
-        ElementSelectorFlags::HAS_SLOW_SELECTOR_LATER_SIBLINGS
-    });
+    flags_setter(
+        element,
+        if is_from_end {
+            ElementSelectorFlags::HAS_SLOW_SELECTOR
+        } else {
+            ElementSelectorFlags::HAS_SLOW_SELECTOR_LATER_SIBLINGS
+        },
+    );
 
     // Grab a reference to the appropriate cache.
-    let mut cache = context.shared.nth_index_cache.as_mut().map(|c| {
-        c.get(is_of_type, is_from_end)
-    });
+    let mut cache = context
+        .shared
+        .nth_index_cache
+        .as_mut()
+        .map(|c| c.get(is_of_type, is_from_end));
 
     // Lookup or compute the index.
     let index = if let Some(i) = cache.as_mut().and_then(|c| c.lookup(element.opaque())) {
         i
     } else {
-        let i = nth_child_index(element, is_of_type, is_from_end, cache.as_mut().map(|s| &mut **s));
+        let i = nth_child_index(
+            element,
+            is_of_type,
+            is_from_end,
+            cache.as_mut().map(|s| &mut **s),
+        );
         cache.as_mut().map(|c| c.insert(element.opaque(), i));
         i
     };
-    debug_assert_eq!(index, nth_child_index(element, is_of_type, is_from_end, None), "invalid cache");
+    debug_assert_eq!(
+        index,
+        nth_child_index(element, is_of_type, is_from_end, None),
+        "invalid cache"
+    );
 
     // Is there a non-negative integer n such that An+B=index?
     match index.checked_sub(b) {
         None => false,
         Some(an) => match an.checked_div(a) {
             Some(n) => n >= 0 && a * n == an,
             None /* a == 0 */ => an == 0,
         },
     }
 }
 
 #[inline]
 fn same_type<E: Element>(a: &E, b: &E) -> bool {
-    a.local_name() == b.local_name() &&
-    a.namespace() == b.namespace()
+    a.local_name() == b.local_name() && a.namespace() == b.namespace()
 }
 
 #[inline]
 fn nth_child_index<E>(
     element: &E,
     is_of_type: bool,
     is_from_end: bool,
     mut cache: Option<&mut NthIndexCacheInner>,
@@ -967,26 +920,32 @@ where
                     index += 1;
                 }
             }
         }
     }
 
     let mut index: i32 = 1;
     let mut curr = element.clone();
-    let next = |e: E| if is_from_end { e.next_sibling_element() } else { e.prev_sibling_element() };
+    let next = |e: E| {
+        if is_from_end {
+            e.next_sibling_element()
+        } else {
+            e.prev_sibling_element()
+        }
+    };
     while let Some(e) = next(curr) {
         curr = e;
         if !is_of_type || same_type(element, &curr) {
             // If we're computing indices from the left, check each element in the
             // cache. We handle the indices-from-the-right case at the top of this
             // function.
             if !is_from_end {
                 if let Some(i) = cache.as_mut().and_then(|c| c.lookup(curr.opaque())) {
-                    return i + index
+                    return i + index;
                 }
             }
             index += 1;
         }
     }
 
     index
 }
--- a/servo/components/selectors/nth_index_cache.rs
+++ b/servo/components/selectors/nth_index_cache.rs
@@ -15,21 +15,17 @@ pub struct NthIndexCache {
     nth: NthIndexCacheInner,
     nth_last: NthIndexCacheInner,
     nth_of_type: NthIndexCacheInner,
     nth_last_of_type: NthIndexCacheInner,
 }
 
 impl NthIndexCache {
     /// Gets the appropriate cache for the given parameters.
-    pub fn get(
-        &mut self,
-        is_of_type: bool,
-        is_from_end: bool
-    ) -> &mut NthIndexCacheInner {
+    pub fn get(&mut self, is_of_type: bool, is_from_end: bool) -> &mut NthIndexCacheInner {
         match (is_of_type, is_from_end) {
             (false, false) => &mut self.nth,
             (false, true) => &mut self.nth_last,
             (true, false) => &mut self.nth_of_type,
             (true, true) => &mut self.nth_last_of_type,
         }
     }
 }
--- a/servo/components/selectors/parser.rs
+++ b/servo/components/selectors/parser.rs
@@ -1,47 +1,48 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-use attr::{AttrSelectorWithNamespace, ParsedAttrSelectorOperation, AttrSelectorOperator};
-use attr::{ParsedCaseSensitivity, SELECTOR_WHITESPACE, NamespaceConstraint};
+use attr::{AttrSelectorOperator, AttrSelectorWithNamespace, ParsedAttrSelectorOperation};
+use attr::{NamespaceConstraint, ParsedCaseSensitivity, SELECTOR_WHITESPACE};
 use bloom::BLOOM_HASH_MASK;
 use builder::{SelectorBuilder, SpecificityAndFlags};
 use context::QuirksMode;
-use cssparser::{ParseError, ParseErrorKind, BasicParseError, BasicParseErrorKind};
-use cssparser::{SourceLocation, CowRcStr, Delimiter};
-use cssparser::{Token, Parser as CssParser, parse_nth, ToCss, serialize_identifier, CssStringWriter};
+use cssparser::{BasicParseError, BasicParseErrorKind, ParseError, ParseErrorKind};
+use cssparser::{CowRcStr, Delimiter, SourceLocation};
+use cssparser::{CssStringWriter, Parser as CssParser, ToCss, Token};
+use cssparser::{parse_nth, serialize_identifier};
 use precomputed_hash::PrecomputedHash;
 use servo_arc::ThinArc;
 use sink::Push;
 use smallvec::SmallVec;
 use std::borrow::{Borrow, Cow};
-use std::fmt::{self, Display, Debug, Write};
+use std::fmt::{self, Debug, Display, Write};
 use std::iter::Rev;
 use std::slice;
-pub use visitor::{Visit, SelectorVisitor};
+pub use visitor::{SelectorVisitor, Visit};
 
 /// A trait that represents a pseudo-element.
-pub trait PseudoElement : Sized + ToCss {
+pub trait PseudoElement: Sized + ToCss {
     /// The `SelectorImpl` this pseudo-element is used for.
     type Impl: SelectorImpl;
 
     /// Whether the pseudo-element supports a given state selector to the right
     /// o