Bug 1529900 - Columnpicker restore column order doesn't work anymore, r=smaug
authorVictor Porof <vporof@mozilla.com>
Tue, 05 Mar 2019 16:35:01 +0000
changeset 521306 2883b91c8f6f0fe8ecfc762787d0ebdb06beef75
parent 521305 7f22a46bf802b3b0a535b56aa43d97e90688c32e
child 521307 06e2967e09efb1907d37319a3c4a2be9ca44e6a0
child 521321 9294eb30e6daf90370ec4ca6dacbf6c0f89d0861
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1529900
milestone67.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 1529900 - Columnpicker restore column order doesn't work anymore, r=smaug Differential Revision: https://phabricator.services.mozilla.com/D22094
layout/xul/tree/nsTreeUtils.cpp
--- a/layout/xul/tree/nsTreeUtils.cpp
+++ b/layout/xul/tree/nsTreeUtils.cpp
@@ -50,16 +50,23 @@ nsresult nsTreeUtils::TokenizeProperties
 nsIContent* nsTreeUtils::GetImmediateChild(nsIContent* aContainer,
                                            nsAtom* aTag) {
   dom::FlattenedChildIterator iter(aContainer);
   for (nsIContent* child = iter.GetNextChild(); child;
        child = iter.GetNextChild()) {
     if (child->IsXULElement(aTag)) {
       return child;
     }
+    // <slot> is in the flattened tree, but <tree> code is used to work with
+    // <xbl:children> which is not, so recurse in <slot> here.
+    if (child->IsHTMLElement(nsGkAtoms::slot)) {
+      if (nsIContent* c = GetImmediateChild(child, aTag)) {
+        return c;
+      }
+    }
   }
 
   return nullptr;
 }
 
 nsIContent* nsTreeUtils::GetDescendantChild(nsIContent* aContainer,
                                             nsAtom* aTag) {
   dom::FlattenedChildIterator iter(aContainer);