Bug 964149 - Tighten up bend/unbend event handling in richgrid. r=rsilveira a=metro-only
authorSam Foster <sfoster@mozilla.com>
Fri, 31 Jan 2014 13:56:42 -0800
changeset 176191 1783cd636fe99138d4bbbfc279d5ce735482087f
parent 176190 104d49784165d37a7ebdccfc7d17406f3c2b3ced
child 176192 1ada2104ea5b61eee69c15789f974b27eddee098
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrsilveira, metro-only
bugs964149
milestone28.0a2
Bug 964149 - Tighten up bend/unbend event handling in richgrid. r=rsilveira a=metro-only
browser/metro/base/content/bindings/grid.xml
--- a/browser/metro/base/content/bindings/grid.xml
+++ b/browser/metro/base/content/bindings/grid.xml
@@ -787,17 +787,17 @@
       </method>
 
       <method name="bendItem">
         <parameter name="aItem"/>
         <parameter name="aEvent"/>
         <body><![CDATA[
           // apply the transform to the contentBox element of the item
           let bendNode = 'richgriditem' == aItem.nodeName && aItem._contentBox;
-          if (!bendNode)
+          if (!bendNode || aItem.hasAttribute("bending"))
             return;
 
           let event = aEvent;
           let rect = bendNode.getBoundingClientRect();
           let angle;
           let x = (event.clientX - rect.left) / rect.width;
           let y = (event.clientY - rect.top) / rect.height;
           let perspective = '450px';
@@ -851,16 +851,17 @@
     </implementation>
     <handlers>
       <!--  item bend effect handlers -->
       <handler event="mousedown" button="0" phase="capturing" action="this.bendItem(event.target, event)"/>
       <handler event="touchstart" action="this.bendItem(event.target, event.touches[0])"/>
       <handler event="mouseup" button="0" action="this.unbendItem(event.target)"/>
       <handler event="mouseout" button="0" action="this.unbendItem(event.target)"/>
       <handler event="touchend" action="this.unbendItem(event.target)"/>
+      <handler event="touchcancel" action="this.unbendItem(event.target)"/>
       <!--  /item bend effect handler -->
 
       <handler event="context-action">
         <![CDATA[
           // context-action is an event fired by the appbar typically
           // which directs us to do something to the selected tiles
           switch (event.action) {
             case "clear":