Bug 1382568: Use AutoTArray in IsOrHasAncestorWithDisplayNone. r=heycam
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 30 Jul 2017 04:12:34 +0200
changeset 420548 6c55b6e879d3d2b89f4b1e5378dd5d93ca463340
parent 420547 6a990e8c471a5ce396806aa9e00023d784a7b4aa
child 420549 874935d5a813753c2c2a6358415e0d99d21fa953
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1382568
milestone56.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 1382568: Use AutoTArray in IsOrHasAncestorWithDisplayNone. r=heycam MozReview-Commit-ID: EiRJOPFWEiN
dom/html/nsGenericHTMLElement.cpp
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -2973,17 +2973,17 @@ nsGenericHTMLElement::NewURIFromString(c
   }
 
   return NS_OK;
 }
 
 static bool
 IsOrHasAncestorWithDisplayNone(Element* aElement, nsIPresShell* aPresShell)
 {
-  nsTArray<Element*> elementsToCheck;
+  AutoTArray<Element*, 10> elementsToCheck;
   for (Element* e = aElement; e; e = e->GetParentElement()) {
     if (e->GetPrimaryFrame()) {
       // e definitely isn't display:none and doesn't have a display:none
       // ancestor.
       break;
     }
     elementsToCheck.AppendElement(e);
   }