Bug 1604155 - replace XULElement.ordinal property usage in Thunderbird. r=darktrojan
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Mon, 06 Jan 2020 22:17:36 +0200
changeset 37913 1aff261d2e1674af6ae8dcfab9f84d60c8a36fcf
parent 37912 97d6645e1b75fda4becc36ecb8615adcfb3b11dc
child 37914 5c985022036abcf76c61e4efe1da7c2c0f0ef003
push id398
push userclokep@gmail.com
push dateMon, 09 Mar 2020 19:10:28 +0000
reviewersdarktrojan
bugs1604155
Bug 1604155 - replace XULElement.ordinal property usage in Thunderbird. r=darktrojan
calendar/base/content/calendar-task-tree.js
--- a/calendar/base/content/calendar-task-tree.js
+++ b/calendar/base/content/calendar-task-tree.js
@@ -329,17 +329,17 @@
      * This function reads data from column attributes and sets it on several attributes on the
      * task tree element, which are persisted because they are in the "persist" attribute of
      * the task tree element.
      * (E.g. `persist="visible-columns ordinals widths sort-active sort-direction"`.)
      */
     persistColumnState() {
       const columns = Array.from(this.querySelectorAll("treecol"));
       const widths = columns.map(col => col.width || 0);
-      const ordinals = columns.map(col => col.ordinal);
+      const ordinals = columns.map(col => col.getAttribute("ordinal"));
       const visibleColumns = columns
         .filter(col => col.getAttribute("hidden") != "true")
         .map(col => col.getAttribute("itemproperty"));
 
       this.setAttribute("widths", widths.join(" "));
       this.setAttribute("ordinals", ordinals.join(" "));
       this.setAttribute("visible-columns", visibleColumns.join(" "));
 
@@ -368,17 +368,17 @@
       this.querySelectorAll("treecol").forEach(col => {
         const itemProperty = col.getAttribute("itemproperty");
         if (visibleColumns.includes(itemProperty)) {
           col.removeAttribute("hidden");
         } else {
           col.setAttribute("hidden", "true");
         }
         if (ordinals && ordinals.length > 0) {
-          col.ordinal = Number(ordinals.shift());
+          col.setAttribute("ordinal", ordinals.shift());
         }
         if (widths && widths.length > 0) {
           col.width = Number(widths.shift());
         }
         if (sorted && sorted == itemProperty) {
           this.mTreeView.sortDirection = sortDirection;
           this.mTreeView.selectedColumn = col;
         }