Bug 400826 - We shouldn't build the styles array for transformed textruns assuming every frame in a flow has the same style; instead we should build it frame by frame. [p=roc r=smontagu a=blocking1.9+]

This commit is contained in:
reed@reedloden.com 2007-11-07 19:52:33 -08:00
Родитель 3253b52030
Коммит aa4a6414ab
1 изменённых файлов: 13 добавлений и 8 удалений

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

@ -1510,16 +1510,21 @@ BuildTextRunsScanner::BuildTextRunForFrames(void* aTextBuffer)
iter.SetOriginalOffset(0);
for (i = 0; i < mMappedFlows.Length(); ++i) {
MappedFlow* mappedFlow = &mMappedFlows[i];
PRUint32 offset = iter.GetSkippedOffset();
iter.AdvanceOriginal(mappedFlow->GetContentEnd() -
mappedFlow->mStartFrame->GetContentOffset());
PRUint32 end = iter.GetSkippedOffset();
nsStyleContext* sc = mappedFlow->mStartFrame->GetStyleContext();
PRUint32 j;
for (j = offset; j < end; ++j) {
styles.AppendElement(sc);
nsTextFrame* f;
for (f = mappedFlow->mStartFrame; f != mappedFlow->mEndFrame;
f = static_cast<nsTextFrame*>(f->GetNextInFlow())) {
PRUint32 offset = iter.GetSkippedOffset();
iter.AdvanceOriginal(f->GetContentLength());
PRUint32 end = iter.GetSkippedOffset();
nsStyleContext* sc = f->GetStyleContext();
PRUint32 j;
for (j = offset; j < end; ++j) {
styles.AppendElement(sc);
}
}
}
NS_ASSERTION(iter.GetSkippedOffset() == transformedLength,
"We didn't cover all the characters in the text run!");
}
gfxTextRun* textRun;