Bug 947588. Part 2: Add gfxTextRunFactory::TEXT_HIDE_CONTROL_CHARACTERS to guard usage of IsInvalidControlChar. r=jfkthame

--HG--
extra : rebase_source : 2ce426ebf3ad1643038954bcb18553dec27153c9
This commit is contained in:
Robert O'Callahan 2014-02-05 23:08:58 +13:00
Родитель 21f9cc6065
Коммит 43edbab0e3
2 изменённых файлов: 9 добавлений и 2 удалений

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

@ -3482,7 +3482,8 @@ gfxFont::ShapeTextWithoutWordCache(gfxContext *aContext,
aTextRun->SetIsTab(aOffset + i);
} else if (ch == '\n') {
aTextRun->SetIsNewline(aOffset + i);
} else if (IsInvalidControlChar(ch)) {
} else if (IsInvalidControlChar(ch) &&
!(aTextRun->GetFlags() & gfxTextRunFactory::TEXT_HIDE_CONTROL_CHARACTERS)) {
aTextRun->SetMissingGlyph(aOffset + i, ch, this);
}
fragStart = i + 1;
@ -3652,7 +3653,8 @@ gfxFont::SplitAndInitTextRun(gfxContext *aContext,
aTextRun->SetIsTab(aRunStart + i);
} else if (ch == '\n') {
aTextRun->SetIsNewline(aRunStart + i);
} else if (IsInvalidControlChar(ch)) {
} else if (IsInvalidControlChar(ch) &&
!(aTextRun->GetFlags() & gfxTextRunFactory::TEXT_HIDE_CONTROL_CHARACTERS)) {
aTextRun->SetMissingGlyph(aRunStart + i, ch, this);
}

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

@ -1137,6 +1137,11 @@ public:
* textruns that have been seen so as to avoid multiple-accounting.
*/
TEXT_RUN_SIZE_ACCOUNTED = 0x0200,
/**
* When set, the textrun should discard control characters instead of
* turning them into hexboxes.
*/
TEXT_HIDE_CONTROL_CHARACTERS = 0x0400,
/**
* nsTextFrameThebes sets these, but they're defined here rather than