Bug 777832 <tree> element shouldn't handle keydown event during editing column r=enndeakin
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 16 May 2014 18:46:36 +0900
changeset 183457 10c6ee2c75240f6f3dfae13f3203c059f39a1a02
parent 183456 e5b1060172bea7860ca6cc040159cadf57d218d8
child 183458 85e85da7890933e5a46dfe7ea11251b4d0b4b03f
push id43562
push usermasayuki@d-toybox.com
push dateFri, 16 May 2014 09:46:49 +0000
treeherdermozilla-inbound@10c6ee2c7524 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenndeakin
bugs777832
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 777832 <tree> element shouldn't handle keydown event during editing column r=enndeakin
toolkit/content/widgets/tree.xml
--- a/toolkit/content/widgets/tree.xml
+++ b/toolkit/content/widgets/tree.xml
@@ -425,17 +425,17 @@
       </method>
 
       <method name="_moveByOffset">
         <parameter name="offset"/>
         <parameter name="edge"/>
         <parameter name="event"/>
         <body>
           <![CDATA[
-            if (this._editingColumn || this.view.rowCount == 0)
+            if (this.view.rowCount == 0)
               return;
 
             if (this._isAccelPressed(event) && this.view.selection.single) {
               this.treeBoxObject.scrollByLines(offset);
               return;
             }
    
             var c = this.currentIndex + offset;
@@ -467,17 +467,17 @@
       </method>
 
       <method name="_moveByOffsetShift">
         <parameter name="offset"/>
         <parameter name="edge"/>
         <parameter name="event"/>
         <body>
           <![CDATA[
-            if (this._editingColumn || this.view.rowCount == 0)
+            if (this.view.rowCount == 0)
               return;
 
             if (this.view.selection.single) {
               this.treeBoxObject.scrollByLines(offset);
               return;
             }
 
             if (this.view.rowCount == 1 && !this.view.selection.isSelected(0)) {
@@ -504,17 +504,17 @@
       </method>
 
       <method name="_moveByPage">
         <parameter name="offset"/>
         <parameter name="edge"/>
         <parameter name="event"/>
         <body>
           <![CDATA[
-            if (this._editingColumn || this.view.rowCount == 0)
+            if (this.view.rowCount == 0)
               return;
 
             if (this.pageUpOrDownMovesSelection == this._isAccelPressed(event)) {
                this.treeBoxObject.scrollByPages(offset);
                return;
             }
 
             if (this.view.rowCount == 1 && !this.view.selection.isSelected(0)) {
@@ -553,17 +553,17 @@
       </method>
 
       <method name="_moveByPageShift">
         <parameter name="offset"/>
         <parameter name="edge"/>
         <parameter name="event"/>
         <body>
           <![CDATA[
-            if (this._editingColumn || this.view.rowCount == 0)
+            if (this.view.rowCount == 0)
               return;
 
             if (this.view.rowCount == 1 && !this.view.selection.isSelected(0) &&
                 !(this.pageUpOrDownMovesSelection == this._isAccelPressed(event))) {
               this.view.selection.timedSelect(0, this._selectDelay);
               return;
             }
 
@@ -603,17 +603,17 @@
         </body>
       </method>
 
       <method name="_moveToEdge">
         <parameter name="edge"/>
         <parameter name="event"/>
         <body>
           <![CDATA[
-            if (this._editingColumn || this.view.rowCount == 0)
+            if (this.view.rowCount == 0)
               return;
 
             if (this.view.selection.isSelected(edge) && this.view.selection.count == 1) {
               this.currentIndex = edge;
               return;
             }
 
             // Normal behaviour is to select the first/last row
@@ -629,17 +629,17 @@
         </body>
       </method>
 
       <method name="_moveToEdgeShift">
         <parameter name="edge"/>
         <parameter name="event"/>
         <body>
           <![CDATA[
-            if (this._editingColumn || this.view.rowCount == 0)
+            if (this.view.rowCount == 0)
               return;
 
             if (this.view.rowCount == 1 && !this.view.selection.isSelected(0)) {
               this.view.selection.timedSelect(0, this._selectDelay);
               return;
             }
 
             if (this.view.selection.single ||
@@ -858,40 +858,112 @@
             if (col) {
               this.view.selection.currentColumn = col;
               this.treeBoxObject.ensureCellIsVisible(row, col);
               event.preventDefault();
             }
           }
         ]]>
       </handler>
-      <handler event="keydown" keycode="VK_UP" preventdefault="true"
-               modifiers="accel any" action="_moveByOffset(-1, 0, event);"/>
-      <handler event="keydown" keycode="VK_DOWN" preventdefault="true"
-               modifiers="accel any" action="_moveByOffset(1, this.view.rowCount - 1, event);"/>
-      <handler event="keydown" keycode="VK_UP" preventdefault="true"
-               modifiers="accel any, shift" action="_moveByOffsetShift(-1, 0, event);"/>
-      <handler event="keydown" keycode="VK_DOWN" preventdefault="true"
-               modifiers="accel any, shift" action="_moveByOffsetShift(1, this.view.rowCount - 1, event);"/>
-      <handler event="keydown" keycode="VK_PAGE_UP" preventdefault="true"
-               modifiers="accel any" action="_moveByPage(-1, 0, event);"/>
-      <handler event="keydown" keycode="VK_PAGE_DOWN" preventdefault="true"
-               modifiers="accel any" action="_moveByPage(1, this.view.rowCount - 1, event);"/>
-      <handler event="keydown" keycode="VK_PAGE_UP" preventdefault="true"
-               modifiers="accel any, shift" action="_moveByPageShift(-1, 0, event);"/>
-      <handler event="keydown" keycode="VK_PAGE_DOWN" preventdefault="true"
-               modifiers="accel any, shift" action="_moveByPageShift(1, this.view.rowCount - 1, event);"/>
-      <handler event="keydown" keycode="VK_HOME" preventdefault="true"
-               modifiers="accel any" action="_moveToEdge(0, event);"/>
-      <handler event="keydown" keycode="VK_END" preventdefault="true"
-               modifiers="accel any" action="_moveToEdge(this.view.rowCount - 1, event);"/>
-      <handler event="keydown" keycode="VK_HOME" preventdefault="true"
-               modifiers="accel any, shift" action="_moveToEdgeShift(0, event);"/>
-      <handler event="keydown" keycode="VK_END" preventdefault="true"
-               modifiers="accel any, shift" action="_moveToEdgeShift(this.view.rowCount - 1, event);"/>
+      <handler event="keydown" keycode="VK_UP" modifiers="accel any">
+        <![CDATA[
+          if (this._editingColumn)
+            return;
+          _moveByOffset(-1, 0, event);
+          event.preventDefault();
+        ]]>
+      </handler>
+      <handler event="keydown" keycode="VK_DOWN" modifiers="accel any">
+        <![CDATA[
+          if (this._editingColumn)
+            return;
+          _moveByOffset(1, this.view.rowCount - 1, event);
+          event.preventDefault();
+        ]]>
+      </handler>
+      <handler event="keydown" keycode="VK_UP" modifiers="accel any, shift">
+        <![CDATA[
+          if (this._editingColumn)
+            return;
+          _moveByOffsetShift(-1, 0, event);
+          event.preventDefault();
+        ]]>
+      </handler>
+      <handler event="keydown" keycode="VK_DOWN" modifiers="accel any, shift">
+        <![CDATA[
+          if (this._editingColumn)
+            return;
+          _moveByOffsetShift(1, this.view.rowCount - 1, event);
+          event.preventDefault();
+        ]]>
+      </handler>
+      <handler event="keydown" keycode="VK_PAGE_UP" modifiers="accel any">
+        <![CDATA[
+          if (this._editingColumn)
+            return;
+          _moveByPage(-1, 0, event);
+          event.preventDefault();
+        ]]>
+      </handler>
+      <handler event="keydown" keycode="VK_PAGE_DOWN" modifiers="accel any">
+        <![CDATA[
+          if (this._editingColumn)
+            return;
+          _moveByPage(1, this.view.rowCount - 1, event);
+          event.preventDefault();
+        ]]>
+      </handler>
+      <handler event="keydown" keycode="VK_PAGE_UP" modifiers="accel any, shift">
+        <![CDATA[
+          if (this._editingColumn)
+            return;
+          _moveByPageShift(-1, 0, event);
+          event.preventDefault();
+        ]]>
+      </handler>
+      <handler event="keydown" keycode="VK_PAGE_DOWN" modifiers="accel any, shift">
+        <![CDATA[
+          if (this._editingColumn)
+            return;
+          _moveByPageShift(1, this.view.rowCount - 1, event);
+          event.preventDefault();
+        ]]>
+      </handler>
+      <handler event="keydown" keycode="VK_HOME" modifiers="accel any">
+        <![CDATA[
+          if (this._editingColumn)
+            return;
+          _moveToEdge(0, event);
+          event.preventDefault();
+        ]]>
+      </handler>
+      <handler event="keydown" keycode="VK_END" modifiers="accel any">
+        <![CDATA[
+          if (this._editingColumn)
+            return;
+          _moveToEdge(this.view.rowCount - 1, event);
+          event.preventDefault();
+        ]]>
+      </handler>
+      <handler event="keydown" keycode="VK_HOME" modifiers="accel any, shift">
+        <![CDATA[
+          if (this._editingColumn)
+            return;
+          _moveToEdgeShift(0, event);
+          event.preventDefault();
+        ]]>
+      </handler>
+      <handler event="keydown" keycode="VK_END" modifiers="accel any, shift">
+        <![CDATA[
+          if (this._editingColumn)
+            return;
+          _moveToEdgeShift(this.view.rowCount - 1, event);
+          event.preventDefault();
+        ]]>
+      </handler>
       <handler event="keypress">
         <![CDATA[
          if (this._editingColumn)
            return;
 
          if (event.charCode == ' '.charCodeAt(0)) {
            var c = this.currentIndex;
            if (!this.view.selection.isSelected(c) ||