mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-25 22:29:07 +00:00
Bug 1140625 - Part 1: Add recursive call in GetFrameForNodeOffset. r=roc
This commit is contained in:
parent
392ca34c49
commit
2f598d90a4
@ -1855,29 +1855,21 @@ nsFrameSelection::GetFrameForNodeOffset(nsIContent* aNode,
|
||||
theNode = childNode;
|
||||
}
|
||||
|
||||
#ifdef DONT_DO_THIS_YET
|
||||
// XXX: We can't use this code yet because the hinting
|
||||
// can cause us to attach to the wrong line frame.
|
||||
|
||||
// Now that we have the child node, check if it too
|
||||
// can contain children. If so, call this method again!
|
||||
|
||||
if (theNode->IsElement())
|
||||
if (theNode->IsElement() &&
|
||||
theNode->GetChildCount() &&
|
||||
!theNode->HasIndependentSelection())
|
||||
{
|
||||
int32_t newOffset = 0;
|
||||
|
||||
if (aOffset > childIndex)
|
||||
{
|
||||
if (aOffset > childIndex) {
|
||||
numChildren = theNode->GetChildCount();
|
||||
|
||||
newOffset = numChildren;
|
||||
}
|
||||
|
||||
return GetFrameForNodeOffset(theNode, newOffset, aHint, aReturnOffset);
|
||||
}
|
||||
else
|
||||
#endif // DONT_DO_THIS_YET
|
||||
{
|
||||
} else {
|
||||
// Check to see if theNode is a text node. If it is, translate
|
||||
// aOffset into an offset into the text node.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user