зеркало из https://github.com/mozilla/gecko-dev.git
Bug 54005. Test if frame CanContinueTextRun() before advancing to its sibling. r=karnaze, a=buster
This commit is contained in:
Родитель
4b12cfdd46
Коммит
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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче