зеркало из https://github.com/mozilla/pjs.git
Bug 385423. Force ZWSP, PSEP and LSEP to be treated as zero-width invisible and not passed into platform textrun creation. Avoids potential bugs and forces consistent handling. r=vlad
This commit is contained in:
Родитель
69671fd285
Коммит
2a49badb09
|
@ -519,10 +519,6 @@ public:
|
|||
* gfxFont. The glyphs are associated with a string of source text, and the
|
||||
* gfxTextRun APIs take parameters that are offsets into that source text.
|
||||
*
|
||||
* \r, \t and \n characters (for which gfxFontGroup::IsInvalidChar returns
|
||||
* PR_TRUE) should be set to a CompressedGlyph with SetMissing() to make them
|
||||
* invisible and zero-width.
|
||||
*
|
||||
* gfxTextRuns are not refcounted. They should be deleted when no longer required.
|
||||
*
|
||||
* gfxTextRuns are mostly immutable. The only things that can change are
|
||||
|
@ -1170,10 +1166,12 @@ public:
|
|||
virtual gfxFontGroup *Copy(const gfxFontStyle *aStyle) = 0;
|
||||
|
||||
/**
|
||||
* Tabs, CRs and LFs should not be passed in to MakeTextRun.
|
||||
* The listed characters should not be passed in to MakeTextRun and should
|
||||
* be treated as invisible and zero-width.
|
||||
*/
|
||||
static PRBool IsInvalidChar(PRUnichar ch) {
|
||||
return ch == '\t' || ch == '\r' || ch == '\n';
|
||||
return ch == '\t' || ch == '\r' || ch == '\n' ||
|
||||
ch == 0x200B/*ZWSP*/ || ch == 0x2028/*LSEP*/ || ch == 0x2029/*PSEP*/;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче