зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1880996
- Check for zero-length text in nsBidiPresUtils::ProcessSimpleRun. r=dholbert
In the example here, failing to check for an empty string was resulting in lots of extra work to set up for drawing a shadow, etc., even though nothing ends up being rendered. Just bail out early if there's no text. Differential Revision: https://phabricator.services.mozilla.com/D202630
This commit is contained in:
Родитель
3087118fc8
Коммит
d80cf90364
|
@ -2363,6 +2363,9 @@ void nsBidiPresUtils::ProcessSimpleRun(const char16_t* aText, size_t aLength,
|
|||
nsBidiPositionResolve* aPosResolve,
|
||||
int32_t aPosResolveCount,
|
||||
nscoord* aWidth) {
|
||||
if (!aLength) {
|
||||
return;
|
||||
}
|
||||
// Get bidi class from the first (or only) character.
|
||||
uint32_t ch = aText[0];
|
||||
if (aLength > 1 && NS_IS_HIGH_SURROGATE(ch) &&
|
||||
|
|
Загрузка…
Ссылка в новой задаче