Bug 1609662: part 13) Declare some methods in `Selection` const. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D60254

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mirko Brodesser 2020-01-21 16:01:59 +00:00
Родитель 99856824e5
Коммит 37eb82cb25
2 изменённых файлов: 7 добавлений и 4 удалений

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

@ -1361,7 +1361,8 @@ nsresult Selection::GetPrimaryOrCaretFrameForNodeOffset(nsIContent* aContent,
return NS_OK;
}
void Selection::SelectFramesForContent(nsIContent* aContent, bool aSelected) {
void Selection::SelectFramesForContent(nsIContent* aContent,
bool aSelected) const {
nsIFrame* frame = aContent->GetPrimaryFrame();
if (!frame) {
return;
@ -1379,7 +1380,8 @@ void Selection::SelectFramesForContent(nsIContent* aContent, bool aSelected) {
// select all content children of aContent
nsresult Selection::SelectAllFramesForContent(
PostContentIterator& aPostOrderIter, nsIContent* aContent, bool aSelected) {
PostContentIterator& aPostOrderIter, nsIContent* aContent,
bool aSelected) const {
// If aContent doesn't have children, we should avoid to use the content
// iterator for performance reason.
if (!aContent->HasChildren()) {

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

@ -707,9 +707,10 @@ class Selection final : public nsSupportsWeakReference,
* nothing.
*/
void SetAnchorFocusRange(int32_t aIndex);
void SelectFramesForContent(nsIContent* aContent, bool aSelected);
void SelectFramesForContent(nsIContent* aContent, bool aSelected) const;
nsresult SelectAllFramesForContent(PostContentIterator& aPostOrderIter,
nsIContent* aContent, bool aSelected);
nsIContent* aContent,
bool aSelected) const;
nsresult SelectFrames(nsPresContext* aPresContext, nsRange* aRange,
bool aSelect);