diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-03-15 09:11:31 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-03-15 09:11:31 +0100 |
commit | 82b361dc4463b13ebda30090e239db487f5aa308 (patch) | |
tree | fdc6fd06e695188735d636da57b02b6c7e0c1c5f /layout/generic/nsTextFrame.cpp | |
parent | 4bb98e2b61ce75d7f5d19398b658441a7ceed04b (diff) | |
parent | 71429dc7ecc496c5924c770746e8c28449ecb7a2 (diff) | |
download | UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar.gz UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar.lz UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar.xz UXP-82b361dc4463b13ebda30090e239db487f5aa308.zip |
Merge branch 'ported-upstream'
Diffstat (limited to 'layout/generic/nsTextFrame.cpp')
-rw-r--r-- | layout/generic/nsTextFrame.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index b9848bcf1..00c0016fd 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -9751,9 +9751,13 @@ nsTextFrame::GetRenderedText(uint32_t aStartOffset, startOffset = aStartOffset; 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, startOffset); - trimmedOffsets.mLength = std::min<uint32_t>(trimmedOffsets.GetEnd(), + trimmedOffsets.mLength = std::min<uint32_t>(origTrimmedOffsetsEnd, endOffset) - trimmedOffsets.mStart; if (trimmedOffsets.mLength <= 0) { offsetInRenderedString = nextOffsetInRenderedString; |