Bug 1062735 - Part 1: Remove GetHintForPosition. r=roc

This commit is contained in:
Morris Tseng 2014-09-28 23:48:00 +02:00
parent ef48a9fa7c
commit 27ecf9f1b4
3 changed files with 2 additions and 19 deletions

View File

@ -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);

View File

@ -584,8 +584,6 @@ public:
void DisconnectFromPresShell();
nsresult ClearNormalSelection();
static CaretAssociateHint GetHintForPosition(nsIContent* aContent, int32_t aOffset);
private:
~nsFrameSelection();

View File

@ -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)
{