From adc79659c3e9c31e813fba95d5013c4f479b8a2e Mon Sep 17 00:00:00 2001 From: "alecf%flett.org" Date: Wed, 7 Jan 2004 17:47:25 +0000 Subject: [PATCH] fix for bug 209679 - remove reflow observer junk - r/sr=dbaron git-svn-id: svn://10.0.0.236/trunk@150986 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsIPresShell.h | 6 ---- mozilla/layout/base/nsPresShell.cpp | 38 -------------------- mozilla/layout/base/public/nsIPresShell.h | 6 ---- mozilla/layout/html/base/src/nsPresShell.cpp | 38 -------------------- 4 files changed, 88 deletions(-) diff --git a/mozilla/layout/base/nsIPresShell.h b/mozilla/layout/base/nsIPresShell.h index 18da59242d4..aa01d9fe937 100644 --- a/mozilla/layout/base/nsIPresShell.h +++ b/mozilla/layout/base/nsIPresShell.h @@ -81,12 +81,6 @@ class nsHTMLReflowCommand; #define NS_PRESSHELL_SCROLL_ANYWHERE -1 #define NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE -2 -// Observer related defines -#define NS_PRESSHELL_REFLOW_TOPIC "REFLOW" // Observer Topic -#define NS_PRESSHELL_INITIAL_REFLOW "INITIAL REFLOW" // Observer Data -#define NS_PRESSHELL_RESIZE_REFLOW "RESIZE REFLOW" // Observer Data -#define NS_PRESSHELL_STYLE_CHANGE_REFLOW "STYLE CHANGE REFLOW" // Observer Data - // debug VerifyReflow flags #define VERIFY_REFLOW_ON 0x01 #define VERIFY_REFLOW_NOISY 0x02 diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 6e647a9494e..bef7d29ea29 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -1230,11 +1230,6 @@ protected: void HandlePostedReflowCallbacks(); void UnsuppressAndInvalidate(); - - /** notify all external reflow observers that reflow of type "aData" is about - * to begin. - */ - nsresult NotifyReflowObservers(const char *aData); nsresult ReflowCommandAdded(nsHTMLReflowCommand* aRC); nsresult ReflowCommandRemoved(nsHTMLReflowCommand* aRC); @@ -2659,31 +2654,6 @@ static void CheckForFocus(nsPIDOMWindow* aOurWindow, aFocusController->SetFocusedWindow(ourWin); } -nsresult -PresShell::NotifyReflowObservers(const char *aData) -{ - if (!aData) { return NS_ERROR_NULL_POINTER; } - - nsresult result = NS_OK; - nsCOMPtr pContainer; - nsCOMPtr pDocShell; - - result = mPresContext->GetContainer( getter_AddRefs( pContainer ) ); - - if (NS_SUCCEEDED( result ) && pContainer) { - pDocShell = do_QueryInterface( pContainer, - &result ); - - if (NS_SUCCEEDED( result ) && pDocShell && mObserverService) { - result = mObserverService->NotifyObservers( pDocShell, - NS_PRESSHELL_REFLOW_TOPIC, - NS_ConvertASCIItoUCS2(aData).get() ); - // notice that we don't really care what the observer service returns - } - } - return NS_OK; -} - static nsresult GetRootScrollFrame(nsIPresContext* aPresContext, nsIFrame* aRootFrame, nsIFrame** aScrollFrame) { @@ -2746,8 +2716,6 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight) } #endif - // notice that we ignore the result - NotifyReflowObservers(NS_PRESSHELL_INITIAL_REFLOW); if (mCaret) mCaret->EraseCaret(); @@ -2914,8 +2882,6 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight) { PRBool firstReflow = PR_FALSE; - // notice that we ignore the result - NotifyReflowObservers(NS_PRESSHELL_RESIZE_REFLOW); mViewManager->CacheWidgetChanges(PR_TRUE); if (mCaret) @@ -3461,10 +3427,6 @@ NS_IMETHODIMP PresShell::StyleChangeReflow() { - // notify any presshell observers about the reflow. - // notice that we ignore the result - NotifyReflowObservers(NS_PRESSHELL_STYLE_CHANGE_REFLOW); - WillCauseReflow(); nsIFrame* rootFrame; diff --git a/mozilla/layout/base/public/nsIPresShell.h b/mozilla/layout/base/public/nsIPresShell.h index 18da59242d4..aa01d9fe937 100644 --- a/mozilla/layout/base/public/nsIPresShell.h +++ b/mozilla/layout/base/public/nsIPresShell.h @@ -81,12 +81,6 @@ class nsHTMLReflowCommand; #define NS_PRESSHELL_SCROLL_ANYWHERE -1 #define NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE -2 -// Observer related defines -#define NS_PRESSHELL_REFLOW_TOPIC "REFLOW" // Observer Topic -#define NS_PRESSHELL_INITIAL_REFLOW "INITIAL REFLOW" // Observer Data -#define NS_PRESSHELL_RESIZE_REFLOW "RESIZE REFLOW" // Observer Data -#define NS_PRESSHELL_STYLE_CHANGE_REFLOW "STYLE CHANGE REFLOW" // Observer Data - // debug VerifyReflow flags #define VERIFY_REFLOW_ON 0x01 #define VERIFY_REFLOW_NOISY 0x02 diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 6e647a9494e..bef7d29ea29 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -1230,11 +1230,6 @@ protected: void HandlePostedReflowCallbacks(); void UnsuppressAndInvalidate(); - - /** notify all external reflow observers that reflow of type "aData" is about - * to begin. - */ - nsresult NotifyReflowObservers(const char *aData); nsresult ReflowCommandAdded(nsHTMLReflowCommand* aRC); nsresult ReflowCommandRemoved(nsHTMLReflowCommand* aRC); @@ -2659,31 +2654,6 @@ static void CheckForFocus(nsPIDOMWindow* aOurWindow, aFocusController->SetFocusedWindow(ourWin); } -nsresult -PresShell::NotifyReflowObservers(const char *aData) -{ - if (!aData) { return NS_ERROR_NULL_POINTER; } - - nsresult result = NS_OK; - nsCOMPtr pContainer; - nsCOMPtr pDocShell; - - result = mPresContext->GetContainer( getter_AddRefs( pContainer ) ); - - if (NS_SUCCEEDED( result ) && pContainer) { - pDocShell = do_QueryInterface( pContainer, - &result ); - - if (NS_SUCCEEDED( result ) && pDocShell && mObserverService) { - result = mObserverService->NotifyObservers( pDocShell, - NS_PRESSHELL_REFLOW_TOPIC, - NS_ConvertASCIItoUCS2(aData).get() ); - // notice that we don't really care what the observer service returns - } - } - return NS_OK; -} - static nsresult GetRootScrollFrame(nsIPresContext* aPresContext, nsIFrame* aRootFrame, nsIFrame** aScrollFrame) { @@ -2746,8 +2716,6 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight) } #endif - // notice that we ignore the result - NotifyReflowObservers(NS_PRESSHELL_INITIAL_REFLOW); if (mCaret) mCaret->EraseCaret(); @@ -2914,8 +2882,6 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight) { PRBool firstReflow = PR_FALSE; - // notice that we ignore the result - NotifyReflowObservers(NS_PRESSHELL_RESIZE_REFLOW); mViewManager->CacheWidgetChanges(PR_TRUE); if (mCaret) @@ -3461,10 +3427,6 @@ NS_IMETHODIMP PresShell::StyleChangeReflow() { - // notify any presshell observers about the reflow. - // notice that we ignore the result - NotifyReflowObservers(NS_PRESSHELL_STYLE_CHANGE_REFLOW); - WillCauseReflow(); nsIFrame* rootFrame;