Merge inbound to mozilla-central. a=merge
authorGurzau Raul <rgurzau@mozilla.com>
Mon, 15 Jan 2018 11:57:47 +0200
changeset 453563 b7d66e4e60ef177ec9ae687daa29443ae4a2acfc
parent 453544 6f9b763bb1c9f03be9ff0420a7b52261306bd227 (current diff)
parent 453562 52397f10a40b2dc2c2e07440e1b9c986eec112fa (diff)
child 453564 ab6c457eac94fed47844d470aa18ecbfa8da0cfc
child 453581 a00e3a3dbad43759ee9474d6c7c908fa16deaee8
child 453585 9c060daf95f04901e8d29501947929b0ac6adc38
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone59.0a1
first release with
nightly linux32
b7d66e4e60ef / 59.0a1 / 20180115100056 / files
nightly linux64
b7d66e4e60ef / 59.0a1 / 20180115100056 / files
nightly mac
b7d66e4e60ef / 59.0a1 / 20180115100056 / files
nightly win32
b7d66e4e60ef / 59.0a1 / 20180115100056 / files
nightly win64
b7d66e4e60ef / 59.0a1 / 20180115100056 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge inbound to mozilla-central. a=merge
dom/base/nsDocument.cpp
dom/tests/mochitest/webcomponents/test_bug1176757.html
testing/web-platform/meta/shadow-dom/Node-prototype-cloneNode.html.ini
testing/web-platform/meta/shadow-dom/ShadowRoot-interface.html.ini
testing/web-platform/meta/shadow-dom/untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/activeElement-confirm-return-null.html.ini
testing/web-platform/meta/shadow-dom/untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-007.html.ini
testing/web-platform/meta/shadow-dom/untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-010.html.ini
testing/web-platform/meta/shadow-dom/untriaged/user-interaction/active-element/test-001.html.ini
testing/web-platform/meta/shadow-dom/untriaged/user-interaction/active-element/test-002.html.ini
--- a/dom/base/DocumentOrShadowRoot.cpp
+++ b/dom/base/DocumentOrShadowRoot.cpp
@@ -1,16 +1,18 @@
 /* -*- 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 "DocumentOrShadowRoot.h"
 #include "mozilla/dom/StyleSheetList.h"
+#include "nsDocument.h"
+#include "nsFocusManager.h"
 
 namespace mozilla {
 namespace dom {
 
 DocumentOrShadowRoot::DocumentOrShadowRoot(mozilla::dom::ShadowRoot& aShadowRoot)
   : mAsNode(aShadowRoot)
   , mKind(Kind::ShadowRoot)
 {}
@@ -80,10 +82,53 @@ DocumentOrShadowRoot::GetElementsByTagNa
 }
 
 already_AddRefed<nsContentList>
 DocumentOrShadowRoot::GetElementsByClassName(const nsAString& aClasses)
 {
   return nsContentUtils::GetElementsByClassName(&AsNode(), aClasses);
 }
 
+nsIContent*
+DocumentOrShadowRoot::Retarget(nsIContent* aContent) const
+{
+  for (nsIContent* cur = aContent;
+       cur;
+       cur = cur->GetContainingShadowHost()) {
+    if (cur->SubtreeRoot() == &AsNode()) {
+      return cur;
+    }
+  }
+  return nullptr;
+}
+
+Element*
+DocumentOrShadowRoot::GetRetargetedFocusedElement()
+{
+  if (nsCOMPtr<nsPIDOMWindowOuter> window = AsNode().OwnerDoc()->GetWindow()) {
+    nsCOMPtr<nsPIDOMWindowOuter> focusedWindow;
+    nsIContent* focusedContent =
+      nsFocusManager::GetFocusedDescendant(window,
+                                           nsFocusManager::eOnlyCurrentWindow,
+                                           getter_AddRefs(focusedWindow));
+    // be safe and make sure the element is from this document
+    if (focusedContent && focusedContent->OwnerDoc() == AsNode().OwnerDoc()) {
+      if (focusedContent->ChromeOnlyAccess()) {
+        focusedContent = focusedContent->FindFirstNonChromeOnlyAccessContent();
+      }
+
+      if (focusedContent) {
+        if (!nsDocument::IsWebComponentsEnabled(focusedContent)) {
+          return focusedContent->AsElement();
+        }
+
+        if (nsIContent* retarget = Retarget(focusedContent)) {
+          return retarget->AsElement();
+        }
+      }
+    }
+  }
+
+  return nullptr;
+}
+
 }
 }
--- a/dom/base/DocumentOrShadowRoot.h
+++ b/dom/base/DocumentOrShadowRoot.h
@@ -109,16 +109,25 @@ public:
                          mozilla::ErrorResult&);
 
   already_AddRefed<nsContentList>
   GetElementsByClassName(const nsAString& aClasses);
 
   ~DocumentOrShadowRoot() = default;
 
 protected:
+  nsIContent* Retarget(nsIContent* aContent) const;
+
+  /**
+   * If focused element's subtree root is this document or shadow root, return
+   * focused element, otherwise, get the shadow host recursively until the
+   * shadow host's subtree root is this document or shadow root.
+   */
+  Element* GetRetargetedFocusedElement();
+
   nsTArray<RefPtr<mozilla::StyleSheet>> mStyleSheets;
   RefPtr<mozilla::dom::StyleSheetList> mDOMStyleSheets;
 
   /*
    * mIdentifierMap works as follows for IDs:
    * 1) Attribute changes affect the table immediately (removing and adding
    *    entries as needed).
    * 2) Removals from the DOM affect the table immediately
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -1112,16 +1112,25 @@ FragmentOrElement::IsLink(nsIURI** aURI)
 nsXBLBinding*
 FragmentOrElement::DoGetXBLBinding() const
 {
   MOZ_ASSERT(HasFlag(NODE_MAY_BE_IN_BINDING_MNGR));
   const nsExtendedDOMSlots* slots = GetExistingExtendedDOMSlots();
   return slots ? slots->mXBLBinding.get() : nullptr;
 }
 
+nsIContent*
+nsIContent::GetContainingShadowHost() const
+{
+  if (mozilla::dom::ShadowRoot* shadow = GetContainingShadow()) {
+    return shadow->GetHost();
+  }
+  return nullptr;
+}
+
 void
 nsIContent::SetAssignedSlot(HTMLSlotElement* aSlot)
 {
   ExtendedContentSlots()->mAssignedSlot = aSlot;
 }
 
 void
 nsIContent::SetXBLInsertionPoint(nsIContent* aContent)
--- a/dom/base/ShadowRoot.cpp
+++ b/dom/base/ShadowRoot.cpp
@@ -449,16 +449,22 @@ void
 ShadowRoot::DistributeAllNodes()
 {
 
   //XXX Handle <slot>.
 
   DistributionChanged();
 }
 
+Element*
+ShadowRoot::GetActiveElement()
+{
+  return GetRetargetedFocusedElement();
+}
+
 void
 ShadowRoot::GetInnerHTML(nsAString& aInnerHTML)
 {
   GetMarkup(false, aInnerHTML);
 }
 
 void
 ShadowRoot::SetInnerHTML(const nsAString& aInnerHTML, ErrorResult& aError)
@@ -606,10 +612,10 @@ ShadowRoot::ContentRemoved(nsIDocument* 
   }
 }
 
 nsresult
 ShadowRoot::Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                   bool aPreallocateChildren) const
 {
   *aResult = nullptr;
-  return NS_ERROR_DOM_DATA_CLONE_ERR;
+  return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
 }
--- a/dom/base/ShadowRoot.h
+++ b/dom/base/ShadowRoot.h
@@ -132,16 +132,18 @@ public:
 
   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
   void AddToIdTable(Element* aElement, nsAtom* aId);
   void RemoveFromIdTable(Element* aElement, nsAtom* aId);
 
   // WebIDL methods.
   using mozilla::dom::DocumentOrShadowRoot::GetElementById;
+
+  Element* GetActiveElement();
   void GetInnerHTML(nsAString& aInnerHTML);
   void SetInnerHTML(const nsAString& aInnerHTML, ErrorResult& aError);
   void StyleSheetChanged();
 
   bool IsComposedDocParticipant() { return mIsComposedDocParticipant; }
   void SetIsComposedDocParticipant(bool aIsComposedDocParticipant)
   {
     mIsComposedDocParticipant = aIsComposedDocParticipant;
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3534,31 +3534,19 @@ nsDocument::GetActiveElement(nsIDOMEleme
   el.forget(aElement);
   return NS_OK;
 }
 
 Element*
 nsIDocument::GetActiveElement()
 {
   // Get the focused element.
-  if (nsCOMPtr<nsPIDOMWindowOuter> window = GetWindow()) {
-    nsCOMPtr<nsPIDOMWindowOuter> focusedWindow;
-    nsIContent* focusedContent =
-      nsFocusManager::GetFocusedDescendant(window,
-                                           nsFocusManager::eOnlyCurrentWindow,
-                                           getter_AddRefs(focusedWindow));
-    // be safe and make sure the element is from this document
-    if (focusedContent && focusedContent->OwnerDoc() == this) {
-      if (focusedContent->ChromeOnlyAccess()) {
-        focusedContent = focusedContent->FindFirstNonChromeOnlyAccessContent();
-      }
-      if (focusedContent) {
-        return focusedContent->AsElement();
-      }
-    }
+  Element* focusedElement = GetRetargetedFocusedElement();
+  if (focusedElement) {
+    return focusedElement;
   }
 
   // No focused element anywhere in this document.  Try to get the BODY.
   RefPtr<nsHTMLDocument> htmlDoc = AsHTMLDocument();
   if (htmlDoc) {
     // Because of IE compatibility, return null when html document doesn't have
     // a body.
     return htmlDoc->GetBody();
@@ -6439,22 +6427,16 @@ nsIDocument::ImportNode(nsINode& aNode, 
   nsINode* imported = &aNode;
 
   switch (imported->NodeType()) {
     case nsIDOMNode::DOCUMENT_NODE:
     {
       break;
     }
     case nsIDOMNode::DOCUMENT_FRAGMENT_NODE:
-    {
-      if (imported->IsShadowRoot()) {
-        break;
-      }
-      MOZ_FALLTHROUGH;
-    }
     case nsIDOMNode::ATTRIBUTE_NODE:
     case nsIDOMNode::ELEMENT_NODE:
     case nsIDOMNode::PROCESSING_INSTRUCTION_NODE:
     case nsIDOMNode::TEXT_NODE:
     case nsIDOMNode::CDATA_SECTION_NODE:
     case nsIDOMNode::COMMENT_NODE:
     case nsIDOMNode::DOCUMENT_TYPE_NODE:
     {
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -845,20 +845,21 @@ nsFocusManager::ContentRemoved(nsIDocume
 {
   NS_ENSURE_ARG(aDocument);
   NS_ENSURE_ARG(aContent);
 
   nsPIDOMWindowOuter *window = aDocument->GetWindow();
   if (!window)
     return NS_OK;
 
-  // if the content is currently focused in the window, or is an ancestor
-  // of the currently focused element, reset the focus within that window.
+  // if the content is currently focused in the window, or is an
+  // shadow-including inclusive ancestor of the currently focused element,
+  // reset the focus within that window.
   nsIContent* content = window->GetFocusedNode();
-  if (content && nsContentUtils::ContentIsDescendantOf(content, aContent)) {
+  if (content && nsContentUtils::ContentIsHostIncludingDescendantOf(content, aContent)) {
     bool shouldShowFocusRing = window->ShouldShowFocusRing();
     window->SetFocusedNode(nullptr);
 
     // if this window is currently focused, clear the global focused
     // element as well, but don't fire any events.
     if (window == mFocusedWindow) {
       mFocusedContent = nullptr;
     } else {
--- a/dom/base/nsIContent.h
+++ b/dom/base/nsIContent.h
@@ -545,16 +545,24 @@ public:
    */
   mozilla::dom::ShadowRoot* GetContainingShadow() const
   {
     const nsExtendedContentSlots* slots = GetExistingExtendedContentSlots();
     return slots ? slots->mContainingShadow.get() : nullptr;
   }
 
   /**
+   * Gets the shadow host if this content is in a shadow tree. That is, the host
+   * of |GetContainingShadow|, if its not null.
+   *
+   * @return The shadow host, if this is in shadow tree, or null.
+   */
+  nsIContent* GetContainingShadowHost() const;
+
+  /**
    * Gets the assigned slot associated with this content.
    *
    * @return The assigned slot element or null.
    */
   mozilla::dom::HTMLSlotElement* GetAssignedSlot() const
   {
     const nsExtendedContentSlots* slots = GetExistingExtendedContentSlots();
     return slots ? slots->mAssignedSlot.get() : nullptr;
--- a/dom/events/test/pointerevents/mochitest.ini
+++ b/dom/events/test/pointerevents/mochitest.ini
@@ -10,16 +10,20 @@ support-files =
 [test_bug1293174_implicit_pointer_capture_for_touch_1.html]
   support-files = bug1293174_implicit_pointer_capture_for_touch_1.html
 [test_bug1293174_implicit_pointer_capture_for_touch_2.html]
   support-files = bug1293174_implicit_pointer_capture_for_touch_2.html
 [test_bug1303704.html]
 [test_bug1315862.html]
 [test_bug1323158.html]
 [test_bug1403055.html]
+[test_bug1414336.html]
+  support-files =
+    ../../../../gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js
+    ../../../../gfx/layers/apz/test/mochitest/apz_test_utils.js
 [test_bug1420589_1.html]
   support-files =
     bug_1420589_iframe1.html
     bug_1420589_iframe2.html
 [test_bug1420589_2.html]
   support-files =
     bug_1420589_iframe1.html
 [test_bug1420589_3.html]
new file mode 100644
--- /dev/null
+++ b/dom/events/test/pointerevents/test_bug1414336.html
@@ -0,0 +1,99 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1414336
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 1414336</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="apz_test_native_event_utils.js"></script>
+  <script type="text/javascript" src="apz_test_utils.js"></script>
+  <script type="text/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <style>
+    #target0 {
+    width: 200px;
+    height: 400px;
+    touch-action: auto;
+    }
+  </style>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1414336">Mozilla Bug 1414336</a>
+<p id="display"></p>
+<div id="target0">
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+  <p>Test bug1414336</p>
+</div>
+<script type="text/javascript">
+/** Test for Bug 1414336 **/
+SimpleTest.waitForExplicitFinish();
+
+waitUntilApzStable().then(() => {
+  let isWindows = (getPlatform() == "windows");
+  SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true],
+                                     ["apz.test.fails_with_native_injection", isWindows]]}, () => {
+
+    let target0 = window.document.getElementById("target0");
+    let target0_events = ["pointerdown", "pointermove"];
+
+    target0_events.forEach((elem, index, arr) => {
+      target0.addEventListener(elem, (event) => {
+        is(event.type, target0_events[0], "receive " + event.type + " on target0");
+        target0_events.shift();
+      }, { once: true });
+    });
+
+    target0.addEventListener("pointercancel", (event) => {
+      ok(false, "Shouldn't receive pointercancel when content prevents default on touchstart");
+      SimpleTest.finish();
+    }, { once: true });
+
+    target0.addEventListener("touchstart", (event) => {
+      event.preventDefault();
+    }, { once: true });
+
+    target0.addEventListener("pointerup", (event) => {
+      ok(target0_events.length == 0, " should receive " + target0_events + " on target0");
+      SimpleTest.finish();
+    }, { once: true });
+
+    synthesizeNativeTouchDrag(target0, 2, 2, 0, 80);
+  });
+});
+
+</script>
+</body>
+</html>
--- a/dom/tests/mochitest/webcomponents/mochitest.ini
+++ b/dom/tests/mochitest/webcomponents/mochitest.ini
@@ -1,17 +1,16 @@
 [DEFAULT]
 support-files =
   inert_style.css
   dummy_page.html
   head.js
 
 [test_bug900724.html]
 [test_bug1017896.html]
-[test_bug1176757.html]
 [test_bug1276240.html]
 [test_custom_element_callback_innerhtml.html]
 [test_custom_element_htmlconstructor.html]
 skip-if = os == 'android' # bug 1323645
 support-files =
   htmlconstructor_autonomous_tests.js
   htmlconstructor_builtin_tests.js
 [test_custom_element_in_shadow.html]
@@ -32,15 +31,16 @@ support-files =
 [test_detached_style.html]
 [test_document_adoptnode.html]
 [test_document_importnode.html]
 [test_event_retarget.html]
 [test_event_stopping.html]
 [test_template.html]
 [test_template_xhtml.html]
 [test_shadowroot.html]
+[test_shadowroot_clonenode.html]
 [test_shadowroot_inert_element.html]
 [test_shadowroot_style.html]
 [test_shadowroot_style_order.html]
 [test_style_fallback_content.html]
 skip-if = stylo # Bug 1410170
 [test_link_prefetch.html]
 [test_bug1269155.html]
rename from dom/tests/mochitest/webcomponents/test_bug1176757.html
rename to dom/tests/mochitest/webcomponents/test_shadowroot_clonenode.html
--- a/dom/tests/mochitest/webcomponents/test_bug1176757.html
+++ b/dom/tests/mochitest/webcomponents/test_shadowroot_clonenode.html
@@ -1,46 +1,46 @@
 <!DOCTYPE HTML>
 <html>
 <!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1176757
+https://bugzilla.mozilla.org/show_bug.cgi?id=1429982
 -->
 <head>
-  <title>Test for Bug 1176757</title>
+  <title>Test for Bug 1429982</title>
   <script type="text/javascript" src="head.js"></script>
   <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
   <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=1176757">Mozilla Bug 1176757</a>
+  href="https://bugzilla.mozilla.org/show_bug.cgi?id=1429982">Mozilla Bug 1429982</a>
 <p id="display"></p>
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
-/** Test for Bug 1176757 **/
+/** Test for Bug 1429982 **/
 SimpleTest.waitForExplicitFinish();
 setWebComponentsPrefAndCreateIframe()
   .then((aDocument) => {
     var element = aDocument.createElement("div");
     var shadowRoot = element.attachShadow({mode: "open"});
     var thrownException = false;
 
     try {
       shadowRoot.cloneNode();
     } catch(err) {
       thrownException = err;
     }
 
     ok(thrownException !== false, "An exception should've been thrown");
-    is(thrownException.name, "DataCloneError", "A DataCloneError exception should've been thrown");
+    is(thrownException.name, "NotSupportedError", "A NotSupportedError exception should've been thrown");
 
     SimpleTest.finish();
   });
 </script>
 </pre>
 </body>
 </html>
 
--- a/dom/webidl/ShadowRoot.webidl
+++ b/dom/webidl/ShadowRoot.webidl
@@ -15,16 +15,18 @@ enum ShadowRootMode {
   "open",
   "closed"
 };
 
 // https://dom.spec.whatwg.org/#shadowroot
 [Func="nsDocument::IsWebComponentsEnabled"]
 interface ShadowRoot : DocumentFragment
 {
+  readonly attribute Element? activeElement;
+
   // Shadow DOM v1
   readonly attribute ShadowRootMode mode;
   readonly attribute Element host;
 
   // [deprecated] Shadow DOM v0
   Element? getElementById(DOMString elementId);
   HTMLCollection getElementsByTagName(DOMString localName);
   HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
new file mode 100644
--- /dev/null
+++ b/editor/libeditor/crashtests/1402526.html
@@ -0,0 +1,14 @@
+<script>
+function jsfuzzer() {
+  try { var var00007 = eventhandler5; } catch(e) { }
+  try { var var00006 = var00007; } catch(e) { }
+  try { htmlvar00007.addEventListener("DOMNodeInserted", var00006); } catch(e) { }
+  try { document.execCommand("justifyFull", false); } catch(e) { }
+}
+function eventhandler5() {
+  try { htmlvar00008.replaceWith("1"); } catch(e) { }
+}
+</script>
+<body onload=jsfuzzer()>
+<dd id="htmlvar00007" contenteditable="true">
+<shadow id="htmlvar00008">
\ No newline at end of file
--- a/editor/libeditor/crashtests/crashtests.list
+++ b/editor/libeditor/crashtests/crashtests.list
@@ -85,14 +85,15 @@ load 1381541.html
 load 1383747.html
 load 1383755.html
 load 1383763.html
 load 1384161.html
 load 1388075.html
 load 1393171.html
 needs-focus load 1402196.html
 load 1402469.html
+load 1402526.html
 load 1402904.html
 load 1405747.html
 load 1408170.html
 load 1414581.html
 load 1415231.html
 load 1425091.html
--- a/gfx/layers/apz/util/APZEventState.cpp
+++ b/gfx/layers/apz/util/APZEventState.cpp
@@ -382,17 +382,17 @@ APZEventState::ProcessTouchEvent(const W
     break;
   }
 
   default:
     MOZ_ASSERT_UNREACHABLE("Unknown touch event type");
     break;
   }
 
-  if (sentContentResponse &&
+  if (sentContentResponse && !isTouchPrevented &&
         aApzResponse == nsEventStatus_eConsumeDoDefault &&
         gfxPrefs::PointerEventsEnabled()) {
     WidgetTouchEvent cancelEvent(aEvent);
     cancelEvent.mMessage = eTouchPointerCancel;
     cancelEvent.mFlags.mCancelable = false; // mMessage != eTouchCancel;
     for (uint32_t i = 0; i < cancelEvent.mTouches.Length(); ++i) {
       if (mozilla::dom::Touch* touch = cancelEvent.mTouches[i]) {
         touch->convertToPointer = true;
--- a/gfx/thebes/gfxFT2FontBase.cpp
+++ b/gfx/thebes/gfxFT2FontBase.cpp
@@ -514,17 +514,21 @@ gfxFT2FontBase::GetFTGlyphAdvance(uint16
     int32_t flags =
         gfxPlatform::GetPlatform()->FontHintingEnabled()
             ? FT_LOAD_ADVANCE_ONLY
             : FT_LOAD_ADVANCE_ONLY | FT_LOAD_NO_AUTOHINT | FT_LOAD_NO_HINTING;
     FT_Fixed advance = 0;
     mozilla::DebugOnly<FT_Error> ftError =
         FT_Load_Glyph(face.get(), aGID, flags);
     MOZ_ASSERT(!ftError);
-    advance = face.get()->glyph->linearHoriAdvance;
+    if (face.get()->face_flags & FT_FACE_FLAG_SCALABLE) {
+        advance = face.get()->glyph->linearHoriAdvance;
+    } else {
+        advance = face.get()->glyph->advance.x << 10; // convert 26.6 to 16.16
+    }
 
     // If freetype emboldening is being used, and it's not a zero-width glyph,
     // adjust the advance to account for the increased width.
     if (mEmbolden && advance > 0) {
         // This is the embolden "strength" used by FT_GlyphSlot_Embolden,
         // converted from 26.6 to 16.16
         FT_Fixed strength = 1024 *
             FT_MulFix(face.get()->units_per_EM,
deleted file mode 100644
--- a/testing/web-platform/meta/shadow-dom/Node-prototype-cloneNode.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[Node-prototype-cloneNode.html]
-  [cloneNode on a shadow root in open mode must throw a NotSupportedError]
-    expected: FAIL
-
-  [cloneNode on a shadow root in closed mode must throw a NotSupportedError]
-    expected: FAIL
-
deleted file mode 100644
--- a/testing/web-platform/meta/shadow-dom/ShadowRoot-interface.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[ShadowRoot-interface.html]
-  [ShadowRoot.activeElement must return the focused element of the context object when shadow root is open.]
-    expected: FAIL
-
-  [ShadowRoot.activeElement must return the focused element of the context object when shadow root is closed.]
-    expected: FAIL
-
deleted file mode 100644
--- a/testing/web-platform/meta/shadow-dom/untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/activeElement-confirm-return-null.html.ini
+++ /dev/null
@@ -1,10 +0,0 @@
-[activeElement-confirm-return-null.html]
-  [confirm activeElement return null]
-    expected: FAIL
-
-  [confirm activeElement return null when there is other element in body]
-    expected: FAIL
-
-  [confirm activeElement return null when focus on the element in the outer shadow tree]
-    expected: FAIL
-
deleted file mode 100644
--- a/testing/web-platform/meta/shadow-dom/untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-attributes/test-007.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[test-007.html]
-  [A_10_01_01_03_01_T01]
-    expected: FAIL
-
deleted file mode 100644
--- a/testing/web-platform/meta/shadow-dom/untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-010.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[test-010.html]
-  [A_10_01_02_09_T01]
-    expected: FAIL
-
deleted file mode 100644
--- a/testing/web-platform/meta/shadow-dom/untriaged/user-interaction/active-element/test-001.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[test-001.html]
-  [A_07_03_01_T01]
-    expected: FAIL
-
deleted file mode 100644
--- a/testing/web-platform/meta/shadow-dom/untriaged/user-interaction/active-element/test-002.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[test-002.html]
-  [A_07_03_02_T01]
-    expected: FAIL
-