mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 07:07:30 +09:00
Bug 1324042 - Fix trimmedOffsets arithmetic in GetRenderedText(). r=mats, a=RyanVM
MozReview-Commit-ID: H4ngU8Juyln --HG-- extra : rebase_source : f4d6ab58ae70e485dfe72d5290cf6fae2c8397dd extra : intermediate-source : bec50ba1fb12aebde4e4065b2799bc730bc30010 extra : source : fbf54020043bd09c162530907b2a1091a10f4f92
This commit is contained in:
parent
b49b2afc58
commit
8d0ffc3c31
1 changed files with 5 additions and 1 deletions
|
|
@ -9751,9 +9751,13 @@ nsTextFrame::GetRenderedText(uint32_t aStartOffset,
|
||||||
startOffset = aStartOffset;
|
startOffset = aStartOffset;
|
||||||
endOffset = std::min<uint32_t>(INT32_MAX, aEndOffset);
|
endOffset = std::min<uint32_t>(INT32_MAX, aEndOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If startOffset and/or endOffset are inside of trimmedOffsets' range,
|
||||||
|
// then clamp the edges of trimmedOffsets accordingly.
|
||||||
|
int32_t origTrimmedOffsetsEnd = trimmedOffsets.GetEnd();
|
||||||
trimmedOffsets.mStart = std::max<uint32_t>(trimmedOffsets.mStart,
|
trimmedOffsets.mStart = std::max<uint32_t>(trimmedOffsets.mStart,
|
||||||
startOffset);
|
startOffset);
|
||||||
trimmedOffsets.mLength = std::min<uint32_t>(trimmedOffsets.GetEnd(),
|
trimmedOffsets.mLength = std::min<uint32_t>(origTrimmedOffsetsEnd,
|
||||||
endOffset) - trimmedOffsets.mStart;
|
endOffset) - trimmedOffsets.mStart;
|
||||||
if (trimmedOffsets.mLength <= 0) {
|
if (trimmedOffsets.mLength <= 0) {
|
||||||
offsetInRenderedString = nextOffsetInRenderedString;
|
offsetInRenderedString = nextOffsetInRenderedString;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue