mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 14:58:37 +09:00
parent
84d3b44b86
commit
6ce9cc2a25
23 changed files with 425 additions and 287 deletions
|
|
@ -1836,7 +1836,7 @@ nsImageFrame::ShouldDisplaySelection()
|
|||
int32_t thisOffset = parentContent->IndexOf(mContent);
|
||||
nsCOMPtr<nsIDOMNode> parentNode = do_QueryInterface(parentContent);
|
||||
nsCOMPtr<nsIDOMNode> rangeNode;
|
||||
int32_t rangeOffset;
|
||||
uint32_t rangeOffset;
|
||||
nsCOMPtr<nsIDOMRange> range;
|
||||
selection->GetRangeAt(0,getter_AddRefs(range));
|
||||
if (range)
|
||||
|
|
@ -1844,12 +1844,16 @@ nsImageFrame::ShouldDisplaySelection()
|
|||
range->GetStartContainer(getter_AddRefs(rangeNode));
|
||||
range->GetStartOffset(&rangeOffset);
|
||||
|
||||
if (parentNode && rangeNode && (rangeNode == parentNode) && rangeOffset == thisOffset)
|
||||
{
|
||||
if (parentNode && rangeNode && rangeNode == parentNode &&
|
||||
static_cast<int32_t>(rangeOffset) == thisOffset) {
|
||||
range->GetEndContainer(getter_AddRefs(rangeNode));
|
||||
range->GetEndOffset(&rangeOffset);
|
||||
if ((rangeNode == parentNode) && (rangeOffset == (thisOffset +1))) //+1 since that would mean this whole content is selected only
|
||||
return false; //do not allow nsFrame do draw any further selection
|
||||
// +1 since that would mean this whole content is selected only
|
||||
if (rangeNode == parentNode &&
|
||||
static_cast<int32_t>(rangeOffset) == thisOffset + 1) {
|
||||
// Do not allow nsFrame do draw any further selection
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue