Bug 1377978 - Make nsRange use uint32_t to offset

Tag #1375
This commit is contained in:
Matt A. Tobin
2020-04-17 06:10:23 -04:00
committed by Roy Tam
parent 84d3b44b86
commit 6ce9cc2a25
23 changed files with 425 additions and 287 deletions
+1 -5
View File
@@ -5275,7 +5275,7 @@ EditorBase::GetIMESelectionStartOffsetIn(nsINode* aTextNode)
return -1;
}
int32_t minOffset = INT32_MAX;
uint32_t minOffset = UINT32_MAX;
static const SelectionType kIMESelectionTypes[] = {
SelectionType::eIMERawClause,
SelectionType::eIMESelectedRawClause,
@@ -5295,15 +5295,11 @@ EditorBase::GetIMESelectionStartOffsetIn(nsINode* aTextNode)
if (NS_WARN_IF(range->GetStartParent() != aTextNode)) {
// ignore the start offset...
} else {
MOZ_ASSERT(range->StartOffset() >= 0,
"start offset shouldn't be negative");
minOffset = std::min(minOffset, range->StartOffset());
}
if (NS_WARN_IF(range->GetEndParent() != aTextNode)) {
// ignore the end offset...
} else {
MOZ_ASSERT(range->EndOffset() >= 0,
"start offset shouldn't be negative");
minOffset = std::min(minOffset, range->EndOffset());
}
}