diff --git a/layout/base/AccessibleCaretManager.cpp b/layout/base/AccessibleCaretManager.cpp index f6b18047ca00..7f81dd3767b9 100644 --- a/layout/base/AccessibleCaretManager.cpp +++ b/layout/base/AccessibleCaretManager.cpp @@ -1406,7 +1406,7 @@ void AccessibleCaretManager::DispatchCaretStateChangedEvent( return; } - Selection* sel = GetSelection(); + const Selection* sel = GetSelection(); if (!sel) { return; } diff --git a/layout/base/nsCaret.cpp b/layout/base/nsCaret.cpp index e6acdf00feb8..2824b2f9bcac 100644 --- a/layout/base/nsCaret.cpp +++ b/layout/base/nsCaret.cpp @@ -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) { diff --git a/layout/base/nsCaret.h b/layout/base/nsCaret.h index cfdf5cd980aa..037ad3f06caa 100644 --- a/layout/base/nsCaret.h +++ b/layout/base/nsCaret.h @@ -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, diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index d366860ec095..3bceada48353 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -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 diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index c075e3ff6f08..087bdc8ce1a3 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -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