Skip to content

Commit

Permalink
Bug 1632726 - part 2: Remove some unused nsISelectionController met…
Browse files Browse the repository at this point in the history
…hods r=smaug

Even in comm-central and BlueGriffon, `nsISelectionController::*ForDelete()`
are not used.  Therefore, we can remove them safely.

Differential Revision: https://phabricator.services.mozilla.com/D72296
  • Loading branch information
masayuki-nakano committed Apr 27, 2020
1 parent f058611 commit 9436c70
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 107 deletions.
21 changes: 0 additions & 21 deletions dom/base/nsISelectionController.idl
Original file line number Diff line number Diff line change
Expand Up @@ -207,21 +207,6 @@ interface nsISelectionController : nsISelectionDisplay
const short MOVE_UP = 2;
const short MOVE_DOWN = 3;

/**
* CharacterExtendForDelete will extend the selection one character cell
* forward in the document.
* this method is used internally for handling del key.
*/
[noscript] void characterExtendForDelete();

/**
* CharacterExtendForBackspace will extend the selection one character cell
* backward in the document.
* this method is used internally for handling backspace key only when we're
* after UTF-16 surrogates.
*/
[noscript] void characterExtendForBackspace();

/** WordMove will move the selection one word forward/backward in the document.
* this will also have the effect of collapsing the selection if the aExtend = PR_FALSE
* the "point" of selection that is extended is considered the "focus" point.
Expand All @@ -232,12 +217,6 @@ interface nsISelectionController : nsISelectionDisplay

void wordMove(in boolean forward, in boolean extend);

/** wordExtendForDelete will extend the selection one word forward/backward in the document.
* this method is used internally for handling ctrl[option]-backspace and ctrl[option]-del.
* @param aForward forward or backward if PR_FALSE
*/
[noscript] void wordExtendForDelete(in boolean forward);

/** LineMove will move the selection one line forward/backward in the document.
* this will also have the effect of collapsing the selection if the aExtend = PR_FALSE
* the "point" of selection that is extended is considered the "focus" point.
Expand Down
30 changes: 0 additions & 30 deletions dom/html/TextControlState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,7 @@ class TextInputSelectionController final : public nsSupportsWeakReference,
NS_IMETHOD PhysicalMove(int16_t aDirection, int16_t aAmount,
bool aExtend) override;
NS_IMETHOD CharacterMove(bool aForward, bool aExtend) override;
NS_IMETHOD CharacterExtendForDelete() override;
NS_IMETHOD CharacterExtendForBackspace() override;
NS_IMETHOD WordMove(bool aForward, bool aExtend) override;
NS_IMETHOD WordExtendForDelete(bool aForward) override;
NS_IMETHOD LineMove(bool aForward, bool aExtend) override;
NS_IMETHOD IntraLineMove(bool aForward, bool aExtend) override;
MOZ_CAN_RUN_SCRIPT
Expand Down Expand Up @@ -591,24 +588,6 @@ TextInputSelectionController::CharacterMove(bool aForward, bool aExtend) {
return frameSelection->CharacterMove(aForward, aExtend);
}

NS_IMETHODIMP
TextInputSelectionController::CharacterExtendForDelete() {
if (!mFrameSelection) {
return NS_ERROR_NULL_POINTER;
}
RefPtr<nsFrameSelection> frameSelection = mFrameSelection;
return frameSelection->CharacterExtendForDelete();
}

NS_IMETHODIMP
TextInputSelectionController::CharacterExtendForBackspace() {
if (!mFrameSelection) {
return NS_ERROR_NULL_POINTER;
}
RefPtr<nsFrameSelection> frameSelection = mFrameSelection;
return frameSelection->CharacterExtendForBackspace();
}

NS_IMETHODIMP
TextInputSelectionController::WordMove(bool aForward, bool aExtend) {
if (!mFrameSelection) {
Expand All @@ -618,15 +597,6 @@ TextInputSelectionController::WordMove(bool aForward, bool aExtend) {
return frameSelection->WordMove(aForward, aExtend);
}

NS_IMETHODIMP
TextInputSelectionController::WordExtendForDelete(bool aForward) {
if (!mFrameSelection) {
return NS_ERROR_NULL_POINTER;
}
RefPtr<nsFrameSelection> frameSelection = mFrameSelection;
return frameSelection->WordExtendForDelete(aForward);
}

NS_IMETHODIMP
TextInputSelectionController::LineMove(bool aForward, bool aExtend) {
if (!mFrameSelection) {
Expand Down
18 changes: 0 additions & 18 deletions layout/base/PresShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2277,18 +2277,6 @@ PresShell::CharacterMove(bool aForward, bool aExtend) {
return frameSelection->CharacterMove(aForward, aExtend);
}

NS_IMETHODIMP
PresShell::CharacterExtendForDelete() {
RefPtr<nsFrameSelection> frameSelection = mSelection;
return frameSelection->CharacterExtendForDelete();
}

NS_IMETHODIMP
PresShell::CharacterExtendForBackspace() {
RefPtr<nsFrameSelection> frameSelection = mSelection;
return frameSelection->CharacterExtendForBackspace();
}

NS_IMETHODIMP
PresShell::WordMove(bool aForward, bool aExtend) {
RefPtr<nsFrameSelection> frameSelection = mSelection;
Expand All @@ -2299,12 +2287,6 @@ PresShell::WordMove(bool aForward, bool aExtend) {
return result;
}

NS_IMETHODIMP
PresShell::WordExtendForDelete(bool aForward) {
RefPtr<nsFrameSelection> frameSelection = mSelection;
return frameSelection->WordExtendForDelete(aForward);
}

NS_IMETHODIMP
PresShell::LineMove(bool aForward, bool aExtend) {
RefPtr<nsFrameSelection> frameSelection = mSelection;
Expand Down
3 changes: 0 additions & 3 deletions layout/base/PresShell.h
Original file line number Diff line number Diff line change
Expand Up @@ -1337,10 +1337,7 @@ class PresShell final : public nsStubDocumentObserver,
NS_IMETHOD PhysicalMove(int16_t aDirection, int16_t aAmount,
bool aExtend) override;
NS_IMETHOD CharacterMove(bool aForward, bool aExtend) override;
NS_IMETHOD CharacterExtendForDelete() override;
NS_IMETHOD CharacterExtendForBackspace() override;
NS_IMETHOD WordMove(bool aForward, bool aExtend) override;
NS_IMETHOD WordExtendForDelete(bool aForward) override;
NS_IMETHOD LineMove(bool aForward, bool aExtend) override;
NS_IMETHOD IntraLineMove(bool aForward, bool aExtend) override;
MOZ_CAN_RUN_SCRIPT
Expand Down
13 changes: 0 additions & 13 deletions layout/generic/nsFrameSelection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2005,24 +2005,11 @@ nsresult nsFrameSelection::CharacterMove(bool aForward, bool aExtend) {
eUsePrefStyle);
}

nsresult nsFrameSelection::CharacterExtendForDelete() {
return MoveCaret(eDirNext, true, eSelectCluster, eLogical);
}

nsresult nsFrameSelection::CharacterExtendForBackspace() {
return MoveCaret(eDirPrevious, true, eSelectCharacter, eLogical);
}

nsresult nsFrameSelection::WordMove(bool aForward, bool aExtend) {
return MoveCaret(aForward ? eDirNext : eDirPrevious, aExtend, eSelectWord,
eUsePrefStyle);
}

nsresult nsFrameSelection::WordExtendForDelete(bool aForward) {
return MoveCaret(aForward ? eDirNext : eDirPrevious, true, eSelectWord,
eLogical);
}

nsresult nsFrameSelection::LineMove(bool aForward, bool aExtend) {
return MoveCaret(aForward ? eDirNext : eDirPrevious, aExtend, eSelectLine,
eUsePrefStyle);
Expand Down
22 changes: 0 additions & 22 deletions layout/generic/nsFrameSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,20 +514,6 @@ class nsFrameSelection final {
MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult CharacterMove(bool aForward,
bool aExtend);

/**
* CharacterExtendForDelete extends the selection forward (logically) to
* the next character cell, so that the selected cell can be deleted.
*/
// TODO: replace with `MOZ_CAN_RUN_SCRIPT`.
MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult CharacterExtendForDelete();

/**
* CharacterExtendForBackspace extends the selection backward (logically) to
* the previous character cell, so that the selected cell can be deleted.
*/
// TODO: replace with `MOZ_CAN_RUN_SCRIPT`.
MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult CharacterExtendForBackspace();

/**
* WordMove will generally be called from the nsiselectioncontroller
* implementations. the effect being the selection will move one word left or
Expand All @@ -538,14 +524,6 @@ class nsFrameSelection final {
// TODO: replace with `MOZ_CAN_RUN_SCRIPT`.
MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult WordMove(bool aForward, bool aExtend);

/**
* WordExtendForDelete extends the selection backward or forward (logically)
* to the next word boundary, so that the selected word can be deleted.
* @param aForward select forward in document.
*/
// TODO: replace with `MOZ_CAN_RUN_SCRIPT`.
MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult WordExtendForDelete(bool aForward);

/**
* LineMove will generally be called from the nsiselectioncontroller
* implementations. the effect being the selection will move one line up or
Expand Down

0 comments on commit 9436c70

Please sign in to comment.