Bug 700031 - "ASSERTION: Can only call this on frames that have been reflowed" with too-deep frame tree. r=roc
authorMats Palmgren <matspal@gmail.com>
Thu, 29 Dec 2011 14:21:00 +0100
changeset 84734 52384048e349c8973fa9a528c6e599369e80a00e
parent 84733 29b864db2073f2d252439b1549a17e91fbbe3909
child 84735 166bde5c0002a648e0c5207ad1342226e8040f79
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs700031
milestone12.0a1
Bug 700031 - "ASSERTION: Can only call this on frames that have been reflowed" with too-deep frame tree. r=roc
layout/generic/nsTextFrameThebes.cpp
--- a/layout/generic/nsTextFrameThebes.cpp
+++ b/layout/generic/nsTextFrameThebes.cpp
@@ -2332,18 +2332,20 @@ GetEndOfTrimmedText(const nsTextFragment
 }
 
 nsTextFrame::TrimmedOffsets
 nsTextFrame::GetTrimmedOffsets(const nsTextFragment* aFrag,
                                bool aTrimAfter)
 {
   NS_ASSERTION(mTextRun, "Need textrun here");
   // This should not be used during reflow. We need our TEXT_REFLOW_FLAGS
-  // to be set correctly.
-  NS_ASSERTION(!(GetStateBits() & NS_FRAME_FIRST_REFLOW),
+  // to be set correctly.  If our parent wasn't reflowed due to the frame
+  // tree being too deep then the return value doesn't matter.
+  NS_ASSERTION(!(GetStateBits() & NS_FRAME_FIRST_REFLOW) ||
+               (GetParent()->GetStateBits() & NS_FRAME_TOO_DEEP_IN_FRAME_TREE),
                "Can only call this on frames that have been reflowed");
   NS_ASSERTION(!(GetStateBits() & NS_FRAME_IN_REFLOW),
                "Can only call this on frames that are not being reflowed");
 
   TrimmedOffsets offsets = { GetContentOffset(), GetContentLength() };
   const nsStyleText* textStyle = GetStyleText();
   // Note that pre-line newlines should still allow us to trim spaces
   // for display