зеркало из 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:
Родитель
afaa047fb9
Коммит
b6a960c96c
|
@ -2363,6 +2363,12 @@ void nsBidiPresUtils::ProcessSimpleRun(const char16_t* aText, size_t aLength,
|
|||
nsBidiPositionResolve* aPosResolve,
|
||||
int32_t aPosResolveCount,
|
||||
nscoord* aWidth) {
|
||||
if (!aLength) {
|
||||
if (aWidth) {
|
||||
*aWidth = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Get bidi class from the first (or only) character.
|
||||
uint32_t ch = aText[0];
|
||||
if (aLength > 1 && NS_IS_HIGH_SURROGATE(ch) &&
|
||||
|
|
Загрузка…
Ссылка в новой задаче