Backed out changeset 08a557e99638 (bug 1113581) for breaking bc4 tests
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 29 Jul 2016 17:05:29 +0200
changeset 307298 907d353fc1c3c9d83cc5d15f6f3476c61d8ecda0
parent 307297 a151859f3a20453f3d46219ed94821d9ace698a3
child 307299 28c06a8a920886900feef350561aa11e74122513
push id30945
push usercbook@mozilla.com
push dateSat, 30 Jul 2016 14:50:21 +0000
treeherderautoland@9e48f74f44c3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1113581
milestone50.0a1
backs out08a557e99638798e51f239d7226b242c96bded9c
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
Backed out changeset 08a557e99638 (bug 1113581) for breaking bc4 tests
toolkit/content/widgets/tree.xml
--- a/toolkit/content/widgets/tree.xml
+++ b/toolkit/content/widgets/tree.xml
@@ -356,63 +356,71 @@
 
             // Get the coordinates of the cell itself.
             var cellRect = box.getCoordsForCellItem(row, column, "cell");
 
             // Calculate the top offset of the textbox.
             var style = window.getComputedStyle(input, "");
             var topadj = parseInt(style.borderTopWidth) + parseInt(style.paddingTop);
             input.top = textRect.y - topadj;
-            input.left = cellRect.x;
+
+            // The leftside of the textbox is aligned to the left side of the text
+            // in LTR mode, and left side of the cell in RTL mode.
+            var left, widthdiff;
+            if (style.direction == "rtl") {
+              left = cellRect.x;
+              widthdiff = cellRect.x - textRect.x;
+            } else {
+              left = textRect.x;
+              widthdiff = textRect.x - cellRect.x;
+            }
+
+            input.left = left;
             input.height = textRect.height + topadj +
                            parseInt(style.borderBottomWidth) +
                            parseInt(style.paddingBottom);
-            input.width = cellRect.width;
+            input.width = cellRect.width - widthdiff;
             input.hidden = false;
 
             input.value = this.view.getCellText(row, column);
             var selectText = function selectText() {
               input.select();
               input.inputField.focus();
             }
             setTimeout(selectText, 0);
 
             this._editingRow = row;
             this._editingColumn = column;
 
-            // Clear the text because we don't want the text appearing underneath the input.
-            this.view.setCellText(this._editingRow, this._editingColumn, "");
-            // Save the original text so we can restore it after stoping editing.
-            input.setAttribute("data-original-text", input.value);
-
             this.setAttribute("editing", "true");
             return true;
           ]]>
         </body>
       </method>
 
       <method name="stopEditing">
         <parameter name="accept"/>
         <body>
           <![CDATA[
             if (!this._editingColumn)
               return;
 
             var input = this.inputField;
             var editingRow = this._editingRow;
             var editingColumn = this._editingColumn;
-            var value = accept ? input.value : input.getAttribute("data-original-text");
             this._editingRow = -1;
             this._editingColumn = null;
-            this.view.setCellText(editingRow, editingColumn, value);
+            if (accept) {
+              var value = input.value;
+              this.view.setCellText(editingRow, editingColumn, value);
+            }
 
             input.hidden = true;
             input.value = "";
             this.removeAttribute("editing");
-            input.removeAttribute("data-original-text");
           ]]>
         </body>
       </method>
 
       <method name="_moveByOffset">
         <parameter name="offset"/>
         <parameter name="edge"/>
         <parameter name="event"/>