Bug 947158 - Drain the overflow list on inlines before traversing children for bidi processing. r=smontagu

This commit is contained in:
Mats Palmgren 2013-12-17 13:30:25 +00:00
parent 9c162501e2
commit b3624fe3c9

View File

@ -976,6 +976,13 @@ nsBidiPresUtils::TraverseFrames(nsBlockFrame* aBlockFrame,
PRUnichar ch = 0;
if (frame->IsFrameOfType(nsIFrame::eBidiInlineContainer)) {
if (!(frame->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
nsContainerFrame* c = static_cast<nsContainerFrame*>(frame);
MOZ_ASSERT(c = do_QueryFrame(frame),
"eBidiInlineContainer must be a nsContainerFrame subclass");
c->DrainSelfOverflowList();
}
const nsStyleVisibility* vis = frame->StyleVisibility();
const nsStyleTextReset* text = frame->StyleTextReset();
if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_OVERRIDE) {
@ -1143,8 +1150,9 @@ nsBidiPresUtils::TraverseFrames(nsBlockFrame* aBlockFrame,
} else {
// For a non-leaf frame, recurse into TraverseFrames
nsIFrame* kid = frame->GetFirstPrincipalChild();
nsIFrame* overflowKid = frame->GetFirstChild(nsIFrame::kOverflowList);
if (kid || overflowKid) {
MOZ_ASSERT(!frame->GetFirstChild(nsIFrame::kOverflowList),
"should have drained the overflow list above");
if (kid) {
const nsStyleTextReset* text = frame->StyleTextReset();
if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_ISOLATE ||
text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_PLAINTEXT) {
@ -1168,7 +1176,6 @@ nsBidiPresUtils::TraverseFrames(nsBlockFrame* aBlockFrame,
subParagraph->Reset(frame, aBpd);
}
TraverseFrames(aBlockFrame, aLineIter, kid, subParagraph);
TraverseFrames(aBlockFrame, aLineIter, overflowKid, subParagraph);
if (isLastContinuation) {
ResolveParagraph(aBlockFrame, subParagraph);
subParagraph->EmptyBuffer();
@ -1179,7 +1186,6 @@ nsBidiPresUtils::TraverseFrames(nsBlockFrame* aBlockFrame,
aBpd->AppendControlChar(kObjectSubstitute);
} else {
TraverseFrames(aBlockFrame, aLineIter, kid, aBpd);
TraverseFrames(aBlockFrame, aLineIter, overflowKid, aBpd);
}
}
}