Bug 1299286 - Add the touchdownstartsdrag attribute to customize mode elements. r=jaws draft
authorJohann Hofmann <jhofmann@mozilla.com>
Fri, 03 Nov 2017 13:12:10 +0100
changeset 694191 b0c08cb1ecafa6fce4b9e55ce3dae65412c5070e
parent 694190 a560e2e9ac4a7ff633f597c0ff20f39373fd30a8
child 739288 edddc7f0a1a0147b895fc5b6e7d79c2494ec63ab
push id88079
push userbmo:jhofmann@mozilla.com
push dateTue, 07 Nov 2017 14:39:38 +0000
reviewersjaws
bugs1299286
milestone58.0a1
Bug 1299286 - Add the touchdownstartsdrag attribute to customize mode elements. r=jaws MozReview-Commit-ID: LziDBjACA0
browser/components/customizableui/CustomizeMode.jsm
--- a/browser/components/customizableui/CustomizeMode.jsm
+++ b/browser/components/customizableui/CustomizeMode.jsm
@@ -901,16 +901,22 @@ CustomizeMode.prototype = {
       } else if (wrapper.hasAttribute("haswideitem")) {
         wrapper.removeAttribute("haswideitem");
       }
     }
 
     let removable = aPlace == "palette" || CustomizableUI.isWidgetRemovable(aNode);
     wrapper.setAttribute("removable", removable);
 
+    if (AppConstants.platform == "win") {
+      // Allow touch events to initiate dragging in customize mode.
+      // This is only supported on Windows for now.
+      wrapper.setAttribute("touchdownstartsdrag", "true");
+    }
+
     let contextMenuAttrName = "";
     if (aNode.getAttribute("context")) {
       contextMenuAttrName = "context";
     } else if (aNode.getAttribute("contextmenu")) {
       contextMenuAttrName = "contextmenu";
     }
     let currentContextMenu = aNode.getAttribute(contextMenuAttrName);
     let contextMenuForPlace = aPlace == "panel" ?