mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-26 18:31:29 +00:00
Bug 1062735 - Part 1: Remove GetHintForPosition. r=roc
This commit is contained in:
parent
ef48a9fa7c
commit
27ecf9f1b4
@ -323,7 +323,7 @@ FindFirstNodeWithFrame(nsIDocument* aDocument,
|
||||
nsCOMPtr<nsIContent> startContent = do_QueryInterface(startNode);
|
||||
nsCOMPtr<nsIContent> endContent = do_QueryInterface(endNode);
|
||||
CaretAssociationHint hintStart =
|
||||
nsFrameSelection::GetHintForPosition(startContent, offset);
|
||||
aBackward ? CARET_ASSOCIATE_BEFORE : CARET_ASSOCIATE_AFTER;
|
||||
nsIFrame* startFrame = aFrameSelection->GetFrameForNodeOffset(startContent,
|
||||
offset,
|
||||
hintStart,
|
||||
@ -718,7 +718,7 @@ SelectionCarets::GetCaretYCenterPosition()
|
||||
|
||||
int32_t offset;
|
||||
CaretAssociationHint hint =
|
||||
nsFrameSelection::GetHintForPosition(node, nodeOffset);
|
||||
mDragMode == START_FRAME ? CARET_ASSOCIATE_AFTER : CARET_ASSOCIATE_BEFORE;
|
||||
nsIFrame* theFrame =
|
||||
fs->GetFrameForNodeOffset(node, nodeOffset, hint, &offset);
|
||||
|
||||
|
@ -584,8 +584,6 @@ public:
|
||||
void DisconnectFromPresShell();
|
||||
nsresult ClearNormalSelection();
|
||||
|
||||
static CaretAssociateHint GetHintForPosition(nsIContent* aContent, int32_t aOffset);
|
||||
|
||||
private:
|
||||
~nsFrameSelection();
|
||||
|
||||
|
@ -714,21 +714,6 @@ GetCellParent(nsINode *aDomNode)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CaretAssociationHint
|
||||
nsFrameSelection::GetHintForPosition(nsIContent* aContent, int32_t aOffset)
|
||||
{
|
||||
CaretAssociateHint hint = CARET_ASSOCIATE_BEFORE;
|
||||
if (!aContent || aOffset < 1) {
|
||||
return hint;
|
||||
}
|
||||
const nsTextFragment* text = aContent->GetText();
|
||||
if (text && text->CharAt(aOffset - 1) == '\n') {
|
||||
// Attach the caret to the next line if needed
|
||||
hint = CARET_ASSOCIATE_AFTER;
|
||||
}
|
||||
return hint;
|
||||
}
|
||||
|
||||
void
|
||||
nsFrameSelection::Init(nsIPresShell *aShell, nsIContent *aLimiter)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user