Test the containing frame for continuations, not the child. Bug 698706, r=roc

This commit is contained in:
Simon Montagu 2011-11-07 16:26:50 +02:00
Родитель c121ebe5e0
Коммит 47421feaee
2 изменённых файлов: 14 добавлений и 17 удалений

Просмотреть файл

@ -904,8 +904,7 @@ void
nsBidiPresUtils::TraverseFrames(nsBlockFrame* aBlockFrame, nsBidiPresUtils::TraverseFrames(nsBlockFrame* aBlockFrame,
nsBlockInFlowLineIterator* aLineIter, nsBlockInFlowLineIterator* aLineIter,
nsIFrame* aCurrentFrame, nsIFrame* aCurrentFrame,
BidiParagraphData* aBpd, BidiParagraphData* aBpd)
BidiParagraphData* aContainingParagraph)
{ {
if (!aCurrentFrame) if (!aCurrentFrame)
return; return;
@ -936,10 +935,6 @@ nsBidiPresUtils::TraverseFrames(nsBlockFrame* aBlockFrame,
} }
} }
if (aContainingParagraph && isFirstFrame) {
aBpd->Reset(aCurrentFrame, aContainingParagraph);
}
PRUnichar ch = 0; PRUnichar ch = 0;
if (frame->IsFrameOfType(nsIFrame::eBidiInlineContainer)) { if (frame->IsFrameOfType(nsIFrame::eBidiInlineContainer)) {
const nsStyleVisibility* vis = frame->GetStyleVisibility(); const nsStyleVisibility* vis = frame->GetStyleVisibility();
@ -1111,8 +1106,18 @@ nsBidiPresUtils::TraverseFrames(nsBlockFrame* aBlockFrame,
if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_ISOLATE) { if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_ISOLATE) {
// css "unicode-bidi: isolate" and html5 bdi: // css "unicode-bidi: isolate" and html5 bdi:
// resolve the element as a separate paragraph // resolve the element as a separate paragraph
TraverseFrames(aBlockFrame, aLineIter, kid, BidiParagraphData* subParagraph = aBpd->GetSubParagraph();
aBpd->GetSubParagraph(), aBpd); if (!frame->GetPrevContinuation()) {
subParagraph->Reset(kid, aBpd);
}
TraverseFrames(aBlockFrame, aLineIter, kid, subParagraph);
if (!frame->GetNextContinuation()) {
ResolveParagraph(aBlockFrame, subParagraph);
}
// Treat the element as a neutral character within its containing
// paragraph.
aBpd->AppendControlChar(kObjectSubstitute);
} else { } else {
TraverseFrames(aBlockFrame, aLineIter, kid, aBpd); TraverseFrames(aBlockFrame, aLineIter, kid, aBpd);
} }
@ -1126,13 +1131,6 @@ nsBidiPresUtils::TraverseFrames(nsBlockFrame* aBlockFrame,
// last frame of an element specifying embedding or override // last frame of an element specifying embedding or override
aBpd->PopBidiControl(); aBpd->PopBidiControl();
} }
if (aContainingParagraph) {
ResolveParagraph(aBlockFrame, aBpd);
// Treat an element with unicode-bidi: isolate as a neutral character
// within its containing paragraph
aContainingParagraph->AppendControlChar(kObjectSubstitute);
}
} }
childFrame = nextSibling; childFrame = nextSibling;
} while (childFrame); } while (childFrame);

Просмотреть файл

@ -371,8 +371,7 @@ private:
static void TraverseFrames(nsBlockFrame* aBlockFrame, static void TraverseFrames(nsBlockFrame* aBlockFrame,
nsBlockInFlowLineIterator* aLineIter, nsBlockInFlowLineIterator* aLineIter,
nsIFrame* aCurrentFrame, nsIFrame* aCurrentFrame,
BidiParagraphData* aBpd, BidiParagraphData* aBpd);
BidiParagraphData* containingParagraph = nsnull);
/* /*
* Position aFrame and it's descendants to their visual places. Also if aFrame * Position aFrame and it's descendants to their visual places. Also if aFrame