Bug 1387143 part 19. Remove remaining methods from nsISelectionPrivate. r=mats

This commit is contained in:
Boris Zbarsky 2018-05-08 13:52:38 -04:00
Родитель a72615f753
Коммит 40b8e1ed5e
4 изменённых файлов: 31 добавлений и 57 удалений

Просмотреть файл

@ -3853,7 +3853,7 @@ Selection::SetBaseAndExtent(nsINode& aAnchorNode, uint32_t aAnchorOffset,
/** SelectionLanguageChange modifies the cursor Bidi level after a change in keyboard direction
* @param aLangRTL is true if the new language is right-to-left or false if the new language is left-to-right
*/
NS_IMETHODIMP
nsresult
Selection::SelectionLanguageChange(bool aLangRTL)
{
if (!mFrameSelection)
@ -3933,18 +3933,6 @@ Selection::SelectionLanguageChange(bool aLangRTL)
return NS_OK;
}
NS_IMETHODIMP
Selection::SetColors(const nsAString& aForegroundColor,
const nsAString& aBackgroundColor,
const nsAString& aAltForegroundColor,
const nsAString& aAltBackgroundColor)
{
ErrorResult result;
SetColors(aForegroundColor, aBackgroundColor,
aAltForegroundColor, aAltBackgroundColor, result);
return result.StealNSResult();
}
void
Selection::SetColors(const nsAString& aForegroundColor,
const nsAString& aBackgroundColor,
@ -4015,14 +4003,6 @@ Selection::SetColors(const nsAString& aForegroundColor,
}
}
NS_IMETHODIMP
Selection::ResetColors()
{
ErrorResult result;
ResetColors(result);
return result.StealNSResult();
}
void
Selection::ResetColors(ErrorResult& aRv)
{

Просмотреть файл

@ -401,6 +401,13 @@ public:
bool aAllowAdjacent,
nsTArray<nsRange*>* aRanges);
/**
* Modifies the cursor Bidi level after a change in keyboard direction
* @param langRTL is true if the new language is right-to-left or
* false if the new language is left-to-right.
*/
nsresult SelectionLanguageChange(bool aLangRTL);
private:
friend class ::nsAutoScrollTimer;

Просмотреть файл

@ -31,41 +31,5 @@ native ScrollAxis(nsIPresShell::ScrollAxis);
[uuid(0c9f4f74-ee7e-4fe9-be6b-0ba856368178)]
interface nsISelectionPrivate : nsISupports
{
/**
* Modifies the cursor Bidi level after a change in keyboard direction
* @param langRTL is PR_TRUE if the new language is right-to-left or
* PR_FALSE if the new language is left-to-right.
*/
[noscript] void selectionLanguageChange(in boolean langRTL);
/**
* setColors() sets custom colors for the selection.
* Currently, this is supported only when the selection type is SELECTION_FIND.
* Otherwise, throws an exception.
*
* @param aForegroundColor The foreground color of the selection.
* If this is "currentColor", foreground color
* isn't changed by this selection.
* @param aBackgroundColor The background color of the selection.
* If this is "transparent", background color is
* never painted.
* @param aAltForegroundColor The alternative foreground color of the
* selection.
* If aBackgroundColor doesn't have sufficient
* contrast with its around or foreground color
* if "currentColor" is specified, alternative
* colors are used if it have higher contrast.
* @param aAltBackgroundColor The alternative background color of the
* selection.
*/
void setColors(in DOMString aForegroundColor,
in DOMString aBackgroundColor,
in DOMString aAltForegroundColor,
in DOMString aAltBackgroundColor);
/**
* resetColors() forget the customized colors which were set by setColors().
*/
void resetColors();
};

Просмотреть файл

@ -122,10 +122,33 @@ partial interface Selection {
[ChromeOnly,Throws]
void scrollIntoView(short aRegion, boolean aIsSynchronous, short aVPercent, short aHPercent);
/**
* setColors() sets custom colors for the selection.
* Currently, this is supported only when the selection type is SELECTION_FIND.
* Otherwise, throws an exception.
*
* @param aForegroundColor The foreground color of the selection.
* If this is "currentColor", foreground color
* isn't changed by this selection.
* @param aBackgroundColor The background color of the selection.
* If this is "transparent", background color is
* never painted.
* @param aAltForegroundColor The alternative foreground color of the
* selection.
* If aBackgroundColor doesn't have sufficient
* contrast with its around or foreground color
* if "currentColor" is specified, alternative
* colors are used if it have higher contrast.
* @param aAltBackgroundColor The alternative background color of the
* selection.
*/
[ChromeOnly,Throws]
void setColors(DOMString aForegroundColor, DOMString aBackgroundColor,
DOMString aAltForegroundColor, DOMString aAltBackgroundColor);
/**
* resetColors() forget the customized colors which were set by setColors().
*/
[ChromeOnly,Throws]
void resetColors();
};