Bug 1018069 Make tree element's _move* methods consume given events themselves r=enndeakin
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 04 Jun 2014 00:22:33 +0900
changeset 186345 7652c6ab1d362fa23ea2662e09e716c873364558
parent 186344 272c37660666f63c10e2cfe662e0e3df46beab26
child 186346 c8a1656249fcd195c1bb2781714df8395db39d88
push id44315
push usermasayuki@d-toybox.com
push dateTue, 03 Jun 2014 15:22:47 +0000
treeherdermozilla-inbound@7652c6ab1d36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenndeakin
bugs1018069
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 1018069 Make tree element's _move* methods consume given events themselves r=enndeakin
toolkit/content/widgets/tree.xml
--- a/toolkit/content/widgets/tree.xml
+++ b/toolkit/content/widgets/tree.xml
@@ -425,16 +425,18 @@
       </method>
 
       <method name="_moveByOffset">
         <parameter name="offset"/>
         <parameter name="edge"/>
         <parameter name="event"/>
         <body>
           <![CDATA[
+            event.preventDefault();
+
             if (this.view.rowCount == 0)
               return;
 
             if (this._isAccelPressed(event) && this.view.selection.single) {
               this.treeBoxObject.scrollByLines(offset);
               return;
             }
    
@@ -467,16 +469,18 @@
       </method>
 
       <method name="_moveByOffsetShift">
         <parameter name="offset"/>
         <parameter name="edge"/>
         <parameter name="event"/>
         <body>
           <![CDATA[
+            event.preventDefault();
+
             if (this.view.rowCount == 0)
               return;
 
             if (this.view.selection.single) {
               this.treeBoxObject.scrollByLines(offset);
               return;
             }
 
@@ -504,16 +508,18 @@
       </method>
 
       <method name="_moveByPage">
         <parameter name="offset"/>
         <parameter name="edge"/>
         <parameter name="event"/>
         <body>
           <![CDATA[
+            event.preventDefault();
+
             if (this.view.rowCount == 0)
               return;
 
             if (this.pageUpOrDownMovesSelection == this._isAccelPressed(event)) {
                this.treeBoxObject.scrollByPages(offset);
                return;
             }
 
@@ -553,16 +559,18 @@
       </method>
 
       <method name="_moveByPageShift">
         <parameter name="offset"/>
         <parameter name="edge"/>
         <parameter name="event"/>
         <body>
           <![CDATA[
+            event.preventDefault();
+
             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,16 +611,18 @@
         </body>
       </method>
 
       <method name="_moveToEdge">
         <parameter name="edge"/>
         <parameter name="event"/>
         <body>
           <![CDATA[
+            event.preventDefault();
+
             if (this.view.rowCount == 0)
               return;
 
             if (this.view.selection.isSelected(edge) && this.view.selection.count == 1) {
               this.currentIndex = edge;
               return;
             }
 
@@ -629,16 +639,18 @@
         </body>
       </method>
 
       <method name="_moveToEdgeShift">
         <parameter name="edge"/>
         <parameter name="event"/>
         <body>
           <![CDATA[
+            event.preventDefault();
+
             if (this.view.rowCount == 0)
               return;
 
             if (this.view.rowCount == 1 && !this.view.selection.isSelected(0)) {
               this.view.selection.timedSelect(0, this._selectDelay);
               return;
             }
 
@@ -863,105 +875,93 @@
           }
         ]]>
       </handler>
       <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)) {