mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-05 15:59:45 +00:00
Make nsContinuingTextFrame::GetFirstInFlow not crash. b=189515 r+sr=bzbarsky
This commit is contained in:
parent
3a031bcf35
commit
23976acf02
@ -966,11 +966,14 @@ nsContinuingTextFrame::Destroy(nsIPresContext* aPresContext)
|
||||
nsIFrame*
|
||||
nsContinuingTextFrame::GetFirstInFlow() const
|
||||
{
|
||||
nsContinuingTextFrame* firstInFlow = (nsContinuingTextFrame*)this;
|
||||
while (firstInFlow->mPrevInFlow) {
|
||||
firstInFlow = (nsContinuingTextFrame*)firstInFlow->mPrevInFlow;
|
||||
}
|
||||
NS_POSTCONDITION(firstInFlow, "illegal state in flow chain.");
|
||||
// Can't cast to |nsContinuingTextFrame*| because the first one isn't.
|
||||
nsIFrame *firstInFlow,
|
||||
*previous = NS_CONST_CAST(nsIFrame*,
|
||||
NS_STATIC_CAST(const nsIFrame*, this));
|
||||
do {
|
||||
firstInFlow = previous;
|
||||
firstInFlow->GetPrevInFlow(&previous);
|
||||
} while (previous);
|
||||
return firstInFlow;
|
||||
}
|
||||
|
||||
|
@ -966,11 +966,14 @@ nsContinuingTextFrame::Destroy(nsIPresContext* aPresContext)
|
||||
nsIFrame*
|
||||
nsContinuingTextFrame::GetFirstInFlow() const
|
||||
{
|
||||
nsContinuingTextFrame* firstInFlow = (nsContinuingTextFrame*)this;
|
||||
while (firstInFlow->mPrevInFlow) {
|
||||
firstInFlow = (nsContinuingTextFrame*)firstInFlow->mPrevInFlow;
|
||||
}
|
||||
NS_POSTCONDITION(firstInFlow, "illegal state in flow chain.");
|
||||
// Can't cast to |nsContinuingTextFrame*| because the first one isn't.
|
||||
nsIFrame *firstInFlow,
|
||||
*previous = NS_CONST_CAST(nsIFrame*,
|
||||
NS_STATIC_CAST(const nsIFrame*, this));
|
||||
do {
|
||||
firstInFlow = previous;
|
||||
firstInFlow->GetPrevInFlow(&previous);
|
||||
} while (previous);
|
||||
return firstInFlow;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user