Bug 1685303: part 20) const-correct internals of `AccessibleCaretManager::DispatchCaretStateChangedEvent. r=TYLin

Differential Revision: https://phabricator.services.mozilla.com/D102302
This commit is contained in:
Mirko Brodesser 2021-01-20 10:11:20 +00:00
parent 32745c95ff
commit d7bf5cbe1f
5 changed files with 7 additions and 7 deletions

View File

@ -1406,7 +1406,7 @@ void AccessibleCaretManager::DispatchCaretStateChangedEvent(
return;
}
Selection* sel = GetSelection();
const Selection* sel = GetSelection();
if (!sel) {
return;
}

View File

@ -354,7 +354,7 @@ nsRect nsCaret::GetGeometryForFrame(nsIFrame* aFrame, int32_t aFrameOffset,
return rect;
}
nsIFrame* nsCaret::GetFrameAndOffset(Selection* aSelection,
nsIFrame* nsCaret::GetFrameAndOffset(const Selection* aSelection,
nsINode* aOverrideNode,
int32_t aOverrideOffset,
int32_t* aFrameOffset,
@ -390,7 +390,7 @@ nsIFrame* nsCaret::GetFrameAndOffset(Selection* aSelection,
}
/* static */
nsIFrame* nsCaret::GetGeometry(Selection* aSelection, nsRect* aRect) {
nsIFrame* nsCaret::GetGeometry(const Selection* aSelection, nsRect* aRect) {
int32_t frameOffset;
nsIFrame* frame = GetFrameAndOffset(aSelection, nullptr, 0, &frameOffset);
if (frame) {

View File

@ -170,7 +170,7 @@ class nsCaret final : public nsISelectionListener {
* This rect does not include any extra decorations for bidi.
* @param aRect must be non-null
*/
static nsIFrame* GetGeometry(mozilla::dom::Selection* aSelection,
static nsIFrame* GetGeometry(const mozilla::dom::Selection* aSelection,
nsRect* aRect);
static nsIFrame* GetCaretFrameForNodeOffset(
nsFrameSelection* aFrameSelection, nsIContent* aContentNode,
@ -186,7 +186,7 @@ class nsCaret final : public nsISelectionListener {
// @param aUnadjustedFrame return the original frame that the selection is
// targeting, without any adjustment for painting.
// @return the frame of the focus node.
static nsIFrame* GetFrameAndOffset(mozilla::dom::Selection* aSelection,
static nsIFrame* GetFrameAndOffset(const mozilla::dom::Selection* aSelection,
nsINode* aOverrideNode,
int32_t aOverrideOffset,
int32_t* aFrameOffset,

View File

@ -8797,7 +8797,7 @@ void nsLayoutUtils::AppendFrameTextContent(nsIFrame* aFrame,
}
/* static */
nsRect nsLayoutUtils::GetSelectionBoundingRect(Selection* aSel) {
nsRect nsLayoutUtils::GetSelectionBoundingRect(const Selection* aSel) {
nsRect res;
// Bounding client rect may be empty after calling GetBoundingClientRect
// when range is collapsed. So we get caret's rect when range is

View File

@ -2732,7 +2732,7 @@ class nsLayoutUtils {
*
* @param aSel Selection to check
*/
static nsRect GetSelectionBoundingRect(mozilla::dom::Selection* aSel);
static nsRect GetSelectionBoundingRect(const mozilla::dom::Selection* aSel);
/**
* Calculate the bounding rect of |aContent|, relative to the origin