Bug 1245075 patch 1 - Remove assertion, since it can fire during frame destruction. r?dholbert draft
authorL. David Baron <dbaron@dbaron.org>
Sat, 06 Feb 2016 19:31:49 -0800
changeset 329441 f661512e3c1a336c3f3332a876737145e34f3ab5
parent 329353 4295f9951e9331a2f2bd0a8ea8c4ad73af141a7b
child 329442 daa16e62d97d9d1e7ed75de87284a81aaf0371c2
push id10526
push userdbaron@mozilla.com
push dateSun, 07 Feb 2016 03:32:00 +0000
reviewersdholbert
bugs1245075
milestone47.0a1
Bug 1245075 patch 1 - Remove assertion, since it can fire during frame destruction. r?dholbert Without this patch, patch 2 will cause assertions since nsFrame::DestroyFrom calls nsFrame::HasCSSAnimations (at a time when the child frame has been destroyed), which calls into the code modified in patch 2 to call GetStyleFrame.
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1471,17 +1471,17 @@ nsLayoutUtils::GetClosestFrameOfType(nsI
 }
 
 // static
 nsIFrame*
 nsLayoutUtils::GetStyleFrame(nsIFrame* aFrame)
 {
   if (aFrame->GetType() == nsGkAtoms::tableOuterFrame) {
     nsIFrame* inner = aFrame->PrincipalChildList().FirstChild();
-    NS_ASSERTION(inner, "Outer table must have an inner");
+    // inner may be null, if aFrame is mid-destruction
     return inner;
   }
 
   return aFrame;
 }
 
 nsIFrame*
 nsLayoutUtils::GetStyleFrame(const nsIContent* aContent)
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -326,16 +326,20 @@ public:
     return GetClosestFrameOfType(aFrame, nsGkAtoms::pageFrame);
   }
 
   /**
    * Given a frame which is the primary frame for an element,
    * return the frame that has the non-psuedoelement style context for
    * the content.
    * This is aPrimaryFrame itself except for tableOuter frames.
+   *
+   * Given a non-null input, this will return null if and only if its
+   * argument is a table outer frame that is mid-destruction (and its
+   * table frame has been destroyed).
    */
   static nsIFrame* GetStyleFrame(nsIFrame* aPrimaryFrame);
 
   /**
    * Given a content node,
    * return the frame that has the non-psuedoelement style context for
    * the content.  May return null.
    * This is aContent->GetPrimaryFrame() except for tableOuter frames.