Bug 1459529: Remove PresShell::BeginUpdate. r?heycam draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 11 May 2018 14:33:49 +0200
changeset 794260 344706edc85a7bb0db31b3d75735a6d4997e2cd1
parent 794259 29dfd16ea517c5b763a38fe177dc65aa3eadee9b
child 794261 8ac5a9265ccb337266c0d886b2585a7ab4f358ed
push id109630
push userbmo:emilio@crisal.io
push dateFri, 11 May 2018 16:44:07 +0000
reviewersheycam
bugs1459529
milestone62.0a1
Bug 1459529: Remove PresShell::BeginUpdate. r?heycam It's useless after the last patch. MozReview-Commit-ID: LdljMfnMjTy
layout/base/PresShell.cpp
layout/base/PresShell.h
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -795,17 +795,16 @@ nsIPresShell::nsIPresShell()
     , mInFlush(false)
   {}
 
 PresShell::PresShell()
   : mCaretEnabled(false)
 #ifdef DEBUG
   , mInVerifyReflow(false)
   , mCurrentReflowRoot(nullptr)
-  , mUpdateCount(0)
 #endif
 #ifdef MOZ_REFLOW_PERF
   , mReflowCountMgr(nullptr)
 #endif
   , mMouseLocation(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE)
   , mCurrentEventFrame(nullptr)
   , mFirstCallbackEventRequest(nullptr)
   , mLastCallbackEventRequest(nullptr)
@@ -2518,31 +2517,18 @@ PresShell::GetPageSequenceFrame() const
 nsCanvasFrame*
 PresShell::GetCanvasFrame() const
 {
   nsIFrame* frame = mFrameConstructor->GetDocElementContainingBlock();
   return do_QueryFrame(frame);
 }
 
 void
-PresShell::BeginUpdate(nsIDocument *aDocument, nsUpdateType aUpdateType)
-{
-#ifdef DEBUG
-  mUpdateCount++;
-#endif
-}
-
-void
 PresShell::EndUpdate(nsIDocument *aDocument, nsUpdateType aUpdateType)
 {
-#ifdef DEBUG
-  MOZ_ASSERT(0 != mUpdateCount, "too many EndUpdate's");
-  --mUpdateCount;
-#endif
-
   if (aUpdateType & UPDATE_STYLE) {
     if (mStyleSet->StyleSheetsHaveChanged()) {
       RestyleForCSSRuleChanges();
     }
   }
 }
 
 void
--- a/layout/base/PresShell.h
+++ b/layout/base/PresShell.h
@@ -278,17 +278,16 @@ public:
   NS_IMETHOD CompleteScroll(bool aForward) override;
   NS_IMETHOD CompleteMove(bool aForward, bool aExtend) override;
   NS_IMETHOD SelectAll() override;
   NS_IMETHOD CheckVisibility(nsIDOMNode *node, int16_t startOffset, int16_t EndOffset, bool *_retval) override;
   nsresult CheckVisibilityContent(nsIContent* aNode, int16_t aStartOffset,
                                   int16_t aEndOffset, bool* aRetval) override;
 
   // nsIDocumentObserver
-  NS_DECL_NSIDOCUMENTOBSERVER_BEGINUPDATE
   NS_DECL_NSIDOCUMENTOBSERVER_ENDUPDATE
   NS_DECL_NSIDOCUMENTOBSERVER_BEGINLOAD
   NS_DECL_NSIDOCUMENTOBSERVER_ENDLOAD
   NS_DECL_NSIDOCUMENTOBSERVER_CONTENTSTATECHANGED
   NS_DECL_NSIDOCUMENTOBSERVER_DOCUMENTSTATESCHANGED
 
   // nsIMutationObserver
   NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
@@ -751,17 +750,16 @@ private:
   nsresult SetResolutionImpl(float aResolution, bool aScaleToResolution);
 
   nsIContent* GetOverrideClickTarget(WidgetGUIEvent* aEvent,
                                      nsIFrame* aFrame);
 #ifdef DEBUG
   // The reflow root under which we're currently reflowing.  Null when
   // not in reflow.
   nsIFrame* mCurrentReflowRoot;
-  uint32_t mUpdateCount;
 #endif
 
 #ifdef MOZ_REFLOW_PERF
   ReflowCountMgr* mReflowCountMgr;
 #endif
 
   // This is used for synthetic mouse events that are sent when what is under
   // the mouse pointer may have changed without the mouse moving (eg scrolling,