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); iter.SetOriginalOffset(0);
for (i = 0; i < mMappedFlows.Length(); ++i) { for (i = 0; i < mMappedFlows.Length(); ++i) {
MappedFlow* mappedFlow = &mMappedFlows[i]; MappedFlow* mappedFlow = &mMappedFlows[i];
PRUint32 offset = iter.GetSkippedOffset(); nsTextFrame* f;
iter.AdvanceOriginal(mappedFlow->GetContentEnd() - for (f = mappedFlow->mStartFrame; f != mappedFlow->mEndFrame;
mappedFlow->mStartFrame->GetContentOffset()); f = static_cast<nsTextFrame*>(f->GetNextInFlow())) {
PRUint32 end = iter.GetSkippedOffset(); PRUint32 offset = iter.GetSkippedOffset();
nsStyleContext* sc = mappedFlow->mStartFrame->GetStyleContext(); iter.AdvanceOriginal(f->GetContentLength());
PRUint32 j; PRUint32 end = iter.GetSkippedOffset();
for (j = offset; j < end; ++j) { nsStyleContext* sc = f->GetStyleContext();
styles.AppendElement(sc); 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; gfxTextRun* textRun;