Bug 964149 - Tighten up bend/unbend event handling in richgrid. r=rsilveira
authorSam Foster <sfoster@mozilla.com>
Fri, 31 Jan 2014 13:56:42 -0800
changeset 166299 b670b20cfcc7469605e66567ce5f03e29863876d
parent 166298 7e577607c4046b3fd5cf080d582e01baebf47608
child 166320 d02efae4db3a863c2d0ffaa479c735a128ca9bf7
push id4755
push usersfoster@mozilla.com
push dateFri, 31 Jan 2014 21:57:59 +0000
treeherderfx-team@b670b20cfcc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrsilveira
bugs964149
milestone29.0a1
Bug 964149 - Tighten up bend/unbend event handling in richgrid. r=rsilveira
browser/metro/base/content/bindings/grid.xml
--- a/browser/metro/base/content/bindings/grid.xml
+++ b/browser/metro/base/content/bindings/grid.xml
@@ -803,17 +803,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 = this.isItem(aItem) ? aItem._contentBox : null;
-          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';
@@ -867,16 +867,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":