mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1034403 - update index to step past the second half of a surrogate pair. r=roc
This commit is contained in:
parent
e5c6ba3311
commit
65a2f6fb2d
8
gfx/tests/crashtests/1034403-1.html
Normal file
8
gfx/tests/crashtests/1034403-1.html
Normal file
@ -0,0 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body style="font-variant: small-caps; font-family: 'Times New Roman';">
|
||||
<div>x󠄱</div>
|
||||
</body>
|
||||
</html>
|
@ -108,3 +108,4 @@ load 893572-1.html
|
||||
load 893572-2.html
|
||||
load 893572-3.html
|
||||
load 893572-4.html
|
||||
load 1034403-1.html
|
||||
|
@ -5764,6 +5764,9 @@ gfxFont::InitFakeSmallCapsRun(gfxContext *aContext,
|
||||
uint32_t runStart = 0;
|
||||
|
||||
for (uint32_t i = 0; i <= aLength; ++i) {
|
||||
uint32_t extraCodeUnits = 0; // Will be set to 1 if we need to consume
|
||||
// a trailing surrogate as well as the
|
||||
// current code unit.
|
||||
RunCaseAction chAction = kNoChange;
|
||||
// Unless we're at the end, figure out what treatment the current
|
||||
// character will need.
|
||||
@ -5772,6 +5775,7 @@ gfxFont::InitFakeSmallCapsRun(gfxContext *aContext,
|
||||
if (NS_IS_HIGH_SURROGATE(ch) && i < aLength - 1 &&
|
||||
NS_IS_LOW_SURROGATE(aText[i + 1])) {
|
||||
ch = SURROGATE_TO_UCS4(ch, aText[i + 1]);
|
||||
extraCodeUnits = 1;
|
||||
}
|
||||
// Characters that aren't the start of a cluster are ignored here.
|
||||
// They get added to whatever lowercase/non-lowercase run we're in.
|
||||
@ -5885,6 +5889,7 @@ gfxFont::InitFakeSmallCapsRun(gfxContext *aContext,
|
||||
runStart = i;
|
||||
}
|
||||
|
||||
i += extraCodeUnits;
|
||||
if (i < aLength) {
|
||||
runAction = chAction;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user