Bug 1343037 part 15. Implement nsTextEditorState::GetSelectionDirection. r=ehsan
MozReview-Commit-ID: 1bLLYhjmlff
This commit is contained in:
@@ -6519,20 +6519,6 @@ HTMLInputElement::GetSelectionRange(int32_t* aSelectionStart,
|
||||
state->GetSelectionRange(aSelectionStart, aSelectionEnd, aRv);
|
||||
}
|
||||
|
||||
static void
|
||||
DirectionToName(nsITextControlFrame::SelectionDirection dir, nsAString& aDirection)
|
||||
{
|
||||
if (dir == nsITextControlFrame::eNone) {
|
||||
aDirection.AssignLiteral("none");
|
||||
} else if (dir == nsITextControlFrame::eForward) {
|
||||
aDirection.AssignLiteral("forward");
|
||||
} else if (dir == nsITextControlFrame::eBackward) {
|
||||
aDirection.AssignLiteral("backward");
|
||||
} else {
|
||||
NS_NOTREACHED("Invalid SelectionDirection value");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
HTMLInputElement::GetSelectionDirection(nsAString& aDirection, ErrorResult& aRv)
|
||||
{
|
||||
@@ -6543,13 +6529,7 @@ HTMLInputElement::GetSelectionDirection(nsAString& aDirection, ErrorResult& aRv)
|
||||
|
||||
nsTextEditorState* state = GetEditorState();
|
||||
MOZ_ASSERT(state, "SupportsTextSelection came back true!");
|
||||
nsITextControlFrame::SelectionDirection dir =
|
||||
state->GetSelectionDirection(aRv);
|
||||
if (aRv.Failed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
DirectionToName(dir, aDirection);
|
||||
state->GetSelectionDirectionString(aDirection, aRv);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user