Bug 1426525 part 4. Remove uses of 'ref' in XUL trees. r=gijs
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 05 Jan 2018 13:48:39 -0500
changeset 398075 cb168f6a6bfd465f80dbacc30e5daa8aa3fc2561
parent 398074 c9fad2f644485a0508a00985ac27c16ef1013e80
child 398076 f5ed4ddcc51299bd4de3803d2c3bd227d7606f22
push id33201
push userapavel@mozilla.com
push dateSat, 06 Jan 2018 09:50:43 +0000
treeherdermozilla-central@ece8a96dfaa4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs
bugs1426525
milestone59.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 1426525 part 4. Remove uses of 'ref' in XUL trees. r=gijs MozReview-Commit-ID: He9RTzZMmSr
layout/xul/tree/nsTreeContentView.cpp
--- a/layout/xul/tree/nsTreeContentView.cpp
+++ b/layout/xul/tree/nsTreeContentView.cpp
@@ -1068,18 +1068,17 @@ nsTreeContentView::AttributeChanged(nsID
         int32_t index = FindContent(parent);
         if (index >= 0 && mBoxObject) {
           mBoxObject->InvalidateRow(index);
         }
       }
     }
   }
   else if (aElement->IsXULElement(nsGkAtoms::treecell)) {
-    if (aAttribute == nsGkAtoms::ref ||
-        aAttribute == nsGkAtoms::properties ||
+    if (aAttribute == nsGkAtoms::properties ||
         aAttribute == nsGkAtoms::mode ||
         aAttribute == nsGkAtoms::src ||
         aAttribute == nsGkAtoms::value ||
         aAttribute == nsGkAtoms::label) {
       nsIContent* parent = aElement->GetParent();
       if (parent) {
         nsCOMPtr<nsIContent> grandParent = parent->GetParent();
         if (grandParent && grandParent->IsXULElement()) {
@@ -1563,35 +1562,28 @@ nsTreeContentView::UpdateParentIndexes(i
       row->mParentIndex += aCount;
     }
   }
 }
 
 Element*
 nsTreeContentView::GetCell(nsIContent* aContainer, nsTreeColumn& aCol)
 {
-  RefPtr<nsAtom> colAtom(aCol.GetAtom());
   int32_t colIndex(aCol.GetIndex());
 
-  // Traverse through cells, try to find the cell by "ref" attribute or by cell
-  // index in a row. "ref" attribute has higher priority.
+  // Traverse through cells, try to find the cell by index in a row.
   Element* result = nullptr;
   int32_t j = 0;
   dom::FlattenedChildIterator iter(aContainer);
   for (nsIContent* cell = iter.GetNextChild(); cell; cell = iter.GetNextChild()) {
     if (cell->IsXULElement(nsGkAtoms::treecell)) {
-      if (colAtom &&
-          cell->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::ref,
-                                         colAtom, eCaseMatters)) {
+      if (j == colIndex) {
         result = cell->AsElement();
         break;
       }
-      else if (j == colIndex) {
-        result = cell->AsElement();
-      }
       j++;
     }
   }
 
   return result;
 }
 
 bool