Merge m-i to m-c, a=merge
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 03 Jan 2017 18:40:26 -0800
changeset 327847 57ac9f63fc6953f4efeb0cc84a60192d3721251f
parent 327817 9c825a25d288e346b46b1d306cc4d4ba4004ae40 (current diff)
parent 327846 db66457631b64fc6c780868bac13b28f8f9bd50f (diff)
child 327848 634999b0963f7918eadb0847bd63b68c32639d5e
child 327867 bc09e56cdc528d35783216836a2f7ceda173ea35
child 327888 6176579defcb66ff80f8c132ab4bd7b70d062d4c
push id31155
push userphilringnalda@gmail.com
push dateWed, 04 Jan 2017 02:40:39 +0000
treeherdermozilla-central@57ac9f63fc69 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone53.0a1
first release with
nightly linux32
57ac9f63fc69 / 53.0a1 / 20170104030214 / files
nightly linux64
57ac9f63fc69 / 53.0a1 / 20170104030214 / files
nightly mac
57ac9f63fc69 / 53.0a1 / 20170104030214 / files
nightly win32
57ac9f63fc69 / 53.0a1 / 20170104030214 / files
nightly win64
57ac9f63fc69 / 53.0a1 / 20170104030214 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge m-i to m-c, a=merge MozReview-Commit-ID: FEe5yZfka5J
layout/style/res/html.css
testing/web-platform/meta/html/semantics/interactive-elements/the-dialog-element/dialog-close.html.ini
testing/web-platform/meta/html/semantics/interactive-elements/the-dialog-element/dialog-open.html.ini
--- a/accessible/tests/mochitest/elm/test_HTMLSpec.html
+++ b/accessible/tests/mochitest/elm/test_HTMLSpec.html
@@ -416,17 +416,17 @@
           { role: ROLE_TEXT_LEAF } // plain text
         ]
       };
       testElm("dfn_container", obj);
 
       //////////////////////////////////////////////////////////////////////////
       // HTML:dialog
 
-      todo(isAccessible("dialog"), "dialog element is not accessible");
+      ok(isAccessible("dialog"), "dialog element is not accessible");
 
       //////////////////////////////////////////////////////////////////////////
       // HTML:div
 
       obj = {
         role: ROLE_SECTION,
         interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
         children: [
--- a/caps/BasePrincipal.h
+++ b/caps/BasePrincipal.h
@@ -132,19 +132,18 @@ public:
   InheritFromDocToChildDocShell(const PrincipalOriginAttributes& aAttrs);
 };
 
 // For OriginAttributes stored on Necko.
 class NeckoOriginAttributes : public OriginAttributes
 {
 public:
   NeckoOriginAttributes() {}
-  NeckoOriginAttributes(uint32_t aAppId, bool aInIsolatedMozBrowser)
+  explicit NeckoOriginAttributes(bool aInIsolatedMozBrowser)
   {
-    mAppId = aAppId;
     mInIsolatedMozBrowser = aInIsolatedMozBrowser;
   }
 
   // Inheriting OriginAttributes from document to necko when a network request
   // is made.
   void InheritFromDocToNecko(const PrincipalOriginAttributes& aAttrs);
 
   // Inheriting OriginAttributes from a docshell when loading a top-level
--- a/caps/nsIScriptSecurityManager.idl
+++ b/caps/nsIScriptSecurityManager.idl
@@ -251,17 +251,16 @@ interface nsIScriptSecurityManager : nsI
       bool isSystem = false;
       IsSystemPrincipal(aPrincipal, &isSystem);
       return isSystem;
     }
 %}
 
     const unsigned long NO_APP_ID = 0;
     const unsigned long UNKNOWN_APP_ID = 4294967295; // UINT32_MAX
-    const unsigned long SAFEBROWSING_APP_ID = 4294967294; // UINT32_MAX - 1
 
     const unsigned long DEFAULT_USER_CONTEXT_ID = 0;
 
     /**
      * Per-domain controls to enable and disable script. This system is designed
      * to be used by at most one consumer, and enforces this with its semantics.
      *
      * Initially, domainPolicyActive is false. When activateDomainPolicy() is
--- a/docshell/base/LoadContext.h
+++ b/docshell/base/LoadContext.h
@@ -20,19 +20,16 @@ namespace mozilla {
 /**
  * Class that provides nsILoadContext info in Parent process.  Typically copied
  * from Child via SerializedLoadContext.
  *
  * Note: this is not the "normal" or "original" nsILoadContext.  That is
  * typically provided by nsDocShell.  This is only used when the original
  * docshell is in a different process and we need to copy certain values from
  * it.
- *
- * Note: we also generate a new nsILoadContext using LoadContext(uint32_t aAppId)
- * to separate the safebrowsing cookie.
  */
 
 class LoadContext final
   : public nsILoadContext
   , public nsIInterfaceRequestor
 {
 public:
   NS_DECL_ISUPPORTS
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -167,16 +167,20 @@ EVENT(change,
 EVENT(auxclick,
       eMouseAuxClick,
       EventNameType_All,
       eMouseEventClass)
 EVENT(click,
       eMouseClick,
       EventNameType_All,
       eMouseEventClass)
+EVENT(close,
+      eClose,
+      EventNameType_HTML,
+      eBasicEventClass)
 EVENT(contextmenu,
       eContextMenu,
       EventNameType_HTMLXUL,
       eMouseEventClass)
 NON_IDL_EVENT(mouselongtap,
       eMouseLongTap,
       EventNameType_HTMLXUL,
       eMouseEventClass)
@@ -1085,9 +1089,8 @@ NON_IDL_EVENT(complete,
 
 #ifdef MESSAGE_TO_EVENT
 #undef EVENT
 #undef WINDOW_ONLY_EVENT
 #undef TOUCH_EVENT
 #undef DOCUMENT_ONLY_EVENT
 #undef NON_IDL_EVENT
 #endif /* MESSAGE_TO_EVENT */
-
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -293,16 +293,17 @@ EventStateManager::EventStateManager()
   , mLastFrameConsumedSetCursor(false)
   , mCurrentTarget(nullptr)
     // init d&d gesture state machine variables
   , mGestureDownPoint(0,0)
   , mPresContext(nullptr)
   , mLClickCount(0)
   , mMClickCount(0)
   , mRClickCount(0)
+  , mInTouchDrag(false)
   , m_haveShutdown(false)
 {
   if (sESMInstanceCount == 0) {
     gUserInteractionTimerCallback = new UITimerCallback();
     if (gUserInteractionTimerCallback)
       NS_ADDREF(gUserInteractionTimerCallback);
     UpdateUserActivityTimer();
   }
@@ -600,22 +601,36 @@ EventStateManager::PreHandleEvent(nsPres
 
   *aStatus = nsEventStatus_eIgnore;
 
   if (aEvent->mClass == eQueryContentEventClass) {
     HandleQueryContentEvent(aEvent->AsQueryContentEvent());
     return NS_OK;
   }
 
+  WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
+  if (touchEvent && mInTouchDrag) {
+    if (touchEvent->mMessage == eTouchMove) {
+      GenerateDragGesture(aPresContext, touchEvent);
+    } else {
+      mInTouchDrag = false;
+      StopTrackingDragGesture();
+    }
+  }
+
   switch (aEvent->mMessage) {
   case eContextMenu:
     if (sIsPointerLocked) {
       return NS_ERROR_DOM_INVALID_STATE_ERR;
     }
     break;
+  case eMouseTouchDrag:
+    mInTouchDrag = true;
+    BeginTrackingDragGesture(aPresContext, mouseEvent, aTargetFrame);
+    break;
   case eMouseDown: {
     switch (mouseEvent->button) {
     case WidgetMouseEvent::eLeftButton:
       BeginTrackingDragGesture(aPresContext, mouseEvent, aTargetFrame);
       mLClickCount = mouseEvent->mClickCount;
       SetClickCount(mouseEvent, aStatus);
       sNormalLMouseEventInProcess = true;
       break;
@@ -1624,17 +1639,17 @@ EventStateManager::BeginTrackingDragGest
     mGestureDownFrameOwner = inDownFrame->GetContent();
     if (!mGestureDownFrameOwner) {
       mGestureDownFrameOwner = mGestureDownContent;
     }
   }
   mGestureModifiers = inDownEvent->mModifiers;
   mGestureDownButtons = inDownEvent->buttons;
 
-  if (Prefs::ClickHoldContextMenu()) {
+  if (inDownEvent->mMessage != eMouseTouchDrag && Prefs::ClickHoldContextMenu()) {
     // fire off a timer to track click-hold
     CreateClickHoldTimer(aPresContext, inDownFrame, inDownEvent);
   }
 }
 
 void
 EventStateManager::BeginTrackingRemoteDragGesture(nsIContent* aContent)
 {
@@ -1673,17 +1688,17 @@ EventStateManager::FillInEventFromGestur
 //
 // GenerateDragGesture
 //
 // If we're in the TRACKING state of the d&d gesture tracker, check the current position
 // of the mouse in relation to the old one. If we've moved a sufficient amount from
 // the mouse down, then fire off a drag gesture event.
 void
 EventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
-                                       WidgetMouseEvent* aEvent)
+                                       WidgetInputEvent* aEvent)
 {
   NS_ASSERTION(aPresContext, "This shouldn't happen.");
   if (IsTrackingDragGesture()) {
     mCurrentTarget = mGestureDownFrameOwner->GetPrimaryFrame();
 
     if (!mCurrentTarget || !mCurrentTarget->GetNearestWidget()) {
       StopTrackingDragGesture();
       return;
@@ -1716,18 +1731,19 @@ EventStateManager::GenerateDragGesture(n
         LookAndFeel::GetInt(LookAndFeel::eIntID_DragThresholdY, 0);
       if (!pixelThresholdX)
         pixelThresholdX = 5;
       if (!pixelThresholdY)
         pixelThresholdY = 5;
     }
 
     // fire drag gesture if mouse has moved enough
-    LayoutDeviceIntPoint pt =
-      aEvent->mRefPoint + aEvent->mWidget->WidgetToScreenOffset();
+    LayoutDeviceIntPoint pt = aEvent->mWidget->WidgetToScreenOffset() +
+      (aEvent->AsTouchEvent() ? aEvent->AsTouchEvent()->mTouches[0]->mRefPoint
+                              : aEvent->mRefPoint);
     LayoutDeviceIntPoint distance = pt - mGestureDownPoint;
     if (Abs(distance.x) > AssertedCast<uint32_t>(pixelThresholdX) ||
         Abs(distance.y) > AssertedCast<uint32_t>(pixelThresholdY)) {
       if (Prefs::ClickHoldContextMenu()) {
         // stop the click-hold before we fire off the drag gesture, in case
         // it takes a long time
         KillClickHoldTimer();
       }
@@ -1766,17 +1782,23 @@ EventStateManager::GenerateDragGesture(n
       sLastDragOverFrame = nullptr;
       nsCOMPtr<nsIWidget> widget = mCurrentTarget->GetNearestWidget();
 
       // get the widget from the target frame
       WidgetDragEvent startEvent(aEvent->IsTrusted(), eDragStart, widget);
       FillInEventFromGestureDown(&startEvent);
 
       startEvent.mDataTransfer = dataTransfer;
-      startEvent.inputSource = aEvent->inputSource;
+      if (aEvent->AsMouseEvent()) {
+        startEvent.inputSource = aEvent->AsMouseEvent()->inputSource;
+      } else if (aEvent->AsTouchEvent()) {
+        startEvent.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
+      } else {
+        MOZ_ASSERT(false);
+      }
 
       // Dispatch to the DOM. By setting mCurrentTarget we are faking
       // out the ESM and telling it that the current target frame is
       // actually where the mouseDown occurred, otherwise it will use
       // the frame the mouse is currently over which may or may not be
       // the same. (Note: saari and I have decided that we don't have
       // to reset |mCurrentTarget| when we're through because no one
       // else is doing anything more with this event and it will get
--- a/dom/events/EventStateManager.h
+++ b/dom/events/EventStateManager.h
@@ -838,17 +838,17 @@ protected:
   void BeginTrackingDragGesture(nsPresContext* aPresContext,
                                 WidgetMouseEvent* aDownEvent,
                                 nsIFrame* aDownFrame);
 
   friend class mozilla::dom::TabParent;
   void BeginTrackingRemoteDragGesture(nsIContent* aContent);
   void StopTrackingDragGesture();
   void GenerateDragGesture(nsPresContext* aPresContext,
-                           WidgetMouseEvent* aEvent);
+                           WidgetInputEvent* aEvent);
 
   /**
    * Determine which node the drag should be targeted at.
    * This is either the node clicked when there is a selection, or, for HTML,
    * the element with a draggable property set to true.
    *
    * aSelectionTarget - target to check for selection
    * aDataTransfer - data transfer object that will contain the data to drag
@@ -966,16 +966,18 @@ private:
   nsCOMPtr<nsIDocument> mDocument;   // Doesn't necessarily need to be owner
 
   RefPtr<IMEContentObserver> mIMEContentObserver;
 
   uint32_t mLClickCount;
   uint32_t mMClickCount;
   uint32_t mRClickCount;
 
+  bool mInTouchDrag;
+
   bool m_haveShutdown;
 
   // Time at which we began handling user input. Reset to the epoch
   // once we have finished handling user input.
   static TimeStamp sHandlingInputStart;
 
   // Time at which we began handling the latest user input. Not reset
   // at the end of the input.
new file mode 100644
--- /dev/null
+++ b/dom/html/HTMLDialogElement.cpp
@@ -0,0 +1,95 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "mozilla/dom/HTMLDialogElement.h"
+#include "mozilla/dom/HTMLDialogElementBinding.h"
+#include "mozilla/dom/HTMLUnknownElement.h"
+#include "mozilla/Preferences.h"
+
+// Expand NS_IMPL_NS_NEW_HTML_ELEMENT(Dialog) with pref check
+nsGenericHTMLElement*
+NS_NewHTMLDialogElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
+                         mozilla::dom::FromParser aFromParser)
+{
+  if (!mozilla::dom::HTMLDialogElement::IsDialogEnabled()) {
+    return new mozilla::dom::HTMLUnknownElement(aNodeInfo);
+  }
+
+  return new mozilla::dom::HTMLDialogElement(aNodeInfo);
+}
+
+namespace mozilla {
+namespace dom {
+
+HTMLDialogElement::~HTMLDialogElement()
+{
+}
+
+NS_IMPL_ELEMENT_CLONE(HTMLDialogElement)
+
+bool
+HTMLDialogElement::IsDialogEnabled()
+{
+  static bool isDialogEnabled = false;
+  static bool added = false;
+
+  if (!added) {
+    Preferences::AddBoolVarCache(&isDialogEnabled,
+                                 "dom.dialog_element.enabled");
+    added = true;
+  }
+
+  return isDialogEnabled;
+}
+
+void
+HTMLDialogElement::Close(const mozilla::dom::Optional<nsAString>& aReturnValue)
+{
+  if (!Open()) {
+    return;
+  }
+  if (aReturnValue.WasPassed()) {
+    SetReturnValue(aReturnValue.Value());
+  }
+  ErrorResult ignored;
+  SetOpen(false, ignored);
+  ignored.SuppressException();
+  RefPtr<AsyncEventDispatcher> eventDispatcher =
+    new AsyncEventDispatcher(this, NS_LITERAL_STRING("close"), false);
+  eventDispatcher->PostDOMEvent();
+}
+
+void
+HTMLDialogElement::Show()
+{
+  if (Open()) {
+    return;
+  }
+  ErrorResult ignored;
+  SetOpen(true, ignored);
+  ignored.SuppressException();
+}
+
+void
+HTMLDialogElement::ShowModal(ErrorResult& aError)
+{
+  if (!IsInComposedDoc() || Open()) {
+   aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
+   return;
+  }
+
+  SetOpen(true, aError);
+  aError.SuppressException();
+}
+
+JSObject*
+HTMLDialogElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
+{
+  return HTMLDialogElementBinding::Wrap(aCx, this, aGivenProto);
+}
+
+} // namespace dom
+} // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/dom/html/HTMLDialogElement.h
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef HTMLDialogElement_h
+#define HTMLDialogElement_h
+
+#include "mozilla/AsyncEventDispatcher.h"
+#include "mozilla/Attributes.h"
+#include "nsGenericHTMLElement.h"
+#include "nsGkAtoms.h"
+
+namespace mozilla {
+namespace dom {
+
+class HTMLDialogElement final : public nsGenericHTMLElement
+{
+public:
+  explicit HTMLDialogElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo) : nsGenericHTMLElement(aNodeInfo)
+  {
+  }
+
+  NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLDialogElement, dialog)
+
+  virtual nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult) const override;
+
+  static bool IsDialogEnabled();
+
+  bool Open() const { return GetBoolAttr(nsGkAtoms::open); }
+  void SetOpen(bool aOpen, ErrorResult& aError)
+  {
+    SetHTMLBoolAttr(nsGkAtoms::open, aOpen, aError);
+  }
+
+  void GetReturnValue(nsAString& aReturnValue)
+  {
+    aReturnValue = mReturnValue;
+  }
+  void SetReturnValue(const nsAString& aReturnValue)
+  {
+    mReturnValue = aReturnValue;
+  }
+
+  void Close(const mozilla::dom::Optional<nsAString>& aReturnValue);
+  void Show();
+  void ShowModal(ErrorResult& aError);
+
+  nsString mReturnValue;
+
+protected:
+  virtual ~HTMLDialogElement();
+  JSObject* WrapNode(JSContext* aCx,
+                     JS::Handle<JSObject*> aGivenProto) override;
+};
+
+} // namespace dom
+} // namespace mozilla
+
+#endif
--- a/dom/html/crashtests/crashtests.list
+++ b/dom/html/crashtests/crashtests.list
@@ -46,17 +46,17 @@ load 614988-1.html
 load 620078-1.html
 load 620078-2.html
 load 631421.html
 load 673853.html
 load 680922-1.xul
 load 682058.xhtml
 load 682460.html
 load 738744.xhtml
-asserts-if(stylo,6) load 741218.json # bug 1324634
+asserts-if(stylo,6-28) load 741218.json # bug 1324634
 load 741250.xhtml
 load 795221-1.html
 asserts-if(stylo,1) load 795221-2.html # bug 1324702
 load 795221-3.html
 asserts-if(stylo,2) load 795221-4.html # bug 1324669
 load 795221-5.xml
 load 811226.html
 load 819745.html
--- a/dom/html/moz.build
+++ b/dom/html/moz.build
@@ -50,16 +50,17 @@ EXPORTS.mozilla.dom += [
     'HTMLBodyElement.h',
     'HTMLBRElement.h',
     'HTMLButtonElement.h',
     'HTMLCanvasElement.h',
     'HTMLContentElement.h',
     'HTMLDataElement.h',
     'HTMLDataListElement.h',
     'HTMLDetailsElement.h',
+    'HTMLDialogElement.h',
     'HTMLDivElement.h',
     'HTMLFieldSetElement.h',
     'HTMLFontElement.h',
     'HTMLFormControlsCollection.h',
     'HTMLFormElement.h',
     'HTMLFormSubmission.h',
     'HTMLFrameElement.h',
     'HTMLFrameSetElement.h',
@@ -128,16 +129,17 @@ UNIFIED_SOURCES += [
     'HTMLBodyElement.cpp',
     'HTMLBRElement.cpp',
     'HTMLButtonElement.cpp',
     'HTMLCanvasElement.cpp',
     'HTMLContentElement.cpp',
     'HTMLDataElement.cpp',
     'HTMLDataListElement.cpp',
     'HTMLDetailsElement.cpp',
+    'HTMLDialogElement.cpp',
     'HTMLDivElement.cpp',
     'HTMLElement.cpp',
     'HTMLFieldSetElement.cpp',
     'HTMLFontElement.cpp',
     'HTMLFormControlsCollection.cpp',
     'HTMLFormElement.cpp',
     'HTMLFormSubmission.cpp',
     'HTMLFrameElement.cpp',
--- a/dom/html/nsGenericHTMLElement.h
+++ b/dom/html/nsGenericHTMLElement.h
@@ -1653,16 +1653,17 @@ NS_DECLARE_NS_NEW_HTML_ELEMENT(BR)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Body)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Button)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Canvas)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Content)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Mod)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Data)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(DataList)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Details)
+NS_DECLARE_NS_NEW_HTML_ELEMENT(Dialog)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Div)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(FieldSet)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Font)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Form)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Frame)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(FrameSet)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(HR)
 NS_DECLARE_NS_NEW_HTML_ELEMENT_AS_SHARED(Head)
--- a/dom/html/test/mochitest.ini
+++ b/dom/html/test/mochitest.ini
@@ -421,16 +421,17 @@ support-files =
 [test_bug1003539.html]
 [test_bug1045270.html]
 [test_bug1146116.html]
 [test_bug1264157.html]
 [test_bug1287321.html]
 [test_bug1323815.html]
 [test_change_crossorigin.html]
 [test_checked.html]
+[test_dialog_pref.html]
 [test_dir_attributes_reflection.html]
 [test_dl_attributes_reflection.html]
 [test_element_prototype.html]
 [test_embed_attributes_reflection.html]
 [test_focusshift_button.html]
 [test_formData.html]
 [test_formSubmission.html]
 skip-if = toolkit == 'android' #TIMED_OUT
new file mode 100644
--- /dev/null
+++ b/dom/html/test/test_dialog_pref.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=dialog-element
+-->
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <title>Test dialog pref</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank"
+href="https://bugzilla.mozilla.org/show_bug.cgi?id=dialog-element">Test dialog element pref</a>
+<div id="testDiv">
+</div>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+
+/** Test for dom.dialog_element.enabled **/
+
+SimpleTest.waitForExplicitFinish();
+
+function testPref() {
+  is(typeof HTMLDialogElement, "undefined",
+     "HTMLDialogElement should not be exposed with pref disabled");
+
+  info("Testing if createElement doesn't expose HTMLDialogElement with pref disabled");
+  let newElement = document.createElement("dialog");
+  testElement(newElement);
+
+  info("Testing if HTML Parser doesn't expose HTMLDialogElement with pref disabled");
+  let testDiv = document.getElementById("testDiv");
+  testDiv.innerHTML = "<dialog></dialog>";
+  testElement(testDiv.firstChild);
+
+  SimpleTest.finish();
+}
+
+function testElement(element) {
+  ok(element instanceof HTMLUnknownElement,
+     "New <dialog> should be instances of HTMLUnknownElement when pref is disabled");
+}
+addLoadEvent(testPref);
+
+</script>
+</pre>
+</body>
+</html>
--- a/dom/indexedDB/test/mochitest.ini
+++ b/dom/indexedDB/test/mochitest.ini
@@ -198,16 +198,17 @@ support-files =
 [test_invalid_version.html]
 [test_invalidate.html]
 # disabled for the moment
 skip-if = true
 [test_key_requirements.html]
 [test_keys.html]
 [test_leaving_page.html]
 [test_lowDiskSpace.html]
+skip-if = toolkit == 'android' && debug # Bug 1328321
 [test_maximal_serialized_object_size.html]
 [test_message_manager_ipc.html]
 # This test is only supposed to run in the main process.
 skip-if = e10s
 [test_multientry.html]
 [test_names_sorted.html]
 [test_objectCursors.html]
 [test_objectStore_getAllKeys.html]
new file mode 100644
--- /dev/null
+++ b/dom/indexedDB/test/unit/test_bad_origin_directory.js
@@ -0,0 +1,32 @@
+/**
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+var testGenerator = testSteps();
+
+function testSteps()
+{
+  const url = "ftp://ftp.example.com";
+  const name = "test_bad_origin_directory.js";
+
+  let ios = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
+                         .getService(SpecialPowers.Ci.nsIIOService);
+
+  let uri = ios.newURI(url, null, null);
+
+  let ssm = SpecialPowers.Cc["@mozilla.org/scriptsecuritymanager;1"]
+                         .getService(SpecialPowers.Ci.nsIScriptSecurityManager);
+
+  let principal = ssm.createCodebasePrincipal(uri, {});
+
+  info("Opening database");
+
+  let request = indexedDB.openForPrincipal(principal, name);
+  request.onerror = continueToNextStepSync;
+  request.onsuccess = unexpectedSuccessHandler;
+  yield undefined;
+
+  finishTest();
+  yield undefined;
+}
--- a/dom/indexedDB/test/unit/xpcshell-parent-process.ini
+++ b/dom/indexedDB/test/unit/xpcshell-parent-process.ini
@@ -26,16 +26,18 @@ support-files =
   schema23upgrade_profile.zip
   snappyUpgrade_profile.zip
   storagePersistentUpgrade_profile.zip
   wasm_recompile_profile.zip
   xpcshell-shared.ini
 
 [include:xpcshell-shared.ini]
 
+[test_bad_origin_directory.js]
+skip-if = release_or_beta
 [test_blob_file_backed.js]
 [test_bug1056939.js]
 [test_cleanup_transaction.js]
 [test_database_close_without_onclose.js]
 [test_database_onclose.js]
 [test_defaultStorageUpgrade.js]
 [test_file_copy_failure.js]
 [test_idbSubdirUpgrade.js]
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -4456,16 +4456,45 @@ QuotaManager::EnsureOriginIsInitialized(
 
     mTemporaryStorageInitialized = true;
 
     CheckTemporaryStorageLimits();
   }
 
   int64_t timestamp;
 
+#ifndef RELEASE_OR_BETA
+  bool exists;
+  rv = directory->Exists(&exists);
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    return rv;
+  }
+
+  if (!exists) {
+    nsString leafName;
+    nsresult rv = directory->GetLeafName(leafName);
+    if (NS_WARN_IF(NS_FAILED(rv))) {
+      return rv;
+    }
+
+    if (!leafName.EqualsLiteral(kChromeOrigin)) {
+      nsCString spec;
+      PrincipalOriginAttributes attrs;
+      bool result = OriginParser::ParseOrigin(NS_ConvertUTF16toUTF8(leafName),
+                                              spec, &attrs);
+      if (NS_WARN_IF(!result)) {
+        QM_WARNING("Preventing creation of a new origin directory which is not "
+                   "supported by our origin parser!");
+
+        return NS_ERROR_FAILURE;
+      }
+    }
+  }
+#endif
+
   bool created;
   rv = EnsureDirectory(directory, &created);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (IsTreatedAsPersistent(aPersistenceType, aIsApp)) {
     if (created) {
       timestamp = PR_Now();
 
@@ -6671,17 +6700,18 @@ OriginParser::HandleSchema(const nsDepen
   bool isFile = false;
   if (aToken.EqualsLiteral("http") ||
       aToken.EqualsLiteral("https") ||
       (isAbout = aToken.EqualsLiteral("about") ||
                  aToken.EqualsLiteral("moz-safe-about")) ||
       aToken.EqualsLiteral("indexeddb") ||
       (isFile = aToken.EqualsLiteral("file")) ||
       aToken.EqualsLiteral("app") ||
-      aToken.EqualsLiteral("resource")) {
+      aToken.EqualsLiteral("resource") ||
+      aToken.EqualsLiteral("moz-extension")) {
     mSchema = aToken;
 
     if (isAbout) {
       mSchemaType = eAbout;
       mState = eExpectingHost;
     } else {
       if (isFile) {
         mSchemaType = eFile;
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -442,16 +442,18 @@ var interfaceNamesInGlobalScope =
     "HTMLContentElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "HTMLDataElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "HTMLDataListElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "HTMLDetailsElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
+    {name: "HTMLDialogElement", disabled: true},
+// IMPORTANT: Do not change this list without review from a DOM peer!
     "HTMLDirectoryElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "HTMLDivElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "HTMLDListElement",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "HTMLDocument",
 // IMPORTANT: Do not change this list without review from a DOM peer!
--- a/dom/webidl/EventHandler.webidl
+++ b/dom/webidl/EventHandler.webidl
@@ -33,17 +33,17 @@ interface GlobalEventHandlers {
 //         attribute OnErrorEventHandler onerror;
            attribute EventHandler onfocus;
            //(Not implemented)attribute EventHandler oncancel;
            attribute EventHandler onauxclick;
            attribute EventHandler oncanplay;
            attribute EventHandler oncanplaythrough;
            attribute EventHandler onchange;
            attribute EventHandler onclick;
-           //(Not implemented)attribute EventHandler onclose;
+           attribute EventHandler onclose;
            attribute EventHandler oncontextmenu;
            //(Not implemented)attribute EventHandler oncuechange;
            attribute EventHandler ondblclick;
            attribute EventHandler ondrag;
            attribute EventHandler ondragend;
            attribute EventHandler ondragenter;
            attribute EventHandler ondragexit;
            attribute EventHandler ondragleave;
new file mode 100644
--- /dev/null
+++ b/dom/webidl/HTMLDialogElement.webidl
@@ -0,0 +1,23 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The origin of this IDL file is
+ * https://html.spec.whatwg.org/multipage/forms.html#the-dialog-element
+ *
+ * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
+ * Opera Software ASA. You are granted a license to use, reproduce
+ * and create derivative works of this document.
+ */
+
+[Pref="dom.dialog_element.enabled"]
+interface HTMLDialogElement : HTMLElement {
+  [SetterThrows] attribute boolean open;
+  attribute DOMString returnValue;
+
+  void show();
+  [Throws] void showModal();
+
+  void close(optional DOMString returnValue);
+};
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -184,16 +184,17 @@ WEBIDL_FILES = [
     'HTMLBRElement.webidl',
     'HTMLButtonElement.webidl',
     'HTMLCanvasElement.webidl',
     'HTMLCollection.webidl',
     'HTMLContentElement.webidl',
     'HTMLDataElement.webidl',
     'HTMLDataListElement.webidl',
     'HTMLDetailsElement.webidl',
+    'HTMLDialogElement.webidl',
     'HTMLDirectoryElement.webidl',
     'HTMLDivElement.webidl',
     'HTMLDListElement.webidl',
     'HTMLDocument.webidl',
     'HTMLElement.webidl',
     'HTMLEmbedElement.webidl',
     'HTMLFieldSetElement.webidl',
     'HTMLFontElement.webidl',
--- a/editor/libeditor/HTMLEditUtils.cpp
+++ b/editor/libeditor/HTMLEditUtils.cpp
@@ -512,19 +512,19 @@ HTMLEditUtils::SupportsAlignAttr(nsIDOMN
 // a, applet, basefont, bdo, br, font, iframe, img, map, meter, object, output,
 // picture, progress, q, script, span, sub, sup
 #define GROUP_SPECIAL          (1 << 5)
 
 // button, form, input, label, select, textarea
 #define GROUP_FORMCONTROL      (1 << 6)
 
 // address, applet, article, aside, blockquote, button, center, del, details,
-// dir, div, dl, fieldset, figure, footer, form, h1, h2, h3, h4, h5, h6, header,
-// hgroup, hr, iframe, ins, main, map, menu, nav, noframes, noscript, object,
-// ol, p, pre, table, section, summary, ul
+// dialog, dir, div, dl, fieldset, figure, footer, form, h1, h2, h3, h4, h5,
+// h6, header, hgroup, hr, iframe, ins, main, map, menu, nav, noframes,
+// noscript, object, ol, p, pre, table, section, summary, ul
 #define GROUP_BLOCK            (1 << 7)
 
 // frame, frameset
 #define GROUP_FRAME            (1 << 8)
 
 // col, tbody
 #define GROUP_TABLE_CONTENT    (1 << 9)
 
@@ -633,16 +633,17 @@ static const ElementInfo kElements[eHTML
   ELEM(content, true, false, GROUP_NONE, GROUP_INLINE_ELEMENT),
   ELEM(data, true, false, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
   ELEM(datalist, true, false, GROUP_PHRASE,
        GROUP_OPTIONS | GROUP_INLINE_ELEMENT),
   ELEM(dd, true, false, GROUP_DL_CONTENT, GROUP_FLOW_ELEMENT),
   ELEM(del, true, true, GROUP_PHRASE | GROUP_BLOCK, GROUP_FLOW_ELEMENT),
   ELEM(details, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
   ELEM(dfn, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
+  ELEM(dialog, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
   ELEM(dir, true, false, GROUP_BLOCK, GROUP_LI),
   ELEM(div, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
   ELEM(dl, true, false, GROUP_BLOCK, GROUP_DL_CONTENT),
   ELEM(dt, true, true, GROUP_DL_CONTENT, GROUP_INLINE_ELEMENT),
   ELEM(em, true, true, GROUP_PHRASE, GROUP_INLINE_ELEMENT),
   ELEM(embed, false, false, GROUP_NONE, GROUP_NONE),
   ELEM(fieldset, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
   ELEM(figcaption, true, false, GROUP_FIGCAPTION, GROUP_FLOW_ELEMENT),
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -736,17 +736,17 @@ public:
    * Creates a ScaledFont using the font corresponding to the index and
    * the given glyph size.
    *
    * @param aIndex index for the font within the resource.
    * @param aGlyphSize the size of ScaledFont required.
    * @return an already_addrefed ScaledFont, containing nullptr if failed.
    */
   virtual already_AddRefed<ScaledFont>
-    CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize) = 0;
+    CreateScaledFont(uint32_t aIndex, Float aGlyphSize) = 0;
 
   virtual ~NativeFontResource() {};
 };
 
 /** This class is designed to allow passing additional glyph rendering
  * parameters to the glyph drawing functions. This is an empty wrapper class
  * merely used to allow holding on to and passing around platform specific
  * parameters. This is because different platforms have unique rendering
--- a/gfx/2d/NativeFontResourceDWrite.cpp
+++ b/gfx/2d/NativeFontResourceDWrite.cpp
@@ -254,17 +254,17 @@ NativeFontResourceDWrite::Create(uint8_t
 
   RefPtr<NativeFontResourceDWrite> fontResource =
     new NativeFontResourceDWrite(factory, fontFile.forget(), faceType,
                                  numberOfFaces, aNeedsCairo);
   return fontResource.forget();
 }
 
 already_AddRefed<ScaledFont>
-NativeFontResourceDWrite::CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize)
+NativeFontResourceDWrite::CreateScaledFont(uint32_t aIndex, Float aGlyphSize)
 {
   if (aIndex >= mNumberOfFaces) {
     gfxWarning() << "Font face index is too high for font resource.";
     return nullptr;
   }
 
   IDWriteFontFile *fontFile = mFontFile;
   RefPtr<IDWriteFontFace> fontFace;
--- a/gfx/2d/NativeFontResourceDWrite.h
+++ b/gfx/2d/NativeFontResourceDWrite.h
@@ -27,17 +27,17 @@ public:
    * @param aDataLength length of data.
    * @param aNeedsCairo whether the ScaledFont created needs a cairo scaled font
    * @return Referenced NativeFontResourceDWrite or nullptr if invalid.
    */
   static already_AddRefed<NativeFontResourceDWrite>
     Create(uint8_t *aFontData, uint32_t aDataLength, bool aNeedsCairo);
 
   already_AddRefed<ScaledFont>
-    CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize) final;
+    CreateScaledFont(uint32_t aIndex, Float aGlyphSize) final;
 
 private:
   NativeFontResourceDWrite(IDWriteFactory *aFactory,
                            already_AddRefed<IDWriteFontFile> aFontFile,
                            DWRITE_FONT_FACE_TYPE aFaceType,
                            uint32_t aNumberOfFaces, bool aNeedsCairo)
     : mFactory(aFactory), mFontFile(aFontFile), mFaceType(aFaceType)
     , mNumberOfFaces(aNumberOfFaces), mNeedsCairo(aNeedsCairo)
--- a/gfx/2d/NativeFontResourceGDI.cpp
+++ b/gfx/2d/NativeFontResourceGDI.cpp
@@ -60,17 +60,17 @@ NativeFontResourceGDI::Create(uint8_t *a
 }
 
 NativeFontResourceGDI::~NativeFontResourceGDI()
 {
   ::RemoveFontMemResourceEx(mFontResourceHandle);
 }
 
 already_AddRefed<ScaledFont>
-NativeFontResourceGDI::CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize)
+NativeFontResourceGDI::CreateScaledFont(uint32_t aIndex, Float aGlyphSize)
 {
   if (aIndex >= mFontNames.length()) {
     gfxWarning() << "Font index is too high for font resource.";
     return nullptr;
   }
 
   if (mFontNames[aIndex].empty()) {
     gfxWarning() << "Font name for index is empty.";
--- a/gfx/2d/NativeFontResourceGDI.h
+++ b/gfx/2d/NativeFontResourceGDI.h
@@ -31,17 +31,17 @@ public:
    * @return Referenced NativeFontResourceGDI or nullptr if invalid.
    */
   static already_AddRefed<NativeFontResourceGDI>
     Create(uint8_t *aFontData, uint32_t aDataLength, bool aNeedsCairo);
 
   ~NativeFontResourceGDI();
 
   already_AddRefed<ScaledFont>
-    CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize) final;
+    CreateScaledFont(uint32_t aIndex, Float aGlyphSize) final;
 
 private:
   NativeFontResourceGDI(HANDLE aFontResourceHandle,
                         Vector<mozilla::u16string>&& aFontNames,
                         bool aNeedsCairo)
     : mFontResourceHandle(aFontResourceHandle), mFontNames(Move(aFontNames))
     , mNeedsCairo(aNeedsCairo)
   {}
--- a/gfx/2d/NativeFontResourceMac.cpp
+++ b/gfx/2d/NativeFontResourceMac.cpp
@@ -45,17 +45,17 @@ NativeFontResourceMac::Create(uint8_t *a
   // passes ownership of fontRef to the NativeFontResourceMac instance
   RefPtr<NativeFontResourceMac> fontResource =
     new NativeFontResourceMac(fontRef);
 
   return fontResource.forget();
 }
 
 already_AddRefed<ScaledFont>
-NativeFontResourceMac::CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize)
+NativeFontResourceMac::CreateScaledFont(uint32_t aIndex, Float aGlyphSize)
 {
   RefPtr<ScaledFontBase> scaledFont = new ScaledFontMac(mFontRef, aGlyphSize);
 
   if (!scaledFont->PopulateCairoScaledFont()) {
     gfxWarning() << "Unable to create cairo scaled Mac font.";
     return nullptr;
   }
 
--- a/gfx/2d/NativeFontResourceMac.h
+++ b/gfx/2d/NativeFontResourceMac.h
@@ -18,17 +18,17 @@ class NativeFontResourceMac final : publ
 {
 public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(NativeFontResourceMac)
 
   static already_AddRefed<NativeFontResourceMac>
     Create(uint8_t *aFontData, uint32_t aDataLength);
 
   already_AddRefed<ScaledFont>
-    CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize);
+    CreateScaledFont(uint32_t aIndex, Float aGlyphSize);
 
   ~NativeFontResourceMac()
   {
     CFRelease(mFontRef);
   }
 
 private:
   explicit NativeFontResourceMac(CGFontRef aFontRef) : mFontRef(aFontRef) {}
--- a/gfx/ipc/GPUParent.cpp
+++ b/gfx/ipc/GPUParent.cpp
@@ -7,16 +7,18 @@
 #include "WMF.h"
 #endif
 #include "GPUParent.h"
 #include "gfxConfig.h"
 #include "gfxPlatform.h"
 #include "gfxPrefs.h"
 #include "GPUProcessHost.h"
 #include "mozilla/Assertions.h"
+#include "mozilla/Telemetry.h"
+#include "mozilla/TimeStamp.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/ipc/CrashReporterClient.h"
 #include "mozilla/ipc/ProcessChild.h"
 #include "mozilla/layers/APZThreadUtils.h"
 #include "mozilla/layers/APZCTreeManager.h"
 #include "mozilla/layers/CompositorBridgeParent.h"
 #include "mozilla/dom/VideoDecoderManagerParent.h"
@@ -44,16 +46,17 @@ namespace mozilla {
 namespace gfx {
 
 using namespace ipc;
 using namespace layers;
 
 static GPUParent* sGPUParent;
 
 GPUParent::GPUParent()
+  : mLaunchTime(TimeStamp::Now())
 {
   sGPUParent = this;
 }
 
 GPUParent::~GPUParent()
 {
   sGPUParent = nullptr;
 }
@@ -186,16 +189,17 @@ GPUParent::RecvInit(nsTArray<GfxPrefSett
 #endif
 
   VRManager::ManagerInit();
   // Send a message to the UI process that we're done.
   GPUDeviceData data;
   RecvGetDeviceStatus(&data);
   Unused << SendInitComplete(data);
 
+  Telemetry::AccumulateTimeDelta(Telemetry::GPU_PROCESS_INITIALIZATION_TIME_MS, mLaunchTime);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 GPUParent::RecvInitVsyncBridge(Endpoint<PVsyncBridgeParent>&& aVsyncEndpoint)
 {
   mVsyncBridge = VsyncBridgeParent::Start(Move(aVsyncEndpoint));
   return IPC_OK();
--- a/gfx/ipc/GPUParent.h
+++ b/gfx/ipc/GPUParent.h
@@ -5,16 +5,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef _include_gfx_ipc_GPUParent_h__
 #define _include_gfx_ipc_GPUParent_h__
 
 #include "mozilla/RefPtr.h"
 #include "mozilla/gfx/PGPUParent.h"
 
 namespace mozilla {
+
+class TimeStamp;
+
 namespace gfx {
 
 class VsyncBridgeParent;
 
 class GPUParent final : public PGPUParent
 {
 public:
   GPUParent();
@@ -48,15 +51,16 @@ public:
   mozilla::ipc::IPCResult RecvGetDeviceStatus(GPUDeviceData* aOutStatus) override;
   mozilla::ipc::IPCResult RecvAddLayerTreeIdMapping(nsTArray<LayerTreeIdMapping>&& aMappings) override;
   mozilla::ipc::IPCResult RecvRemoveLayerTreeIdMapping(const LayerTreeIdMapping& aMapping) override;
   mozilla::ipc::IPCResult RecvNotifyGpuObservers(const nsCString& aTopic) override;
 
   void ActorDestroy(ActorDestroyReason aWhy) override;
 
 private:
+  const TimeStamp mLaunchTime;
   RefPtr<VsyncBridgeParent> mVsyncBridge;
 };
 
 } // namespace gfx
 } // namespace mozilla
 
 #endif // _include_gfx_ipc_GPUParent_h__
--- a/gfx/thebes/PrintTargetPDF.cpp
+++ b/gfx/thebes/PrintTargetPDF.cpp
@@ -63,17 +63,17 @@ PrintTargetPDF::CreateOrNull(nsIOutputSt
                                                      aStream);
   return target.forget();
 }
 
 nsresult
 PrintTargetPDF::EndPage()
 {
   cairo_surface_show_page(mCairoSurface);
-  return NS_OK;
+  return PrintTarget::EndPage();
 }
 
 void
 PrintTargetPDF::Finish()
 {
   if (mIsFinished) {
     return; // We don't want to call Close() on mStream more than once
   }
--- a/js/src/ds/MemoryProtectionExceptionHandler.cpp
+++ b/js/src/ds/MemoryProtectionExceptionHandler.cpp
@@ -517,16 +517,19 @@ struct MachExceptionParameters
 
 struct ExceptionHandlerState
 {
     MachExceptionParameters current;
     MachExceptionParameters previous;
 
     /* Each Mach exception handler runs in its own thread. */
     Thread handlerThread;
+
+    /* Ensure that the exception handler thread is terminated before we quit. */
+    ~ExceptionHandlerState() { MemoryProtectionExceptionHandler::uninstall(); }
 };
 
 /* This choice of ID is arbitrary, but must not match our exception ID. */
 static const mach_msg_id_t sIDQuit = 42;
 
 static ExceptionHandlerState sMachExceptionState;
 
 /*
--- a/js/src/ds/PageProtectingVector.h
+++ b/js/src/ds/PageProtectingVector.h
@@ -2,349 +2,509 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef ds_PageProtectingVector_h
 #define ds_PageProtectingVector_h
 
+#include "mozilla/Atomics.h"
 #include "mozilla/Vector.h"
 
 #include "ds/MemoryProtectionExceptionHandler.h"
 #include "gc/Memory.h"
 
 namespace js {
 
 /*
  * PageProtectingVector is a vector that can only grow or be cleared, restricts
  * access to memory pages that haven't been used yet, and marks all of its fully
  * used memory pages as read-only. It can be used to detect heap corruption in
  * important buffers, since anything that tries to write into its protected
  * pages will crash. On Nightly and Aurora, these crashes will additionally be
  * annotated with a moz crash reason using MemoryProtectionExceptionHandler.
  *
  * PageProtectingVector's protection is limited to full pages. If the front
- * of its buffer is not aligned on a page boundary, bytes preceding the first
+ * of its buffer is not aligned on a page boundary, elems preceding the first
  * page boundary will not be protected. Similarly, the end of the buffer will
  * not be fully protected unless it is aligned on a page boundary. Altogether,
  * up to two pages of memory may not be protected.
  */
 template<typename T,
          size_t MinInlineCapacity = 0,
          class AllocPolicy = mozilla::MallocAllocPolicy,
          bool ProtectUsed = true,
          bool ProtectUnused = true,
+         bool GuardAgainstReentrancy = true,
          size_t InitialLowerBound = 0>
 class PageProtectingVector final
 {
     mozilla::Vector<T, MinInlineCapacity, AllocPolicy> vector;
 
-    size_t pageSize;
-    size_t pageMask;
+    static constexpr size_t toShift(size_t v) { return v <= 1 ? 0 : 1 + toShift(v >> 1); }
+
+    static_assert((sizeof(T) & (sizeof(T) - 1)) == 0, "For performance reasons, "
+                  "PageProtectingVector only works with power-of-2 sized elements!");
 
-    /*
-     * The number of bytes between the start of the buffer being used by
-     * |vector| and the first page we can protect. With jemalloc, this number
-     * should always be 0 for vectors with a buffer larger than |pageSize / 2|
-     * bytes, but with other allocators large buffers may not be page-aligned.
-     */
-    size_t offsetToPage;
+    static const size_t elemShift = toShift(sizeof(T));
+    static const size_t elemSize = 1 << elemShift;
+    static const size_t elemMask = elemSize - 1;
+
+    /* We hardcode the page size here to minimize administrative overhead. */
+    static const size_t pageShift = 12;
+    static const size_t pageSize = 1 << pageShift;
+    static const size_t pageMask = pageSize - 1;
 
     /*
-     * The offset in bytes of the first completely unused page in the buffer.
-     * Note: this page might extend or even begin past the end of the buffer.
+     * The number of elements that can be added before we need to either adjust
+     * the active page or resize the buffer. If |elemsUntilTest < 0| we will
+     * take the slow paths in the append calls.
      */
-    size_t firstUnusedPage;
+    intptr_t elemsUntilTest;
 
-    /* The number of currently protected bytes (a multiple of pageSize). */
-    size_t protectedBytes;
-    size_t protectedUnusedBytes;
+    /*
+     * The offset of the currently 'active' page - that is, the page that is
+     * currently being written to. If both used and unused bytes are protected,
+     * this will be the only (fully owned) page with read and write access.
+     */
+    size_t currPage;
 
     /*
-     * The number of used bytes that are currently unprotected, but could be.
-     * This number starts at |-offsetToPage|, since any bytes before
-     * |vector.begin() + offsetToPage| can never be protected (as we do not own
-     * the whole page). As a result, if |unprotectedBytes >= pageSize|, we know
-     * we can protect at least one more page, and |unprotectedBytes & ~pageMask|
-     * is always the number of additional bytes we can protect. Put another way,
-     * |offsetToPage + protectedBytes + unprotectedBytes == [size in bytes]|
-     * always holds, and if |protectedBytes != 0| then |unprotectedBytes >= 0|.
+     * The first fully owned page. This is the first page that can
+     * be protected, but it may not be the first *active* page.
      */
-    intptr_t unprotectedBytes;
+    size_t initPage;
 
     /*
-     * The number of unprotected, unused pages. Note that this value
-     * may not be up to date if unused page protection is disabled.
+     * The last fully owned page. This is the last page that can
+     * be protected, but it may not be the last *active* page.
      */
-    intptr_t unprotectedUnusedPages;
+    size_t lastPage;
 
     /*
-     * The size in bytes that a buffer needs to be before its pages will be
+     * The size in elems that a buffer needs to be before its pages will be
      * protected. This is intended to reduce churn for small vectors while
      * still offering protection when they grow large enough.
      */
-    size_t protectionLowerBound;
+    size_t lowerBound;
 
+#ifdef DEBUG
+    bool regionUnprotected;
+#endif
+
+    bool usable;
+    bool enabled;
     bool protectUsedEnabled;
     bool protectUnusedEnabled;
-    bool regionUnprotected;
-    bool protectionDisabled;
+
+    bool reentrancyGuardEnabled;
+    mutable mozilla::Atomic<bool, mozilla::ReleaseAcquire> reentrancyGuard;
 
-    void updateProtectUsedOffsets() {
-        MOZ_ASSERT(!protectedBytes);
-        unprotectedBytes += offsetToPage;
-        offsetToPage = (pageSize - (uintptr_t(vector.begin()) & pageMask)) & pageMask;
-        unprotectedBytes -= offsetToPage;
-        protectUsedEnabled = ProtectUsed && !protectionDisabled &&
-                             vector.capacity() * sizeof(T) >= protectionLowerBound &&
-                             vector.capacity() * sizeof(T) >= pageSize + offsetToPage;
+    MOZ_ALWAYS_INLINE void resetTest() {
+        MOZ_ASSERT(protectUsedEnabled || protectUnusedEnabled);
+        size_t nextPage = (pageSize - (uintptr_t(begin() + length()) & pageMask)) >> elemShift;
+        size_t nextResize = capacity() - length();
+        if (MOZ_LIKELY(nextPage <= nextResize))
+            elemsUntilTest = intptr_t(nextPage);
+        else
+            elemsUntilTest = intptr_t(nextResize);
     }
 
-    void updateProtectUnusedOffsets() {
-        MOZ_ASSERT(!protectedUnusedBytes);
-        firstUnusedPage = ((vector.length() * sizeof(T) - offsetToPage - 1) | pageMask) +
-                          offsetToPage + 1;
-        if (MOZ_LIKELY(vector.capacity() * sizeof(T) >= firstUnusedPage))
-            unprotectedUnusedPages = (vector.capacity() * sizeof(T) - firstUnusedPage) / pageSize;
+    MOZ_ALWAYS_INLINE void setTestInitial() {
+        if (MOZ_LIKELY(!protectUsedEnabled && !protectUnusedEnabled))
+            elemsUntilTest = intptr_t(capacity() - length());
         else
-            unprotectedUnusedPages = 0;
-        protectUnusedEnabled = ProtectUnused && !protectionDisabled &&
-                               vector.capacity() * sizeof(T) >= protectionLowerBound &&
-                               vector.capacity() * sizeof(T) >= pageSize + offsetToPage;
+            resetTest();
+    }
+
+    MOZ_ALWAYS_INLINE void resetForNewBuffer() {
+        initPage = (uintptr_t(begin() - 1) >> pageShift) + 1;
+        currPage = (uintptr_t(begin() + length()) >> pageShift);
+        lastPage = (uintptr_t(begin() + capacity()) >> pageShift) - 1;
+        protectUsedEnabled = ProtectUsed && usable && enabled && initPage <= lastPage &&
+                             (uintptr_t(begin()) & elemMask) == 0 && capacity() >= lowerBound;
+        protectUnusedEnabled = ProtectUnused && usable && enabled && initPage <= lastPage &&
+                               (uintptr_t(begin()) & elemMask) == 0 && capacity() >= lowerBound;
+        reentrancyGuardEnabled = GuardAgainstReentrancy && enabled && initPage <= lastPage &&
+                                 capacity() >= lowerBound;
+        setTestInitial();
+    }
+
+    MOZ_ALWAYS_INLINE void addExceptionHandler() {
+        if (MOZ_UNLIKELY(protectUsedEnabled || protectUnusedEnabled))
+            MemoryProtectionExceptionHandler::addRegion(begin(), capacity() << elemShift);
     }
 
-    void updateProtectionOffsets() {
-        updateProtectUsedOffsets();
-        updateProtectUnusedOffsets();
+    MOZ_ALWAYS_INLINE void removeExceptionHandler() {
+        if (MOZ_UNLIKELY(protectUsedEnabled || protectUnusedEnabled))
+            MemoryProtectionExceptionHandler::removeRegion(begin());
     }
 
-    void protect() {
-        MOZ_ASSERT(!regionUnprotected);
-        if (MOZ_UNLIKELY(protectUsedEnabled && unprotectedBytes >= intptr_t(pageSize))) {
-            size_t toProtect = size_t(unprotectedBytes) & ~pageMask;
-            uintptr_t addr = uintptr_t(vector.begin()) + offsetToPage + protectedBytes;
-            gc::MakePagesReadOnly(reinterpret_cast<void*>(addr), toProtect);
-            unprotectedBytes -= toProtect;
-            protectedBytes += toProtect;
-        }
+    MOZ_ALWAYS_INLINE void protectUsed() {
+        if (MOZ_LIKELY(!protectUsedEnabled))
+            return;
+        if (MOZ_UNLIKELY(currPage <= initPage))
+            return;
+        T* addr = reinterpret_cast<T*>(initPage << pageShift);
+        size_t size = (currPage - initPage) << pageShift;
+        gc::MakePagesReadOnly(addr, size);
+    }
+
+    MOZ_ALWAYS_INLINE void unprotectUsed() {
+        if (MOZ_LIKELY(!protectUsedEnabled))
+            return;
+        if (MOZ_UNLIKELY(currPage <= initPage))
+            return;
+        T* addr = reinterpret_cast<T*>(initPage << pageShift);
+        size_t size = (currPage - initPage) << pageShift;
+        gc::UnprotectPages(addr, size);
     }
 
-    void protectUnused() {
-        MOZ_ASSERT(!protectedUnusedBytes);
-        if (protectUnusedEnabled && unprotectedUnusedPages) {
-            size_t toProtect = unprotectedUnusedPages * pageSize;
-            uintptr_t addr = uintptr_t(vector.begin()) + firstUnusedPage;
-            gc::ProtectPages(reinterpret_cast<void*>(addr), toProtect);
-            unprotectedUnusedPages = 0;
-            protectedUnusedBytes = toProtect;
-        }
+    MOZ_ALWAYS_INLINE void protectUnused() {
+        if (MOZ_LIKELY(!protectUnusedEnabled))
+            return;
+        if (MOZ_UNLIKELY(currPage >= lastPage))
+            return;
+        T* addr = reinterpret_cast<T*>((currPage + 1) << pageShift);
+        size_t size = (lastPage - currPage) << pageShift;
+        gc::ProtectPages(addr, size);
     }
 
-    void protectNewBuffer() {
-        updateProtectionOffsets();
-        if (protectUsedEnabled || protectUnusedEnabled)
-            MemoryProtectionExceptionHandler::addRegion(vector.begin(),
-                                                        vector.capacity() * sizeof(T));
-        protect();
+    MOZ_ALWAYS_INLINE void unprotectUnused() {
+        if (MOZ_LIKELY(!protectUnusedEnabled))
+            return;
+        if (MOZ_UNLIKELY(currPage >= lastPage))
+            return;
+        T* addr = reinterpret_cast<T*>((currPage + 1) << pageShift);
+        size_t size = (lastPage - currPage) << pageShift;
+        gc::UnprotectPages(addr, size);
+    }
+
+    MOZ_ALWAYS_INLINE void protectNewBuffer() {
+        resetForNewBuffer();
+        addExceptionHandler();
+        protectUsed();
         protectUnused();
     }
 
-    void unprotect() {
+    MOZ_ALWAYS_INLINE void unprotectOldBuffer() {
         MOZ_ASSERT(!regionUnprotected);
-        MOZ_ASSERT_IF(!protectUsedEnabled, !protectedBytes);
-        if (protectedBytes) {
-            uintptr_t addr = uintptr_t(vector.begin()) + offsetToPage;
-            gc::UnprotectPages(reinterpret_cast<void*>(addr), protectedBytes);
-            unprotectedBytes += protectedBytes;
-            protectedBytes = 0;
-        }
+        unprotectUnused();
+        unprotectUsed();
+        removeExceptionHandler();
+    }
+
+    MOZ_ALWAYS_INLINE void protectUnusedPartial(size_t curr, size_t next) {
+        if (MOZ_LIKELY(!protectUnusedEnabled))
+            return;
+        if (MOZ_UNLIKELY(next > lastPage))
+            --next;
+        if (MOZ_UNLIKELY(next == curr))
+            return;
+        void* addr = reinterpret_cast<T*>((curr + 1) << pageShift);
+        size_t size = (next - curr) << pageShift;
+        gc::ProtectPages(addr, size);
     }
 
-    void unprotectUnused(size_t newSize) {
-        MOZ_ASSERT_IF(!protectUnusedEnabled, !protectedUnusedBytes);
-        if (MOZ_UNLIKELY(protectedUnusedBytes && newSize > firstUnusedPage)) {
-            size_t toUnprotect = ((newSize - firstUnusedPage) + pageMask) & ~pageMask;
-            if (toUnprotect > protectedUnusedBytes)
-                toUnprotect = protectedUnusedBytes;
-            uintptr_t addr = uintptr_t(vector.begin()) + firstUnusedPage;
-            gc::UnprotectPages(reinterpret_cast<void*>(addr), toUnprotect);
-            firstUnusedPage += toUnprotect;
-            protectedUnusedBytes -= toUnprotect;
-        }
+    MOZ_ALWAYS_INLINE void unprotectUnusedPartial(size_t curr, size_t next) {
+        if (MOZ_LIKELY(!protectUnusedEnabled))
+            return;
+        if (MOZ_UNLIKELY(next > lastPage))
+            --next;
+        if (MOZ_UNLIKELY(next == curr))
+            return;
+        void* addr = reinterpret_cast<T*>((curr + 1) << pageShift);
+        size_t size = (next - curr) << pageShift;
+        gc::UnprotectPages(addr, size);
     }
 
-    void unprotectOldBuffer() {
-        unprotect();
-        unprotectUnused(vector.capacity() * sizeof(T));
-        if (protectUsedEnabled || protectUnusedEnabled)
-            MemoryProtectionExceptionHandler::removeRegion(vector.begin());
+    MOZ_ALWAYS_INLINE void protectUsedPartial(size_t curr, size_t next) {
+        if (MOZ_LIKELY(!protectUsedEnabled))
+            return;
+        if (MOZ_UNLIKELY(curr < initPage))
+            ++curr;
+        if (MOZ_UNLIKELY(next == curr))
+            return;
+        void* addr = reinterpret_cast<T*>(curr << pageShift);
+        size_t size = (next - curr) << pageShift;
+        gc::MakePagesReadOnly(addr, size);
     }
 
-    bool anyProtected(size_t first, size_t last) {
-        return last >= offsetToPage && first < offsetToPage + protectedBytes;
+    MOZ_ALWAYS_INLINE MOZ_MUST_USE bool reserveNewBuffer(size_t size) {
+        unprotectOldBuffer();
+        bool ret = vector.reserve(size);
+        protectNewBuffer();
+        return ret;
+    }
+
+    template<typename U>
+    MOZ_ALWAYS_INLINE void infallibleAppendNewPage(const U* values, size_t size) {
+        size_t nextPage = uintptr_t(begin() + length() + size) >> pageShift;
+        MOZ_ASSERT(currPage < nextPage);
+        unprotectUnusedPartial(currPage, nextPage);
+        vector.infallibleAppend(values, size);
+        protectUsedPartial(currPage, nextPage);
+        currPage = nextPage;
+        resetTest();
     }
 
-    void setContainingRegion(size_t first, size_t last, uintptr_t* addr, size_t* size) {
-        if (first < offsetToPage)
-            first = offsetToPage;
-        if (last > offsetToPage + protectedBytes - 1)
-            last = offsetToPage + protectedBytes - 1;
-        uintptr_t firstAddr = uintptr_t(vector.begin());
-        uintptr_t firstPage = (firstAddr + first) & ~pageMask;
-        uintptr_t lastPage = (firstAddr + last) & ~pageMask;
-        *size = pageSize + (lastPage - firstPage);
-        *addr = firstPage;
+    template<typename U>
+    MOZ_ALWAYS_INLINE MOZ_MUST_USE bool appendNewPage(const U* values, size_t size) {
+        size_t nextPage = uintptr_t(begin() + length() + size) >> pageShift;
+        MOZ_ASSERT(currPage < nextPage);
+        unprotectUnusedPartial(currPage, nextPage);
+        bool ret = vector.append(values, size);
+        if (MOZ_LIKELY(ret)) {
+            protectUsedPartial(currPage, nextPage);
+            currPage = nextPage;
+        } else {
+            protectUnusedPartial(currPage, nextPage);
+        }
+        resetTest();
+        return ret;
     }
 
-    void protectAfterUsing(size_t size) {
-        unprotectedBytes += size * sizeof(T);
-        protect();
-    }
-
-    void unprotectBeforeUsing(size_t size) {
-        MOZ_ASSERT(vector.length() + size <= vector.capacity());
-        unprotectUnused((vector.length() + size) * sizeof(T));
+    template<typename U>
+    MOZ_ALWAYS_INLINE MOZ_MUST_USE bool appendNewBuffer(const U* values, size_t size) {
+        unprotectOldBuffer();
+        bool ret = vector.append(values, size);
+        protectNewBuffer();
+        return ret;
     }
 
-    /* A helper class to simplify unprotecting and reprotecting when needed. */
-    class AutoUnprotect
+    MOZ_NEVER_INLINE void unprotectRegionSlow(uintptr_t l, uintptr_t r);
+    MOZ_NEVER_INLINE void reprotectRegionSlow(uintptr_t l, uintptr_t r);
+
+    MOZ_NEVER_INLINE MOZ_MUST_USE bool reserveSlow(size_t size);
+
+    template<typename U>
+    MOZ_NEVER_INLINE void infallibleAppendSlow(const U* values, size_t size);
+
+    template<typename U>
+    MOZ_NEVER_INLINE MOZ_MUST_USE bool appendSlow(const U* values, size_t size);
+
+    MOZ_ALWAYS_INLINE void lock() const {
+        if (MOZ_LIKELY(!GuardAgainstReentrancy || !reentrancyGuardEnabled))
+            return;
+        if (MOZ_UNLIKELY(!reentrancyGuard.compareExchange(false, true)))
+            lockSlow();
+    }
+
+    MOZ_ALWAYS_INLINE void unlock() const {
+        if (!GuardAgainstReentrancy)
+            return;
+        reentrancyGuard = false;
+    }
+
+    MOZ_NEVER_INLINE void lockSlow() const;
+
+    /* A helper class to guard against concurrent access. */
+    class AutoGuardAgainstReentrancy
     {
-        PageProtectingVector* vector;
+        PageProtectingVector& vector;
 
       public:
-        AutoUnprotect() : vector(nullptr) {};
-
-        void emplace(PageProtectingVector* holder) {
-            vector = holder;
-            vector->unprotectOldBuffer();
+        MOZ_ALWAYS_INLINE explicit AutoGuardAgainstReentrancy(PageProtectingVector& holder)
+          : vector(holder)
+        {
+            vector.lock();
         }
 
-        explicit AutoUnprotect(PageProtectingVector* holder) {
-            emplace(holder);
-        }
-
-        ~AutoUnprotect() {
-            if (vector)
-                vector->protectNewBuffer();
+        MOZ_ALWAYS_INLINE ~AutoGuardAgainstReentrancy() {
+            vector.unlock();
         }
     };
 
+    MOZ_ALWAYS_INLINE T* begin() { return vector.begin(); }
+    MOZ_ALWAYS_INLINE const T* begin() const { return vector.begin(); }
+
   public:
     explicit PageProtectingVector(AllocPolicy policy = AllocPolicy())
       : vector(policy),
-        pageSize(gc::SystemPageSize()),
-        pageMask(pageSize - 1),
-        offsetToPage(0),
-        firstUnusedPage(0),
-        protectedBytes(0),
-        protectedUnusedBytes(0),
-        unprotectedBytes(0),
-        unprotectedUnusedPages(0),
-        protectionLowerBound(InitialLowerBound),
+        elemsUntilTest(0),
+        currPage(0),
+        initPage(0),
+        lastPage(0),
+        lowerBound(InitialLowerBound),
+#ifdef DEBUG
+        regionUnprotected(false),
+#endif
+        usable(true),
+        enabled(true),
         protectUsedEnabled(false),
         protectUnusedEnabled(false),
-        regionUnprotected(false),
-        protectionDisabled(false) { protectNewBuffer(); }
+        reentrancyGuardEnabled(false),
+        reentrancyGuard(false)
+    {
+        if (gc::SystemPageSize() != pageSize)
+            usable = false;
+        protectNewBuffer();
+    }
 
     ~PageProtectingVector() { unprotectOldBuffer(); }
 
     void disableProtection() {
-        MOZ_ASSERT(!protectionDisabled);
+        MOZ_ASSERT(enabled);
         unprotectOldBuffer();
-        protectionDisabled = true;
-        updateProtectionOffsets();
+        enabled = false;
+        resetForNewBuffer();
     }
 
     void enableProtection() {
-        MOZ_ASSERT(protectionDisabled);
-        protectionDisabled = false;
+        MOZ_ASSERT(!enabled);
+        enabled = true;
         protectNewBuffer();
     }
 
     /*
-     * Sets the lower bound on the size, in bytes, that this vector's underlying
+     * Sets the lower bound on the size, in elems, that this vector's underlying
      * capacity has to be before its used pages will be protected.
      */
-    void setLowerBoundForProtection(size_t bytes) {
-        if (protectionLowerBound != bytes) {
+    void setLowerBoundForProtection(size_t elems) {
+        if (lowerBound != elems) {
             unprotectOldBuffer();
-            protectionLowerBound = bytes;
+            lowerBound = elems;
             protectNewBuffer();
         }
     }
 
-    /*
-     * Disable protection on the smallest number of pages containing
-     * both |firstByteOffset| and |lastByteOffset|.
-     */
-    void unprotectRegion(size_t firstByteOffset, size_t lastByteOffset) {
-        MOZ_ASSERT(!regionUnprotected);
+    /* Disable protection on the smallest containing region. */
+    MOZ_ALWAYS_INLINE void unprotectRegion(T* first, size_t size) {
+#ifdef DEBUG
         regionUnprotected = true;
-        if (!protectedBytes || !anyProtected(firstByteOffset, lastByteOffset))
-            return;
-        size_t size;
-        uintptr_t addr;
-        setContainingRegion(firstByteOffset, lastByteOffset, &addr, &size);
-        gc::UnprotectPages(reinterpret_cast<void*>(addr), size);
+#endif
+        if (MOZ_UNLIKELY(protectUsedEnabled)) {
+            uintptr_t l = uintptr_t(first) >> pageShift;
+            uintptr_t r = uintptr_t(first + size - 1) >> pageShift;
+            if (r >= initPage && l < currPage)
+                unprotectRegionSlow(l, r);
+        }
+    }
+
+    /* Re-enable protection on the smallest containing region. */
+    MOZ_ALWAYS_INLINE void reprotectRegion(T* first, size_t size) {
+#ifdef DEBUG
+        regionUnprotected = false;
+#endif
+        if (MOZ_UNLIKELY(protectUsedEnabled)) {
+            uintptr_t l = uintptr_t(first) >> pageShift;
+            uintptr_t r = uintptr_t(first + size - 1) >> pageShift;
+            if (r >= initPage && l < currPage)
+                reprotectRegionSlow(l, r);
+        }
     }
 
-    /*
-     * Re-enable protection on the region containing
-     * |firstByteOffset| and |lastByteOffset|.
-     */
-    void reprotectRegion(size_t firstByteOffset, size_t lastByteOffset) {
-        MOZ_ASSERT(regionUnprotected);
-        regionUnprotected = false;
-        if (!protectedBytes || !anyProtected(firstByteOffset, lastByteOffset))
-            return;
-        size_t size;
-        uintptr_t addr;
-        setContainingRegion(firstByteOffset, lastByteOffset, &addr, &size);
-        gc::MakePagesReadOnly(reinterpret_cast<void*>(addr), size);
+    MOZ_ALWAYS_INLINE size_t capacity() const { return vector.capacity(); }
+    MOZ_ALWAYS_INLINE size_t length() const { return vector.length(); }
+
+    MOZ_ALWAYS_INLINE T* acquire() {
+        lock();
+        return begin();
+    }
+
+    MOZ_ALWAYS_INLINE const T* acquire() const {
+        lock();
+        return begin();
     }
 
-    size_t length() const { return vector.length(); }
-
-    T* begin() { return vector.begin(); }
-    const T* begin() const { return vector.begin(); }
+    MOZ_ALWAYS_INLINE void release() const {
+        unlock();
+    }
 
     void clear() {
-        AutoUnprotect guard(this);
+        AutoGuardAgainstReentrancy guard(*this);
+        unprotectOldBuffer();
         vector.clear();
-        offsetToPage = 0;
-        unprotectedBytes = 0;
+        protectNewBuffer();
     }
 
-    MOZ_MUST_USE bool reserve(size_t size) {
-        AutoUnprotect guard;
-        if (size > vector.capacity())
-            guard.emplace(this);
-        return vector.reserve(size);
+    MOZ_ALWAYS_INLINE MOZ_MUST_USE bool reserve(size_t size) {
+        AutoGuardAgainstReentrancy guard(*this);
+        if (MOZ_LIKELY(size <= capacity()))
+            return vector.reserve(size);
+        return reserveSlow(size);
     }
 
     template<typename U>
     MOZ_ALWAYS_INLINE void infallibleAppend(const U* values, size_t size) {
-        unprotectBeforeUsing(size);
-        vector.infallibleAppend(values, size);
-        protectAfterUsing(size);
+        AutoGuardAgainstReentrancy guard(*this);
+        elemsUntilTest -= size;
+        if (MOZ_LIKELY(elemsUntilTest >= 0))
+            return vector.infallibleAppend(values, size);
+        infallibleAppendSlow(values, size);
     }
 
     template<typename U>
-    MOZ_MUST_USE bool append(const U* values, size_t size) {
-        bool ret;
-        {
-            AutoUnprotect guard;
-            if (MOZ_UNLIKELY(vector.length() + size > vector.capacity()))
-                guard.emplace(this);
-            else
-                unprotectBeforeUsing(size);
-            ret = vector.append(values, size);
-        }
-        if (ret)
-            protectAfterUsing(size);
-        return ret;
+    MOZ_ALWAYS_INLINE MOZ_MUST_USE bool append(const U* values, size_t size) {
+        AutoGuardAgainstReentrancy guard(*this);
+        elemsUntilTest -= size;
+        if (MOZ_LIKELY(elemsUntilTest >= 0))
+            return vector.append(values, size);
+        return appendSlow(values, size);
     }
 };
 
+template<typename T, size_t N, class AP, bool P, bool Q, bool G, size_t I>
+MOZ_NEVER_INLINE void
+PageProtectingVector<T, N, AP, P, Q, G, I>::unprotectRegionSlow(uintptr_t l, uintptr_t r)
+{
+    if (l < initPage)
+        l = initPage;
+    if (r >= currPage)
+        r = currPage - 1;
+    T* addr = reinterpret_cast<T*>(l << pageShift);
+    size_t size = (r - l + 1) << pageShift;
+    gc::UnprotectPages(addr, size);
+}
+
+template<typename T, size_t N, class AP, bool P, bool Q, bool G, size_t I>
+MOZ_NEVER_INLINE void
+PageProtectingVector<T, N, AP, P, Q, G, I>::reprotectRegionSlow(uintptr_t l, uintptr_t r)
+{
+    if (l < initPage)
+        l = initPage;
+    if (r >= currPage)
+        r = currPage - 1;
+    T* addr = reinterpret_cast<T*>(l << pageShift);
+    size_t size = (r - l + 1) << pageShift;
+    gc::MakePagesReadOnly(addr, size);
+}
+
+template<typename T, size_t N, class AP, bool P, bool Q, bool G, size_t I>
+MOZ_NEVER_INLINE MOZ_MUST_USE bool
+PageProtectingVector<T, N, AP, P, Q, G, I>::reserveSlow(size_t size)
+{
+    return reserveNewBuffer(size);
+}
+
+template<typename T, size_t N, class AP, bool P, bool Q, bool G, size_t I>
+template<typename U>
+MOZ_NEVER_INLINE void
+PageProtectingVector<T, N, AP, P, Q, G, I>::infallibleAppendSlow(const U* values, size_t size)
+{
+    // Ensure that we're here because we reached a page
+    // boundary and not because of a buffer overflow.
+    MOZ_RELEASE_ASSERT(MOZ_LIKELY(length() + size <= capacity()),
+                       "About to overflow our AssemblerBuffer using infallibleAppend!");
+    infallibleAppendNewPage(values, size);
+}
+
+template<typename T, size_t N, class AP, bool P, bool Q, bool G, size_t I>
+template<typename U>
+MOZ_NEVER_INLINE MOZ_MUST_USE bool
+PageProtectingVector<T, N, AP, P, Q, G, I>::appendSlow(const U* values, size_t size)
+{
+    if (MOZ_LIKELY(length() + size <= capacity()))
+        return appendNewPage(values, size);
+    return appendNewBuffer(values, size);
+}
+
+template<typename T, size_t N, class AP, bool P, bool Q, bool G, size_t I>
+MOZ_NEVER_INLINE void
+PageProtectingVector<T, N, AP, P, Q, G, I>::lockSlow() const
+{
+    MOZ_CRASH("Cannot access PageProtectingVector from more than one thread at a time!");
+}
+
 } /* namespace js */
 
 #endif /* ds_PageProtectingVector_h */
--- a/js/src/jit/CacheIR.cpp
+++ b/js/src/jit/CacheIR.cpp
@@ -123,29 +123,33 @@ GetPropIRGenerator::tryAttachStub()
                 return true;
             if (tryAttachProxy(obj, objId, id))
                 return true;
             return false;
         }
 
         MOZ_ASSERT(cacheKind_ == CacheKind::GetElem);
 
+        if (tryAttachProxyElement(obj, objId))
+            return true;
+
         uint32_t index;
         Int32OperandId indexId;
         if (maybeGuardInt32Index(idVal_, getElemKeyValueId(), &index, &indexId)) {
             if (tryAttachTypedElement(obj, objId, index, indexId))
                 return true;
             if (tryAttachDenseElement(obj, objId, index, indexId))
                 return true;
             if (tryAttachDenseElementHole(obj, objId, index, indexId))
                 return true;
             if (tryAttachUnboxedArrayElement(obj, objId, index, indexId))
                 return true;
             if (tryAttachArgumentsObjectArg(obj, objId, index, indexId))
                 return true;
+            return false;
         }
 
         return false;
     }
 
     if (nameOrSymbol) {
         if (tryAttachPrimitive(valId, id))
             return true;
@@ -1114,16 +1118,35 @@ GetPropIRGenerator::tryAttachTypedElemen
     // later, so ensure we monitor the result.
     if (TypedThingElementType(obj) == Scalar::Type::Uint32)
         writer.typeMonitorResult();
     else
         writer.returnFromIC();
     return true;
 }
 
+bool
+GetPropIRGenerator::tryAttachProxyElement(HandleObject obj, ObjOperandId objId)
+{
+    if (!obj->is<ProxyObject>())
+        return false;
+
+    writer.guardIsProxy(objId);
+
+    // We are not guarding against DOM proxies here, because there is no other
+    // specialized DOM IC we could attach.
+    // We could call maybeEmitIdGuard here and then emit CallProxyGetResult,
+    // but for GetElem we prefer to attach a stub that can handle any Value
+    // so we don't attach a new stub for every id.
+    MOZ_ASSERT(cacheKind_ == CacheKind::GetElem);
+    writer.callProxyGetByValueResult(objId, getElemKeyValueId());
+    writer.typeMonitorResult();
+    return true;
+}
+
 void
 GetPropIRGenerator::maybeEmitIdGuard(jsid id)
 {
     if (cacheKind_ == CacheKind::GetProp) {
         // Constant PropertyName, no guards necessary.
         MOZ_ASSERT(&idVal_.toString()->asAtom() == JSID_TO_ATOM(id));
         return;
     }
--- a/js/src/jit/CacheIR.h
+++ b/js/src/jit/CacheIR.h
@@ -760,16 +760,18 @@ class MOZ_RAII GetPropIRGenerator : publ
                                uint32_t index, Int32OperandId indexId);
     bool tryAttachDenseElementHole(HandleObject obj, ObjOperandId objId,
                                    uint32_t index, Int32OperandId indexId);
     bool tryAttachUnboxedArrayElement(HandleObject obj, ObjOperandId objId,
                                       uint32_t index, Int32OperandId indexId);
     bool tryAttachTypedElement(HandleObject obj, ObjOperandId objId,
                                uint32_t index, Int32OperandId indexId);
 
+    bool tryAttachProxyElement(HandleObject obj, ObjOperandId objId);
+
     ValOperandId getElemKeyValueId() const {
         MOZ_ASSERT(cacheKind_ == CacheKind::GetElem);
         return ValOperandId(1);
     }
 
     // No pc if idempotent, as there can be multiple bytecode locations
     // due to GVN.
     bool idempotent() const { return pc_ == nullptr; }
--- a/js/src/jit/MacroAssembler.h
+++ b/js/src/jit/MacroAssembler.h
@@ -368,16 +368,19 @@ class MacroAssembler : public MacroAssem
 
 #if defined(JS_CODEGEN_ARM)
         initWithAllocator();
         m_buffer.id = 0;
 #elif defined(JS_CODEGEN_ARM64)
         initWithAllocator();
         armbuffer_.id = 0;
 #endif
+
+        // Disable page protection for WASM.
+        disableProtection();
     }
 
     void constructRoot(JSContext* cx) {
         autoRooter_.emplace(cx, this);
     }
 
     MoveResolver& moveResolver() {
         return moveResolver_;
--- a/js/src/jit/arm/Assembler-arm.h
+++ b/js/src/jit/arm/Assembler-arm.h
@@ -1390,16 +1390,22 @@ class Assembler : public AssemblerShared
     static const uint32_t* GetCF32Target(Iter* iter);
 
     static uintptr_t GetPointer(uint8_t*);
     template <class Iter>
     static const uint32_t* GetPtr32Target(Iter* iter, Register* dest = nullptr, RelocStyle* rs = nullptr);
 
     bool oom() const;
 
+    void disableProtection() {}
+    void enableProtection() {}
+    void setLowerBoundForProtection(size_t) {}
+    void unprotectRegion(unsigned char*, size_t) {}
+    void reprotectRegion(unsigned char*, size_t) {}
+
     void setPrinter(Sprinter* sp) {
 #ifdef JS_DISASM_ARM
         printer_ = sp;
 #endif
     }
 
     static const Register getStackPointer() {
         return StackPointer;
--- a/js/src/jit/arm64/Assembler-arm64.h
+++ b/js/src/jit/arm64/Assembler-arm64.h
@@ -218,16 +218,22 @@ class Assembler : public vixl::Assembler
     bool oom() const {
         return AssemblerShared::oom() ||
             armbuffer_.oom() ||
             jumpRelocations_.oom() ||
             dataRelocations_.oom() ||
             preBarriers_.oom();
     }
 
+    void disableProtection() {}
+    void enableProtection() {}
+    void setLowerBoundForProtection(size_t) {}
+    void unprotectRegion(unsigned char*, size_t) {}
+    void reprotectRegion(unsigned char*, size_t) {}
+
     void copyJumpRelocationTable(uint8_t* dest) const {
         if (jumpRelocations_.length())
             memcpy(dest, jumpRelocations_.buffer(), jumpRelocations_.length());
     }
     void copyDataRelocationTable(uint8_t* dest) const {
         if (dataRelocations_.length())
             memcpy(dest, dataRelocations_.buffer(), dataRelocations_.length());
     }
--- a/js/src/jit/mips-shared/Assembler-mips-shared.h
+++ b/js/src/jit/mips-shared/Assembler-mips-shared.h
@@ -905,16 +905,22 @@ class AssemblerMIPSShared : public Assem
     }
     void writePrebarrierOffset(CodeOffset label) {
         preBarriers_.writeUnsigned(label.offset());
     }
 
   public:
     bool oom() const;
 
+    void disableProtection() {}
+    void enableProtection() {}
+    void setLowerBoundForProtection(size_t) {}
+    void unprotectRegion(unsigned char*, size_t) {}
+    void reprotectRegion(unsigned char*, size_t) {}
+
     void setPrinter(Sprinter* sp) {
     }
 
     static const Register getStackPointer() {
         return StackPointer;
     }
 
   protected:
--- a/js/src/jit/none/MacroAssembler-none.h
+++ b/js/src/jit/none/MacroAssembler-none.h
@@ -417,16 +417,22 @@ class MacroAssemblerNone : public Assemb
     Operand ToPayload(Operand base) { MOZ_CRASH(); }
 
     static const Register getStackPointer() { MOZ_CRASH(); }
 
     // Instrumentation for entering and leaving the profiler.
     void profilerEnterFrame(Register , Register ) { MOZ_CRASH(); }
     void profilerExitFrame() { MOZ_CRASH(); }
 
+    void disableProtection() { MOZ_CRASH(); }
+    void enableProtection() { MOZ_CRASH(); }
+    void setLowerBoundForProtection(size_t) { MOZ_CRASH(); }
+    void unprotectRegion(unsigned char*, size_t) { MOZ_CRASH(); }
+    void reprotectRegion(unsigned char*, size_t) { MOZ_CRASH(); }
+
 #ifdef JS_NUNBOX32
     Address ToPayload(Address) { MOZ_CRASH(); }
     Address ToType(Address) { MOZ_CRASH(); }
 #endif
 };
 
 typedef MacroAssemblerNone MacroAssemblerSpecific;
 
--- a/js/src/jit/x64/Assembler-x64.h
+++ b/js/src/jit/x64/Assembler-x64.h
@@ -357,17 +357,19 @@ class Assembler : public AssemblerX86Sha
         return CodeOffset(masm.currentOffset());
     }
     CodeOffset movWithPatch(ImmPtr imm, Register dest) {
         return movWithPatch(ImmWord(uintptr_t(imm.value)), dest);
     }
 
     // This is for patching during code generation, not after.
     void patchAddq(CodeOffset offset, int32_t n) {
-        X86Encoding::SetInt32(masm.data() + offset.offset(), n);
+        unsigned char* code = masm.acquireData();
+        X86Encoding::SetInt32(code + offset.offset(), n);
+        masm.releaseData();
     }
 
     // Load an ImmWord value into a register. Note that this instruction will
     // attempt to optimize its immediate field size. When a full 64-bit
     // immediate is needed for a relocation, use movWithPatch.
     void movq(ImmWord word, Register dest) {
         // Load a 64-bit immediate into a register. If the value falls into
         // certain ranges, we can use specialized instructions which have
--- a/js/src/jit/x86-shared/Assembler-x86-shared.cpp
+++ b/js/src/jit/x86-shared/Assembler-x86-shared.cpp
@@ -92,17 +92,19 @@ AssemblerX86Shared::trace(JSTracer* trc)
         if (rp.kind == Relocation::JITCODE) {
             JitCode* code = JitCode::FromExecutable((uint8_t*)rp.target);
             TraceManuallyBarrieredEdge(trc, &code, "masmrel32");
             MOZ_ASSERT(code == JitCode::FromExecutable((uint8_t*)rp.target));
         }
     }
     if (dataRelocations_.length()) {
         CompactBufferReader reader(dataRelocations_);
-        ::TraceDataRelocations(trc, masm.data(), reader);
+        unsigned char* code = masm.acquireData();
+        ::TraceDataRelocations(trc, code, reader);
+        masm.releaseData();
     }
 }
 
 void
 AssemblerX86Shared::executableCopy(void* buffer)
 {
     masm.executableCopy(buffer);
 
@@ -256,17 +258,19 @@ AssemblerX86Shared::InvertCondition(Doub
 
 void
 AssemblerX86Shared::verifyHeapAccessDisassembly(uint32_t begin, uint32_t end,
                                                 const Disassembler::HeapAccess& heapAccess)
 {
 #ifdef DEBUG
     if (masm.oom())
         return;
-    Disassembler::VerifyHeapAccess(masm.data() + begin, masm.data() + end, heapAccess);
+    unsigned char* code = masm.acquireData();
+    Disassembler::VerifyHeapAccess(code + begin, code + end, heapAccess);
+    masm.releaseData();
 #endif
 }
 
 CPUInfo::SSEVersion CPUInfo::maxSSEVersion = UnknownSSE;
 CPUInfo::SSEVersion CPUInfo::maxEnabledSSEVersion = UnknownSSE;
 bool CPUInfo::avxPresent = false;
 bool CPUInfo::avxEnabled = false;
 bool CPUInfo::popcntPresent = false;
--- a/js/src/jit/x86-shared/Assembler-x86-shared.h
+++ b/js/src/jit/x86-shared/Assembler-x86-shared.h
@@ -404,16 +404,28 @@ class AssemblerX86Shared : public Assemb
     bool oom() const {
         return AssemblerShared::oom() ||
                masm.oom() ||
                jumpRelocations_.oom() ||
                dataRelocations_.oom() ||
                preBarriers_.oom();
     }
 
+    void disableProtection() { masm.disableProtection(); }
+    void enableProtection() { masm.enableProtection(); }
+    void setLowerBoundForProtection(size_t size) {
+        masm.setLowerBoundForProtection(size);
+    }
+    void unprotectRegion(unsigned char* first, size_t size) {
+        masm.unprotectRegion(first, size);
+    }
+    void reprotectRegion(unsigned char* first, size_t size) {
+        masm.reprotectRegion(first, size);
+    }
+
     void setPrinter(Sprinter* sp) {
         masm.setPrinter(sp);
     }
 
     static const Register getStackPointer() {
         return StackPointer;
     }
 
@@ -1056,33 +1068,37 @@ class AssemblerX86Shared : public Assemb
         }
     }
 
     CodeOffset callWithPatch() {
         return CodeOffset(masm.call().offset());
     }
 
     void patchCall(uint32_t callerOffset, uint32_t calleeOffset) {
-        unsigned char* code = masm.data();
+        unsigned char* code = masm.acquireData();
         X86Encoding::SetRel32(code + callerOffset, code + calleeOffset);
+        masm.releaseData();
     }
     CodeOffset farJumpWithPatch() {
         return CodeOffset(masm.jmp().offset());
     }
     void patchFarJump(CodeOffset farJump, uint32_t targetOffset) {
-        unsigned char* code = masm.data();
+        unsigned char* code = masm.acquireData();
         X86Encoding::SetRel32(code + farJump.offset(), code + targetOffset);
+        masm.releaseData();
     }
     static void repatchFarJump(uint8_t* code, uint32_t farJumpOffset, uint32_t targetOffset) {
         X86Encoding::SetRel32(code + farJumpOffset, code + targetOffset);
     }
 
     // This is for patching during code generation, not after.
     void patchAddl(CodeOffset offset, int32_t n) {
-        X86Encoding::SetInt32(masm.data() + offset.offset(), n);
+        unsigned char* code = masm.acquireData();
+        X86Encoding::SetInt32(code + offset.offset(), n);
+        masm.releaseData();
     }
 
     CodeOffset twoByteNop() {
         return CodeOffset(masm.twoByteNop().offset());
     }
     static void patchTwoByteNopToJump(uint8_t* jump, uint8_t* target) {
         X86Encoding::BaseAssembler::patchTwoByteNopToJump(jump, target);
     }
--- a/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.h
+++ b/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.h
@@ -111,35 +111,64 @@ namespace jit {
         {
             if (MOZ_UNLIKELY(!m_buffer.append(values, size))) {
                 oomDetected();
                 return false;
             }
             return true;
         }
 
-        unsigned char* data()
-        {
-            return m_buffer.begin();
-        }
-
         size_t size() const
         {
             return m_buffer.length();
         }
 
         bool oom() const
         {
             return m_oom;
         }
 
-        const unsigned char* buffer() const {
-            MOZ_ASSERT(!m_oom);
+#ifndef RELEASE_OR_BETA
+        const unsigned char* acquireBuffer() const
+        {
+            MOZ_RELEASE_ASSERT(!m_oom);
+            return m_buffer.acquire();
+        }
+        void releaseBuffer() const { m_buffer.release(); }
+        unsigned char* acquireData() { return m_buffer.acquire(); }
+        void releaseData() const { m_buffer.release(); }
+        void disableProtection() { m_buffer.disableProtection(); }
+        void enableProtection() { m_buffer.enableProtection(); }
+        void setLowerBoundForProtection(size_t size)
+        {
+            m_buffer.setLowerBoundForProtection(size);
+        }
+        void unprotectRegion(unsigned char* first, size_t size)
+        {
+            m_buffer.unprotectRegion(first, size);
+        }
+        void reprotectRegion(unsigned char* first, size_t size)
+        {
+            m_buffer.reprotectRegion(first, size);
+        }
+#else
+        const unsigned char* acquireBuffer() const
+        {
+            MOZ_RELEASE_ASSERT(!m_oom);
             return m_buffer.begin();
         }
+        void releaseBuffer() const {}
+        unsigned char* acquireData() { return m_buffer.begin(); }
+        void releaseData() const {}
+        void disableProtection() {}
+        void enableProtection() {}
+        void setLowerBoundForProtection(size_t) {}
+        void unprotectRegion(unsigned char*, size_t) {}
+        void reprotectRegion(unsigned char*, size_t) {}
+#endif
 
     protected:
         /*
          * OOM handling: This class can OOM in the ensureSpace() method trying
          * to allocate a new buffer. In response to an OOM, we need to avoid
          * crashing and report the error. We also want to make it so that
          * users of this class need to check for OOM only at certain points
          * and not after every operation.
@@ -153,17 +182,18 @@ namespace jit {
          */
         void oomDetected() {
             m_oom = true;
             m_buffer.clear();
         }
 
 #ifndef RELEASE_OR_BETA
         PageProtectingVector<unsigned char, 256, SystemAllocPolicy,
-                             /* ProtectUsed = */ false, /* ProtectUnused = */ true,
+                             /* ProtectUsed = */ false, /* ProtectUnused = */ false,
+                             /* GuardAgainstReentrancy = */ true,
                              /* InitialLowerBound = */ 32 * 1024> m_buffer;
 #else
         mozilla::Vector<unsigned char, 256, SystemAllocPolicy> m_buffer;
 #endif
         bool m_oom;
     };
 
     class GenericAssembler
--- a/js/src/jit/x86-shared/BaseAssembler-x86-shared.h
+++ b/js/src/jit/x86-shared/BaseAssembler-x86-shared.h
@@ -49,20 +49,37 @@ class BaseAssembler : public GenericAsse
 public:
     BaseAssembler()
       : useVEX_(true)
     { }
 
     void disableVEX() { useVEX_ = false; }
 
     size_t size() const { return m_formatter.size(); }
-    const unsigned char* buffer() const { return m_formatter.buffer(); }
-    unsigned char* data() { return m_formatter.data(); }
+    const unsigned char* acquireBuffer() const { return m_formatter.acquireBuffer(); }
+    void releaseBuffer() const { m_formatter.releaseBuffer(); }
+    unsigned char* acquireData() { return m_formatter.acquireData(); }
+    void releaseData() const { m_formatter.releaseData(); }
     bool oom() const { return m_formatter.oom(); }
 
+    void disableProtection() { m_formatter.disableProtection(); }
+    void enableProtection() { m_formatter.enableProtection(); }
+    void setLowerBoundForProtection(size_t size)
+    {
+        m_formatter.setLowerBoundForProtection(size);
+    }
+    void unprotectRegion(unsigned char* first, size_t size)
+    {
+        m_formatter.unprotectRegion(first, size);
+    }
+    void reprotectRegion(unsigned char* first, size_t size)
+    {
+        m_formatter.reprotectRegion(first, size);
+    }
+
     void nop()
     {
         spew("nop");
         m_formatter.oneByteOp(OP_NOP);
     }
 
     void comment(const char* msg)
     {
@@ -3758,18 +3775,19 @@ threeByteOpImmSimd("vblendps", VEX_PD, O
     {
         // Sanity check - if the assembler has OOM'd, it will start overwriting
         // its internal buffer and thus our links could be garbage.
         if (oom())
             return false;
 
         assertValidJmpSrc(from);
 
-        const unsigned char* code = m_formatter.data();
+        const unsigned char* code = m_formatter.acquireData();
         int32_t offset = GetInt32(code + from.offset());
+        m_formatter.releaseData();
         if (offset == -1)
             return false;
 
         if (MOZ_UNLIKELY(size_t(offset) >= size())) {
 #ifdef NIGHTLY_BUILD
             // Stash some data on the stack so we can retrieve it from minidumps,
             // see bug 1124397.
             int32_t startOffset = from.offset() - 1;
@@ -3802,45 +3820,52 @@ threeByteOpImmSimd("vblendps", VEX_PD, O
         // Sanity check - if the assembler has OOM'd, it will start overwriting
         // its internal buffer and thus our links could be garbage.
         if (oom())
             return;
 
         assertValidJmpSrc(from);
         MOZ_RELEASE_ASSERT(to.offset() == -1 || size_t(to.offset()) <= size());
 
-        unsigned char* code = m_formatter.data();
+        unsigned char* code = m_formatter.acquireData();
         SetInt32(code + from.offset(), to.offset());
+        m_formatter.releaseData();
     }
 
     void linkJump(JmpSrc from, JmpDst to)
     {
         MOZ_ASSERT(from.offset() != -1);
         MOZ_ASSERT(to.offset() != -1);
 
         // Sanity check - if the assembler has OOM'd, it will start overwriting
         // its internal buffer and thus our links could be garbage.
         if (oom())
             return;
 
         assertValidJmpSrc(from);
         MOZ_RELEASE_ASSERT(size_t(to.offset()) <= size());
 
         spew(".set .Lfrom%d, .Llabel%d", from.offset(), to.offset());
-        unsigned char* code = m_formatter.data();
+        unsigned char* code = m_formatter.acquireData();
         SetRel32(code + from.offset(), code + to.offset());
-    }
-
-    void executableCopy(void* buffer)
-    {
-        memcpy(buffer, m_formatter.buffer(), size());
+        m_formatter.releaseData();
+    }
+
+    void executableCopy(void* dst)
+    {
+        const unsigned char* src = m_formatter.acquireBuffer();
+        memcpy(dst, src, size());
+        m_formatter.releaseBuffer();
     }
     MOZ_MUST_USE bool appendBuffer(const BaseAssembler& other)
     {
-        return m_formatter.append(other.m_formatter.buffer(), other.size());
+        const unsigned char* buf = other.m_formatter.acquireBuffer();
+        bool ret = m_formatter.append(buf, other.size());
+        other.m_formatter.releaseBuffer();
+        return ret;
     }
 
   protected:
     static bool CAN_SIGN_EXTEND_8_32(int32_t value) { return value == (int32_t)(int8_t)value; }
     static bool CAN_SIGN_EXTEND_16_32(int32_t value) { return value == (int32_t)(int16_t)value; }
     static bool CAN_ZERO_EXTEND_8_32(int32_t value) { return value == (int32_t)(uint8_t)value; }
     static bool CAN_ZERO_EXTEND_8H_32(int32_t value) { return value == (value & 0xff00); }
     static bool CAN_ZERO_EXTEND_16_32(int32_t value) { return value == (int32_t)(uint16_t)value; }
@@ -5094,20 +5119,37 @@ threeByteOpImmSimd("vblendps", VEX_PD, O
         {
             m_buffer.ensureSpace(sizeof(int32_t));
             m_buffer.putIntUnchecked(i);
         }
 
         // Administrative methods:
 
         size_t size() const { return m_buffer.size(); }
-        const unsigned char* buffer() const { return m_buffer.buffer(); }
+        const unsigned char* acquireBuffer() const { return m_buffer.acquireBuffer(); }
+        void releaseBuffer() const { m_buffer.releaseBuffer(); }
+        unsigned char* acquireData() { return m_buffer.acquireData(); }
+        void releaseData() const { m_buffer.releaseData(); }
         bool oom() const { return m_buffer.oom(); }
         bool isAligned(int alignment) const { return m_buffer.isAligned(alignment); }
-        unsigned char* data() { return m_buffer.data(); }
+
+        void disableProtection() { m_buffer.disableProtection(); }
+        void enableProtection() { m_buffer.enableProtection(); }
+        void setLowerBoundForProtection(size_t size)
+        {
+            m_buffer.setLowerBoundForProtection(size);
+        }
+        void unprotectRegion(unsigned char* first, size_t size)
+        {
+            m_buffer.unprotectRegion(first, size);
+        }
+        void reprotectRegion(unsigned char* first, size_t size)
+        {
+            m_buffer.reprotectRegion(first, size);
+        }
 
         MOZ_MUST_USE bool append(const unsigned char* values, size_t size)
         {
             return m_buffer.append(values, size);
         }
 
     private:
 
--- a/layout/printing/nsPagePrintTimer.cpp
+++ b/layout/printing/nsPagePrintTimer.cpp
@@ -81,35 +81,37 @@ nsPagePrintTimer::Run()
   bool initNewTimer = true;
   // Check to see if we are done
   // inRange will be true if a page is actually printed
   bool inRange;
   bool donePrinting;
 
   // donePrinting will be true if it completed successfully or
   // if the printing was cancelled
-  donePrinting = mPrintEngine->PrintPage(mPrintObj, inRange);
+  donePrinting = !mPrintEngine || mPrintEngine->PrintPage(mPrintObj, inRange);
   if (donePrinting) {
     // now clean up print or print the next webshell
-    if (mPrintEngine->DonePrintingPages(mPrintObj, NS_OK)) {
+    if (!mPrintEngine || mPrintEngine->DonePrintingPages(mPrintObj, NS_OK)) {
       initNewTimer = false;
       mDone = true;
     }
   }
 
   // Note that the Stop() destroys this after the print job finishes
   // (The PrintEngine stops holding a reference when DonePrintingPages
   // returns true.)
   Stop(); 
   if (initNewTimer) {
     ++mFiringCount;
     nsresult result = StartTimer(inRange);
     if (NS_FAILED(result)) {
       mDone = true;     // had a failure.. we are finished..
-      mPrintEngine->SetIsPrinting(false);
+      if (mPrintEngine) {
+        mPrintEngine->SetIsPrinting(false);
+      }
     }
   }
   return NS_OK;
 }
 
 // nsITimerCallback
 NS_IMETHODIMP
 nsPagePrintTimer::Notify(nsITimer *timer)
@@ -144,17 +146,20 @@ nsPagePrintTimer::Notify(nsITimer *timer
     mWatchDogCount++;
     if (mWatchDogCount > WATCH_DOG_MAX_COUNT) {
       Fail();
       return NS_OK;
     }
   }
 
   if (mDocViewerPrint) {
-    bool donePrePrint = mPrintEngine->PrePrintPage();
+    bool donePrePrint = true;
+    if (mPrintEngine) {
+      donePrePrint = mPrintEngine->PrePrintPage();
+    }
 
     if (donePrePrint && !mWaitingForRemotePrint) {
       StopWatchDogTimer();
       NS_DispatchToMainThread(this);
     } else {
       // Start the watch dog if we're waiting for preprint to ensure that if any
       // mozPrintCallbacks take to long we error out.
       StartWatchDogTimer();
--- a/layout/printing/nsPagePrintTimer.h
+++ b/layout/printing/nsPagePrintTimer.h
@@ -45,16 +45,18 @@ public:
 
   NS_IMETHOD Run() override;
 
   void Stop();
 
   void WaitForRemotePrint();
   void RemotePrintFinished();
 
+  void Disconnect() { mPrintEngine = nullptr; }
+
 private:
   ~nsPagePrintTimer();
 
   nsresult StartTimer(bool aUseDelay);
   nsresult StartWatchDogTimer();
   void     StopWatchDogTimer();
   void     Fail();
 
--- a/layout/printing/nsPrintEngine.cpp
+++ b/layout/printing/nsPrintEngine.cpp
@@ -212,72 +212,54 @@ NS_IMPL_ISUPPORTS(nsPrintEngine, nsIWebP
 //-- nsPrintEngine Class Impl
 //---------------------------------------------------
 nsPrintEngine::nsPrintEngine() :
   mIsCreatingPrintPreview(false),
   mIsDoingPrinting(false),
   mIsDoingPrintPreview(false),
   mProgressDialogIsShown(false),
   mScreenDPI(115.0f),
-  mPrt(nullptr),
   mPagePrintTimer(nullptr),
   mPageSeqFrame(nullptr),
-  mPrtPreview(nullptr),
-  mOldPrtPreview(nullptr),
   mDebugFile(nullptr),
   mLoadCounter(0),
   mDidLoadDataForPrinting(false),
   mIsDestroying(false),
   mDisallowSelectionPrint(false)
 {
 }
 
 //-------------------------------------------------------
 nsPrintEngine::~nsPrintEngine()
 {
   Destroy(); // for insurance
+  DisconnectPagePrintTimer();
 }
 
 //-------------------------------------------------------
 void nsPrintEngine::Destroy()
 {
   if (mIsDestroying) {
     return;
   }
   mIsDestroying = true;
 
-  if (mPrt) {
-    delete mPrt;
-    mPrt = nullptr;
-  }
+  mPrt = nullptr;
 
 #ifdef NS_PRINT_PREVIEW
-  if (mPrtPreview) {
-    delete mPrtPreview;
-    mPrtPreview = nullptr;
-  }
-
-  // This is insruance
-  if (mOldPrtPreview) {
-    delete mOldPrtPreview;
-    mOldPrtPreview = nullptr;
-  }
-
+  mPrtPreview = nullptr;
+  mOldPrtPreview = nullptr;
 #endif
   mDocViewerPrint = nullptr;
 }
 
 //-------------------------------------------------------
 void nsPrintEngine::DestroyPrintingData()
 {
-  if (mPrt) {
-    nsPrintData* data = mPrt;
-    mPrt = nullptr;
-    delete data;
-  }
+  mPrt = nullptr;
 }
 
 //---------------------------------------------------------------------------------
 //-- Section: Methods needed by the DocViewer
 //---------------------------------------------------------------------------------
 
 //--------------------------------------------------------
 nsresult nsPrintEngine::Initialize(nsIDocumentViewerPrint* aDocViewerPrint, 
@@ -410,17 +392,16 @@ nsPrintEngine::CommonPrint(bool         
     } else {
       SetIsPrinting(false);
     }
     if (mProgressDialogIsShown)
       CloseProgressDialog(aWebProgressListener);
     if (rv != NS_ERROR_ABORT && rv != NS_ERROR_OUT_OF_MEMORY) {
       FirePrintingErrorEvent(rv);
     }
-    delete mPrt;
     mPrt = nullptr;
   }
 
   return rv;
 }
 
 nsresult
 nsPrintEngine::DoCommonPrint(bool                    aIsPrintPreview,
@@ -432,25 +413,25 @@ nsPrintEngine::DoCommonPrint(bool       
 
   if (aIsPrintPreview) {
     // The WebProgressListener can be QI'ed to nsIPrintingPromptService
     // then that means the progress dialog is already being shown.
     nsCOMPtr<nsIPrintingPromptService> pps(do_QueryInterface(aWebProgressListener));
     mProgressDialogIsShown = pps != nullptr;
 
     if (mIsDoingPrintPreview) {
-      mOldPrtPreview = mPrtPreview;
-      mPrtPreview = nullptr;
+      mOldPrtPreview = Move(mPrtPreview);
     }
   } else {
     mProgressDialogIsShown = false;
   }
 
-  mPrt = new nsPrintData(aIsPrintPreview ? nsPrintData::eIsPrintPreview :
-                                           nsPrintData::eIsPrinting);
+  mPrt = mozilla::MakeUnique<nsPrintData>(aIsPrintPreview
+                                          ? nsPrintData::eIsPrintPreview
+                                          : nsPrintData::eIsPrinting);
   NS_ENSURE_TRUE(mPrt, NS_ERROR_OUT_OF_MEMORY);
 
   // if they don't pass in a PrintSettings, then get the Global PS
   mPrt->mPrintSettings = aPrintSettings;
   if (!mPrt->mPrintSettings) {
     rv = GetGlobalPrintSettings(getter_AddRefs(mPrt->mPrintSettings));
     NS_ENSURE_SUCCESS(rv, rv);
   }
@@ -873,19 +854,19 @@ nsPrintEngine::GetPrintPreviewNumPages(i
 
   nsPrintData* prt = nullptr;
   nsIFrame* seqFrame  = nullptr;
   *aPrintPreviewNumPages = 0;
 
   // When calling this function, the FinishPrintPreview() function might not
   // been called as there are still some 
   if (mPrtPreview) {
-    prt = mPrtPreview;
+    prt = mPrtPreview.get();
   } else {
-    prt = mPrt;
+    prt = mPrt.get();
   }
   if ((!prt) ||
       NS_FAILED(GetSeqFrameAndCountPagesInternal(prt->mPrintObject, seqFrame, *aPrintPreviewNumPages))) {
     return NS_ERROR_FAILURE;
   }
   return NS_OK;
 }
 
@@ -1503,17 +1484,17 @@ nsresult nsPrintEngine::DocumentReadyFor
  */
 nsresult nsPrintEngine::CleanupOnFailure(nsresult aResult, bool aIsPrinting)
 {
   PR_PL(("****  Failed %s - rv 0x%X", aIsPrinting?"Printing":"Print Preview", aResult));
 
   /* cleanup... */
   if (mPagePrintTimer) {
     mPagePrintTimer->Stop();
-    NS_RELEASE(mPagePrintTimer);
+    DisconnectPagePrintTimer();
   }
   
   if (aIsPrinting) {
     SetIsPrinting(false);
   } else {
     SetIsPrintPreview(false);
     SetIsCreatingPrintPreview(false);
   }
@@ -3070,17 +3051,17 @@ nsPrintEngine::DonePrintingPages(nsPrint
     FirePrintCompletionEvent();
   }
 
   TurnScriptingOn(true);
   SetIsPrinting(false);
 
   // Release reference to mPagePrintTimer; the timer object destroys itself
   // after this returns true
-  NS_IF_RELEASE(mPagePrintTimer);
+  DisconnectPagePrintTimer();
 
   return true;
 }
 
 //-------------------------------------------------------
 // Recursively sets the PO items to be printed "As Is"
 // from the given item down into the tree
 void
@@ -3354,20 +3335,20 @@ nsPrintEngine::TurnScriptingOn(bool aDoT
 {
   if (mIsDoingPrinting && aDoTurnOn && mDocViewerPrint &&
       mDocViewerPrint->GetIsPrintPreview()) {
     // We don't want to turn scripting on if print preview is shown still after
     // printing.
     return;
   }
 
-  nsPrintData* prt = mPrt;
+  nsPrintData* prt = mPrt.get();
 #ifdef NS_PRINT_PREVIEW
   if (!prt) {
-    prt = mPrtPreview;
+    prt = mPrtPreview.get();
   }
 #endif
   if (!prt) {
     return;
   }
 
   NS_ASSERTION(mDocument, "We MUST have a document.");
   // First, get the script global object from the document...
@@ -3460,27 +3441,25 @@ nsPrintEngine::FinishPrintPreview()
     return rv;
   }
 
   // At this point we are done preparing everything
   // before it is to be created
 
 
   if (mIsDoingPrintPreview && mOldPrtPreview) {
-    delete mOldPrtPreview;
     mOldPrtPreview = nullptr;
   }
 
 
   mPrt->OnEndPrinting();
 
   // PrintPreview was built using the mPrt (code reuse)
   // then we assign it over
-  mPrtPreview = mPrt;
-  mPrt        = nullptr;
+  mPrtPreview = Move(mPrt);
 
 #endif // NS_PRINT_PREVIEW
 
   return NS_OK;
 }
 
 //-----------------------------------------------------------------
 //-- Done: Finishing up or Cleaning up
@@ -3555,16 +3534,25 @@ private:
 void
 nsPrintEngine::FirePrintCompletionEvent()
 {
   nsCOMPtr<nsIRunnable> event = new nsPrintCompletionEvent(mDocViewerPrint);
   if (NS_FAILED(NS_DispatchToCurrentThread(event)))
     NS_WARNING("failed to dispatch print completion event");
 }
 
+void
+nsPrintEngine::DisconnectPagePrintTimer()
+{
+  if (mPagePrintTimer) {
+    mPagePrintTimer->Disconnect();
+    NS_RELEASE(mPagePrintTimer);
+  }
+}
+
 //---------------------------------------------------------------
 //---------------------------------------------------------------
 //-- Debug helper routines
 //---------------------------------------------------------------
 //---------------------------------------------------------------
 #if defined(XP_WIN) && defined(EXTENDED_DEBUG_PRINTING)
 #include "windows.h"
 #include "process.h"
--- a/layout/printing/nsPrintEngine.h
+++ b/layout/printing/nsPrintEngine.h
@@ -1,23 +1,23 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsPrintEngine_h___
 #define nsPrintEngine_h___
 
 #include "mozilla/Attributes.h"
+#include "mozilla/UniquePtr.h"
 
 #include "nsCOMPtr.h"
 
 #include "nsPrintObject.h"
 #include "nsPrintData.h"
 #include "nsFrameList.h"
-#include "mozilla/Attributes.h"
 #include "nsIWebProgress.h"
 #include "mozilla/dom/HTMLCanvasElement.h"
 #include "nsIWebProgressListener.h"
 #include "nsWeakReference.h"
 
 // Interfaces
 #include "nsIObserver.h"
 
@@ -243,33 +243,35 @@ protected:
                                            nsRect&               aEndRect);
 
   static void MapContentForPO(nsPrintObject* aPO, nsIContent* aContent);
 
   static void MapContentToWebShells(nsPrintObject* aRootPO, nsPrintObject* aPO);
 
   static void SetPrintAsIs(nsPrintObject* aPO, bool aAsIs = true);
 
+  void DisconnectPagePrintTimer();
+
   // Static member variables
   bool mIsCreatingPrintPreview;
   bool mIsDoingPrinting;
   bool mIsDoingPrintPreview; // per DocumentViewer
   bool mProgressDialogIsShown;
 
   nsCOMPtr<nsIDocumentViewerPrint> mDocViewerPrint;
   nsWeakPtr               mContainer;
   float                   mScreenDPI;
   
-  nsPrintData*            mPrt;
+  mozilla::UniquePtr<nsPrintData> mPrt;
   nsPagePrintTimer*       mPagePrintTimer;
   nsIPageSequenceFrame*   mPageSeqFrame;
 
   // Print Preview
-  nsPrintData*            mPrtPreview;
-  nsPrintData*            mOldPrtPreview;
+  mozilla::UniquePtr<nsPrintData> mPrtPreview;
+  mozilla::UniquePtr<nsPrintData> mOldPrtPreview;
 
   nsCOMPtr<nsIDocument>   mDocument;
 
   FILE* mDebugFile;
 
   int32_t mLoadCounter;
   bool mDidLoadDataForPrinting;
   bool mIsDestroying;
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -1050,20 +1050,26 @@ Gecko_LoadStyleSheet(css::Loader* aLoade
                                  aMediaStringLength);
     nsCSSParser mediumParser(aLoader);
     mediumParser.ParseMediaList(
         NS_ConvertUTF8toUTF16(medium), nullptr, 0, media);
   }
 
   nsDependentCSubstring urlSpec(reinterpret_cast<const char*>(aURLString),
                                 aURLStringLength);
+  nsCOMPtr<nsIURI> uri;
+  nsresult rv = NS_NewURI(getter_AddRefs(uri), urlSpec);
 
-  // Servo's loader guarantees that the URL is valid.
-  nsCOMPtr<nsIURI> uri;
-  MOZ_ALWAYS_SUCCEEDS(NS_NewURI(getter_AddRefs(uri), urlSpec));
+  if (NS_FAILED(rv)) {
+    // Servo and Gecko have different ideas of what a valid URL is, so we might
+    // get in here with a URL string that NS_NewURI can't handle.  If so,
+    // silently do nothing.  Eventually we should be able to assert that the
+    // NS_NewURI succeeds, here.
+    return;
+  }
 
   aLoader->LoadChildSheet(aParent, uri, media, nullptr, aImportRule, nullptr);
 }
 
 NS_IMPL_THREADSAFE_FFI_REFCOUNTING(nsCSSValueSharedList, CSSValueSharedList);
 
 #define STYLE_STRUCT(name, checkdata_cb)                                      \
                                                                               \
--- a/layout/style/res/html.css
+++ b/layout/style/res/html.css
@@ -800,16 +800,37 @@ details[open] > summary:-moz-native-anon
   list-style-type: disclosure-open;
 }
 
 details > summary:first-of-type > *|* {
   /* Cancel "list-style-position: inside" inherited from summary. */
   list-style-position: initial;
 }
 
+/* <dialog> element styles */
+
+dialog {
+  position: absolute;
+  offset-inline-start: 0;
+  offset-inline-end: 0;
+  color: black;
+  margin: auto;
+  border-width: initial;
+  border-style: solid;
+  border-color: initial;
+  border-image: initial;
+  padding: 1em;
+  background: white;
+  width: -moz-fit-content;
+}
+
+dialog:not([open]) {
+  display: none;
+}
+
 /* emulation of non-standard HTML <marquee> tag */
 marquee {
   inline-size: -moz-available;
   display: inline-block;
   vertical-align: text-bottom;
   text-align: start;
   -moz-binding: url('chrome://xbl-marquee/content/xbl-marquee.xml#marquee-horizontal');
 }
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5421,16 +5421,19 @@ pref("narrate.filter-voices", true);
 // Whether to allow, on a Linux system that doesn't support the necessary sandboxing
 // features, loading Gecko Media Plugins unsandboxed.  However, EME CDMs will not be
 // loaded without sandboxing even if this pref is changed.
 pref("media.gmp.insecure.allow", false);
 #endif
 
 pref("dom.audiochannel.mutedByDefault", false);
 
+// HTML <dialog> element
+pref("dom.dialog_element.enabled", false);
+
 // Secure Element API
 #ifdef MOZ_SECUREELEMENT
 pref("dom.secureelement.enabled", false);
 #endif
 
 // Allow control characters appear in composition string.
 // When this is false, control characters except
 // CHARACTER TABULATION (horizontal tab) are removed from
@@ -5552,10 +5555,9 @@ pref("dom.storageManager.enabled", false
 // a single web page in a row, all following authentication dialogs will
 // be blocked (automatically canceled) for that page. The counter resets
 // when the page is reloaded. To turn this feature off, just set the limit to 0.
 pref("prompts.authentication_dialog_abuse_limit", 3);
 
 // Enable the Storage management in about:preferences and persistent-storage permission request
 // To enable the DOM implementation, turn on "dom.storageManager.enabled"
 pref("browser.storageManager.enabled", false);
-
 pref("dom.IntersectionObserver.enabled", false);
--- a/netwerk/base/LoadContextInfo.cpp
+++ b/netwerk/base/LoadContextInfo.cpp
@@ -132,18 +132,17 @@ GetLoadContextInfo(nsIChannel * aChannel
 
   return new LoadContextInfo(anon, oa);
 }
 
 LoadContextInfo *
 GetLoadContextInfo(nsILoadContext *aLoadContext, bool aIsAnonymous)
 {
   if (!aLoadContext) {
-    return new LoadContextInfo(aIsAnonymous,
-                               NeckoOriginAttributes(nsILoadContextInfo::NO_APP_ID, false));
+    return new LoadContextInfo(aIsAnonymous, NeckoOriginAttributes(false));
   }
 
   DebugOnly<bool> pb = aLoadContext->UsePrivateBrowsing();
   DocShellOriginAttributes doa;
   aLoadContext->GetOriginAttributes(doa);
   MOZ_ASSERT(pb == (doa.mPrivateBrowsingId > 0));
 
   NeckoOriginAttributes noa;
--- a/netwerk/base/nsNetUtil.h
+++ b/netwerk/base/nsNetUtil.h
@@ -667,18 +667,22 @@ bool NS_GetOriginAttributes(nsIChannel *
  * URLs that it was redirected through.
  */
 bool NS_HasBeenCrossOrigin(nsIChannel* aChannel, bool aReport = false);
 
 // Constants duplicated from nsIScriptSecurityManager so we avoid having necko
 // know about script security manager.
 #define NECKO_NO_APP_ID 0
 #define NECKO_UNKNOWN_APP_ID UINT32_MAX
-// special app id reserved for separating the safebrowsing cookie
-#define NECKO_SAFEBROWSING_APP_ID UINT32_MAX - 1
+
+// Unique first-party domain for separating the safebrowsing cookie.
+// Note if this value is changed, code in test_cookiejars_safebrowsing.js
+// should also be changed.
+#define NECKO_SAFEBROWSING_FIRST_PARTY_DOMAIN \
+  "safebrowsing.86868755-6b82-4842-b301-72671a0db32e.mozilla"
 
 /**
  * Determines whether appcache should be checked for a given URI.
  */
 bool NS_ShouldCheckAppCache(nsIURI *aURI, bool usePrivateBrowsing);
 
 bool NS_ShouldCheckAppCache(nsIPrincipal *aPrincipal, bool usePrivateBrowsing);
 
--- a/netwerk/cache2/CacheFileUtils.cpp
+++ b/netwerk/cache2/CacheFileUtils.cpp
@@ -30,17 +30,17 @@ namespace {
  * A simple recursive descent parser for the mapping key.
  */
 class KeyParser : protected Tokenizer
 {
 public:
   explicit KeyParser(nsACString const& aInput)
     : Tokenizer(aInput)
     // Initialize attributes to their default values
-    , originAttribs(0, false)
+    , originAttribs(false)
     , isAnonymous(false)
     // Initialize the cache key to a zero length by default
     , lastTag(0)
   {
   }
 
 private:
   // Results
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -829,26 +829,24 @@ class ConvertAppIdToOriginAttrsSQLFuncti
 
 NS_IMPL_ISUPPORTS(ConvertAppIdToOriginAttrsSQLFunction, mozIStorageFunction);
 
 NS_IMETHODIMP
 ConvertAppIdToOriginAttrsSQLFunction::OnFunctionCall(
   mozIStorageValueArray* aFunctionArguments, nsIVariant** aResult)
 {
   nsresult rv;
-  int32_t appId, inIsolatedMozBrowser;
-
-  rv = aFunctionArguments->GetInt32(0, &appId);
-  NS_ENSURE_SUCCESS(rv, rv);
+  int32_t inIsolatedMozBrowser;
+
   rv = aFunctionArguments->GetInt32(1, &inIsolatedMozBrowser);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  // Create an originAttributes object by appId and inIsolatedMozBrowser.
+  // Create an originAttributes object by inIsolatedMozBrowser.
   // Then create the originSuffix string from this object.
-  NeckoOriginAttributes attrs(appId, (inIsolatedMozBrowser ? 1 : 0));
+  NeckoOriginAttributes attrs((inIsolatedMozBrowser ? 1 : 0));
   nsAutoCString suffix;
   attrs.CreateSuffix(suffix);
 
   RefPtr<nsVariant> outVar(new nsVariant());
   rv = outVar->SetAsAUTF8String(suffix);
   NS_ENSURE_SUCCESS(rv, rv);
 
   outVar.forget(aResult);
--- a/netwerk/dns/nsDNSService2.cpp
+++ b/netwerk/dns/nsDNSService2.cpp
@@ -939,21 +939,27 @@ nsDNSService::Observe(nsISupports *subje
 {
     // We are only getting called if a preference has changed or there's a
     // network link event.
     NS_ASSERTION(strcmp(topic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) == 0 ||
                  strcmp(topic, "last-pb-context-exited") == 0 ||
                  strcmp(topic, NS_NETWORK_LINK_TOPIC) == 0,
                  "unexpected observe call");
 
+    bool flushCache = false;
     if (!strcmp(topic, NS_NETWORK_LINK_TOPIC)) {
         nsAutoCString converted = NS_ConvertUTF16toUTF8(data);
         if (mResolver && !strcmp(converted.get(), NS_NETWORK_LINK_DATA_CHANGED)) {
-            mResolver->FlushCache();
+            flushCache = true;
         }
+    } else if (!strcmp(topic, "last-pb-context-exited")) {
+        flushCache = true;
+    }
+    if (flushCache) {
+        mResolver->FlushCache();
         return NS_OK;
     }
 
     //
     // Shutdown and this function are both only called on the UI thread, so we don't
     // have to worry about mResolver being cleared out from under us.
     //
     // NOTE Shutting down and reinitializing the service like this is obviously
--- a/netwerk/protocol/http/Http2Session.cpp
+++ b/netwerk/protocol/http/Http2Session.cpp
@@ -1270,21 +1270,31 @@ Http2Session::RecvHeaders(Http2Session *
 
   // queue up any compression bytes
   self->mDecompressBuffer.Append(&self->mInputFrameBuffer[kFrameHeaderBytes + paddingControlBytes + priorityLen],
                                  self->mInputFrameDataSize - paddingControlBytes - priorityLen - paddingLength);
 
   self->mInputFrameDataStream->UpdateTransportReadEvents(self->mInputFrameDataSize);
   self->mLastDataReadEpoch = self->mLastReadEpoch;
 
+  if (!isContinuation) {
+    self->mAggregatedHeaderSize = self->mInputFrameDataSize - paddingControlBytes - priorityLen - paddingLength;
+  } else {
+    self->mAggregatedHeaderSize += self->mInputFrameDataSize - paddingControlBytes - priorityLen - paddingLength;
+  }
+
   if (!endHeadersFlag) { // more are coming - don't process yet
     self->ResetDownstreamState();
     return NS_OK;
   }
 
+  if (isContinuation) {
+    Telemetry::Accumulate(Telemetry::SPDY_CONTINUED_HEADERS, self->mAggregatedHeaderSize);
+  }
+
   rv = self->ResponseHeadersComplete();
   if (rv == NS_ERROR_ILLEGAL_VALUE) {
     LOG3(("Http2Session::RecvHeaders %p PROTOCOL_ERROR detected stream 0x%X\n",
           self, self->mInputFrameID));
     self->CleanupStream(self->mInputFrameDataStream, rv, PROTOCOL_ERROR);
     self->ResetDownstreamState();
     rv = NS_OK;
   } else if (NS_FAILED(rv)) {
@@ -1668,22 +1678,32 @@ Http2Session::RecvPushPromise(Http2Sessi
     }
     self->ResetDownstreamState();
     return NS_OK;
   }
 
   self->mDecompressBuffer.Append(&self->mInputFrameBuffer[kFrameHeaderBytes + paddingControlBytes + promiseLen],
                                  self->mInputFrameDataSize - paddingControlBytes - promiseLen - paddingLength);
 
+  if (self->mInputFrameType != FRAME_TYPE_CONTINUATION) {
+    self->mAggregatedHeaderSize = self->mInputFrameDataSize - paddingControlBytes - promiseLen - paddingLength;
+  } else {
+    self->mAggregatedHeaderSize += self->mInputFrameDataSize - paddingControlBytes - promiseLen - paddingLength;
+  }
+
   if (!(self->mInputFrameFlags & kFlag_END_PUSH_PROMISE)) {
     LOG3(("Http2Session::RecvPushPromise not finishing processing for multi-frame push\n"));
     self->ResetDownstreamState();
     return NS_OK;
   }
 
+  if (self->mInputFrameType == FRAME_TYPE_CONTINUATION) {
+    Telemetry::Accumulate(Telemetry::SPDY_CONTINUED_HEADERS, self->mAggregatedHeaderSize);
+  }
+
   // Create the buffering transaction and push stream
   RefPtr<Http2PushTransactionBuffer> transactionBuffer =
     new Http2PushTransactionBuffer();
   transactionBuffer->SetConnection(self);
   Http2PushedStream *pushedStream =
     new Http2PushedStream(transactionBuffer, self, associatedStream, promisedID);
 
   rv = pushedStream->ConvertPushHeaders(&self->mDecompressor,
--- a/netwerk/protocol/http/Http2Session.h
+++ b/netwerk/protocol/http/Http2Session.h
@@ -478,16 +478,19 @@ private:
   // used as a temporary buffer while enumerating the stream hash during GoAway
   nsDeque  mGoAwayStreamsToRestart;
 
   // Each session gets a unique serial number because the push cache is correlated
   // by the load group and the serial number can be used as part of the cache key
   // to make sure streams aren't shared across sessions.
   uint64_t        mSerial;
 
+  // Telemetry for continued headers (pushed and pulled) for quic design
+  uint32_t        mAggregatedHeaderSize;
+
   // If push is disabled, we want to be able to send PROTOCOL_ERRORs if we
   // receive a PUSH_PROMISE, but we have to wait for the SETTINGS ACK before
   // we can actually tell the other end to go away. These help us keep track
   // of that state so we can behave appropriately.
   bool mWaitingForSettingsAck;
   bool mGoAwayOnPush;
 
   bool mUseH2Deps;
--- a/netwerk/test/unit/test_cookiejars_safebrowsing.js
+++ b/netwerk/test/unit/test_cookiejars_safebrowsing.js
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Description of the test:
  *   We show that we can separate the safebrowsing cookie by creating a custom
- *   OriginAttributes using a reserved AppId (UINT_32_MAX - 1). Setting this
+ *   OriginAttributes using a unique safebrowsing first-party domain. Setting this
  *   custom OriginAttributes on the loadInfo of the channel allows us to query the
- *   AppId and therefore separate the safebrowing cookie in its own cookie-jar.
- *   For testing safebrowsing update we do >> NOT << emulate a response
+ *   first-party domain and therefore separate the safebrowing cookie in its own
+ *   cookie-jar. For testing safebrowsing update we do >> NOT << emulate a response
  *   in the body, rather we only set the cookies in the header of the response
  *   and confirm that cookies are separated in their own cookie-jar.
  *
  * 1) We init safebrowsing and simulate an update (cookies are set for localhost)
  *
  * 2) We open a channel that should send regular cookies, but not the
  *    safebrowsing cookie.
  *
@@ -143,17 +143,19 @@ add_test(function test_non_safebrowsing_
   }
 
   setNonSafeBrowsingCookie();
 });
 
 add_test(function test_safebrowsing_cookie() {
 
   var cookieName = 'sbCookie_id4294967294';
-  var originAttributes = new OriginAttributes(Ci.nsIScriptSecurityManager.SAFEBROWSING_APP_ID, false, 0);
+  var originAttributes = new OriginAttributes(0, false, 0);
+  originAttributes.firstPartyDomain =
+    "safebrowsing.86868755-6b82-4842-b301-72671a0db32e.mozilla";
 
   function setSafeBrowsingCookie() {
     var channel = setupChannel(setCookiePath, originAttributes);
     channel.setRequestHeader("set-cookie", cookieName, false);
     channel.asyncOpen2(new ChannelListener(checkSafeBrowsingCookie, null));
   }
 
   function checkSafeBrowsingCookie() {
--- a/parser/html/javasrc/ElementName.java
+++ b/parser/html/javasrc/ElementName.java
@@ -1,27 +1,27 @@
 /*
- * Copyright (c) 2008-2014 Mozilla Foundation
+ * Copyright (c) 2008-2016 Mozilla Foundation
  *
- * Permission is hereby granted, free of charge, to any person obtaining a 
- * copy of this software and associated documentation files (the "Software"), 
- * to deal in the Software without restriction, including without limitation 
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, 
- * and/or sell copies of the Software, and to permit persons to whom the 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
  *
- * The above copyright notice and this permission notice shall be included in 
+ * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
 
 package nu.validator.htmlparser.impl;
 
 import java.util.Arrays;
 
 import nu.validator.htmlparser.annotation.Inline;
@@ -36,17 +36,17 @@ public final class ElementName
 {
 
     /**
      * The mask for extracting the dispatch group.
      */
     public static final int GROUP_MASK = 127;
 
     /**
-     * Indicates that the element is not a pre-interned element. Forbidden 
+     * Indicates that the element is not a pre-interned element. Forbidden
      * on preinterned elements.
      */
     public static final int CUSTOM = (1 << 30);
 
     /**
      * Indicates that the element is in the "special" category. This bit
      * should not be pre-set on MathML or SVG specials--only on HTML specials.
      */
@@ -93,21 +93,21 @@ public final class ElementName
     /**
      * The lowest 7 bits are the dispatch group. The high bits are flags.
      */
     public final int flags;
 
     @Inline public int getFlags() {
         return flags;
     }
-    
+
     public int getGroup() {
         return flags & GROUP_MASK;
     }
-    
+
     public boolean isCustom() {
         return (flags & CUSTOM) != 0;
     }
 
     static ElementName elementNameByBuffer(@NoLength char[] buf, int offset, int length, Interner interner) {
         int hash = ElementName.bufToHash(buf, length);
         int index = Arrays.binarySearch(ElementName.ELEMENT_HASHES, hash);
         if (index < 0) {
@@ -121,17 +121,17 @@ public final class ElementName
             }
             return elementName;
         }
     }
 
     /**
      * This method has to return a unique integer for each well-known
      * lower-cased element name.
-     * 
+     *
      * @param buf
      * @param len
      * @return
      */
     private static int bufToHash(@NoLength char[] buf, int len) {
         int hash = len;
         hash <<= 5;
         hash += buf[0] - 0x60;
@@ -151,30 +151,30 @@ public final class ElementName
         this.flags = flags;
     }
 
     protected ElementName(@Local String name) {
         this.name = name;
         this.camelCaseName = name;
         this.flags = TreeBuilder.OTHER | CUSTOM;
     }
-    
+
     @Virtual void release() {
-        // No-op in Java. 
+        // No-op in Java.
         // Implement as delete this in subclass.
         // Be sure to release the local name
     }
-    
+
     @SuppressWarnings("unused") @Virtual private void destructor() {
     }
 
     @Virtual public ElementName cloneElementName(Interner interner) {
         return this;
     }
-    
+
     // START CODE ONLY USED FOR GENERATING CODE uncomment and run to regenerate
 
 //    /**
 //     * @see java.lang.Object#toString()
 //     */
 //    @Override public String toString() {
 //        return "(\"" + name + "\", \"" + camelCaseName + "\", " + decomposedFlags() + ")";
 //    }
@@ -347,18 +347,18 @@ public final class ElementName
 //            case TreeBuilder.IMG:
 //                return "IMG";
 //            case TreeBuilder.AREA_OR_WBR:
 //                return "AREA_OR_WBR";
 //            case TreeBuilder.DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU:
 //                return "DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU";
 //            case TreeBuilder.FIELDSET:
 //                return "FIELDSET";
-//            case TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY:
-//                return "ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY";
+//            case TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY:
+//                return "ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY";
 //            case TreeBuilder.RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR:
 //                return "RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR";
 //            case TreeBuilder.RB_OR_RTC:
 //                return "RB_OR_RTC";
 //            case TreeBuilder.RT_OR_RP:
 //                return "RT_OR_RP";
 //            case TreeBuilder.PARAM_OR_SOURCE_OR_TRACK:
 //                return "PARAM_OR_SOURCE_OR_TRACK";
@@ -461,17 +461,17 @@ public final class ElementName
     public static final ElementName BIG = new ElementName("big", "big", TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U);
     public static final ElementName BDO = new ElementName("bdo", "bdo", TreeBuilder.OTHER);
     public static final ElementName CSC = new ElementName("csc", "csc", TreeBuilder.OTHER);
     public static final ElementName COL = new ElementName("col", "col", TreeBuilder.COL | SPECIAL);
     public static final ElementName COS = new ElementName("cos", "cos", TreeBuilder.OTHER);
     public static final ElementName COT = new ElementName("cot", "cot", TreeBuilder.OTHER);
     public static final ElementName DEL = new ElementName("del", "del", TreeBuilder.OTHER);
     public static final ElementName DFN = new ElementName("dfn", "dfn", TreeBuilder.OTHER);
-    public static final ElementName DIR = new ElementName("dir", "dir", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
+    public static final ElementName DIR = new ElementName("dir", "dir", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
     public static final ElementName DIV = new ElementName("div", "div", TreeBuilder.DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU | SPECIAL);
     public static final ElementName EXP = new ElementName("exp", "exp", TreeBuilder.OTHER);
     public static final ElementName GCD = new ElementName("gcd", "gcd", TreeBuilder.OTHER);
     public static final ElementName GEQ = new ElementName("geq", "geq", TreeBuilder.OTHER);
     public static final ElementName IMG = new ElementName("img", "img", TreeBuilder.IMG | SPECIAL);
     public static final ElementName INS = new ElementName("ins", "ins", TreeBuilder.OTHER);
     public static final ElementName INT = new ElementName("int", "int", TreeBuilder.OTHER);
     public static final ElementName KBD = new ElementName("kbd", "kbd", TreeBuilder.OTHER);
@@ -480,17 +480,17 @@ public final class ElementName
     public static final ElementName LEQ = new ElementName("leq", "leq", TreeBuilder.OTHER);
     public static final ElementName MTD = new ElementName("mtd", "mtd", TreeBuilder.OTHER);
     public static final ElementName MIN = new ElementName("min", "min", TreeBuilder.OTHER);
     public static final ElementName MAP = new ElementName("map", "map", TreeBuilder.OTHER);
     public static final ElementName MTR = new ElementName("mtr", "mtr", TreeBuilder.OTHER);
     public static final ElementName MAX = new ElementName("max", "max", TreeBuilder.OTHER);
     public static final ElementName NEQ = new ElementName("neq", "neq", TreeBuilder.OTHER);
     public static final ElementName NOT = new ElementName("not", "not", TreeBuilder.OTHER);
-    public static final ElementName NAV = new ElementName("nav", "nav", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
+    public static final ElementName NAV = new ElementName("nav", "nav", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
     public static final ElementName PRE = new ElementName("pre", "pre", TreeBuilder.PRE_OR_LISTING | SPECIAL);
     public static final ElementName RTC = new ElementName("rtc", "rtc", TreeBuilder.RB_OR_RTC | OPTIONAL_END_TAG);
     public static final ElementName REM = new ElementName("rem", "rem", TreeBuilder.OTHER);
     public static final ElementName SUB = new ElementName("sub", "sub", TreeBuilder.RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR);
     public static final ElementName SEC = new ElementName("sec", "sec", TreeBuilder.OTHER);
     public static final ElementName SVG = new ElementName("svg", "svg", TreeBuilder.SVG);
     public static final ElementName SUM = new ElementName("sum", "sum", TreeBuilder.OTHER);
     public static final ElementName SIN = new ElementName("sin", "sin", TreeBuilder.OTHER);
@@ -528,17 +528,17 @@ public final class ElementName
     public static final ElementName LIST = new ElementName("list", "list", TreeBuilder.OTHER);
     public static final ElementName META = new ElementName("meta", "meta", TreeBuilder.META | SPECIAL);
     public static final ElementName MSUB = new ElementName("msub", "msub", TreeBuilder.OTHER);
     public static final ElementName MODE = new ElementName("mode", "mode", TreeBuilder.OTHER);
     public static final ElementName MATH = new ElementName("math", "math", TreeBuilder.MATH);
     public static final ElementName MARK = new ElementName("mark", "mark", TreeBuilder.OTHER);
     public static final ElementName MASK = new ElementName("mask", "mask", TreeBuilder.OTHER);
     public static final ElementName MEAN = new ElementName("mean", "mean", TreeBuilder.OTHER);
-    public static final ElementName MAIN = new ElementName("main", "main", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
+    public static final ElementName MAIN = new ElementName("main", "main", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
     public static final ElementName MSUP = new ElementName("msup", "msup", TreeBuilder.OTHER);
     public static final ElementName MENU = new ElementName("menu", "menu", TreeBuilder.DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU | SPECIAL);
     public static final ElementName MROW = new ElementName("mrow", "mrow", TreeBuilder.OTHER);
     public static final ElementName NONE = new ElementName("none", "none", TreeBuilder.OTHER);
     public static final ElementName NOBR = new ElementName("nobr", "nobr", TreeBuilder.NOBR);
     public static final ElementName NEST = new ElementName("nest", "nest", TreeBuilder.OTHER);
     public static final ElementName PATH = new ElementName("path", "path", TreeBuilder.OTHER);
     public static final ElementName PLUS = new ElementName("plus", "plus", TreeBuilder.OTHER);
@@ -555,17 +555,17 @@ public final class ElementName
     public static final ElementName STOP = new ElementName("stop", "stop", TreeBuilder.OTHER);
     public static final ElementName SDEV = new ElementName("sdev", "sdev", TreeBuilder.OTHER);
     public static final ElementName TIME = new ElementName("time", "time", TreeBuilder.OTHER);
     public static final ElementName TRUE = new ElementName("true", "true", TreeBuilder.OTHER);
     public static final ElementName TREF = new ElementName("tref", "tref", TreeBuilder.OTHER);
     public static final ElementName TANH = new ElementName("tanh", "tanh", TreeBuilder.OTHER);
     public static final ElementName TEXT = new ElementName("text", "text", TreeBuilder.OTHER);
     public static final ElementName VIEW = new ElementName("view", "view", TreeBuilder.OTHER);
-    public static final ElementName ASIDE = new ElementName("aside", "aside", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
+    public static final ElementName ASIDE = new ElementName("aside", "aside", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
     public static final ElementName AUDIO = new ElementName("audio", "audio", TreeBuilder.OTHER);
     public static final ElementName APPLY = new ElementName("apply", "apply", TreeBuilder.OTHER);
     public static final ElementName EMBED = new ElementName("embed", "embed", TreeBuilder.EMBED | SPECIAL);
     public static final ElementName FRAME = new ElementName("frame", "frame", TreeBuilder.FRAME | SPECIAL);
     public static final ElementName FALSE = new ElementName("false", "false", TreeBuilder.OTHER);
     public static final ElementName FLOOR = new ElementName("floor", "floor", TreeBuilder.OTHER);
     public static final ElementName GLYPH = new ElementName("glyph", "glyph", TreeBuilder.OTHER);
     public static final ElementName HKERN = new ElementName("hkern", "hkern", TreeBuilder.OTHER);
@@ -610,25 +610,26 @@ public final class ElementName
     public static final ElementName APPROX = new ElementName("approx", "approx", TreeBuilder.OTHER);
     public static final ElementName BUTTON = new ElementName("button", "button", TreeBuilder.BUTTON | SPECIAL);
     public static final ElementName CIRCLE = new ElementName("circle", "circle", TreeBuilder.OTHER);
     public static final ElementName CENTER = new ElementName("center", "center", TreeBuilder.DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU | SPECIAL);
     public static final ElementName CURSOR = new ElementName("cursor", "cursor", TreeBuilder.OTHER);
     public static final ElementName CANVAS = new ElementName("canvas", "canvas", TreeBuilder.OTHER);
     public static final ElementName DIVIDE = new ElementName("divide", "divide", TreeBuilder.OTHER);
     public static final ElementName DEGREE = new ElementName("degree", "degree", TreeBuilder.OTHER);
+    public static final ElementName DIALOG = new ElementName("dialog", "dialog", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
     public static final ElementName DOMAIN = new ElementName("domain", "domain", TreeBuilder.OTHER);
     public static final ElementName EXISTS = new ElementName("exists", "exists", TreeBuilder.OTHER);
     public static final ElementName FETILE = new ElementName("fetile", "feTile", TreeBuilder.OTHER);
-    public static final ElementName FIGURE = new ElementName("figure", "figure", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
+    public static final ElementName FIGURE = new ElementName("figure", "figure", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
     public static final ElementName FORALL = new ElementName("forall", "forall", TreeBuilder.OTHER);
     public static final ElementName FILTER = new ElementName("filter", "filter", TreeBuilder.OTHER);
-    public static final ElementName FOOTER = new ElementName("footer", "footer", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
-    public static final ElementName HGROUP = new ElementName("hgroup", "hgroup", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
-    public static final ElementName HEADER = new ElementName("header", "header", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
+    public static final ElementName FOOTER = new ElementName("footer", "footer", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
+    public static final ElementName HGROUP = new ElementName("hgroup", "hgroup", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
+    public static final ElementName HEADER = new ElementName("header", "header", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
     public static final ElementName IFRAME = new ElementName("iframe", "iframe", TreeBuilder.IFRAME | SPECIAL);
     public static final ElementName KEYGEN = new ElementName("keygen", "keygen", TreeBuilder.KEYGEN);
     public static final ElementName LAMBDA = new ElementName("lambda", "lambda", TreeBuilder.OTHER);
     public static final ElementName LEGEND = new ElementName("legend", "legend", TreeBuilder.OTHER);
     public static final ElementName MSPACE = new ElementName("mspace", "mspace", TreeBuilder.OTHER);
     public static final ElementName MTABLE = new ElementName("mtable", "mtable", TreeBuilder.OTHER);
     public static final ElementName MSTYLE = new ElementName("mstyle", "mstyle", TreeBuilder.OTHER);
     public static final ElementName MGLYPH = new ElementName("mglyph", "mglyph", TreeBuilder.MGLYPH_OR_MALIGNMARK);
@@ -647,34 +648,34 @@ public final class ElementName
     public static final ElementName STRONG = new ElementName("strong", "strong", TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U);
     public static final ElementName SWITCH = new ElementName("switch", "switch", TreeBuilder.OTHER);
     public static final ElementName SYMBOL = new ElementName("symbol", "symbol", TreeBuilder.OTHER);
     public static final ElementName SELECT = new ElementName("select", "select", TreeBuilder.SELECT | SPECIAL);
     public static final ElementName SUBSET = new ElementName("subset", "subset", TreeBuilder.OTHER);
     public static final ElementName SCRIPT = new ElementName("script", "script", TreeBuilder.SCRIPT | SPECIAL);
     public static final ElementName TBREAK = new ElementName("tbreak", "tbreak", TreeBuilder.OTHER);
     public static final ElementName VECTOR = new ElementName("vector", "vector", TreeBuilder.OTHER);
-    public static final ElementName ARTICLE = new ElementName("article", "article", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
+    public static final ElementName ARTICLE = new ElementName("article", "article", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
     public static final ElementName ANIMATE = new ElementName("animate", "animate", TreeBuilder.OTHER);
     public static final ElementName ARCSECH = new ElementName("arcsech", "arcsech", TreeBuilder.OTHER);
     public static final ElementName ARCCSCH = new ElementName("arccsch", "arccsch", TreeBuilder.OTHER);
     public static final ElementName ARCTANH = new ElementName("arctanh", "arctanh", TreeBuilder.OTHER);
     public static final ElementName ARCSINH = new ElementName("arcsinh", "arcsinh", TreeBuilder.OTHER);
     public static final ElementName ARCCOSH = new ElementName("arccosh", "arccosh", TreeBuilder.OTHER);
     public static final ElementName ARCCOTH = new ElementName("arccoth", "arccoth", TreeBuilder.OTHER);
     public static final ElementName ACRONYM = new ElementName("acronym", "acronym", TreeBuilder.OTHER);
-    public static final ElementName ADDRESS = new ElementName("address", "address", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
+    public static final ElementName ADDRESS = new ElementName("address", "address", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
     public static final ElementName BGSOUND = new ElementName("bgsound", "bgsound", TreeBuilder.LINK_OR_BASEFONT_OR_BGSOUND | SPECIAL);
     public static final ElementName COMPOSE = new ElementName("compose", "compose", TreeBuilder.OTHER);
     public static final ElementName CEILING = new ElementName("ceiling", "ceiling", TreeBuilder.OTHER);
     public static final ElementName CSYMBOL = new ElementName("csymbol", "csymbol", TreeBuilder.OTHER);
     public static final ElementName CAPTION = new ElementName("caption", "caption", TreeBuilder.CAPTION | SPECIAL | SCOPING);
     public static final ElementName DISCARD = new ElementName("discard", "discard", TreeBuilder.OTHER);
     public static final ElementName DECLARE = new ElementName("declare", "declare", TreeBuilder.OTHER);
-    public static final ElementName DETAILS = new ElementName("details", "details", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
+    public static final ElementName DETAILS = new ElementName("details", "details", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
     public static final ElementName ELLIPSE = new ElementName("ellipse", "ellipse", TreeBuilder.OTHER);
     public static final ElementName FEFUNCA = new ElementName("fefunca", "feFuncA", TreeBuilder.OTHER);
     public static final ElementName FEFUNCB = new ElementName("fefuncb", "feFuncB", TreeBuilder.OTHER);
     public static final ElementName FEBLEND = new ElementName("feblend", "feBlend", TreeBuilder.OTHER);
     public static final ElementName FEFLOOD = new ElementName("feflood", "feFlood", TreeBuilder.OTHER);
     public static final ElementName FEIMAGE = new ElementName("feimage", "feImage", TreeBuilder.OTHER);
     public static final ElementName FEMERGE = new ElementName("femerge", "feMerge", TreeBuilder.OTHER);
     public static final ElementName FEFUNCG = new ElementName("fefuncg", "feFuncG", TreeBuilder.OTHER);
@@ -686,23 +687,23 @@ public final class ElementName
     public static final ElementName LOGBASE = new ElementName("logbase", "logbase", TreeBuilder.OTHER);
     public static final ElementName LISTING = new ElementName("listing", "listing", TreeBuilder.PRE_OR_LISTING | SPECIAL);
     public static final ElementName MFENCED = new ElementName("mfenced", "mfenced", TreeBuilder.OTHER);
     public static final ElementName MPADDED = new ElementName("mpadded", "mpadded", TreeBuilder.OTHER);
     public static final ElementName MARQUEE = new ElementName("marquee", "marquee", TreeBuilder.MARQUEE_OR_APPLET | SPECIAL | SCOPING);
     public static final ElementName MACTION = new ElementName("maction", "maction", TreeBuilder.OTHER);
     public static final ElementName MSUBSUP = new ElementName("msubsup", "msubsup", TreeBuilder.OTHER);
     public static final ElementName NOEMBED = new ElementName("noembed", "noembed", TreeBuilder.NOEMBED | SPECIAL);
+    public static final ElementName PICTURE = new ElementName("picture", "picture", TreeBuilder.OTHER);
     public static final ElementName POLYGON = new ElementName("polygon", "polygon", TreeBuilder.OTHER);
     public static final ElementName PATTERN = new ElementName("pattern", "pattern", TreeBuilder.OTHER);
-    public static final ElementName PICTURE = new ElementName("picture", "picture", TreeBuilder.OTHER);
     public static final ElementName PRODUCT = new ElementName("product", "product", TreeBuilder.OTHER);
     public static final ElementName SETDIFF = new ElementName("setdiff", "setdiff", TreeBuilder.OTHER);
-    public static final ElementName SECTION = new ElementName("section", "section", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
-    public static final ElementName SUMMARY = new ElementName("summary", "summary", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
+    public static final ElementName SECTION = new ElementName("section", "section", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
+    public static final ElementName SUMMARY = new ElementName("summary", "summary", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
     public static final ElementName TENDSTO = new ElementName("tendsto", "tendsto", TreeBuilder.OTHER);
     public static final ElementName UPLIMIT = new ElementName("uplimit", "uplimit", TreeBuilder.OTHER);
     public static final ElementName ALTGLYPH = new ElementName("altglyph", "altGlyph", TreeBuilder.OTHER);
     public static final ElementName BASEFONT = new ElementName("basefont", "basefont", TreeBuilder.LINK_OR_BASEFONT_OR_BGSOUND | SPECIAL);
     public static final ElementName CLIPPATH = new ElementName("clippath", "clipPath", TreeBuilder.OTHER);
     public static final ElementName CODOMAIN = new ElementName("codomain", "codomain", TreeBuilder.OTHER);
     public static final ElementName COLGROUP = new ElementName("colgroup", "colgroup", TreeBuilder.COLGROUP | SPECIAL | OPTIONAL_END_TAG);
     public static final ElementName EMPTYSET = new ElementName("emptyset", "emptyset", TreeBuilder.OTHER);
@@ -750,17 +751,17 @@ public final class ElementName
     public static final ElementName RATIONALS = new ElementName("rationals", "rationals", TreeBuilder.OTHER);
     public static final ElementName SEMANTICS = new ElementName("semantics", "semantics", TreeBuilder.OTHER);
     public static final ElementName TRANSPOSE = new ElementName("transpose", "transpose", TreeBuilder.OTHER);
     public static final ElementName ANNOTATION = new ElementName("annotation", "annotation", TreeBuilder.OTHER);
     public static final ElementName BLOCKQUOTE = new ElementName("blockquote", "blockquote", TreeBuilder.DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU | SPECIAL);
     public static final ElementName DIVERGENCE = new ElementName("divergence", "divergence", TreeBuilder.OTHER);
     public static final ElementName EULERGAMMA = new ElementName("eulergamma", "eulergamma", TreeBuilder.OTHER);
     public static final ElementName EQUIVALENT = new ElementName("equivalent", "equivalent", TreeBuilder.OTHER);
-    public static final ElementName FIGCAPTION = new ElementName("figcaption", "figcaption", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
+    public static final ElementName FIGCAPTION = new ElementName("figcaption", "figcaption", TreeBuilder.ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | SPECIAL);
     public static final ElementName IMAGINARYI = new ElementName("imaginaryi", "imaginaryi", TreeBuilder.OTHER);
     public static final ElementName MALIGNMARK = new ElementName("malignmark", "malignmark", TreeBuilder.MGLYPH_OR_MALIGNMARK);
     public static final ElementName MUNDEROVER = new ElementName("munderover", "munderover", TreeBuilder.OTHER);
     public static final ElementName MLABELEDTR = new ElementName("mlabeledtr", "mlabeledtr", TreeBuilder.OTHER);
     public static final ElementName NOTANUMBER = new ElementName("notanumber", "notanumber", TreeBuilder.OTHER);
     public static final ElementName SOLIDCOLOR = new ElementName("solidcolor", "solidcolor", TreeBuilder.OTHER);
     public static final ElementName ALTGLYPHDEF = new ElementName("altglyphdef", "altGlyphDef", TreeBuilder.OTHER);
     public static final ElementName DETERMINANT = new ElementName("determinant", "determinant", TreeBuilder.OTHER);
@@ -1008,16 +1009,17 @@ public final class ElementName
     APPROX,
     BUTTON,
     CIRCLE,
     CENTER,
     CURSOR,
     CANVAS,
     DIVIDE,
     DEGREE,
+    DIALOG,
     DOMAIN,
     EXISTS,
     FETILE,
     FIGURE,
     FORALL,
     FILTER,
     FOOTER,
     HGROUP,
@@ -1084,19 +1086,19 @@ public final class ElementName
     LOGBASE,
     LISTING,
     MFENCED,
     MPADDED,
     MARQUEE,
     MACTION,
     MSUBSUP,
     NOEMBED,
+    PICTURE,
     POLYGON,
     PATTERN,
-    PICTURE,
     PRODUCT,
     SETDIFF,
     SECTION,
     SUMMARY,
     TENDSTO,
     UPLIMIT,
     ALTGLYPH,
     BASEFONT,
@@ -1407,16 +1409,17 @@ public final class ElementName
     203177552,
     203898516,
     204648562,
     205067918,
     205078130,
     205096654,
     205689142,
     205690439,
+    205766017,
     205988909,
     207213161,
     207794484,
     207800999,
     208023602,
     208213644,
     208213647,
     210261490,
@@ -1483,19 +1486,19 @@ public final class ElementName
     247647266,
     247707956,
     248648814,
     248648836,
     248682161,
     248986932,
     249058914,
     249697357,
+    251841204,
     252132601,
     252135604,
-    251841204,
     252317348,
     255007012,
     255278388,
     255641645,
     256365156,
     257566121,
     269763372,
     271202790,
--- a/parser/html/javasrc/TreeBuilder.java
+++ b/parser/html/javasrc/TreeBuilder.java
@@ -164,17 +164,17 @@ public abstract class TreeBuilder<T> imp
     final static int IFRAME = 47;
 
     final static int EMBED = 48;
 
     final static int AREA_OR_WBR = 49;
 
     final static int DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU = 50;
 
-    final static int ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY = 51;
+    final static int ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY = 51;
 
     final static int RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR = 52;
 
     final static int RB_OR_RTC = 53;
 
     final static int PARAM_OR_SOURCE_OR_TRACK = 55;
 
     final static int MGLYPH_OR_MALIGNMARK = 56;
@@ -2117,17 +2117,17 @@ public abstract class TreeBuilder<T> imp
                                 }
                                 if (addAttributesToBody(attributes)) {
                                     attributes = null; // CPP
                                 }
                                 break starttagloop;
                             case P:
                             case DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU:
                             case UL_OR_OL_OR_DL:
-                            case ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY:
+                            case ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY:
                                 implicitlyCloseP();
                                 appendToCurrentNodeAndPushElementMayFoster(
                                         elementName,
                                         attributes);
                                 attributes = null; // CPP
                                 break starttagloop;
                             case H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6:
                                 implicitlyCloseP();
@@ -3675,17 +3675,17 @@ public abstract class TreeBuilder<T> imp
                             }
                             mode = AFTER_BODY;
                             continue;
                         case DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU:
                         case UL_OR_OL_OR_DL:
                         case PRE_OR_LISTING:
                         case FIELDSET:
                         case BUTTON:
-                        case ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY:
+                        case ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY:
                             eltPos = findLastInScope(name);
                             if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) {
                                 errStrayEndTag(name);
                             } else {
                                 generateImpliedEndTags();
                                 if (errorHandler != null && !isCurrent(name)) {
                                     errUnclosedElements(eltPos, name);
                                 }
--- a/parser/html/nsHtml5AtomList.h
+++ b/parser/html/nsHtml5AtomList.h
@@ -862,16 +862,17 @@ HTML5_ATOM(arccos, "arccos")
 HTML5_ATOM(applet, "applet")
 HTML5_ATOM(arccot, "arccot")
 HTML5_ATOM(approx, "approx")
 HTML5_ATOM(circle, "circle")
 HTML5_ATOM(center, "center")
 HTML5_ATOM(canvas, "canvas")
 HTML5_ATOM(divide, "divide")
 HTML5_ATOM(degree, "degree")
+HTML5_ATOM(dialog, "dialog")
 HTML5_ATOM(domain, "domain")
 HTML5_ATOM(exists, "exists")
 HTML5_ATOM(fetile, "fetile")
 HTML5_ATOM(feTile, "feTile")
 HTML5_ATOM(figure, "figure")
 HTML5_ATOM(forall, "forall")
 HTML5_ATOM(footer, "footer")
 HTML5_ATOM(hgroup, "hgroup")
@@ -937,18 +938,18 @@ HTML5_ATOM(implies, "implies")
 HTML5_ATOM(isindex, "isindex")
 HTML5_ATOM(logbase, "logbase")
 HTML5_ATOM(listing, "listing")
 HTML5_ATOM(mfenced, "mfenced")
 HTML5_ATOM(mpadded, "mpadded")
 HTML5_ATOM(marquee, "marquee")
 HTML5_ATOM(maction, "maction")
 HTML5_ATOM(msubsup, "msubsup")
+HTML5_ATOM(picture, "picture")
 HTML5_ATOM(polygon, "polygon")
-HTML5_ATOM(picture, "picture")
 HTML5_ATOM(product, "product")
 HTML5_ATOM(setdiff, "setdiff")
 HTML5_ATOM(section, "section")
 HTML5_ATOM(tendsto, "tendsto")
 HTML5_ATOM(uplimit, "uplimit")
 HTML5_ATOM(altglyph, "altglyph")
 HTML5_ATOM(altGlyph, "altGlyph")
 HTML5_ATOM(basefont, "basefont")
--- a/parser/html/nsHtml5ElementName.cpp
+++ b/parser/html/nsHtml5ElementName.cpp
@@ -1,27 +1,27 @@
 /*
- * Copyright (c) 2008-2014 Mozilla Foundation
+ * Copyright (c) 2008-2016 Mozilla Foundation
  *
- * Permission is hereby granted, free of charge, to any person obtaining a 
- * copy of this software and associated documentation files (the "Software"), 
- * to deal in the Software without restriction, including without limitation 
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, 
- * and/or sell copies of the Software, and to permit persons to whom the 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
  *
- * The above copyright notice and this permission notice shall be included in 
+ * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
 
 /*
  * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
  * Please edit ElementName.java instead and regenerate.
  */
 
@@ -334,16 +334,17 @@ nsHtml5ElementName* nsHtml5ElementName::
 nsHtml5ElementName* nsHtml5ElementName::ELT_APPROX = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_BUTTON = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_CIRCLE = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_CENTER = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_CURSOR = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_CANVAS = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_DIVIDE = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_DEGREE = nullptr;
+nsHtml5ElementName* nsHtml5ElementName::ELT_DIALOG = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_DOMAIN = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_EXISTS = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_FETILE = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_FIGURE = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_FORALL = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_FILTER = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_FOOTER = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_HGROUP = nullptr;
@@ -410,19 +411,19 @@ nsHtml5ElementName* nsHtml5ElementName::
 nsHtml5ElementName* nsHtml5ElementName::ELT_LOGBASE = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_LISTING = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_MFENCED = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_MPADDED = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_MARQUEE = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_MACTION = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_MSUBSUP = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_NOEMBED = nullptr;
+nsHtml5ElementName* nsHtml5ElementName::ELT_PICTURE = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_POLYGON = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_PATTERN = nullptr;
-nsHtml5ElementName* nsHtml5ElementName::ELT_PICTURE = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_PRODUCT = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_SETDIFF = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_SECTION = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_SUMMARY = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_TENDSTO = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_UPLIMIT = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_ALTGLYPH = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_BASEFONT = nullptr;
@@ -528,17 +529,17 @@ nsHtml5ElementName* nsHtml5ElementName::
 nsHtml5ElementName* nsHtml5ElementName::ELT_FONT_FACE_FORMAT = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_FECONVOLVEMATRIX = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_FEDIFFUSELIGHTING = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_FEDISPLACEMENTMAP = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_FESPECULARLIGHTING = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_DOMAINOFAPPLICATION = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_FECOMPONENTTRANSFER = nullptr;
 nsHtml5ElementName** nsHtml5ElementName::ELEMENT_NAMES = 0;
-static int32_t const ELEMENT_HASHES_DATA[] = { 1057, 1090, 1255, 1321, 1552, 1585, 1651, 1717, 68162, 68899, 69059, 69764, 70020, 70276, 71077, 71205, 72134, 72232, 72264, 72296, 72328, 72360, 72392, 73351, 74312, 75209, 78124, 78284, 78476, 79149, 79309, 79341, 79469, 81295, 81487, 82224, 84050, 84498, 84626, 86164, 86292, 86612, 86676, 87445, 3183041, 3186241, 3198017, 3218722, 3226754, 3247715, 3256803, 3263971, 3264995, 3289252, 3291332, 3295524, 3299620, 3326725, 3379303, 3392679, 3448233, 3460553, 3461577, 3510347, 3546604, 3552364, 3556524, 3576461, 3586349, 3588141, 3590797, 3596333, 3622062, 3625454, 3627054, 3675728, 3739282, 3749042, 3771059, 3771571, 3776211, 3782323, 3782963, 3784883, 3785395, 3788979, 3815476, 3839605, 3885110, 3917911, 3948984, 3951096, 135304769, 135858241, 136498210, 136906434, 137138658, 137512995, 137531875, 137548067, 137629283, 137645539, 137646563, 137775779, 138529956, 138615076, 139040932, 140954086, 141179366, 141690439, 142738600, 143013512, 146979116, 147175724, 147475756, 147902637, 147936877, 148017645, 148131885, 148228141, 148229165, 148309165, 148317229, 148395629, 148551853, 148618829, 149076462, 149490158, 149572782, 151277616, 151639440, 153268914, 153486514, 153563314, 153750706, 153763314, 153914034, 154406067, 154417459, 154600979, 154678323, 154680979, 154866835, 155366708, 155375188, 155391572, 155465780, 155869364, 158045494, 168988979, 169321621, 169652752, 173151309, 174240818, 174247297, 174669292, 175391532, 176638123, 177380397, 177879204, 177886734, 180753473, 181020073, 181503558, 181686320, 181999237, 181999311, 182048201, 182074866, 182078003, 182083764, 182920847, 184716457, 184976961, 185145071, 187281445, 187872052, 188100653, 188875944, 188919873, 188920457, 189107250, 189203987, 189371817, 189414886, 189567458, 190266670, 191318187, 191337609, 202479203, 202493027, 202835587, 202843747, 203013219, 203036048, 203045987, 203177552, 203898516, 204648562, 205067918, 205078130, 205096654, 205689142, 205690439, 205988909, 207213161, 207794484, 207800999, 208023602, 208213644, 208213647, 210261490, 210310273, 210940978, 213325049, 213946445, 214055079, 215125040, 215134273, 215135028, 215237420, 215418148, 215553166, 215553394, 215563858, 215627949, 215754324, 217529652, 217713834, 217732628, 218731945, 221417045, 221424946, 221493746, 221515401, 221658189, 221908140, 221910626, 221921586, 222659762, 225001091, 236105833, 236113965, 236194995, 236195427, 236206132, 236206387, 236211683, 236212707, 236381647, 236571826, 237124271, 238210544, 238270764, 238435405, 238501172, 239224867, 239257644, 239710497, 240307721, 241208789, 241241557, 241318060, 241319404, 241343533, 241344069, 241405397, 241765845, 243864964, 244502085, 244946220, 245109902, 247647266, 247707956, 248648814, 248648836, 248682161, 248986932, 249058914, 249697357, 252132601, 252135604, 251841204, 252317348, 255007012, 255278388, 255641645, 256365156, 257566121, 269763372, 271202790, 271863856, 272049197, 272127474, 274339449, 274939471, 275388004, 275388005, 275388006, 275977800, 278267602, 278513831, 278712622, 281613765, 281683369, 282120228, 282250732, 282498697, 282508942, 283743649, 283787570, 284710386, 285391148, 285478533, 285854898, 285873762, 286931113, 288964227, 289445441, 289591340, 289689648, 291671489, 303512884, 305319975, 305610036, 305764101, 308448294, 308675890, 312085683, 312264750, 315032867, 316391000, 317331042, 317902135, 318950711, 319447220, 321499182, 322538804, 323145200, 337067316, 337826293, 339905989, 340833697, 341457068, 342310196, 345302593, 349554733, 349771471, 349786245, 350819405, 356072847, 370349192, 373962798, 375558638, 375574835, 376053993, 383276530, 383373833, 383407586, 384439906, 386079012, 404133513, 404307343, 407031852, 408072233, 409112005, 409608425, 409713793, 409771500, 419040932, 437730612, 439529766, 442616365, 442813037, 443157674, 443295316, 450118444, 450482697, 456789668, 459935396, 471217869, 474073645, 476230702, 476665218, 476717289, 483014825, 485083298, 489306281, 538364390, 540675748, 543819186, 543958612, 576960820, 577242548, 610515252, 642202932, 644420819 };
+static int32_t const ELEMENT_HASHES_DATA[] = { 1057, 1090, 1255, 1321, 1552, 1585, 1651, 1717, 68162, 68899, 69059, 69764, 70020, 70276, 71077, 71205, 72134, 72232, 72264, 72296, 72328, 72360, 72392, 73351, 74312, 75209, 78124, 78284, 78476, 79149, 79309, 79341, 79469, 81295, 81487, 82224, 84050, 84498, 84626, 86164, 86292, 86612, 86676, 87445, 3183041, 3186241, 3198017, 3218722, 3226754, 3247715, 3256803, 3263971, 3264995, 3289252, 3291332, 3295524, 3299620, 3326725, 3379303, 3392679, 3448233, 3460553, 3461577, 3510347, 3546604, 3552364, 3556524, 3576461, 3586349, 3588141, 3590797, 3596333, 3622062, 3625454, 3627054, 3675728, 3739282, 3749042, 3771059, 3771571, 3776211, 3782323, 3782963, 3784883, 3785395, 3788979, 3815476, 3839605, 3885110, 3917911, 3948984, 3951096, 135304769, 135858241, 136498210, 136906434, 137138658, 137512995, 137531875, 137548067, 137629283, 137645539, 137646563, 137775779, 138529956, 138615076, 139040932, 140954086, 141179366, 141690439, 142738600, 143013512, 146979116, 147175724, 147475756, 147902637, 147936877, 148017645, 148131885, 148228141, 148229165, 148309165, 148317229, 148395629, 148551853, 148618829, 149076462, 149490158, 149572782, 151277616, 151639440, 153268914, 153486514, 153563314, 153750706, 153763314, 153914034, 154406067, 154417459, 154600979, 154678323, 154680979, 154866835, 155366708, 155375188, 155391572, 155465780, 155869364, 158045494, 168988979, 169321621, 169652752, 173151309, 174240818, 174247297, 174669292, 175391532, 176638123, 177380397, 177879204, 177886734, 180753473, 181020073, 181503558, 181686320, 181999237, 181999311, 182048201, 182074866, 182078003, 182083764, 182920847, 184716457, 184976961, 185145071, 187281445, 187872052, 188100653, 188875944, 188919873, 188920457, 189107250, 189203987, 189371817, 189414886, 189567458, 190266670, 191318187, 191337609, 202479203, 202493027, 202835587, 202843747, 203013219, 203036048, 203045987, 203177552, 203898516, 204648562, 205067918, 205078130, 205096654, 205689142, 205690439, 205766017, 205988909, 207213161, 207794484, 207800999, 208023602, 208213644, 208213647, 210261490, 210310273, 210940978, 213325049, 213946445, 214055079, 215125040, 215134273, 215135028, 215237420, 215418148, 215553166, 215553394, 215563858, 215627949, 215754324, 217529652, 217713834, 217732628, 218731945, 221417045, 221424946, 221493746, 221515401, 221658189, 221908140, 221910626, 221921586, 222659762, 225001091, 236105833, 236113965, 236194995, 236195427, 236206132, 236206387, 236211683, 236212707, 236381647, 236571826, 237124271, 238210544, 238270764, 238435405, 238501172, 239224867, 239257644, 239710497, 240307721, 241208789, 241241557, 241318060, 241319404, 241343533, 241344069, 241405397, 241765845, 243864964, 244502085, 244946220, 245109902, 247647266, 247707956, 248648814, 248648836, 248682161, 248986932, 249058914, 249697357, 251841204, 252132601, 252135604, 252317348, 255007012, 255278388, 255641645, 256365156, 257566121, 269763372, 271202790, 271863856, 272049197, 272127474, 274339449, 274939471, 275388004, 275388005, 275388006, 275977800, 278267602, 278513831, 278712622, 281613765, 281683369, 282120228, 282250732, 282498697, 282508942, 283743649, 283787570, 284710386, 285391148, 285478533, 285854898, 285873762, 286931113, 288964227, 289445441, 289591340, 289689648, 291671489, 303512884, 305319975, 305610036, 305764101, 308448294, 308675890, 312085683, 312264750, 315032867, 316391000, 317331042, 317902135, 318950711, 319447220, 321499182, 322538804, 323145200, 337067316, 337826293, 339905989, 340833697, 341457068, 342310196, 345302593, 349554733, 349771471, 349786245, 350819405, 356072847, 370349192, 373962798, 375558638, 375574835, 376053993, 383276530, 383373833, 383407586, 384439906, 386079012, 404133513, 404307343, 407031852, 408072233, 409112005, 409608425, 409713793, 409771500, 419040932, 437730612, 439529766, 442616365, 442813037, 443157674, 443295316, 450118444, 450482697, 456789668, 459935396, 471217869, 474073645, 476230702, 476665218, 476717289, 483014825, 485083298, 489306281, 538364390, 540675748, 543819186, 543958612, 576960820, 577242548, 610515252, 642202932, 644420819 };
 staticJArray<int32_t,int32_t> nsHtml5ElementName::ELEMENT_HASHES = { ELEMENT_HASHES_DATA, MOZ_ARRAY_LENGTH(ELEMENT_HASHES_DATA) };
 void
 nsHtml5ElementName::initializeStatics()
 {
   ELT_NULL_ELEMENT_NAME = new nsHtml5ElementName(nullptr);
   ELT_A = new nsHtml5ElementName(nsHtml5Atoms::a, nsHtml5Atoms::a, NS_HTML5TREE_BUILDER_A);
   ELT_B = new nsHtml5ElementName(nsHtml5Atoms::b, nsHtml5Atoms::b, NS_HTML5TREE_BUILDER_B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U);
   ELT_G = new nsHtml5ElementName(nsHtml5Atoms::g, nsHtml5Atoms::g, NS_HTML5TREE_BUILDER_OTHER);
@@ -589,17 +590,17 @@ nsHtml5ElementName::initializeStatics()
   ELT_BIG = new nsHtml5ElementName(nsHtml5Atoms::big, nsHtml5Atoms::big, NS_HTML5TREE_BUILDER_B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U);
   ELT_BDO = new nsHtml5ElementName(nsHtml5Atoms::bdo, nsHtml5Atoms::bdo, NS_HTML5TREE_BUILDER_OTHER);
   ELT_CSC = new nsHtml5ElementName(nsHtml5Atoms::csc, nsHtml5Atoms::csc, NS_HTML5TREE_BUILDER_OTHER);
   ELT_COL = new nsHtml5ElementName(nsHtml5Atoms::col, nsHtml5Atoms::col, NS_HTML5TREE_BUILDER_COL | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_COS = new nsHtml5ElementName(nsHtml5Atoms::cos, nsHtml5Atoms::cos, NS_HTML5TREE_BUILDER_OTHER);
   ELT_COT = new nsHtml5ElementName(nsHtml5Atoms::cot, nsHtml5Atoms::cot, NS_HTML5TREE_BUILDER_OTHER);
   ELT_DEL = new nsHtml5ElementName(nsHtml5Atoms::del, nsHtml5Atoms::del, NS_HTML5TREE_BUILDER_OTHER);
   ELT_DFN = new nsHtml5ElementName(nsHtml5Atoms::dfn, nsHtml5Atoms::dfn, NS_HTML5TREE_BUILDER_OTHER);
-  ELT_DIR = new nsHtml5ElementName(nsHtml5Atoms::dir, nsHtml5Atoms::dir, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_DIR = new nsHtml5ElementName(nsHtml5Atoms::dir, nsHtml5Atoms::dir, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_DIV = new nsHtml5ElementName(nsHtml5Atoms::div, nsHtml5Atoms::div, NS_HTML5TREE_BUILDER_DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_EXP = new nsHtml5ElementName(nsHtml5Atoms::exp, nsHtml5Atoms::exp, NS_HTML5TREE_BUILDER_OTHER);
   ELT_GCD = new nsHtml5ElementName(nsHtml5Atoms::gcd, nsHtml5Atoms::gcd, NS_HTML5TREE_BUILDER_OTHER);
   ELT_GEQ = new nsHtml5ElementName(nsHtml5Atoms::geq, nsHtml5Atoms::geq, NS_HTML5TREE_BUILDER_OTHER);
   ELT_IMG = new nsHtml5ElementName(nsHtml5Atoms::img, nsHtml5Atoms::img, NS_HTML5TREE_BUILDER_IMG | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_INS = new nsHtml5ElementName(nsHtml5Atoms::ins, nsHtml5Atoms::ins, NS_HTML5TREE_BUILDER_OTHER);
   ELT_INT = new nsHtml5ElementName(nsHtml5Atoms::int_, nsHtml5Atoms::int_, NS_HTML5TREE_BUILDER_OTHER);
   ELT_KBD = new nsHtml5ElementName(nsHtml5Atoms::kbd, nsHtml5Atoms::kbd, NS_HTML5TREE_BUILDER_OTHER);
@@ -608,17 +609,17 @@ nsHtml5ElementName::initializeStatics()
   ELT_LEQ = new nsHtml5ElementName(nsHtml5Atoms::leq, nsHtml5Atoms::leq, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MTD = new nsHtml5ElementName(nsHtml5Atoms::mtd, nsHtml5Atoms::mtd, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MIN = new nsHtml5ElementName(nsHtml5Atoms::min, nsHtml5Atoms::min, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MAP = new nsHtml5ElementName(nsHtml5Atoms::map, nsHtml5Atoms::map, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MTR = new nsHtml5ElementName(nsHtml5Atoms::mtr, nsHtml5Atoms::mtr, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MAX = new nsHtml5ElementName(nsHtml5Atoms::max, nsHtml5Atoms::max, NS_HTML5TREE_BUILDER_OTHER);
   ELT_NEQ = new nsHtml5ElementName(nsHtml5Atoms::neq, nsHtml5Atoms::neq, NS_HTML5TREE_BUILDER_OTHER);
   ELT_NOT = new nsHtml5ElementName(nsHtml5Atoms::not_, nsHtml5Atoms::not_, NS_HTML5TREE_BUILDER_OTHER);
-  ELT_NAV = new nsHtml5ElementName(nsHtml5Atoms::nav, nsHtml5Atoms::nav, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_NAV = new nsHtml5ElementName(nsHtml5Atoms::nav, nsHtml5Atoms::nav, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_PRE = new nsHtml5ElementName(nsHtml5Atoms::pre, nsHtml5Atoms::pre, NS_HTML5TREE_BUILDER_PRE_OR_LISTING | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_RTC = new nsHtml5ElementName(nsHtml5Atoms::rtc, nsHtml5Atoms::rtc, NS_HTML5TREE_BUILDER_RB_OR_RTC | NS_HTML5ELEMENT_NAME_OPTIONAL_END_TAG);
   ELT_REM = new nsHtml5ElementName(nsHtml5Atoms::rem, nsHtml5Atoms::rem, NS_HTML5TREE_BUILDER_OTHER);
   ELT_SUB = new nsHtml5ElementName(nsHtml5Atoms::sub, nsHtml5Atoms::sub, NS_HTML5TREE_BUILDER_RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR);
   ELT_SEC = new nsHtml5ElementName(nsHtml5Atoms::sec, nsHtml5Atoms::sec, NS_HTML5TREE_BUILDER_OTHER);
   ELT_SVG = new nsHtml5ElementName(nsHtml5Atoms::svg, nsHtml5Atoms::svg, NS_HTML5TREE_BUILDER_SVG);
   ELT_SUM = new nsHtml5ElementName(nsHtml5Atoms::sum, nsHtml5Atoms::sum, NS_HTML5TREE_BUILDER_OTHER);
   ELT_SIN = new nsHtml5ElementName(nsHtml5Atoms::sin, nsHtml5Atoms::sin, NS_HTML5TREE_BUILDER_OTHER);
@@ -656,17 +657,17 @@ nsHtml5ElementName::initializeStatics()
   ELT_LIST = new nsHtml5ElementName(nsHtml5Atoms::list, nsHtml5Atoms::list, NS_HTML5TREE_BUILDER_OTHER);
   ELT_META = new nsHtml5ElementName(nsHtml5Atoms::meta, nsHtml5Atoms::meta, NS_HTML5TREE_BUILDER_META | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_MSUB = new nsHtml5ElementName(nsHtml5Atoms::msub, nsHtml5Atoms::msub, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MODE = new nsHtml5ElementName(nsHtml5Atoms::mode, nsHtml5Atoms::mode, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MATH = new nsHtml5ElementName(nsHtml5Atoms::math, nsHtml5Atoms::math, NS_HTML5TREE_BUILDER_MATH);
   ELT_MARK = new nsHtml5ElementName(nsHtml5Atoms::mark, nsHtml5Atoms::mark, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MASK = new nsHtml5ElementName(nsHtml5Atoms::mask, nsHtml5Atoms::mask, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MEAN = new nsHtml5ElementName(nsHtml5Atoms::mean, nsHtml5Atoms::mean, NS_HTML5TREE_BUILDER_OTHER);
-  ELT_MAIN = new nsHtml5ElementName(nsHtml5Atoms::main, nsHtml5Atoms::main, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_MAIN = new nsHtml5ElementName(nsHtml5Atoms::main, nsHtml5Atoms::main, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_MSUP = new nsHtml5ElementName(nsHtml5Atoms::msup, nsHtml5Atoms::msup, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MENU = new nsHtml5ElementName(nsHtml5Atoms::menu, nsHtml5Atoms::menu, NS_HTML5TREE_BUILDER_DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_MROW = new nsHtml5ElementName(nsHtml5Atoms::mrow, nsHtml5Atoms::mrow, NS_HTML5TREE_BUILDER_OTHER);
   ELT_NONE = new nsHtml5ElementName(nsHtml5Atoms::none, nsHtml5Atoms::none, NS_HTML5TREE_BUILDER_OTHER);
   ELT_NOBR = new nsHtml5ElementName(nsHtml5Atoms::nobr, nsHtml5Atoms::nobr, NS_HTML5TREE_BUILDER_NOBR);
   ELT_NEST = new nsHtml5ElementName(nsHtml5Atoms::nest, nsHtml5Atoms::nest, NS_HTML5TREE_BUILDER_OTHER);
   ELT_PATH = new nsHtml5ElementName(nsHtml5Atoms::path, nsHtml5Atoms::path, NS_HTML5TREE_BUILDER_OTHER);
   ELT_PLUS = new nsHtml5ElementName(nsHtml5Atoms::plus, nsHtml5Atoms::plus, NS_HTML5TREE_BUILDER_OTHER);
@@ -683,17 +684,17 @@ nsHtml5ElementName::initializeStatics()
   ELT_STOP = new nsHtml5ElementName(nsHtml5Atoms::stop, nsHtml5Atoms::stop, NS_HTML5TREE_BUILDER_OTHER);
   ELT_SDEV = new nsHtml5ElementName(nsHtml5Atoms::sdev, nsHtml5Atoms::sdev, NS_HTML5TREE_BUILDER_OTHER);
   ELT_TIME = new nsHtml5ElementName(nsHtml5Atoms::time, nsHtml5Atoms::time, NS_HTML5TREE_BUILDER_OTHER);
   ELT_TRUE = new nsHtml5ElementName(nsHtml5Atoms::true_, nsHtml5Atoms::true_, NS_HTML5TREE_BUILDER_OTHER);
   ELT_TREF = new nsHtml5ElementName(nsHtml5Atoms::tref, nsHtml5Atoms::tref, NS_HTML5TREE_BUILDER_OTHER);
   ELT_TANH = new nsHtml5ElementName(nsHtml5Atoms::tanh, nsHtml5Atoms::tanh, NS_HTML5TREE_BUILDER_OTHER);
   ELT_TEXT = new nsHtml5ElementName(nsHtml5Atoms::text, nsHtml5Atoms::text, NS_HTML5TREE_BUILDER_OTHER);
   ELT_VIEW = new nsHtml5ElementName(nsHtml5Atoms::view, nsHtml5Atoms::view, NS_HTML5TREE_BUILDER_OTHER);
-  ELT_ASIDE = new nsHtml5ElementName(nsHtml5Atoms::aside, nsHtml5Atoms::aside, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_ASIDE = new nsHtml5ElementName(nsHtml5Atoms::aside, nsHtml5Atoms::aside, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_AUDIO = new nsHtml5ElementName(nsHtml5Atoms::audio, nsHtml5Atoms::audio, NS_HTML5TREE_BUILDER_OTHER);
   ELT_APPLY = new nsHtml5ElementName(nsHtml5Atoms::apply, nsHtml5Atoms::apply, NS_HTML5TREE_BUILDER_OTHER);
   ELT_EMBED = new nsHtml5ElementName(nsHtml5Atoms::embed, nsHtml5Atoms::embed, NS_HTML5TREE_BUILDER_EMBED | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_FRAME = new nsHtml5ElementName(nsHtml5Atoms::frame, nsHtml5Atoms::frame, NS_HTML5TREE_BUILDER_FRAME | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_FALSE = new nsHtml5ElementName(nsHtml5Atoms::false_, nsHtml5Atoms::false_, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FLOOR = new nsHtml5ElementName(nsHtml5Atoms::floor, nsHtml5Atoms::floor, NS_HTML5TREE_BUILDER_OTHER);
   ELT_GLYPH = new nsHtml5ElementName(nsHtml5Atoms::glyph, nsHtml5Atoms::glyph, NS_HTML5TREE_BUILDER_OTHER);
   ELT_HKERN = new nsHtml5ElementName(nsHtml5Atoms::hkern, nsHtml5Atoms::hkern, NS_HTML5TREE_BUILDER_OTHER);
@@ -738,25 +739,26 @@ nsHtml5ElementName::initializeStatics()
   ELT_APPROX = new nsHtml5ElementName(nsHtml5Atoms::approx, nsHtml5Atoms::approx, NS_HTML5TREE_BUILDER_OTHER);
   ELT_BUTTON = new nsHtml5ElementName(nsHtml5Atoms::button, nsHtml5Atoms::button, NS_HTML5TREE_BUILDER_BUTTON | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_CIRCLE = new nsHtml5ElementName(nsHtml5Atoms::circle, nsHtml5Atoms::circle, NS_HTML5TREE_BUILDER_OTHER);
   ELT_CENTER = new nsHtml5ElementName(nsHtml5Atoms::center, nsHtml5Atoms::center, NS_HTML5TREE_BUILDER_DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_CURSOR = new nsHtml5ElementName(nsHtml5Atoms::cursor, nsHtml5Atoms::cursor, NS_HTML5TREE_BUILDER_OTHER);
   ELT_CANVAS = new nsHtml5ElementName(nsHtml5Atoms::canvas, nsHtml5Atoms::canvas, NS_HTML5TREE_BUILDER_OTHER);
   ELT_DIVIDE = new nsHtml5ElementName(nsHtml5Atoms::divide, nsHtml5Atoms::divide, NS_HTML5TREE_BUILDER_OTHER);
   ELT_DEGREE = new nsHtml5ElementName(nsHtml5Atoms::degree, nsHtml5Atoms::degree, NS_HTML5TREE_BUILDER_OTHER);
+  ELT_DIALOG = new nsHtml5ElementName(nsHtml5Atoms::dialog, nsHtml5Atoms::dialog, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_DOMAIN = new nsHtml5ElementName(nsHtml5Atoms::domain, nsHtml5Atoms::domain, NS_HTML5TREE_BUILDER_OTHER);
   ELT_EXISTS = new nsHtml5ElementName(nsHtml5Atoms::exists, nsHtml5Atoms::exists, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FETILE = new nsHtml5ElementName(nsHtml5Atoms::fetile, nsHtml5Atoms::feTile, NS_HTML5TREE_BUILDER_OTHER);
-  ELT_FIGURE = new nsHtml5ElementName(nsHtml5Atoms::figure, nsHtml5Atoms::figure, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_FIGURE = new nsHtml5ElementName(nsHtml5Atoms::figure, nsHtml5Atoms::figure, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_FORALL = new nsHtml5ElementName(nsHtml5Atoms::forall, nsHtml5Atoms::forall, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FILTER = new nsHtml5ElementName(nsHtml5Atoms::filter, nsHtml5Atoms::filter, NS_HTML5TREE_BUILDER_OTHER);
-  ELT_FOOTER = new nsHtml5ElementName(nsHtml5Atoms::footer, nsHtml5Atoms::footer, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
-  ELT_HGROUP = new nsHtml5ElementName(nsHtml5Atoms::hgroup, nsHtml5Atoms::hgroup, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
-  ELT_HEADER = new nsHtml5ElementName(nsHtml5Atoms::header, nsHtml5Atoms::header, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_FOOTER = new nsHtml5ElementName(nsHtml5Atoms::footer, nsHtml5Atoms::footer, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_HGROUP = new nsHtml5ElementName(nsHtml5Atoms::hgroup, nsHtml5Atoms::hgroup, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_HEADER = new nsHtml5ElementName(nsHtml5Atoms::header, nsHtml5Atoms::header, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_IFRAME = new nsHtml5ElementName(nsHtml5Atoms::iframe, nsHtml5Atoms::iframe, NS_HTML5TREE_BUILDER_IFRAME | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_KEYGEN = new nsHtml5ElementName(nsHtml5Atoms::keygen, nsHtml5Atoms::keygen, NS_HTML5TREE_BUILDER_KEYGEN);
   ELT_LAMBDA = new nsHtml5ElementName(nsHtml5Atoms::lambda, nsHtml5Atoms::lambda, NS_HTML5TREE_BUILDER_OTHER);
   ELT_LEGEND = new nsHtml5ElementName(nsHtml5Atoms::legend, nsHtml5Atoms::legend, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MSPACE = new nsHtml5ElementName(nsHtml5Atoms::mspace, nsHtml5Atoms::mspace, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MTABLE = new nsHtml5ElementName(nsHtml5Atoms::mtable, nsHtml5Atoms::mtable, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MSTYLE = new nsHtml5ElementName(nsHtml5Atoms::mstyle, nsHtml5Atoms::mstyle, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MGLYPH = new nsHtml5ElementName(nsHtml5Atoms::mglyph, nsHtml5Atoms::mglyph, NS_HTML5TREE_BUILDER_MGLYPH_OR_MALIGNMARK);
@@ -775,34 +777,34 @@ nsHtml5ElementName::initializeStatics()
   ELT_STRONG = new nsHtml5ElementName(nsHtml5Atoms::strong, nsHtml5Atoms::strong, NS_HTML5TREE_BUILDER_B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U);
   ELT_SWITCH = new nsHtml5ElementName(nsHtml5Atoms::switch_, nsHtml5Atoms::switch_, NS_HTML5TREE_BUILDER_OTHER);
   ELT_SYMBOL = new nsHtml5ElementName(nsHtml5Atoms::symbol, nsHtml5Atoms::symbol, NS_HTML5TREE_BUILDER_OTHER);
   ELT_SELECT = new nsHtml5ElementName(nsHtml5Atoms::select, nsHtml5Atoms::select, NS_HTML5TREE_BUILDER_SELECT | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_SUBSET = new nsHtml5ElementName(nsHtml5Atoms::subset, nsHtml5Atoms::subset, NS_HTML5TREE_BUILDER_OTHER);
   ELT_SCRIPT = new nsHtml5ElementName(nsHtml5Atoms::script, nsHtml5Atoms::script, NS_HTML5TREE_BUILDER_SCRIPT | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_TBREAK = new nsHtml5ElementName(nsHtml5Atoms::tbreak, nsHtml5Atoms::tbreak, NS_HTML5TREE_BUILDER_OTHER);
   ELT_VECTOR = new nsHtml5ElementName(nsHtml5Atoms::vector, nsHtml5Atoms::vector, NS_HTML5TREE_BUILDER_OTHER);
-  ELT_ARTICLE = new nsHtml5ElementName(nsHtml5Atoms::article, nsHtml5Atoms::article, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_ARTICLE = new nsHtml5ElementName(nsHtml5Atoms::article, nsHtml5Atoms::article, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_ANIMATE = new nsHtml5ElementName(nsHtml5Atoms::animate, nsHtml5Atoms::animate, NS_HTML5TREE_BUILDER_OTHER);
   ELT_ARCSECH = new nsHtml5ElementName(nsHtml5Atoms::arcsech, nsHtml5Atoms::arcsech, NS_HTML5TREE_BUILDER_OTHER);
   ELT_ARCCSCH = new nsHtml5ElementName(nsHtml5Atoms::arccsch, nsHtml5Atoms::arccsch, NS_HTML5TREE_BUILDER_OTHER);
   ELT_ARCTANH = new nsHtml5ElementName(nsHtml5Atoms::arctanh, nsHtml5Atoms::arctanh, NS_HTML5TREE_BUILDER_OTHER);
   ELT_ARCSINH = new nsHtml5ElementName(nsHtml5Atoms::arcsinh, nsHtml5Atoms::arcsinh, NS_HTML5TREE_BUILDER_OTHER);
   ELT_ARCCOSH = new nsHtml5ElementName(nsHtml5Atoms::arccosh, nsHtml5Atoms::arccosh, NS_HTML5TREE_BUILDER_OTHER);
   ELT_ARCCOTH = new nsHtml5ElementName(nsHtml5Atoms::arccoth, nsHtml5Atoms::arccoth, NS_HTML5TREE_BUILDER_OTHER);
   ELT_ACRONYM = new nsHtml5ElementName(nsHtml5Atoms::acronym, nsHtml5Atoms::acronym, NS_HTML5TREE_BUILDER_OTHER);
-  ELT_ADDRESS = new nsHtml5ElementName(nsHtml5Atoms::address, nsHtml5Atoms::address, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_ADDRESS = new nsHtml5ElementName(nsHtml5Atoms::address, nsHtml5Atoms::address, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_BGSOUND = new nsHtml5ElementName(nsHtml5Atoms::bgsound, nsHtml5Atoms::bgsound, NS_HTML5TREE_BUILDER_LINK_OR_BASEFONT_OR_BGSOUND | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_COMPOSE = new nsHtml5ElementName(nsHtml5Atoms::compose, nsHtml5Atoms::compose, NS_HTML5TREE_BUILDER_OTHER);
   ELT_CEILING = new nsHtml5ElementName(nsHtml5Atoms::ceiling, nsHtml5Atoms::ceiling, NS_HTML5TREE_BUILDER_OTHER);
   ELT_CSYMBOL = new nsHtml5ElementName(nsHtml5Atoms::csymbol, nsHtml5Atoms::csymbol, NS_HTML5TREE_BUILDER_OTHER);
   ELT_CAPTION = new nsHtml5ElementName(nsHtml5Atoms::caption, nsHtml5Atoms::caption, NS_HTML5TREE_BUILDER_CAPTION | NS_HTML5ELEMENT_NAME_SPECIAL | NS_HTML5ELEMENT_NAME_SCOPING);
   ELT_DISCARD = new nsHtml5ElementName(nsHtml5Atoms::discard, nsHtml5Atoms::discard, NS_HTML5TREE_BUILDER_OTHER);
   ELT_DECLARE = new nsHtml5ElementName(nsHtml5Atoms::declare, nsHtml5Atoms::declare, NS_HTML5TREE_BUILDER_OTHER);
-  ELT_DETAILS = new nsHtml5ElementName(nsHtml5Atoms::details, nsHtml5Atoms::details, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_DETAILS = new nsHtml5ElementName(nsHtml5Atoms::details, nsHtml5Atoms::details, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_ELLIPSE = new nsHtml5ElementName(nsHtml5Atoms::ellipse, nsHtml5Atoms::ellipse, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FEFUNCA = new nsHtml5ElementName(nsHtml5Atoms::fefunca, nsHtml5Atoms::feFuncA, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FEFUNCB = new nsHtml5ElementName(nsHtml5Atoms::fefuncb, nsHtml5Atoms::feFuncB, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FEBLEND = new nsHtml5ElementName(nsHtml5Atoms::feblend, nsHtml5Atoms::feBlend, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FEFLOOD = new nsHtml5ElementName(nsHtml5Atoms::feflood, nsHtml5Atoms::feFlood, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FEIMAGE = new nsHtml5ElementName(nsHtml5Atoms::feimage, nsHtml5Atoms::feImage, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FEMERGE = new nsHtml5ElementName(nsHtml5Atoms::femerge, nsHtml5Atoms::feMerge, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FEFUNCG = new nsHtml5ElementName(nsHtml5Atoms::fefuncg, nsHtml5Atoms::feFuncG, NS_HTML5TREE_BUILDER_OTHER);
@@ -814,23 +816,23 @@ nsHtml5ElementName::initializeStatics()
   ELT_LOGBASE = new nsHtml5ElementName(nsHtml5Atoms::logbase, nsHtml5Atoms::logbase, NS_HTML5TREE_BUILDER_OTHER);
   ELT_LISTING = new nsHtml5ElementName(nsHtml5Atoms::listing, nsHtml5Atoms::listing, NS_HTML5TREE_BUILDER_PRE_OR_LISTING | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_MFENCED = new nsHtml5ElementName(nsHtml5Atoms::mfenced, nsHtml5Atoms::mfenced, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MPADDED = new nsHtml5ElementName(nsHtml5Atoms::mpadded, nsHtml5Atoms::mpadded, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MARQUEE = new nsHtml5ElementName(nsHtml5Atoms::marquee, nsHtml5Atoms::marquee, NS_HTML5TREE_BUILDER_MARQUEE_OR_APPLET | NS_HTML5ELEMENT_NAME_SPECIAL | NS_HTML5ELEMENT_NAME_SCOPING);
   ELT_MACTION = new nsHtml5ElementName(nsHtml5Atoms::maction, nsHtml5Atoms::maction, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MSUBSUP = new nsHtml5ElementName(nsHtml5Atoms::msubsup, nsHtml5Atoms::msubsup, NS_HTML5TREE_BUILDER_OTHER);
   ELT_NOEMBED = new nsHtml5ElementName(nsHtml5Atoms::noembed, nsHtml5Atoms::noembed, NS_HTML5TREE_BUILDER_NOEMBED | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_PICTURE = new nsHtml5ElementName(nsHtml5Atoms::picture, nsHtml5Atoms::picture, NS_HTML5TREE_BUILDER_OTHER);
   ELT_POLYGON = new nsHtml5ElementName(nsHtml5Atoms::polygon, nsHtml5Atoms::polygon, NS_HTML5TREE_BUILDER_OTHER);
   ELT_PATTERN = new nsHtml5ElementName(nsHtml5Atoms::pattern, nsHtml5Atoms::pattern, NS_HTML5TREE_BUILDER_OTHER);
-  ELT_PICTURE = new nsHtml5ElementName(nsHtml5Atoms::picture, nsHtml5Atoms::picture, NS_HTML5TREE_BUILDER_OTHER);
   ELT_PRODUCT = new nsHtml5ElementName(nsHtml5Atoms::product, nsHtml5Atoms::product, NS_HTML5TREE_BUILDER_OTHER);
   ELT_SETDIFF = new nsHtml5ElementName(nsHtml5Atoms::setdiff, nsHtml5Atoms::setdiff, NS_HTML5TREE_BUILDER_OTHER);
-  ELT_SECTION = new nsHtml5ElementName(nsHtml5Atoms::section, nsHtml5Atoms::section, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
-  ELT_SUMMARY = new nsHtml5ElementName(nsHtml5Atoms::summary, nsHtml5Atoms::summary, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_SECTION = new nsHtml5ElementName(nsHtml5Atoms::section, nsHtml5Atoms::section, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_SUMMARY = new nsHtml5ElementName(nsHtml5Atoms::summary, nsHtml5Atoms::summary, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_TENDSTO = new nsHtml5ElementName(nsHtml5Atoms::tendsto, nsHtml5Atoms::tendsto, NS_HTML5TREE_BUILDER_OTHER);
   ELT_UPLIMIT = new nsHtml5ElementName(nsHtml5Atoms::uplimit, nsHtml5Atoms::uplimit, NS_HTML5TREE_BUILDER_OTHER);
   ELT_ALTGLYPH = new nsHtml5ElementName(nsHtml5Atoms::altglyph, nsHtml5Atoms::altGlyph, NS_HTML5TREE_BUILDER_OTHER);
   ELT_BASEFONT = new nsHtml5ElementName(nsHtml5Atoms::basefont, nsHtml5Atoms::basefont, NS_HTML5TREE_BUILDER_LINK_OR_BASEFONT_OR_BGSOUND | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_CLIPPATH = new nsHtml5ElementName(nsHtml5Atoms::clippath, nsHtml5Atoms::clipPath, NS_HTML5TREE_BUILDER_OTHER);
   ELT_CODOMAIN = new nsHtml5ElementName(nsHtml5Atoms::codomain, nsHtml5Atoms::codomain, NS_HTML5TREE_BUILDER_OTHER);
   ELT_COLGROUP = new nsHtml5ElementName(nsHtml5Atoms::colgroup, nsHtml5Atoms::colgroup, NS_HTML5TREE_BUILDER_COLGROUP | NS_HTML5ELEMENT_NAME_SPECIAL | NS_HTML5ELEMENT_NAME_OPTIONAL_END_TAG);
   ELT_EMPTYSET = new nsHtml5ElementName(nsHtml5Atoms::emptyset, nsHtml5Atoms::emptyset, NS_HTML5TREE_BUILDER_OTHER);
@@ -878,17 +880,17 @@ nsHtml5ElementName::initializeStatics()
   ELT_RATIONALS = new nsHtml5ElementName(nsHtml5Atoms::rationals, nsHtml5Atoms::rationals, NS_HTML5TREE_BUILDER_OTHER);
   ELT_SEMANTICS = new nsHtml5ElementName(nsHtml5Atoms::semantics, nsHtml5Atoms::semantics, NS_HTML5TREE_BUILDER_OTHER);
   ELT_TRANSPOSE = new nsHtml5ElementName(nsHtml5Atoms::transpose, nsHtml5Atoms::transpose, NS_HTML5TREE_BUILDER_OTHER);
   ELT_ANNOTATION = new nsHtml5ElementName(nsHtml5Atoms::annotation, nsHtml5Atoms::annotation, NS_HTML5TREE_BUILDER_OTHER);
   ELT_BLOCKQUOTE = new nsHtml5ElementName(nsHtml5Atoms::blockquote, nsHtml5Atoms::blockquote, NS_HTML5TREE_BUILDER_DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_DIVERGENCE = new nsHtml5ElementName(nsHtml5Atoms::divergence, nsHtml5Atoms::divergence, NS_HTML5TREE_BUILDER_OTHER);
   ELT_EULERGAMMA = new nsHtml5ElementName(nsHtml5Atoms::eulergamma, nsHtml5Atoms::eulergamma, NS_HTML5TREE_BUILDER_OTHER);
   ELT_EQUIVALENT = new nsHtml5ElementName(nsHtml5Atoms::equivalent, nsHtml5Atoms::equivalent, NS_HTML5TREE_BUILDER_OTHER);
-  ELT_FIGCAPTION = new nsHtml5ElementName(nsHtml5Atoms::figcaption, nsHtml5Atoms::figcaption, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
+  ELT_FIGCAPTION = new nsHtml5ElementName(nsHtml5Atoms::figcaption, nsHtml5Atoms::figcaption, NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_IMAGINARYI = new nsHtml5ElementName(nsHtml5Atoms::imaginaryi, nsHtml5Atoms::imaginaryi, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MALIGNMARK = new nsHtml5ElementName(nsHtml5Atoms::malignmark, nsHtml5Atoms::malignmark, NS_HTML5TREE_BUILDER_MGLYPH_OR_MALIGNMARK);
   ELT_MUNDEROVER = new nsHtml5ElementName(nsHtml5Atoms::munderover, nsHtml5Atoms::munderover, NS_HTML5TREE_BUILDER_OTHER);
   ELT_MLABELEDTR = new nsHtml5ElementName(nsHtml5Atoms::mlabeledtr, nsHtml5Atoms::mlabeledtr, NS_HTML5TREE_BUILDER_OTHER);
   ELT_NOTANUMBER = new nsHtml5ElementName(nsHtml5Atoms::notanumber, nsHtml5Atoms::notanumber, NS_HTML5TREE_BUILDER_OTHER);
   ELT_SOLIDCOLOR = new nsHtml5ElementName(nsHtml5Atoms::solidcolor, nsHtml5Atoms::solidcolor, NS_HTML5TREE_BUILDER_OTHER);
   ELT_ALTGLYPHDEF = new nsHtml5ElementName(nsHtml5Atoms::altglyphdef, nsHtml5Atoms::altGlyphDef, NS_HTML5TREE_BUILDER_OTHER);
   ELT_DETERMINANT = new nsHtml5ElementName(nsHtml5Atoms::determinant, nsHtml5Atoms::determinant, NS_HTML5TREE_BUILDER_OTHER);
@@ -931,17 +933,17 @@ nsHtml5ElementName::initializeStatics()
   ELT_CARTESIANPRODUCT = new nsHtml5ElementName(nsHtml5Atoms::cartesianproduct, nsHtml5Atoms::cartesianproduct, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FONT_FACE_FORMAT = new nsHtml5ElementName(nsHtml5Atoms::font_face_format, nsHtml5Atoms::font_face_format, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FECONVOLVEMATRIX = new nsHtml5ElementName(nsHtml5Atoms::feconvolvematrix, nsHtml5Atoms::feConvolveMatrix, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FEDIFFUSELIGHTING = new nsHtml5ElementName(nsHtml5Atoms::fediffuselighting, nsHtml5Atoms::feDiffuseLighting, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FEDISPLACEMENTMAP = new nsHtml5ElementName(nsHtml5Atoms::fedisplacementmap, nsHtml5Atoms::feDisplacementMap, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FESPECULARLIGHTING = new nsHtml5ElementName(nsHtml5Atoms::fespecularlighting, nsHtml5Atoms::feSpecularLighting, NS_HTML5TREE_BUILDER_OTHER);
   ELT_DOMAINOFAPPLICATION = new nsHtml5ElementName(nsHtml5Atoms::domainofapplication, nsHtml5Atoms::domainofapplication, NS_HTML5TREE_BUILDER_OTHER);
   ELT_FECOMPONENTTRANSFER = new nsHtml5ElementName(nsHtml5Atoms::fecomponenttransfer, nsHtml5Atoms::feComponentTransfer, NS_HTML5TREE_BUILDER_OTHER);
-  ELEMENT_NAMES = new nsHtml5ElementName*[397];
+  ELEMENT_NAMES = new nsHtml5ElementName*[398];
   ELEMENT_NAMES[0] = ELT_A;
   ELEMENT_NAMES[1] = ELT_B;
   ELEMENT_NAMES[2] = ELT_G;
   ELEMENT_NAMES[3] = ELT_I;
   ELEMENT_NAMES[4] = ELT_P;
   ELEMENT_NAMES[5] = ELT_Q;
   ELEMENT_NAMES[6] = ELT_S;
   ELEMENT_NAMES[7] = ELT_U;
@@ -1136,209 +1138,210 @@ nsHtml5ElementName::initializeStatics()
   ELEMENT_NAMES[196] = ELT_APPROX;
   ELEMENT_NAMES[197] = ELT_BUTTON;
   ELEMENT_NAMES[198] = ELT_CIRCLE;
   ELEMENT_NAMES[199] = ELT_CENTER;
   ELEMENT_NAMES[200] = ELT_CURSOR;
   ELEMENT_NAMES[201] = ELT_CANVAS;
   ELEMENT_NAMES[202] = ELT_DIVIDE;
   ELEMENT_NAMES[203] = ELT_DEGREE;
-  ELEMENT_NAMES[204] = ELT_DOMAIN;
-  ELEMENT_NAMES[205] = ELT_EXISTS;
-  ELEMENT_NAMES[206] = ELT_FETILE;
-  ELEMENT_NAMES[207] = ELT_FIGURE;
-  ELEMENT_NAMES[208] = ELT_FORALL;
-  ELEMENT_NAMES[209] = ELT_FILTER;
-  ELEMENT_NAMES[210] = ELT_FOOTER;
-  ELEMENT_NAMES[211] = ELT_HGROUP;
-  ELEMENT_NAMES[212] = ELT_HEADER;
-  ELEMENT_NAMES[213] = ELT_IFRAME;
-  ELEMENT_NAMES[214] = ELT_KEYGEN;
-  ELEMENT_NAMES[215] = ELT_LAMBDA;
-  ELEMENT_NAMES[216] = ELT_LEGEND;
-  ELEMENT_NAMES[217] = ELT_MSPACE;
-  ELEMENT_NAMES[218] = ELT_MTABLE;
-  ELEMENT_NAMES[219] = ELT_MSTYLE;
-  ELEMENT_NAMES[220] = ELT_MGLYPH;
-  ELEMENT_NAMES[221] = ELT_MEDIAN;
-  ELEMENT_NAMES[222] = ELT_MUNDER;
-  ELEMENT_NAMES[223] = ELT_MARKER;
-  ELEMENT_NAMES[224] = ELT_MERROR;
-  ELEMENT_NAMES[225] = ELT_MOMENT;
-  ELEMENT_NAMES[226] = ELT_MATRIX;
-  ELEMENT_NAMES[227] = ELT_OPTION;
-  ELEMENT_NAMES[228] = ELT_OBJECT;
-  ELEMENT_NAMES[229] = ELT_OUTPUT;
-  ELEMENT_NAMES[230] = ELT_PRIMES;
-  ELEMENT_NAMES[231] = ELT_SOURCE;
-  ELEMENT_NAMES[232] = ELT_STRIKE;
-  ELEMENT_NAMES[233] = ELT_STRONG;
-  ELEMENT_NAMES[234] = ELT_SWITCH;
-  ELEMENT_NAMES[235] = ELT_SYMBOL;
-  ELEMENT_NAMES[236] = ELT_SELECT;
-  ELEMENT_NAMES[237] = ELT_SUBSET;
-  ELEMENT_NAMES[238] = ELT_SCRIPT;
-  ELEMENT_NAMES[239] = ELT_TBREAK;
-  ELEMENT_NAMES[240] = ELT_VECTOR;
-  ELEMENT_NAMES[241] = ELT_ARTICLE;
-  ELEMENT_NAMES[242] = ELT_ANIMATE;
-  ELEMENT_NAMES[243] = ELT_ARCSECH;
-  ELEMENT_NAMES[244] = ELT_ARCCSCH;
-  ELEMENT_NAMES[245] = ELT_ARCTANH;
-  ELEMENT_NAMES[246] = ELT_ARCSINH;
-  ELEMENT_NAMES[247] = ELT_ARCCOSH;
-  ELEMENT_NAMES[248] = ELT_ARCCOTH;
-  ELEMENT_NAMES[249] = ELT_ACRONYM;
-  ELEMENT_NAMES[250] = ELT_ADDRESS;
-  ELEMENT_NAMES[251] = ELT_BGSOUND;
-  ELEMENT_NAMES[252] = ELT_COMPOSE;
-  ELEMENT_NAMES[253] = ELT_CEILING;
-  ELEMENT_NAMES[254] = ELT_CSYMBOL;
-  ELEMENT_NAMES[255] = ELT_CAPTION;
-  ELEMENT_NAMES[256] = ELT_DISCARD;
-  ELEMENT_NAMES[257] = ELT_DECLARE;
-  ELEMENT_NAMES[258] = ELT_DETAILS;
-  ELEMENT_NAMES[259] = ELT_ELLIPSE;
-  ELEMENT_NAMES[260] = ELT_FEFUNCA;
-  ELEMENT_NAMES[261] = ELT_FEFUNCB;
-  ELEMENT_NAMES[262] = ELT_FEBLEND;
-  ELEMENT_NAMES[263] = ELT_FEFLOOD;
-  ELEMENT_NAMES[264] = ELT_FEIMAGE;
-  ELEMENT_NAMES[265] = ELT_FEMERGE;
-  ELEMENT_NAMES[266] = ELT_FEFUNCG;
-  ELEMENT_NAMES[267] = ELT_FEFUNCR;
-  ELEMENT_NAMES[268] = ELT_HANDLER;
-  ELEMENT_NAMES[269] = ELT_INVERSE;
-  ELEMENT_NAMES[270] = ELT_IMPLIES;
-  ELEMENT_NAMES[271] = ELT_ISINDEX;
-  ELEMENT_NAMES[272] = ELT_LOGBASE;
-  ELEMENT_NAMES[273] = ELT_LISTING;
-  ELEMENT_NAMES[274] = ELT_MFENCED;
-  ELEMENT_NAMES[275] = ELT_MPADDED;
-  ELEMENT_NAMES[276] = ELT_MARQUEE;
-  ELEMENT_NAMES[277] = ELT_MACTION;
-  ELEMENT_NAMES[278] = ELT_MSUBSUP;
-  ELEMENT_NAMES[279] = ELT_NOEMBED;
-  ELEMENT_NAMES[280] = ELT_POLYGON;
-  ELEMENT_NAMES[281] = ELT_PATTERN;
-  ELEMENT_NAMES[282] = ELT_PICTURE;
-  ELEMENT_NAMES[283] = ELT_PRODUCT;
-  ELEMENT_NAMES[284] = ELT_SETDIFF;
-  ELEMENT_NAMES[285] = ELT_SECTION;
-  ELEMENT_NAMES[286] = ELT_SUMMARY;
-  ELEMENT_NAMES[287] = ELT_TENDSTO;
-  ELEMENT_NAMES[288] = ELT_UPLIMIT;
-  ELEMENT_NAMES[289] = ELT_ALTGLYPH;
-  ELEMENT_NAMES[290] = ELT_BASEFONT;
-  ELEMENT_NAMES[291] = ELT_CLIPPATH;
-  ELEMENT_NAMES[292] = ELT_CODOMAIN;
-  ELEMENT_NAMES[293] = ELT_COLGROUP;
-  ELEMENT_NAMES[294] = ELT_EMPTYSET;
-  ELEMENT_NAMES[295] = ELT_FACTOROF;
-  ELEMENT_NAMES[296] = ELT_FIELDSET;
-  ELEMENT_NAMES[297] = ELT_FRAMESET;
-  ELEMENT_NAMES[298] = ELT_FEOFFSET;
-  ELEMENT_NAMES[299] = ELT_GLYPHREF;
-  ELEMENT_NAMES[300] = ELT_INTERVAL;
-  ELEMENT_NAMES[301] = ELT_INTEGERS;
-  ELEMENT_NAMES[302] = ELT_INFINITY;
-  ELEMENT_NAMES[303] = ELT_LISTENER;
-  ELEMENT_NAMES[304] = ELT_LOWLIMIT;
-  ELEMENT_NAMES[305] = ELT_METADATA;
-  ELEMENT_NAMES[306] = ELT_MENCLOSE;
-  ELEMENT_NAMES[307] = ELT_MENUITEM;
-  ELEMENT_NAMES[308] = ELT_MPHANTOM;
-  ELEMENT_NAMES[309] = ELT_NOFRAMES;
-  ELEMENT_NAMES[310] = ELT_NOSCRIPT;
-  ELEMENT_NAMES[311] = ELT_OPTGROUP;
-  ELEMENT_NAMES[312] = ELT_POLYLINE;
-  ELEMENT_NAMES[313] = ELT_PREFETCH;
-  ELEMENT_NAMES[314] = ELT_PROGRESS;
-  ELEMENT_NAMES[315] = ELT_PRSUBSET;
-  ELEMENT_NAMES[316] = ELT_QUOTIENT;
-  ELEMENT_NAMES[317] = ELT_SELECTOR;
-  ELEMENT_NAMES[318] = ELT_TEXTAREA;
-  ELEMENT_NAMES[319] = ELT_TEMPLATE;
-  ELEMENT_NAMES[320] = ELT_TEXTPATH;
-  ELEMENT_NAMES[321] = ELT_VARIANCE;
-  ELEMENT_NAMES[322] = ELT_ANIMATION;
-  ELEMENT_NAMES[323] = ELT_CONJUGATE;
-  ELEMENT_NAMES[324] = ELT_CONDITION;
-  ELEMENT_NAMES[325] = ELT_COMPLEXES;
-  ELEMENT_NAMES[326] = ELT_FONT_FACE;
-  ELEMENT_NAMES[327] = ELT_FACTORIAL;
-  ELEMENT_NAMES[328] = ELT_INTERSECT;
-  ELEMENT_NAMES[329] = ELT_IMAGINARY;
-  ELEMENT_NAMES[330] = ELT_LAPLACIAN;
-  ELEMENT_NAMES[331] = ELT_MATRIXROW;
-  ELEMENT_NAMES[332] = ELT_NOTSUBSET;
-  ELEMENT_NAMES[333] = ELT_OTHERWISE;
-  ELEMENT_NAMES[334] = ELT_PIECEWISE;
-  ELEMENT_NAMES[335] = ELT_PLAINTEXT;
-  ELEMENT_NAMES[336] = ELT_RATIONALS;
-  ELEMENT_NAMES[337] = ELT_SEMANTICS;
-  ELEMENT_NAMES[338] = ELT_TRANSPOSE;
-  ELEMENT_NAMES[339] = ELT_ANNOTATION;
-  ELEMENT_NAMES[340] = ELT_BLOCKQUOTE;
-  ELEMENT_NAMES[341] = ELT_DIVERGENCE;
-  ELEMENT_NAMES[342] = ELT_EULERGAMMA;
-  ELEMENT_NAMES[343] = ELT_EQUIVALENT;
-  ELEMENT_NAMES[344] = ELT_FIGCAPTION;
-  ELEMENT_NAMES[345] = ELT_IMAGINARYI;
-  ELEMENT_NAMES[346] = ELT_MALIGNMARK;
-  ELEMENT_NAMES[347] = ELT_MUNDEROVER;
-  ELEMENT_NAMES[348] = ELT_MLABELEDTR;
-  ELEMENT_NAMES[349] = ELT_NOTANUMBER;
-  ELEMENT_NAMES[350] = ELT_SOLIDCOLOR;
-  ELEMENT_NAMES[351] = ELT_ALTGLYPHDEF;
-  ELEMENT_NAMES[352] = ELT_DETERMINANT;
-  ELEMENT_NAMES[353] = ELT_FEMERGENODE;
-  ELEMENT_NAMES[354] = ELT_FECOMPOSITE;
-  ELEMENT_NAMES[355] = ELT_FESPOTLIGHT;
-  ELEMENT_NAMES[356] = ELT_MALIGNGROUP;
-  ELEMENT_NAMES[357] = ELT_MPRESCRIPTS;
-  ELEMENT_NAMES[358] = ELT_MOMENTABOUT;
-  ELEMENT_NAMES[359] = ELT_NOTPRSUBSET;
-  ELEMENT_NAMES[360] = ELT_PARTIALDIFF;
-  ELEMENT_NAMES[361] = ELT_ALTGLYPHITEM;
-  ELEMENT_NAMES[362] = ELT_ANIMATECOLOR;
-  ELEMENT_NAMES[363] = ELT_DATATEMPLATE;
-  ELEMENT_NAMES[364] = ELT_EXPONENTIALE;
-  ELEMENT_NAMES[365] = ELT_FETURBULENCE;
-  ELEMENT_NAMES[366] = ELT_FEPOINTLIGHT;
-  ELEMENT_NAMES[367] = ELT_FEDROPSHADOW;
-  ELEMENT_NAMES[368] = ELT_FEMORPHOLOGY;
-  ELEMENT_NAMES[369] = ELT_OUTERPRODUCT;
-  ELEMENT_NAMES[370] = ELT_ANIMATEMOTION;
-  ELEMENT_NAMES[371] = ELT_COLOR_PROFILE;
-  ELEMENT_NAMES[372] = ELT_FONT_FACE_SRC;
-  ELEMENT_NAMES[373] = ELT_FONT_FACE_URI;
-  ELEMENT_NAMES[374] = ELT_FOREIGNOBJECT;
-  ELEMENT_NAMES[375] = ELT_FECOLORMATRIX;
-  ELEMENT_NAMES[376] = ELT_MISSING_GLYPH;
-  ELEMENT_NAMES[377] = ELT_MMULTISCRIPTS;
-  ELEMENT_NAMES[378] = ELT_SCALARPRODUCT;
-  ELEMENT_NAMES[379] = ELT_VECTORPRODUCT;
-  ELEMENT_NAMES[380] = ELT_ANNOTATION_XML;
-  ELEMENT_NAMES[381] = ELT_DEFINITION_SRC;
-  ELEMENT_NAMES[382] = ELT_FONT_FACE_NAME;
-  ELEMENT_NAMES[383] = ELT_FEGAUSSIANBLUR;
-  ELEMENT_NAMES[384] = ELT_FEDISTANTLIGHT;
-  ELEMENT_NAMES[385] = ELT_LINEARGRADIENT;
-  ELEMENT_NAMES[386] = ELT_NATURALNUMBERS;
-  ELEMENT_NAMES[387] = ELT_RADIALGRADIENT;
-  ELEMENT_NAMES[388] = ELT_ANIMATETRANSFORM;
-  ELEMENT_NAMES[389] = ELT_CARTESIANPRODUCT;
-  ELEMENT_NAMES[390] = ELT_FONT_FACE_FORMAT;
-  ELEMENT_NAMES[391] = ELT_FECONVOLVEMATRIX;
-  ELEMENT_NAMES[392] = ELT_FEDIFFUSELIGHTING;
-  ELEMENT_NAMES[393] = ELT_FEDISPLACEMENTMAP;
-  ELEMENT_NAMES[394] = ELT_FESPECULARLIGHTING;
-  ELEMENT_NAMES[395] = ELT_DOMAINOFAPPLICATION;
-  ELEMENT_NAMES[396] = ELT_FECOMPONENTTRANSFER;
+  ELEMENT_NAMES[204] = ELT_DIALOG;
+  ELEMENT_NAMES[205] = ELT_DOMAIN;
+  ELEMENT_NAMES[206] = ELT_EXISTS;
+  ELEMENT_NAMES[207] = ELT_FETILE;
+  ELEMENT_NAMES[208] = ELT_FIGURE;
+  ELEMENT_NAMES[209] = ELT_FORALL;
+  ELEMENT_NAMES[210] = ELT_FILTER;
+  ELEMENT_NAMES[211] = ELT_FOOTER;
+  ELEMENT_NAMES[212] = ELT_HGROUP;
+  ELEMENT_NAMES[213] = ELT_HEADER;
+  ELEMENT_NAMES[214] = ELT_IFRAME;
+  ELEMENT_NAMES[215] = ELT_KEYGEN;
+  ELEMENT_NAMES[216] = ELT_LAMBDA;
+  ELEMENT_NAMES[217] = ELT_LEGEND;
+  ELEMENT_NAMES[218] = ELT_MSPACE;
+  ELEMENT_NAMES[219] = ELT_MTABLE;
+  ELEMENT_NAMES[220] = ELT_MSTYLE;
+  ELEMENT_NAMES[221] = ELT_MGLYPH;
+  ELEMENT_NAMES[222] = ELT_MEDIAN;
+  ELEMENT_NAMES[223] = ELT_MUNDER;
+  ELEMENT_NAMES[224] = ELT_MARKER;
+  ELEMENT_NAMES[225] = ELT_MERROR;
+  ELEMENT_NAMES[226] = ELT_MOMENT;
+  ELEMENT_NAMES[227] = ELT_MATRIX;
+  ELEMENT_NAMES[228] = ELT_OPTION;
+  ELEMENT_NAMES[229] = ELT_OBJECT;
+  ELEMENT_NAMES[230] = ELT_OUTPUT;
+  ELEMENT_NAMES[231] = ELT_PRIMES;
+  ELEMENT_NAMES[232] = ELT_SOURCE;
+  ELEMENT_NAMES[233] = ELT_STRIKE;
+  ELEMENT_NAMES[234] = ELT_STRONG;
+  ELEMENT_NAMES[235] = ELT_SWITCH;
+  ELEMENT_NAMES[236] = ELT_SYMBOL;
+  ELEMENT_NAMES[237] = ELT_SELECT;
+  ELEMENT_NAMES[238] = ELT_SUBSET;
+  ELEMENT_NAMES[239] = ELT_SCRIPT;
+  ELEMENT_NAMES[240] = ELT_TBREAK;
+  ELEMENT_NAMES[241] = ELT_VECTOR;
+  ELEMENT_NAMES[242] = ELT_ARTICLE;
+  ELEMENT_NAMES[243] = ELT_ANIMATE;
+  ELEMENT_NAMES[244] = ELT_ARCSECH;
+  ELEMENT_NAMES[245] = ELT_ARCCSCH;
+  ELEMENT_NAMES[246] = ELT_ARCTANH;
+  ELEMENT_NAMES[247] = ELT_ARCSINH;
+  ELEMENT_NAMES[248] = ELT_ARCCOSH;
+  ELEMENT_NAMES[249] = ELT_ARCCOTH;
+  ELEMENT_NAMES[250] = ELT_ACRONYM;
+  ELEMENT_NAMES[251] = ELT_ADDRESS;
+  ELEMENT_NAMES[252] = ELT_BGSOUND;
+  ELEMENT_NAMES[253] = ELT_COMPOSE;
+  ELEMENT_NAMES[254] = ELT_CEILING;
+  ELEMENT_NAMES[255] = ELT_CSYMBOL;
+  ELEMENT_NAMES[256] = ELT_CAPTION;
+  ELEMENT_NAMES[257] = ELT_DISCARD;
+  ELEMENT_NAMES[258] = ELT_DECLARE;
+  ELEMENT_NAMES[259] = ELT_DETAILS;
+  ELEMENT_NAMES[260] = ELT_ELLIPSE;
+  ELEMENT_NAMES[261] = ELT_FEFUNCA;
+  ELEMENT_NAMES[262] = ELT_FEFUNCB;
+  ELEMENT_NAMES[263] = ELT_FEBLEND;
+  ELEMENT_NAMES[264] = ELT_FEFLOOD;
+  ELEMENT_NAMES[265] = ELT_FEIMAGE;
+  ELEMENT_NAMES[266] = ELT_FEMERGE;
+  ELEMENT_NAMES[267] = ELT_FEFUNCG;
+  ELEMENT_NAMES[268] = ELT_FEFUNCR;
+  ELEMENT_NAMES[269] = ELT_HANDLER;
+  ELEMENT_NAMES[270] = ELT_INVERSE;
+  ELEMENT_NAMES[271] = ELT_IMPLIES;
+  ELEMENT_NAMES[272] = ELT_ISINDEX;
+  ELEMENT_NAMES[273] = ELT_LOGBASE;
+  ELEMENT_NAMES[274] = ELT_LISTING;
+  ELEMENT_NAMES[275] = ELT_MFENCED;
+  ELEMENT_NAMES[276] = ELT_MPADDED;
+  ELEMENT_NAMES[277] = ELT_MARQUEE;
+  ELEMENT_NAMES[278] = ELT_MACTION;
+  ELEMENT_NAMES[279] = ELT_MSUBSUP;
+  ELEMENT_NAMES[280] = ELT_NOEMBED;
+  ELEMENT_NAMES[281] = ELT_PICTURE;
+  ELEMENT_NAMES[282] = ELT_POLYGON;
+  ELEMENT_NAMES[283] = ELT_PATTERN;
+  ELEMENT_NAMES[284] = ELT_PRODUCT;
+  ELEMENT_NAMES[285] = ELT_SETDIFF;
+  ELEMENT_NAMES[286] = ELT_SECTION;
+  ELEMENT_NAMES[287] = ELT_SUMMARY;
+  ELEMENT_NAMES[288] = ELT_TENDSTO;
+  ELEMENT_NAMES[289] = ELT_UPLIMIT;
+  ELEMENT_NAMES[290] = ELT_ALTGLYPH;
+  ELEMENT_NAMES[291] = ELT_BASEFONT;
+  ELEMENT_NAMES[292] = ELT_CLIPPATH;
+  ELEMENT_NAMES[293] = ELT_CODOMAIN;
+  ELEMENT_NAMES[294] = ELT_COLGROUP;
+  ELEMENT_NAMES[295] = ELT_EMPTYSET;
+  ELEMENT_NAMES[296] = ELT_FACTOROF;
+  ELEMENT_NAMES[297] = ELT_FIELDSET;
+  ELEMENT_NAMES[298] = ELT_FRAMESET;
+  ELEMENT_NAMES[299] = ELT_FEOFFSET;
+  ELEMENT_NAMES[300] = ELT_GLYPHREF;
+  ELEMENT_NAMES[301] = ELT_INTERVAL;
+  ELEMENT_NAMES[302] = ELT_INTEGERS;
+  ELEMENT_NAMES[303] = ELT_INFINITY;
+  ELEMENT_NAMES[304] = ELT_LISTENER;
+  ELEMENT_NAMES[305] = ELT_LOWLIMIT;
+  ELEMENT_NAMES[306] = ELT_METADATA;
+  ELEMENT_NAMES[307] = ELT_MENCLOSE;
+  ELEMENT_NAMES[308] = ELT_MENUITEM;
+  ELEMENT_NAMES[309] = ELT_MPHANTOM;
+  ELEMENT_NAMES[310] = ELT_NOFRAMES;
+  ELEMENT_NAMES[311] = ELT_NOSCRIPT;
+  ELEMENT_NAMES[312] = ELT_OPTGROUP;
+  ELEMENT_NAMES[313] = ELT_POLYLINE;
+  ELEMENT_NAMES[314] = ELT_PREFETCH;
+  ELEMENT_NAMES[315] = ELT_PROGRESS;
+  ELEMENT_NAMES[316] = ELT_PRSUBSET;
+  ELEMENT_NAMES[317] = ELT_QUOTIENT;
+  ELEMENT_NAMES[318] = ELT_SELECTOR;
+  ELEMENT_NAMES[319] = ELT_TEXTAREA;
+  ELEMENT_NAMES[320] = ELT_TEMPLATE;
+  ELEMENT_NAMES[321] = ELT_TEXTPATH;
+  ELEMENT_NAMES[322] = ELT_VARIANCE;
+  ELEMENT_NAMES[323] = ELT_ANIMATION;
+  ELEMENT_NAMES[324] = ELT_CONJUGATE;
+  ELEMENT_NAMES[325] = ELT_CONDITION;
+  ELEMENT_NAMES[326] = ELT_COMPLEXES;
+  ELEMENT_NAMES[327] = ELT_FONT_FACE;
+  ELEMENT_NAMES[328] = ELT_FACTORIAL;
+  ELEMENT_NAMES[329] = ELT_INTERSECT;
+  ELEMENT_NAMES[330] = ELT_IMAGINARY;
+  ELEMENT_NAMES[331] = ELT_LAPLACIAN;
+  ELEMENT_NAMES[332] = ELT_MATRIXROW;
+  ELEMENT_NAMES[333] = ELT_NOTSUBSET;
+  ELEMENT_NAMES[334] = ELT_OTHERWISE;
+  ELEMENT_NAMES[335] = ELT_PIECEWISE;
+  ELEMENT_NAMES[336] = ELT_PLAINTEXT;
+  ELEMENT_NAMES[337] = ELT_RATIONALS;
+  ELEMENT_NAMES[338] = ELT_SEMANTICS;
+  ELEMENT_NAMES[339] = ELT_TRANSPOSE;
+  ELEMENT_NAMES[340] = ELT_ANNOTATION;
+  ELEMENT_NAMES[341] = ELT_BLOCKQUOTE;
+  ELEMENT_NAMES[342] = ELT_DIVERGENCE;
+  ELEMENT_NAMES[343] = ELT_EULERGAMMA;
+  ELEMENT_NAMES[344] = ELT_EQUIVALENT;
+  ELEMENT_NAMES[345] = ELT_FIGCAPTION;
+  ELEMENT_NAMES[346] = ELT_IMAGINARYI;
+  ELEMENT_NAMES[347] = ELT_MALIGNMARK;
+  ELEMENT_NAMES[348] = ELT_MUNDEROVER;
+  ELEMENT_NAMES[349] = ELT_MLABELEDTR;
+  ELEMENT_NAMES[350] = ELT_NOTANUMBER;
+  ELEMENT_NAMES[351] = ELT_SOLIDCOLOR;
+  ELEMENT_NAMES[352] = ELT_ALTGLYPHDEF;
+  ELEMENT_NAMES[353] = ELT_DETERMINANT;
+  ELEMENT_NAMES[354] = ELT_FEMERGENODE;
+  ELEMENT_NAMES[355] = ELT_FECOMPOSITE;
+  ELEMENT_NAMES[356] = ELT_FESPOTLIGHT;
+  ELEMENT_NAMES[357] = ELT_MALIGNGROUP;
+  ELEMENT_NAMES[358] = ELT_MPRESCRIPTS;
+  ELEMENT_NAMES[359] = ELT_MOMENTABOUT;
+  ELEMENT_NAMES[360] = ELT_NOTPRSUBSET;
+  ELEMENT_NAMES[361] = ELT_PARTIALDIFF;
+  ELEMENT_NAMES[362] = ELT_ALTGLYPHITEM;
+  ELEMENT_NAMES[363] = ELT_ANIMATECOLOR;
+  ELEMENT_NAMES[364] = ELT_DATATEMPLATE;
+  ELEMENT_NAMES[365] = ELT_EXPONENTIALE;
+  ELEMENT_NAMES[366] = ELT_FETURBULENCE;
+  ELEMENT_NAMES[367] = ELT_FEPOINTLIGHT;
+  ELEMENT_NAMES[368] = ELT_FEDROPSHADOW;
+  ELEMENT_NAMES[369] = ELT_FEMORPHOLOGY;
+  ELEMENT_NAMES[370] = ELT_OUTERPRODUCT;
+  ELEMENT_NAMES[371] = ELT_ANIMATEMOTION;
+  ELEMENT_NAMES[372] = ELT_COLOR_PROFILE;
+  ELEMENT_NAMES[373] = ELT_FONT_FACE_SRC;
+  ELEMENT_NAMES[374] = ELT_FONT_FACE_URI;
+  ELEMENT_NAMES[375] = ELT_FOREIGNOBJECT;
+  ELEMENT_NAMES[376] = ELT_FECOLORMATRIX;
+  ELEMENT_NAMES[377] = ELT_MISSING_GLYPH;
+  ELEMENT_NAMES[378] = ELT_MMULTISCRIPTS;
+  ELEMENT_NAMES[379] = ELT_SCALARPRODUCT;
+  ELEMENT_NAMES[380] = ELT_VECTORPRODUCT;
+  ELEMENT_NAMES[381] = ELT_ANNOTATION_XML;
+  ELEMENT_NAMES[382] = ELT_DEFINITION_SRC;
+  ELEMENT_NAMES[383] = ELT_FONT_FACE_NAME;
+  ELEMENT_NAMES[384] = ELT_FEGAUSSIANBLUR;
+  ELEMENT_NAMES[385] = ELT_FEDISTANTLIGHT;
+  ELEMENT_NAMES[386] = ELT_LINEARGRADIENT;
+  ELEMENT_NAMES[387] = ELT_NATURALNUMBERS;
+  ELEMENT_NAMES[388] = ELT_RADIALGRADIENT;
+  ELEMENT_NAMES[389] = ELT_ANIMATETRANSFORM;
+  ELEMENT_NAMES[390] = ELT_CARTESIANPRODUCT;
+  ELEMENT_NAMES[391] = ELT_FONT_FACE_FORMAT;
+  ELEMENT_NAMES[392] = ELT_FECONVOLVEMATRIX;
+  ELEMENT_NAMES[393] = ELT_FEDIFFUSELIGHTING;
+  ELEMENT_NAMES[394] = ELT_FEDISPLACEMENTMAP;
+  ELEMENT_NAMES[395] = ELT_FESPECULARLIGHTING;
+  ELEMENT_NAMES[396] = ELT_DOMAINOFAPPLICATION;
+  ELEMENT_NAMES[397] = ELT_FECOMPONENTTRANSFER;
 }
 
 void
 nsHtml5ElementName::releaseStatics()
 {
   delete ELT_NULL_ELEMENT_NAME;
   delete ELT_A;
   delete ELT_B;
@@ -1539,16 +1542,17 @@ nsHtml5ElementName::releaseStatics()
   delete ELT_APPROX;
   delete ELT_BUTTON;
   delete ELT_CIRCLE;
   delete ELT_CENTER;
   delete ELT_CURSOR;
   delete ELT_CANVAS;
   delete ELT_DIVIDE;
   delete ELT_DEGREE;
+  delete ELT_DIALOG;
   delete ELT_DOMAIN;
   delete ELT_EXISTS;
   delete ELT_FETILE;
   delete ELT_FIGURE;
   delete ELT_FORALL;
   delete ELT_FILTER;
   delete ELT_FOOTER;
   delete ELT_HGROUP;
@@ -1615,19 +1619,19 @@ nsHtml5ElementName::releaseStatics()
   delete ELT_LOGBASE;
   delete ELT_LISTING;
   delete ELT_MFENCED;
   delete ELT_MPADDED;
   delete ELT_MARQUEE;
   delete ELT_MACTION;
   delete ELT_MSUBSUP;
   delete ELT_NOEMBED;
+  delete ELT_PICTURE;
   delete ELT_POLYGON;
   delete ELT_PATTERN;
-  delete ELT_PICTURE;
   delete ELT_PRODUCT;
   delete ELT_SETDIFF;
   delete ELT_SECTION;
   delete ELT_SUMMARY;
   delete ELT_TENDSTO;
   delete ELT_UPLIMIT;
   delete ELT_ALTGLYPH;
   delete ELT_BASEFONT;
--- a/parser/html/nsHtml5ElementName.h
+++ b/parser/html/nsHtml5ElementName.h
@@ -1,27 +1,27 @@
 /*
- * Copyright (c) 2008-2014 Mozilla Foundation
+ * Copyright (c) 2008-2016 Mozilla Foundation
  *
- * Permission is hereby granted, free of charge, to any person obtaining a 
- * copy of this software and associated documentation files (the "Software"), 
- * to deal in the Software without restriction, including without limitation 
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, 
- * and/or sell copies of the Software, and to permit persons to whom the 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
  *
- * The above copyright notice and this permission notice shall be included in 
+ * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
 
 /*
  * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
  * Please edit ElementName.java instead and regenerate.
  */
 
@@ -278,16 +278,17 @@ class nsHtml5ElementName
     static nsHtml5ElementName* ELT_APPROX;
     static nsHtml5ElementName* ELT_BUTTON;
     static nsHtml5ElementName* ELT_CIRCLE;
     static nsHtml5ElementName* ELT_CENTER;
     static nsHtml5ElementName* ELT_CURSOR;
     static nsHtml5ElementName* ELT_CANVAS;
     static nsHtml5ElementName* ELT_DIVIDE;
     static nsHtml5ElementName* ELT_DEGREE;
+    static nsHtml5ElementName* ELT_DIALOG;
     static nsHtml5ElementName* ELT_DOMAIN;
     static nsHtml5ElementName* ELT_EXISTS;
     static nsHtml5ElementName* ELT_FETILE;
     static nsHtml5ElementName* ELT_FIGURE;
     static nsHtml5ElementName* ELT_FORALL;
     static nsHtml5ElementName* ELT_FILTER;
     static nsHtml5ElementName* ELT_FOOTER;
     static nsHtml5ElementName* ELT_HGROUP;
@@ -354,19 +355,19 @@ class nsHtml5ElementName
     static nsHtml5ElementName* ELT_LOGBASE;
     static nsHtml5ElementName* ELT_LISTING;
     static nsHtml5ElementName* ELT_MFENCED;
     static nsHtml5ElementName* ELT_MPADDED;
     static nsHtml5ElementName* ELT_MARQUEE;
     static nsHtml5ElementName* ELT_MACTION;
     static nsHtml5ElementName* ELT_MSUBSUP;
     static nsHtml5ElementName* ELT_NOEMBED;
+    static nsHtml5ElementName* ELT_PICTURE;
     static nsHtml5ElementName* ELT_POLYGON;
     static nsHtml5ElementName* ELT_PATTERN;
-    static nsHtml5ElementName* ELT_PICTURE;
     static nsHtml5ElementName* ELT_PRODUCT;
     static nsHtml5ElementName* ELT_SETDIFF;
     static nsHtml5ElementName* ELT_SECTION;
     static nsHtml5ElementName* ELT_SUMMARY;
     static nsHtml5ElementName* ELT_TENDSTO;
     static nsHtml5ElementName* ELT_UPLIMIT;
     static nsHtml5ElementName* ELT_ALTGLYPH;
     static nsHtml5ElementName* ELT_BASEFONT;
--- a/parser/html/nsHtml5TreeBuilder.cpp
+++ b/parser/html/nsHtml5TreeBuilder.cpp
@@ -1043,17 +1043,17 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
               if (addAttributesToBody(attributes)) {
                 attributes = nullptr;
               }
               NS_HTML5_BREAK(starttagloop);
             }
             case NS_HTML5TREE_BUILDER_P:
             case NS_HTML5TREE_BUILDER_DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU:
             case NS_HTML5TREE_BUILDER_UL_OR_OL_OR_DL:
-            case NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY: {
+            case NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY: {
               implicitlyCloseP();
               appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case NS_HTML5TREE_BUILDER_H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6: {
               implicitlyCloseP();
               if (stack[currentPtr]->getGroup() == NS_HTML5TREE_BUILDER_H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6) {
@@ -2542,17 +2542,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
             mode = NS_HTML5TREE_BUILDER_AFTER_BODY;
             continue;
           }
           case NS_HTML5TREE_BUILDER_DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU:
           case NS_HTML5TREE_BUILDER_UL_OR_OL_OR_DL:
           case NS_HTML5TREE_BUILDER_PRE_OR_LISTING:
           case NS_HTML5TREE_BUILDER_FIELDSET:
           case NS_HTML5TREE_BUILDER_BUTTON:
-          case NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY: {
+          case NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY: {
             eltPos = findLastInScope(name);
             if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
               errStrayEndTag(name);
             } else {
               generateImpliedEndTags();
               if (!!MOZ_UNLIKELY(mViewSource) && !isCurrent(name)) {
                 errUnclosedElements(eltPos, name);
               }
--- a/parser/html/nsHtml5TreeBuilder.h
+++ b/parser/html/nsHtml5TreeBuilder.h
@@ -319,17 +319,17 @@ class nsHtml5TreeBuilder : public nsAHtm
 #define NS_HTML5TREE_BUILDER_MARQUEE_OR_APPLET 43
 #define NS_HTML5TREE_BUILDER_PRE_OR_LISTING 44
 #define NS_HTML5TREE_BUILDER_B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U 45
 #define NS_HTML5TREE_BUILDER_UL_OR_OL_OR_DL 46
 #define NS_HTML5TREE_BUILDER_IFRAME 47
 #define NS_HTML5TREE_BUILDER_EMBED 48
 #define NS_HTML5TREE_BUILDER_AREA_OR_WBR 49
 #define NS_HTML5TREE_BUILDER_DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU 50
-#define NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY 51
+#define NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY 51
 #define NS_HTML5TREE_BUILDER_RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR 52
 #define NS_HTML5TREE_BUILDER_RB_OR_RTC 53
 #define NS_HTML5TREE_BUILDER_PARAM_OR_SOURCE_OR_TRACK 55
 #define NS_HTML5TREE_BUILDER_MGLYPH_OR_MALIGNMARK 56
 #define NS_HTML5TREE_BUILDER_MI_MO_MN_MS_MTEXT 57
 #define NS_HTML5TREE_BUILDER_ANNOTATION_XML 58
 #define NS_HTML5TREE_BUILDER_FOREIGNOBJECT_OR_DESC 59
 #define NS_HTML5TREE_BUILDER_NOEMBED 60
--- a/parser/htmlparser/nsElementTable.cpp
+++ b/parser/htmlparser/nsElementTable.cpp
@@ -147,16 +147,20 @@ const nsHTMLElement gHTMLElements[] = {
     /*tag*/         eHTMLTag_details,
     /*parent,leaf*/ kBlock, false
   },
   {
     /*tag*/         eHTMLTag_dfn,
     /*parent,leaf*/ kPhrase, false
   },
   {
+    /*tag*/         eHTMLTag_dialog,
+    /*parent,leaf*/ kBlock, false
+  },
+  {
     /*tag*/         eHTMLTag_dir,
     /*parent,leaf*/ kList, false
   },
   {
     /*tag*/         eHTMLTag_div,
     /*parent,leaf*/ kBlock, false
   },
   {
--- a/parser/htmlparser/nsHTMLTagList.h
+++ b/parser/htmlparser/nsHTMLTagList.h
@@ -68,16 +68,17 @@ HTML_TAG(col, TableCol, TableCol)
 HTML_TAG(colgroup, TableCol, TableCol)
 HTML_TAG(content, Content, Content)
 HTML_TAG(data, Data, Data)
 HTML_TAG(datalist, DataList, DataList)
 HTML_HTMLELEMENT_TAG(dd)
 HTML_TAG(del, Mod, Mod)
 HTML_TAG(details, Details, Details)
 HTML_HTMLELEMENT_TAG(dfn)
+HTML_TAG(dialog, Dialog, Dialog)
 HTML_TAG(dir, Shared, Directory)
 HTML_TAG(div, Div, Div)
 HTML_TAG(dl, SharedList, DList)
 HTML_HTMLELEMENT_TAG(dt)
 HTML_HTMLELEMENT_TAG(em)
 HTML_TAG(embed, SharedObject, Embed)
 HTML_TAG(fieldset, FieldSet, FieldSet)
 HTML_HTMLELEMENT_TAG(figcaption)
--- a/testing/talos/talos/tests/tabpaint/bootstrap.js
+++ b/testing/talos/talos/tests/tabpaint/bootstrap.js
@@ -23,16 +23,18 @@
 var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource:///modules/RecentWindow.jsm");
 
 const TAB_ANIMATION_PREF = "browser.tabs.animate";
 
+const PROCESS_COUNT_PREF = "dom.ipc.processCount";
+
 const TARGET_URI = "chrome://tabpaint/content/target.html";
 
 var TabPaint = {
   MESSAGES: [
     "TabPaint:Go",
     "TabPaint:Painted",
   ],
 
@@ -65,24 +67,27 @@ var TabPaint = {
     // is wait for the tabpaint.html content to send us a message to
     // get us moving.
     for (let msgName of this.MESSAGES) {
       Services.mm.addMessageListener(msgName, this);
     }
 
     this.originalTabsAnimate = Services.prefs.getBoolPref(TAB_ANIMATION_PREF);
     Services.prefs.setBoolPref(TAB_ANIMATION_PREF, false);
+    this.originalProcessCount = Services.prefs.getIntPref(PROCESS_COUNT_PREF);
+    Services.prefs.setIntPref(PROCESS_COUNT_PREF, 1);
   },
 
   uninit() {
     for (let msgName of this.MESSAGES) {
       Services.mm.removeMessageListener(msgName, this);
     }
 
     Services.prefs.setBoolPref(TAB_ANIMATION_PREF, this.originalTabsAnimate);
+    Services.prefs.setIntPref(PROCESS_COUNT_PREF, this.originalProcessCount);
   },
 
   receiveMessage(msg) {
     let browser = msg.target;
 
     let gBrowser = browser.ownerGlobal.gBrowser;
 
     switch(msg.name) {
--- a/testing/talos/talos/tests/tabpaint/install.rdf
+++ b/testing/talos/talos/tests/tabpaint/install.rdf
@@ -1,15 +1,15 @@
 <?xml version="1.0"?>
 <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
   <Description about="urn:mozilla:install-manifest">
     <em:id>tabpaint-test@mozilla.org</em:id>
     <em:type>2</em:type>
     <em:name>tabpaint test</em:name>
-    <em:version>1.0.0</em:version>
+    <em:version>1.0.1</em:version>
     <em:bootstrap>true</em:bootstrap>
     <em:description>Measures the performance of opening tabs</em:description>
     <em:creator>Mike Conley</em:creator>
     <em:multiprocessCompatible>true</em:multiprocessCompatible>
 
     <!-- Desktop -->
     <em:targetApplication>
       <Description>
index 4956d03b09855cb8b48874c73cca51616487321e..ad990811fcae9864a66566c52e04a68b7782f570
GIT binary patch
literal 9609
zc$}S@byOVNw(c8u*Py{^Ah^4`ySsaE4IbPbf(Ccj;M%wo9D)aT4ZLK(ac}m?+h^Q!
z->Ol6tRCIJS)=Q#IlsATDat@VVgdjFSOAkcsq`tGXz>Li0HBTv0Q~w?PE1wkos_&d
zgPntym94E2y_2)inudm|sug+>gj`JY&Xhl6u>B*uQeZ-S010ehZV<T?{8})jw5^jo
zJZXXu9%xxQj$8;;2$ir-G66Ax9Cjq|H0t!YkN;%J`S#>PbFYC~@%M5SK)^JtI0bed
zVXX{IK42dmcODG<Gczt^?-W3l(doSxY+B+c#N3BG$PtRECNRiLY<~dBo^bbDMqFs-
zuH{)Zq^Tc;Q2AW!@Q3$%kjCI4Jw23zxc2^6kcxd<UYr6{78W+a+!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?}Amlv1u2hh${QIBJe
z+qU}I_07L|TsncqfiH?*ApZ59@}Gg#SpS@P0)AD<f7oK-Y>qG?J1Ij4d?!7RB=e4D
zVr;TrnQ@L~^U{@R-W4RP@Q!}^Ms93W7J|6~^BEpt#K|cLDH2g7dJTzS^vf4s8ro4i
zyVgKH0wkv7RLVyzOBl=~Pbe-=Y<1`-P27x+Ar!4Ul;S%pPVd2f$_)%06XM_R|M;)r
z4+i)*yFq>th#>y`^638^sDKk8G9<u%uvq$w_V1TVe~n+4QV?MDllGr1p8lQqPcHm7
zQ5OgBpL+5?p?^B;-_Us+!2ix~{~i5LhUzz32oLbTu~&Zw|5FwH4K5@A{3kW_&p+YM
zr2HFLOa%DPQ}o}l|CD=wV{wT80sB8?;y)GtXNvu;_*mk9PPl&({(PW+6HG|{@$pua
Ufr9?^1%#i6>(8(+B)?|=2U73zRsaA1
--- a/testing/talos/talos/tests/tabswitch/bootstrap.js
+++ b/testing/talos/talos/tests/tabswitch/bootstrap.js
@@ -152,17 +152,16 @@ function loadTPSContentScript(browser) {
        * Note also that this comment needs to stay inside this comment
        * block. No // comments allowed when serializing JS to content
        * scripts this way.
        */
       let cwu = content.QueryInterface(Ci.nsIInterfaceRequestor)
                        .getInterface(Ci.nsIDOMWindowUtils);
       let lastTransactionId = cwu.lastTransactionId;
       Services.profiler.AddMarker("Content waiting for id > " + lastTransactionId);
-
       addEventListener("MozAfterPaint", function onPaint(event) {
         Services.profiler.AddMarker("Content saw transaction id: " + event.transactionId);
         if (event.transactionId > lastTransactionId) {
           Services.profiler.AddMarker("Content saw correct MozAfterPaint");
           sendAsyncMessage("TPS:ContentSawPaint", {
             time: Date.now().valueOf(),
           });
           removeEventListener("MozAfterPaint", onPaint);
@@ -398,16 +397,28 @@ function test(window) {
     // in an attempt to put the graphics layer into a "steady"
     // state before switching to the next tab.
     initialTab.linkedBrowser.loadURI("about:blank", null, null);
 
     let tabs = gBrowser.getTabsToTheEndFrom(initialTab);
     let times = [];
 
     for (let tab of tabs) {
+      // Let's do an initial run to warm up any paint related caches
+      // (like glyph caches for text). In the next loop we will start with
+      // a GC before each switch so we don't need here.
+      // Note: in case of multiple content processes, closing all the tabs
+      // would close the related content processes, and even if we kept them
+      // alive it would be unlikely that the same pages end up in the same
+      // content processes, so we cannot do this at the manifest level.
+      yield switchToTab(tab);
+      yield switchToTab(initialTab);
+    }
+
+    for (let tab of tabs) {
       yield forceGC(win, tab.linkedBrowser);
       let time = yield switchToTab(tab);
       dump(`${tab.linkedBrowser.currentURI.spec}: ${time}ms\n`);
       times.push(time);
       yield switchToTab(initialTab);
     }
 
     let output = '<!DOCTYPE html>'+
--- a/testing/talos/talos/tests/tabswitch/install.rdf
+++ b/testing/talos/talos/tests/tabswitch/install.rdf
@@ -1,15 +1,15 @@
 <?xml version="1.0"?>
 <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
   <Description about="urn:mozilla:install-manifest">
     <em:id>tab-switch-test@lassey.us</em:id>
     <em:type>2</em:type>
     <em:name>Tab Switch Test</em:name>
-    <em:version>1.0.2</em:version>
+    <em:version>1.0.3</em:version>
     <em:optionsType>2</em:optionsType>
     <em:optionsURL>chrome://tabswitch/content/options.xul</em:optionsURL>
     <em:bootstrap>true</em:bootstrap>
     <em:description>Measures the performance of switching tabs</em:description>
     <em:creator>Brad Lassey</em:creator>
     <em:multiprocessCompatible>true</em:multiprocessCompatible>
     <!-- Desktop -->
     <em:targetApplication>
index 50b3bb6cb1a1688a53484c44fb0858160428ca6e..cea60112ff1009c1613a4da1f7da59e810294349
GIT binary patch
literal 13350
zc$}qs1CS=mw(j4yZQGc(r)}G|ZFf&ko70-sv~AnAZQFjc&wcmqeRiA^@7#D9kr9;@
zkzcM@tg3I7yc7s1DgXe01PG`QOBS!xcmm)6098Z);E%g9BFchv60)KUHg=vC*475}
zj!p*aYG%p_r#0juQ|W@9P%a=udoUu1%AQF1;-Cg3#Dp@yIi$)Kf=G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TszM*C0r>c7kP_tN(#
zVhj!7KPrTOSL5Gn-k*p^G=Tq21^lb1|Ed7|3Cv0d_+OQSzem&GGyk8_ltlNh>%iX;
h{+=xUMEJ$<FH?uS6c{+*A3BExO#coHe#Spm{|7u!2QL5s
--- a/testing/web-platform/meta/html/browsers/the-window-object/window-properties.html.ini
+++ b/testing/web-platform/meta/html/browsers/the-window-object/window-properties.html.ini
@@ -1,14 +1,11 @@
 [window-properties.html]
   type: testharness
   [Window attribute: oncancel]
     expected: FAIL
 
-  [Window attribute: onclose]
-    expected: FAIL
-
   [Window attribute: oncuechange]
     expected: FAIL
 
   [Window attribute: onmousewheel]
     expected: FAIL
 
--- a/testing/web-platform/meta/html/dom/interfaces.html.ini
+++ b/testing/web-platform/meta/html/dom/interfaces.html.ini
@@ -1,11 +1,11 @@
 [interfaces.html]
   type: testharness
-  prefs: [dom.forms.inputmode:true]
+  prefs: [dom.forms.inputmode:true, dom.dialog_element.enabled:true]
   [Document interface: attribute domain]
     expected: FAIL
 
   [Document interface: attribute cookie]
     expected: FAIL
 
   [Document interface: attribute body]
     expected: FAIL
@@ -116,19 +116,16 @@
     expected: FAIL
 
   [Document interface: attribute onautocompleteerror]
     expected: FAIL
 
   [Document interface: attribute oncancel]
     expected: FAIL
 
-  [Document interface: attribute onclose]
-    expected: FAIL
-
   [Document interface: attribute oncuechange]
     expected: FAIL
 
   [Document interface: attribute onmousewheel]
     expected: FAIL
 
   [Document interface: attribute onsort]
     expected: FAIL
@@ -167,19 +164,16 @@
     expected: FAIL
 
   [Document interface: iframe.contentDocument must inherit property "onautocompleteerror" with the proper type (95)]
     expected: FAIL
 
   [Document interface: iframe.contentDocument must inherit property "oncancel" with the proper type (97)]
     expected: FAIL
 
-  [Document interface: iframe.contentDocument must inherit property "onclose" with the proper type (102)]
-    expected: FAIL
-
   [Document interface: iframe.contentDocument must inherit property "oncuechange" with the proper type (104)]
     expected: FAIL
 
   [Document interface: iframe.contentDocument must inherit property "onmousewheel" with the proper type (135)]
     expected: FAIL
 
   [Document interface: iframe.contentDocument must inherit property "onsort" with the proper type (148)]
     expected: FAIL
@@ -353,19 +347,16 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "onautocompleteerror" with the proper type (95)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncancel" with the proper type (97)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "onclose" with the proper type (102)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncuechange" with the proper type (104)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "onmousewheel" with the proper type (135)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "onsort" with the proper type (148)]
     expected: FAIL
@@ -473,19 +464,16 @@
     expected: FAIL
 
   [HTMLElement interface: attribute onautocompleteerror]
     expected: FAIL
 
   [HTMLElement interface: attribute oncancel]
     expected: FAIL
 
-  [HTMLElement interface: attribute onclose]
-    expected: FAIL
-
   [HTMLElement interface: attribute oncuechange]
     expected: FAIL
 
   [HTMLElement interface: attribute onmousewheel]
     expected: FAIL
 
   [HTMLElement interface: attribute onsort]
     expected: FAIL
@@ -521,19 +509,16 @@
     expected: FAIL
 
   [HTMLElement interface: document.createElement("noscript") must inherit property "onautocompleteerror" with the proper type (27)]
     expected: FAIL
 
   [HTMLElement interface: document.createElement("noscript") must inherit property "oncancel" with the proper type (29)]
     expected: FAIL
 
-  [HTMLElement interface: document.createElement("noscript") must inherit property "onclose" with the proper type (34)]
-    expected: FAIL
-
   [HTMLElement interface: document.createElement("noscript") must inherit property "oncuechange" with the proper type (36)]
     expected: FAIL
 
   [HTMLElement interface: document.createElement("noscript") must inherit property "onmousewheel" with the proper type (67)]
     expected: FAIL
 
   [HTMLElement interface: document.createElement("noscript") must inherit property "onsort" with the proper type (80)]
     expected: FAIL
@@ -1328,43 +1313,16 @@
     expected: FAIL
 
   [RelatedEvent interface: existence and properties of interface prototype object's "constructor" property]
     expected: FAIL
 
   [RelatedEvent interface: attribute relatedTarget]
     expected: FAIL
 
-  [HTMLDialogElement interface: existence and properties of interface object]
-    expected: FAIL
-
-  [HTMLDialogElement interface object length]
-    expected: FAIL
-
-  [HTMLDialogElement interface: existence and properties of interface prototype object]
-    expected: FAIL
-
-  [HTMLDialogElement interface: existence and properties of interface prototype object's "constructor" property]
-    expected: FAIL
-
-  [HTMLDialogElement interface: attribute open]
-    expected: FAIL
-
-  [HTMLDialogElement interface: attribute returnValue]
-    expected: FAIL
-
-  [HTMLDialogElement interface: operation show([object Object\],[object Object\])]
-    expected: FAIL
-
-  [HTMLDialogElement interface: operation showModal([object Object\],[object Object\])]
-    expected: FAIL
-
-  [HTMLDialogElement interface: operation close(DOMString)]
-    expected: FAIL
-
   [HTMLCanvasElement interface: operation probablySupportsContext(DOMString,any)]
     expected: FAIL
 
   [HTMLCanvasElement interface: operation setContext(RenderingContext)]
     expected: FAIL
 
   [HTMLCanvasElement interface: operation transferControlToProxy()]
     expected: FAIL
@@ -1614,19 +1572,16 @@
     expected: FAIL
 
   [Window interface: attribute onautocompleteerror]
     expected: FAIL
 
   [Window interface: attribute oncancel]
     expected: FAIL
 
-  [Window interface: attribute onclose]
-    expected: FAIL
-
   [Window interface: attribute oncuechange]
     expected: FAIL
 
   [Window interface: attribute onmousewheel]
     expected: FAIL
 
   [Window interface: attribute onsort]
     expected: FAIL
@@ -1642,19 +1597,16 @@
     expected: FAIL
 
   [Window interface: window must inherit property "onautocompleteerror" with the proper type (40)]
     expected: FAIL
 
   [Window interface: window must inherit property "oncancel" with the proper type (42)]
     expected: FAIL
 
-  [Window interface: window must inherit property "onclose" with the proper type (47)]
-    expected: FAIL
-
   [Window interface: window must inherit property "oncuechange" with the proper type (49)]
     expected: FAIL
 
   [Window interface: window must inherit property "onmousewheel" with the proper type (80)]
     expected: FAIL
 
   [Window interface: window must inherit property "onsort" with the proper type (93)]
     expected: FAIL
@@ -2126,19 +2078,16 @@
     expected: FAIL
 
   [Document interface: iframe.contentDocument must inherit property "onautocompleteerror" with the proper type (96)]
     expected: FAIL
 
   [Document interface: iframe.contentDocument must inherit property "oncancel" with the proper type (98)]
     expected: FAIL
 
-  [Document interface: iframe.contentDocument must inherit property "onclose" with the proper type (103)]
-    expected: FAIL
-
   [Document interface: iframe.contentDocument must inherit property "oncuechange" with the proper type (105)]
     expected: FAIL
 
   [Document interface: iframe.contentDocument must inherit property "onmousewheel" with the proper type (136)]
     expected: FAIL
 
   [Document interface: iframe.contentDocument must inherit property "onsort" with the proper type (149)]
     expected: FAIL
@@ -2264,19 +2213,16 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "onautocompleteerror" with the proper type (96)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncancel" with the proper type (98)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "onclose" with the proper type (103)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncuechange" with the proper type (105)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "onmousewheel" with the proper type (136)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "onsort" with the proper type (149)]
     expected: FAIL
@@ -2339,19 +2285,16 @@
     expected: FAIL
 
   [AutocompleteErrorEvent interface object name]
     expected: FAIL
 
   [RelatedEvent interface object name]
     expected: FAIL
 
-  [HTMLDialogElement interface object name]
-    expected: FAIL
-
   [CanvasProxy interface object name]
     expected: FAIL
 
   [DrawingStyle interface object name]
     expected: FAIL
 
   [ApplicationCache interface object name]
     expected: FAIL
@@ -2558,19 +2501,16 @@
     expected: FAIL
 
   [Document interface: new Document() must inherit property "onautocompleteerror" with the proper type (95)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "oncancel" with the proper type (97)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "onclose" with the proper type (102)]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "oncuechange" with the proper type (104)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "onmousewheel" with the proper type (135)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "onsort" with the proper type (148)]
     expected: FAIL
@@ -2885,19 +2825,16 @@
     expected: FAIL
 
   [Document interface: iframe.contentDocument must inherit property "all" with the proper type (79)]
     expected: FAIL
 
   [Document interface: iframe.contentDocument must inherit property "oncancel" with the proper type (91)]
     expected: FAIL
 
-  [Document interface: iframe.contentDocument must inherit property "onclose" with the proper type (96)]
-    expected: FAIL
-
   [Document interface: iframe.contentDocument must inherit property "oncuechange" with the proper type (98)]
     expected: FAIL
 
   [Document interface: iframe.contentDocument must inherit property "onmousewheel" with the proper type (129)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "open" with the proper type (53)]
     expected: FAIL
@@ -2966,19 +2903,16 @@
     expected: FAIL
 
   [Document interface: new Document() must inherit property "all" with the proper type (79)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "oncancel" with the proper type (91)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "onclose" with the proper type (96)]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "oncuechange" with the proper type (98)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "onmousewheel" with the proper type (129)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "open" with the proper type (53)]
     expected: FAIL
@@ -3047,34 +2981,28 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "all" with the proper type (79)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncancel" with the proper type (91)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "onclose" with the proper type (96)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncuechange" with the proper type (98)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "onmousewheel" with the proper type (129)]
     expected: FAIL
 
   [HTMLElement interface: document.createElement("noscript") must inherit property "forceSpellCheck" with the proper type (16)]
     expected: FAIL
 
   [HTMLElement interface: document.createElement("noscript") must inherit property "oncancel" with the proper type (20)]
     expected: FAIL
 
-  [HTMLElement interface: document.createElement("noscript") must inherit property "onclose" with the proper type (25)]
-    expected: FAIL
-
   [HTMLElement interface: document.createElement("noscript") must inherit property "oncuechange" with the proper type (27)]
     expected: FAIL
 
   [HTMLElement interface: document.createElement("noscript") must inherit property "onmousewheel" with the proper type (58)]
     expected: FAIL
 
   [HTMLStyleElement interface: attribute nonce]
     expected: FAIL
@@ -3218,19 +3146,16 @@
     expected: FAIL
 
   [CanvasPattern interface: operation setTransform(DOMMatrixInit)]
     expected: FAIL
 
   [Window interface: window must inherit property "oncancel" with the proper type (40)]
     expected: FAIL
 
-  [Window interface: window must inherit property "onclose" with the proper type (45)]
-    expected: FAIL
-
   [Window interface: window must inherit property "oncuechange" with the proper type (47)]
     expected: FAIL
 
   [Window interface: window must inherit property "onmousewheel" with the proper type (78)]
     expected: FAIL
 
   [Navigator interface: operation isProtocolHandlerRegistered(DOMString,USVString)]
     expected: FAIL
@@ -3275,19 +3200,16 @@
     expected: FAIL
 
   [Document interface: iframe.contentDocument must inherit property "all" with the proper type (80)]
     expected: FAIL
 
   [Document interface: iframe.contentDocument must inherit property "oncancel" with the proper type (92)]
     expected: FAIL
 
-  [Document interface: iframe.contentDocument must inherit property "onclose" with the proper type (97)]
-    expected: FAIL
-
   [Document interface: iframe.contentDocument must inherit property "oncuechange" with the proper type (99)]
     expected: FAIL
 
   [Document interface: iframe.contentDocument must inherit property "onmousewheel" with the proper type (130)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "styleSheetSets" with the proper type (33)]
     expected: FAIL
@@ -3356,19 +3278,16 @@
     expected: FAIL
 
   [Document interface: new Document() must inherit property "all" with the proper type (80)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "oncancel" with the proper type (92)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "onclose" with the proper type (97)]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "oncuechange" with the proper type (99)]
     expected: FAIL
 
   [Document interface: new Document() must inherit property "onmousewheel" with the proper type (130)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "styleSheetSets" with the proper type (33)]
     expected: FAIL
@@ -3437,20 +3356,16 @@
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "all" with the proper type (80)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncancel" with the proper type (92)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "onclose" with the proper type (97)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncuechange" with the proper type (99)]
     expected: FAIL
 
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "onmousewheel" with the proper type (130)]
     expected: FAIL
 
   [Location interface: stringifier]
     expected: FAIL
-
--- a/testing/web-platform/meta/html/dom/reflection-misc.html.ini
+++ b/testing/web-platform/meta/html/dom/reflection-misc.html.ini
@@ -1,10 +1,11 @@
 [reflection-misc.html]
   type: testharness
+  prefs: [dom.dialog_element.enabled: true]
   [html.tabIndex: setAttribute() to object "3" followed by getAttribute()]
     expected: FAIL
 
   [html.tabIndex: setAttribute() to object "3" followed by IDL get]
     expected: FAIL
 
   [script.tabIndex: setAttribute() to object "3" followed by getAttribute()]
     expected: FAIL
@@ -478,124 +479,16 @@
     expected: FAIL
 
   [undefinedelement.tabIndex: setAttribute() to object "3" followed by getAttribute()]
     expected: FAIL
 
   [undefinedelement.tabIndex: setAttribute() to object "3" followed by IDL get]
     expected: FAIL
 
-  [dialog.open: typeof IDL attribute]
-    expected: FAIL
-
-  [dialog.open: IDL get with DOM attribute unset]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to "" followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to " foo " followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to undefined followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to null followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to 7 followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to 1.5 followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to true followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to false followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to object "[object Object\]" followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to NaN followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to Infinity followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to -Infinity followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to "\\0" followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to object "test-toString" followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to object "test-valueOf" followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to "open" followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: IDL set to "" followed by hasAttribute()]
-    expected: FAIL
-
-  [dialog.open: IDL set to "" followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: IDL set to " foo " followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: IDL set to undefined followed by hasAttribute()]
-    expected: FAIL
-
-  [dialog.open: IDL set to undefined followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: IDL set to null followed by hasAttribute()]
-    expected: FAIL
-
-  [dialog.open: IDL set to null followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: IDL set to 7 followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: IDL set to 1.5 followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: IDL set to false followed by hasAttribute()]
-    expected: FAIL
-
-  [dialog.open: IDL set to object "[object Object\]" followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: IDL set to NaN followed by hasAttribute()]
-    expected: FAIL
-
-  [dialog.open: IDL set to NaN followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: IDL set to Infinity followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: IDL set to -Infinity followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: IDL set to "\\0" followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: IDL set to object "test-toString" followed by IDL get]
-    expected: FAIL
-
-  [dialog.open: IDL set to object "test-valueOf" followed by IDL get]
-    expected: FAIL
-
   [menu.type: setAttribute() to ""]
     expected: FAIL
 
   [menu.type: setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f  foo "]
     expected: FAIL
 
   [menu.type: setAttribute() to undefined]
     expected: FAIL
@@ -984,99 +877,8 @@
   [menuitem.default: IDL set to "\\0"]
     expected: FAIL
 
   [menuitem.default: IDL set to object "test-toString"]
     expected: FAIL
 
   [menuitem.default: IDL set to object "test-valueOf"]
     expected: FAIL
-
-  [dialog.open: setAttribute() to ""]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to " foo "]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to undefined]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to null]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to 7]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to 1.5]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to true]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to false]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to object "[object Object\]"]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to NaN]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to Infinity]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to -Infinity]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to "\\0"]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to object "test-toString"]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to object "test-valueOf"]
-    expected: FAIL
-
-  [dialog.open: setAttribute() to "open"]
-    expected: FAIL
-
-  [dialog.open: IDL set to ""]
-    expected: FAIL
-
-  [dialog.open: IDL set to " foo "]
-    expected: FAIL
-
-  [dialog.open: IDL set to undefined]
-    expected: FAIL
-
-  [dialog.open: IDL set to null]
-    expected: FAIL
-
-  [dialog.open: IDL set to 7]
-    expected: FAIL
-
-  [dialog.open: IDL set to 1.5]
-    expected: FAIL
-
-  [dialog.open: IDL set to false]
-    expected: FAIL
-
-  [dialog.open: IDL set to object "[object Object\]"]
-    expected: FAIL
-
-  [dialog.open: IDL set to NaN]
-    expected: FAIL
-
-  [dialog.open: IDL set to Infinity]
-    expected: FAIL
-
-  [dialog.open: IDL set to -Infinity]
-    expected: FAIL
-
-  [dialog.open: IDL set to "\\0"]
-    expected: FAIL
-
-  [dialog.open: IDL set to object "test-toString"]
-    expected: FAIL
-
-  [dialog.open: IDL set to object "test-valueOf"]
-    expected: FAIL
-
--- a/testing/web-platform/meta/html/semantics/interactive-elements/the-dialog-element/dialog-close.html.ini
+++ b/testing/web-platform/meta/html/semantics/interactive-elements/the-dialog-element/dialog-close.html.ini
@@ -1,20 +1,3 @@
 [dialog-close.html]
   type: testharness
-  [close() fires a close event]
-    expected: FAIL
-
-  [close() on a <dialog> that doesn't have an open attribute throws an InvalidStateError exception]
-    expected: FAIL
-
-  [close() removes the open attribute and set the returnValue to the first argument]
-    expected: FAIL
-
-  [close() without argument removes the open attribute and there's no returnValue]
-    expected: FAIL
-
-  [close() should set the returnValue IDL attribute but not the JS property]
-    expected: FAIL
-
-  [close() on a <dialog> that doesn't have an open attribute aborts the steps]
-    expected: FAIL
-
+  prefs: [dom.dialog_element.enabled:true]
--- a/testing/web-platform/meta/html/semantics/interactive-elements/the-dialog-element/dialog-open.html.ini
+++ b/testing/web-platform/meta/html/semantics/interactive-elements/the-dialog-element/dialog-open.html.ini
@@ -1,8 +1,3 @@
 [dialog-open.html]
   type: testharness
-  [On getting, the IDL open attribute must return true if the content open attribute is set, and false if it is absent.]
-    expected: FAIL
-
-  [On setting, the content open attribute must be removed if the IDL open attribute is set to false, and must be present if the IDL open attribute is set to true.]
-    expected: FAIL
-
+  prefs: [dom.dialog_element.enabled:true]
--- a/testing/web-platform/meta/html/semantics/interactive-elements/the-dialog-element/dialog-showModal.html.ini
+++ b/testing/web-platform/meta/html/semantics/interactive-elements/the-dialog-element/dialog-showModal.html.ini
@@ -1,23 +1,17 @@
 [dialog-showModal.html]
   type: testharness
+  prefs: [dom.dialog_element.enabled:true]
   [dialog element: showModal()]
     expected: FAIL
 
-  [showModal() on a <dialog> that already has an open attribute throws an InvalidStateError exception]
-    expected: FAIL
-
-  [showModal() on a <dialog> not in a Document throws an InvalidStateError exception]
-    expected: FAIL
-
   [when opening multiple dialogs, only the newest one is non-inert]
     expected: FAIL
 
   [opening dialog without focusable children]
     expected: FAIL
 
   [opening dialog with multiple focusable children]
     expected: FAIL
 
   [opening dialog with multiple focusable children, one having the autofocus attribute]
     expected: FAIL
-
--- a/testing/web-platform/meta/html/semantics/interfaces.html.ini
+++ b/testing/web-platform/meta/html/semantics/interfaces.html.ini
@@ -1,41 +1,35 @@
 [interfaces.html]
   type: testharness
+  prefs: [dom.dialog_element.enabled: true]
   [Interfaces for image]
     expected: FAIL
 
   [Interfaces for keygen]
     expected: FAIL
 
   [Interfaces for marquee]
     expected: FAIL
 
   [Interfaces for bdi]
     expected: FAIL
 
-  [Interfaces for dialog]
-    expected: FAIL
-
   [Interfaces for IMAGE]
     expected: FAIL
 
   [Interfaces for KEYGEN]
     expected: FAIL
 
   [Interfaces for MARQUEE]
     expected: FAIL
 
   [Interfaces for BDI]
     expected: FAIL
 
-  [Interfaces for DIALOG]
-    expected: FAIL
-
   [Interfaces for slot]
     expected: FAIL
 
   [Interfaces for SLOT]
     expected: FAIL
 
   [Interfaces for å-bar]
     expected: FAIL
-
--- a/testing/web-platform/meta/svg/interfaces.html.ini
+++ b/testing/web-platform/meta/svg/interfaces.html.ini
@@ -97,37 +97,31 @@
     expected: FAIL
 
   [SVGElement interface: svg must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: svg must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: svg must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: svg must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: svg must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: g must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: g must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: g must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: g must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: g must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: g must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGUnknownElement interface: existence and properties of interface object]
     expected: FAIL
@@ -148,145 +142,121 @@
     expected: FAIL
 
   [SVGElement interface: defs must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: defs must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: defs must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: defs must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: defs must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: Desc must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: Desc must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: Desc must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: Desc must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: Desc must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: Desc must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: metadata must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: metadata must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: metadata must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: metadata must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: metadata must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: metadata must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: title must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: title must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: title must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: title must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: title must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: title must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: symbol must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: symbol must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: symbol must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: symbol must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: symbol must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: symbol must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: use must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: use must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: use must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: use must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: use must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: use must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: Switch must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: Switch must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: Switch must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: Switch must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: Switch must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: Switch must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: style must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: style must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: style must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: style must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: style must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: style must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGTransform interface: svg.createSVGTransform() must inherit property "matrix" with the proper type (8)]
     expected: FAIL
@@ -307,19 +277,16 @@
     expected: FAIL
 
   [SVGElement interface: path must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: path must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: path must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: path must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: path must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGRectElement interface: existence and properties of interface object]
     expected: FAIL
@@ -355,19 +322,16 @@
     expected: FAIL
 
   [SVGElement interface: rect must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: rect must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: rect must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: rect must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: rect must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGCircleElement interface: existence and properties of interface object]
     expected: FAIL
@@ -403,19 +367,16 @@
     expected: FAIL
 
   [SVGElement interface: circle must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: circle must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: circle must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: circle must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: circle must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGEllipseElement interface: existence and properties of interface object]
     expected: FAIL
@@ -451,19 +412,16 @@
     expected: FAIL
 
   [SVGElement interface: ellipse must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: ellipse must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: ellipse must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: ellipse must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: ellipse must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGLineElement interface: existence and properties of interface object]
     expected: FAIL
@@ -499,19 +457,16 @@
     expected: FAIL
 
   [SVGElement interface: line must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: line must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: line must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: line must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: line must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGPolylineElement interface: existence and properties of interface object]
     expected: FAIL
@@ -547,19 +502,16 @@
     expected: FAIL
 
   [SVGElement interface: polyline must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: polyline must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: polyline must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: polyline must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: polyline must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGPolygonElement interface: existence and properties of interface object]
     expected: FAIL
@@ -595,19 +547,16 @@
     expected: FAIL
 
   [SVGElement interface: polygon must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: polygon must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: polygon must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: polygon must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: polygon must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGTextContentElement must be primary interface of textContent]
     expected: FAIL
@@ -703,73 +652,61 @@
     expected: FAIL
 
   [SVGElement interface: textContent must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: textContent must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: textContent must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: textContent must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: textContent must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: text must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: text must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: text must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: text must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: text must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: text must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: tspan must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: tspan must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: tspan must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: tspan must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: tspan must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: tspan must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: textPath must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: textPath must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: textPath must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: textPath must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: textPath must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: textPath must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGImageElement interface: attribute crossOrigin]
     expected: FAIL
@@ -781,37 +718,31 @@
     expected: FAIL
 
   [SVGElement interface: image must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: image must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: image must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: image must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: image must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: foreignObject must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: foreignObject must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: foreignObject must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: foreignObject must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: foreignObject must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: foreignObject must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGMarkerElement interface: attribute orient]
     expected: FAIL
@@ -823,19 +754,16 @@
     expected: FAIL
 
   [SVGElement interface: marker must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: marker must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: marker must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: marker must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: marker must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGSolidcolorElement interface: existence and properties of interface object]
     expected: FAIL
@@ -856,19 +784,16 @@
     expected: FAIL
 
   [SVGElement interface: linearGradient must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: linearGradient must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: linearGradient must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: linearGradient must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: linearGradient must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGRadialGradientElement interface: attribute fr]
     expected: FAIL
@@ -880,19 +805,16 @@
     expected: FAIL
 
   [SVGElement interface: radialGradient must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: radialGradient must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: radialGradient must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: radialGradient must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: radialGradient must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGMeshElement interface: existence and properties of interface object]
     expected: FAIL
@@ -943,37 +865,31 @@
     expected: FAIL
 
   [SVGElement interface: stop must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: stop must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: stop must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: stop must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: stop must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: pattern must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: pattern must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: pattern must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: pattern must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: pattern must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: pattern must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGHatchElement interface: existence and properties of interface object]
     expected: FAIL
@@ -1048,19 +964,16 @@
     expected: FAIL
 
   [SVGElement interface: cursor must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: cursor must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: cursor must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: cursor must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: cursor must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGScriptElement interface: script must inherit property "crossOrigin" with the proper type (1)]
     expected: FAIL
@@ -1069,19 +982,16 @@
     expected: FAIL
 
   [SVGElement interface: script must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: script must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: script must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: script must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: script must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGZoomEvent interface: existence and properties of interface object]
     expected: FAIL
@@ -1096,325 +1006,271 @@
     expected: FAIL
 
   [SVGElement interface: a must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: a must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: a must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: a must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: a must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: view must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: view must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: view must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: view must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: view must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: view must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: filter must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: filter must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: filter must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: filter must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: filter must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: filter must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feBlend must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feBlend must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feBlend must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feBlend must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feBlend must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feBlend must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feColorMatrix must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feColorMatrix must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feColorMatrix must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feColorMatrix must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feColorMatrix must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feColorMatrix must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feComponentTransfer must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feComponentTransfer must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feComponentTransfer must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feComponentTransfer must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feComponentTransfer must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feComponentTransfer must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feFuncR must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feFuncR must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feFuncR must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feFuncR must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feFuncR must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feFuncR must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feFuncG must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feFuncG must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feFuncG must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feFuncG must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feFuncG must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feFuncG must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feFuncB must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feFuncB must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feFuncB must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feFuncB must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feFuncB must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feFuncB must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feFuncA must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feFuncA must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feFuncA must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feFuncA must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feFuncA must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feFuncA must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feComposite must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feComposite must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feComposite must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feComposite must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feComposite must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feComposite must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feConvolveMatrix must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feConvolveMatrix must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feConvolveMatrix must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feConvolveMatrix must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feConvolveMatrix must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feConvolveMatrix must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feDiffuseLighting must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feDiffuseLighting must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feDiffuseLighting must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feDiffuseLighting must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feDiffuseLighting must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feDiffuseLighting must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: fePointLight must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: fePointLight must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: fePointLight must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: fePointLight must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: fePointLight must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: fePointLight must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feSpotLight must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feSpotLight must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feSpotLight must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feSpotLight must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feSpotLight must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feSpotLight must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feDisplacementMap must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feDisplacementMap must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feDisplacementMap must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feDisplacementMap must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feDisplacementMap must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feDisplacementMap must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feDropShadow must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feDropShadow must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feDropShadow must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feDropShadow must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feDropShadow must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feDropShadow must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feFlood must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feFlood must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feFlood must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feFlood must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feFlood must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feFlood must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGFEGaussianBlurElement interface: constant SVG_EDGEMODE_UNKNOWN on interface object]
     expected: FAIL
@@ -1462,19 +1318,16 @@
     expected: FAIL
 
   [SVGElement interface: feGaussianBlur must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feGaussianBlur must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feGaussianBlur must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feGaussianBlur must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feGaussianBlur must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGFEImageElement interface: attribute crossOrigin]
     expected: FAIL
@@ -1486,127 +1339,106 @@
     expected: FAIL
 
   [SVGElement interface: feImage must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feImage must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feImage must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feImage must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feImage must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feMerge must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feMerge must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feMerge must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feMerge must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feMerge must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feMerge must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feMergeNode must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feMergeNode must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feMergeNode must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feMergeNode must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feMergeNode must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feMergeNode must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feMorphology must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feMorphology must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feMorphology must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feMorphology must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feMorphology must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feMorphology must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feSpecularLighting must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feSpecularLighting must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feSpecularLighting must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feSpecularLighting must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feSpecularLighting must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feSpecularLighting must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feTile must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feTile must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feTile must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feTile must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feTile must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feTile must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGElement interface: feTurbulence must inherit property "onautocomplete" with the proper type (8)]
     expected: FAIL
 
   [SVGElement interface: feTurbulence must inherit property "onautocompleteerror" with the proper type (9)]
     expected: FAIL
 
   [SVGElement interface: feTurbulence must inherit property "oncancel" with the proper type (11)]
     expected: FAIL
 
-  [SVGElement interface: feTurbulence must inherit property "onclose" with the proper type (16)]
-    expected: FAIL
-
   [SVGElement interface: feTurbulence must inherit property "oncuechange" with the proper type (18)]
     expected: FAIL
 
   [SVGElement interface: feTurbulence must inherit property "onsort" with the proper type (62)]
     expected: FAIL
 
   [SVGGeometryElement interface: path must inherit property "isPointInFill" with the proper type (1)]
     expected: FAIL
--- a/toolkit/components/downloads/ApplicationReputation.cpp
+++ b/toolkit/components/downloads/ApplicationReputation.cpp
@@ -1273,41 +1273,34 @@ PendingLookup::SendRemoteQueryInternal()
                         nullptr, // aTriggeringPrincipal
                         nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                         nsIContentPolicy::TYPE_OTHER,
                         getter_AddRefs(mChannel));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo();
   if (loadInfo) {
-    loadInfo->SetOriginAttributes(
-      mozilla::NeckoOriginAttributes(NECKO_SAFEBROWSING_APP_ID, false));
+    mozilla::NeckoOriginAttributes neckoAttrs(false);
+    neckoAttrs.mFirstPartyDomain.AssignLiteral(NECKO_SAFEBROWSING_FIRST_PARTY_DOMAIN);
+    loadInfo->SetOriginAttributes(neckoAttrs);
   }
 
   nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(mChannel, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
   mozilla::Unused << httpChannel;
 
   // Upload the protobuf to the application reputation service.
   nsCOMPtr<nsIUploadChannel2> uploadChannel = do_QueryInterface(mChannel, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = uploadChannel->ExplicitSetUploadStream(sstream,
     NS_LITERAL_CSTRING("application/octet-stream"), serialized.size(),
     NS_LITERAL_CSTRING("POST"), false);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  // Set the Safebrowsing cookie jar, so that the regular Google cookie is not
-  // sent with this request. See bug 897516.
-  DocShellOriginAttributes attrs;
-  attrs.mAppId = NECKO_SAFEBROWSING_APP_ID;
-  nsCOMPtr<nsIInterfaceRequestor> loadContext = new mozilla::LoadContext(attrs);
-  rv = mChannel->SetNotificationCallbacks(loadContext);
-  NS_ENSURE_SUCCESS(rv, rv);
-
   uint32_t timeoutMs = Preferences::GetUint(PREF_SB_DOWNLOADS_REMOTE_TIMEOUT, 10000);
   mTimeoutTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
   mTimeoutTimer->InitWithCallback(this, timeoutMs, nsITimer::TYPE_ONE_SHOT);
 
   rv = mChannel->AsyncOpen2(this);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -959,16 +959,26 @@
     "expires_in_version": "never",
     "bug_numbers": [1297790, 1317796],
     "kind": "exponential",
     "high": 64000,
     "n_buckets": 100,
     "releaseChannelCollection": "opt-out",
     "description": "GPU process launch time in milliseconds"
   },
+  "GPU_PROCESS_INITIALIZATION_TIME_MS" : {
+    "alert_emails": ["george@mozilla.com", "danderson@mozilla.com"],
+    "expires_in_version": "never",
+    "bug_numbers": [1324095],
+    "kind": "exponential",
+    "high": 64000,
+    "n_buckets": 100,
+    "releaseChannelCollection": "opt-out",
+    "description": "GPU process initialization (excluding XPCOM and fork time) time in milliseconds"
+  },
   "JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT": {
     "alert_emails": ["jdemooij@mozilla.com"],
     "expires_in_version": "never",
     "kind": "enumerated",
     "n_values": 10,
     "description": "Use of SpiderMonkey's deprecated language extensions in web content: ForEach=0, DestructuringForIn=1 (obsolete), LegacyGenerator=2, ExpressionClosure=3, LetBlock=4 (obsolete), LetExpression=5 (obsolete), NoSuchMethod=6 (obsolete), FlagsArgument=7 (obsolete), RegExpSourceProp=8 (obsolete), RestoredRegExpStatics=9 (obsolete), BlockScopeFunRedecl=10"
   },
   "JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS": {
@@ -2319,16 +2329,25 @@
     "description": "H2: goaway reason client sent from rfc 7540. 31 is none sent."
   },
   "SPDY_GOAWAY_PEER": {
     "expires_in_version": "never",
     "kind": "enumerated",
     "n_values": 32,
     "description": "H2: goaway reason from peer from rfc 7540. 31 is none received."
   },
+  "SPDY_CONTINUED_HEADERS": {
+    "expires_in_version": "59",
+    "alert_emails": ["necko@mozilla.com"],
+    "bug_numbers": [1324855],
+    "kind": "exponential",
+    "high": 32000000,
+    "n_buckets": 75,
+    "description": "Size of continued H2 headers in bytes."
+  },
   "HPACK_ELEMENTS_EVICTED_DECOMPRESSOR": {
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 256,
     "n_buckets": 50,
     "description": "HPACK: Number of items removed from dynamic table to make room for 1 new item",
     "alert_emails": ["necko@mozilla.com", "hurley@mozilla.com"],
     "bug_numbers": [1296280]
--- a/toolkit/components/url-classifier/content/xml-fetcher.js
+++ b/toolkit/components/url-classifier/content/xml-fetcher.js
@@ -29,24 +29,25 @@ this.PROT_NewXMLHttpRequest = function P
 /**
  * A helper class that does HTTP GETs and calls back a function with
  * the content it receives. Asynchronous, so uses a closure for the
  * callback.
  *
  * Note, that XMLFetcher is only used for SafeBrowsing, therefore
  * we inherit from nsILoadContext, so we can use the callbacks on the
  * channel to separate the safebrowsing cookie based on a reserved
- * appId.
+ * first-party domain.
  * @constructor
  */
 this.PROT_XMLFetcher = function PROT_XMLFetcher() {
   this.debugZone = "xmlfetcher";
   this._request = PROT_NewXMLHttpRequest();
   // implements nsILoadContext
-  this.appId = Ci.nsIScriptSecurityManager.SAFEBROWSING_APP_ID;
+  this.firstPartyDomain =
+    "safebrowsing.86868755-6b82-4842-b301-72671a0db32e.mozilla";
   this.isInIsolatedMozBrowserElement = false;
   this.usePrivateBrowsing = false;
   this.isContent = false;
 }
 
 PROT_XMLFetcher.prototype = {
   /**
    * Function that will be called back upon fetch completion.
@@ -61,17 +62,17 @@ PROT_XMLFetcher.prototype = {
    * @param callback Function to call back when complete.
    */
   get: function(page, callback) {
     this._request.abort();                // abort() is asynchronous, so
     this._request = PROT_NewXMLHttpRequest();
     this._callback = callback;
     var asynchronous = true;
     this._request.loadInfo.originAttributes = {
-      appId: this.appId,
+      firstPartyDomain: this.firstPartyDomain,
       inIsolatedMozBrowser: this.isInIsolatedMozBrowserElement
     };
     this._request.open("GET", page, asynchronous);
     this._request.channel.notificationCallbacks = this;
 
     // Create a closure
     var self = this;
     this._request.addEventListener("readystatechange", function() {
--- a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp
@@ -126,17 +126,19 @@ nsUrlClassifierStreamUpdater::FetchUpdat
                      nsIContentPolicy::TYPE_OTHER,
                      nullptr,  // aLoadGroup
                      this,     // aInterfaceRequestor
                      loadFlags);
 
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo();
-  loadInfo->SetOriginAttributes(mozilla::NeckoOriginAttributes(NECKO_SAFEBROWSING_APP_ID, false));
+  mozilla::NeckoOriginAttributes neckoAttrs(false);
+  neckoAttrs.mFirstPartyDomain.AssignLiteral(NECKO_SAFEBROWSING_FIRST_PARTY_DOMAIN);
+  loadInfo->SetOriginAttributes(neckoAttrs);
 
   mBeganStream = false;
 
   if (!aIsPostRequest) {
     // We use POST method to send our request in v2. In v4, the request
     // needs to be embedded to the URL and use GET method to send.
     // However, from the Chromium source code, a extended HTTP header has
     // to be sent along with the request to make the request succeed.
@@ -170,25 +172,16 @@ nsUrlClassifierStreamUpdater::FetchUpdat
 
     // Disable keepalive.
     nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(mChannel, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
     rv = httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Connection"), NS_LITERAL_CSTRING("close"), false);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
-  // Create a custom LoadContext for SafeBrowsing, so we can use callbacks on
-  // the channel to query the appId which allows separation of safebrowsing
-  // cookies in a separate jar.
-  DocShellOriginAttributes attrs;
-  attrs.mAppId = NECKO_SAFEBROWSING_APP_ID;
-  nsCOMPtr<nsIInterfaceRequestor> sbContext = new mozilla::LoadContext(attrs);
-  rv = mChannel->SetNotificationCallbacks(sbContext);
-  NS_ENSURE_SUCCESS(rv, rv);
-
   // Make the request.
   rv = mChannel->AsyncOpen2(this);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mStreamTable = aStreamTable;
 
   return NS_OK;
 }
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -82,16 +82,17 @@ NS_EVENT_MESSAGE(eMouseClick)
 NS_EVENT_MESSAGE(eMouseAuxClick)
 // eMouseActivate is fired when the widget is activated by a click.
 NS_EVENT_MESSAGE(eMouseActivate)
 NS_EVENT_MESSAGE(eMouseOver)
 NS_EVENT_MESSAGE(eMouseOut)
 NS_EVENT_MESSAGE(eMouseHitTest)
 NS_EVENT_MESSAGE(eMouseEnter)
 NS_EVENT_MESSAGE(eMouseLeave)
+NS_EVENT_MESSAGE(eMouseTouchDrag)
 NS_EVENT_MESSAGE(eMouseLongTap)
 NS_EVENT_MESSAGE_FIRST_LAST(eMouseEvent, eMouseMove, eMouseLongTap)
 
 // Pointer spec events
 NS_EVENT_MESSAGE(ePointerMove)
 NS_EVENT_MESSAGE(ePointerUp)
 NS_EVENT_MESSAGE(ePointerDown)
 NS_EVENT_MESSAGE(ePointerOver)
@@ -437,12 +438,15 @@ NS_EVENT_MESSAGE(eEditorInput)
 
 // selection events
 NS_EVENT_MESSAGE(eSelectStart)
 NS_EVENT_MESSAGE(eSelectionChange)
 
 // Details element events.
 NS_EVENT_MESSAGE(eToggle)
 
+// Dialog element events.
+NS_EVENT_MESSAGE(eClose)
+
 #ifdef UNDEF_NS_EVENT_MESSAGE_FIRST_LAST
 #undef UNDEF_NS_EVENT_MESSAGE_FIRST_LAST
 #undef NS_EVENT_MESSAGE_FIRST_LAST
 #endif
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -379,16 +379,19 @@ WidgetEvent::IsAllowedToDispatchDOMEvent
       // still need the mouse events to be handled in EventStateManager to
       // generate other events (e.g. eMouseClick). So we only stop dispatching
       // them to DOM.
       if (DefaultPreventedByContent() &&
           (mMessage == eMouseMove || mMessage == eMouseDown ||
            mMessage == eMouseUp)) {
         return false;
       }
+      if (mMessage == eMouseTouchDrag) {
+        return false;
+      }
       MOZ_FALLTHROUGH;
     case ePointerEventClass:
       // We want synthesized mouse moves to cause mouseover and mouseout
       // DOM events (EventStateManager::PreHandleEvent), but not mousemove
       // DOM events.
       // Synthesized button up events also do not cause DOM events because they
       // do not have a reliable mRefPoint.
       return AsMouseEvent()->mReason == WidgetMouseEvent::eReal;
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -4173,19 +4173,25 @@ nsWindow::DispatchMouseEvent(EventMessag
   if (WinUtils::GetIsMouseFromTouch(aEventMessage)) {
     if (aEventMessage == eMouseDown) {
       Telemetry::Accumulate(Telemetry::FX_TOUCH_USED, 1);
     }
 
     if (mTouchWindow) {
       // If mTouchWindow is true, then we must have APZ enabled and be
       // feeding it raw touch events. In that case we don't need to
-      // send touch-generated mouse events to content.
+      // send touch-generated mouse events to content. The only exception is
+      // the touch-generated mouse double-click, which is used to start off the
+      // touch-based drag-and-drop gesture.
       MOZ_ASSERT(mAPZC);
-      return result;
+      if (aEventMessage == eMouseDoubleClick) {
+        aEventMessage = eMouseTouchDrag;
+      } else {
+        return result;
+      }
     }
   }
 
   uint32_t pointerId = aPointerInfo ? aPointerInfo->pointerId :
                                       MOUSE_POINTERID();
 
   // Since it is unclear whether a user will use the digitizer,
   // Postpone initialization until first PEN message will be found.