From 76ae1d169f094cabd87e020bc3115fcaf94e1264 Mon Sep 17 00:00:00 2001 From: Mirko Brodesser Date: Wed, 11 Mar 2020 09:18:18 +0000 Subject: [PATCH] Bug 1620952: part 9) Rename `nsFrameSelection::GetBatching` to `IsBatching`. r=jfkthame Differential Revision: https://phabricator.services.mozilla.com/D66061 --HG-- extra : moz-landing-system : lando --- dom/base/Selection.cpp | 6 ++++-- layout/generic/nsFrameSelection.cpp | 4 +++- layout/generic/nsFrameSelection.h | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dom/base/Selection.cpp b/dom/base/Selection.cpp index b9474a7c05d7..7d6f1b3c54a8 100644 --- a/dom/base/Selection.cpp +++ b/dom/base/Selection.cpp @@ -2887,7 +2887,9 @@ nsresult Selection::ScrollIntoView(SelectionRegion aRegion, return NS_OK; } - if (mFrameSelection->GetBatching()) return NS_OK; + if (mFrameSelection->IsBatching()) { + return NS_OK; + } if (!(aFlags & Selection::SCROLL_SYNCHRONOUS)) return PostScrollSelectionIntoViewEvent(aRegion, aFlags, aVertical, @@ -3036,7 +3038,7 @@ nsresult Selection::NotifySelectionListeners() { } RefPtr frameSelection = mFrameSelection; - if (frameSelection->GetBatching()) { + if (frameSelection->IsBatching()) { frameSelection->SetChangesDuringBatchingFlag(); return NS_OK; } diff --git a/layout/generic/nsFrameSelection.cpp b/layout/generic/nsFrameSelection.cpp index d263fd015245..c5944f1144f1 100644 --- a/layout/generic/nsFrameSelection.cpp +++ b/layout/generic/nsFrameSelection.cpp @@ -1408,7 +1408,9 @@ nsresult nsFrameSelection::TakeFocus(nsIContent* aNewFocus, } // Don't notify selection listeners if batching is on: - if (GetBatching()) return NS_OK; + if (IsBatching()) { + return NS_OK; + } // Be aware, the Selection instance may be destroyed after this call. return NotifySelectionListeners(SelectionType::eNormal); diff --git a/layout/generic/nsFrameSelection.h b/layout/generic/nsFrameSelection.h index 78c38af9d9b1..5c491691bf8a 100644 --- a/layout/generic/nsFrameSelection.h +++ b/layout/generic/nsFrameSelection.h @@ -781,7 +781,7 @@ class nsFrameSelection final { // get another. void SetDesiredPos(nsPoint aPos); // set the mDesiredPos.mValue - uint32_t GetBatching() const { return mBatching.mCounter; } + bool IsBatching() const { return mBatching.mCounter > 0; } void SetChangesDuringBatchingFlag() { MOZ_ASSERT(mBatching.mCounter > 0);