mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Bug 54005. Test if frame CanContinueTextRun() before advancing to its sibling. r=karnaze, a=buster
This commit is contained in:
parent
4b12cfdd46
commit
072a02200b
@ -2988,21 +2988,23 @@ nsLineLayout::FindNextText(nsIPresContext* aPresContext, nsIFrame* aFrame)
|
||||
PRInt32 lastIndex = count - 1;
|
||||
nsIFrame* top = NS_STATIC_CAST(nsIFrame*, stack.ElementAt(lastIndex));
|
||||
|
||||
// If this is a frame that'll break a word, then bail.
|
||||
PRBool canContinue;
|
||||
top->CanContinueTextRun(canContinue);
|
||||
if (! canContinue)
|
||||
break;
|
||||
|
||||
// Advance to top's next sibling
|
||||
nsIFrame* next;
|
||||
top->GetNextSibling(&next);
|
||||
|
||||
if (! next) {
|
||||
// No next. Pop the top element.
|
||||
// No more siblings. Pop the top element to walk back up the
|
||||
// frame tree.
|
||||
stack.RemoveElementAt(lastIndex);
|
||||
continue;
|
||||
}
|
||||
|
||||
// If this is a frame that'll break a word, then bail.
|
||||
PRBool canContinue;
|
||||
next->CanContinueTextRun(canContinue);
|
||||
if (! canContinue)
|
||||
break;
|
||||
|
||||
// We know top's parent is good, but next's might not be. So let's
|
||||
// set it to be sure.
|
||||
nsIFrame* parent;
|
||||
|
@ -2988,21 +2988,23 @@ nsLineLayout::FindNextText(nsIPresContext* aPresContext, nsIFrame* aFrame)
|
||||
PRInt32 lastIndex = count - 1;
|
||||
nsIFrame* top = NS_STATIC_CAST(nsIFrame*, stack.ElementAt(lastIndex));
|
||||
|
||||
// If this is a frame that'll break a word, then bail.
|
||||
PRBool canContinue;
|
||||
top->CanContinueTextRun(canContinue);
|
||||
if (! canContinue)
|
||||
break;
|
||||
|
||||
// Advance to top's next sibling
|
||||
nsIFrame* next;
|
||||
top->GetNextSibling(&next);
|
||||
|
||||
if (! next) {
|
||||
// No next. Pop the top element.
|
||||
// No more siblings. Pop the top element to walk back up the
|
||||
// frame tree.
|
||||
stack.RemoveElementAt(lastIndex);
|
||||
continue;
|
||||
}
|
||||
|
||||
// If this is a frame that'll break a word, then bail.
|
||||
PRBool canContinue;
|
||||
next->CanContinueTextRun(canContinue);
|
||||
if (! canContinue)
|
||||
break;
|
||||
|
||||
// We know top's parent is good, but next's might not be. So let's
|
||||
// set it to be sure.
|
||||
nsIFrame* parent;
|
||||
|
Loading…
Reference in New Issue
Block a user