From c87efbeeaee1837184dd9f6c1b39497692f0b7a1 Mon Sep 17 00:00:00 2001 From: "aaronleventhal%moonset.net" Date: Thu, 3 May 2007 20:20:58 +0000 Subject: [PATCH] Backing out accidental checkin for bug 357583 git-svn-id: svn://10.0.0.236/trunk@225545 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/accessible/src/base/nsAccessNode.cpp | 16 ---------------- mozilla/accessible/src/base/nsAccessNode.h | 5 ----- mozilla/layout/base/nsIPresShell.h | 3 +-- mozilla/layout/base/nsPresShell.cpp | 14 +++----------- 4 files changed, 4 insertions(+), 34 deletions(-) diff --git a/mozilla/accessible/src/base/nsAccessNode.cpp b/mozilla/accessible/src/base/nsAccessNode.cpp index fb37d6a499b..34655238262 100755 --- a/mozilla/accessible/src/base/nsAccessNode.cpp +++ b/mozilla/accessible/src/base/nsAccessNode.cpp @@ -65,7 +65,6 @@ #include "nsITimer.h" #include "nsRootAccessible.h" #include "nsIFocusController.h" -#include "nsIObserverService.h" /* For documentation of the accessibility architecture, * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html @@ -225,20 +224,6 @@ void nsAccessNode::InitXPAccessibility() } gIsAccessibilityActive = PR_TRUE; - NotifyA11yInitOrShutdown(); -} - -void nsAccessNode::NotifyA11yInitOrShutdown() -{ - nsCOMPtr obsService = - do_GetService("@mozilla.org/observer-service;1"); - NS_ASSERTION(obsService, "No observer service to notify of a11y init/shutdown"); - if (obsService) { - static const PRUnichar kInitIndicator[] = { '1', 0 }; - static const PRUnichar kShutdownIndicator[] = { '0', 0 }; - obsService->NotifyObservers(nsnull, "a11y-init-or-shutdown", - gIsAccessibilityActive ? kInitIndicator : kShutdownIndicator); - } } void nsAccessNode::ShutdownXPAccessibility() @@ -259,7 +244,6 @@ void nsAccessNode::ShutdownXPAccessibility() ClearCache(gGlobalDocAccessibleCache); gIsAccessibilityActive = PR_FALSE; - NotifyA11yInitOrShutdown(); } already_AddRefed nsAccessNode::GetPresShell() diff --git a/mozilla/accessible/src/base/nsAccessNode.h b/mozilla/accessible/src/base/nsAccessNode.h index 190d55ac042..6d90f61d9ac 100755 --- a/mozilla/accessible/src/base/nsAccessNode.h +++ b/mozilla/accessible/src/base/nsAccessNode.h @@ -165,11 +165,6 @@ protected: PRBool mIsInitialized; #endif - /** - * Notify global nsIObserver's that a11y is getting init'd or shutdown - */ - static void NotifyA11yInitOrShutdown(); - // Static data, we do our own refcounting for our static data static nsIStringBundle *gStringBundle; static nsIStringBundle *gKeyStringBundle; diff --git a/mozilla/layout/base/nsIPresShell.h b/mozilla/layout/base/nsIPresShell.h index d524aed5f1f..473a1f9ccc0 100644 --- a/mozilla/layout/base/nsIPresShell.h +++ b/mozilla/layout/base/nsIPresShell.h @@ -636,8 +636,7 @@ public: virtual void VerifyStyleTree() = 0; #endif - static PRBool gIsAccessibilityActive; - static PRBool IsAccessibilityActive() { return gIsAccessibilityActive; } + PRBool IsAccessibilityActive() { return mIsAccessibilityActive; } /** * Stop all active elements (plugins and the caret) in this presentation and diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index b1c612d3e64..05a34695052 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -204,8 +204,6 @@ static NS_DEFINE_CID(kCSSStyleSheetCID, NS_CSS_STYLESHEET_CID); static NS_DEFINE_IID(kRangeCID, NS_RANGE_CID); -PRBool nsIPresShell::gIsAccessibilityActive = PR_FALSE; - // convert a color value to a string, in the CSS format #RRGGBB // * - initially created for bugs 31816, 20760, 22963 static void ColorToString(nscolor aColor, nsAutoString &aString); @@ -1421,6 +1419,7 @@ NS_NewPresShell(nsIPresShell** aInstancePtrResult) PresShell::PresShell() { + mIsAccessibilityActive = PR_FALSE; mSelection = nsnull; #ifdef MOZ_REFLOW_PERF mReflowCountMgr = new ReflowCountMgr(); @@ -1578,9 +1577,6 @@ PresShell::Init(nsIDocument* aDocument, os->AddObserver(this, "user-sheet-removed", PR_FALSE); #ifdef MOZ_XUL os->AddObserver(this, "chrome-flush-skin-caches", PR_FALSE); -#endif -#ifdef ACCESSIBILITY - os->AddObserver(this, "a11y-init-or-shutdown", PR_FALSE); #endif } } @@ -3347,7 +3343,7 @@ PresShell::CancelAllPendingReflows() #ifdef ACCESSIBILITY void nsIPresShell::InvalidateAccessibleSubtree(nsIContent *aContent) { - if (gIsAccessibilityActive) { + if (mIsAccessibilityActive) { nsCOMPtr accService = do_GetService("@mozilla.org/accessibilityService;1"); if (accService) { @@ -5682,6 +5678,7 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsIView *aView, // We'll make sure the right number of Addref's occur before // handing this back to the accessibility client NS_STATIC_CAST(nsAccessibleEvent*, aEvent)->accessible = acc; + mIsAccessibilityActive = PR_TRUE; return NS_OK; } } @@ -6400,11 +6397,6 @@ PresShell::Observe(nsISupports* aSubject, return NS_OK; } -#ifdef ACCESSIBILITY - if (!nsCRT::strcmp(aTopic, "a11y-init-or-shutdown")) { - gIsAccessibilityActive = aData && *aData == '1'; - } -#endif NS_WARNING("unrecognized topic in PresShell::Observe"); return NS_ERROR_FAILURE; }