From 125ccc2c5252f7ee535da78bb04ebf69d97afc7e Mon Sep 17 00:00:00 2001 From: "aaronleventhal%moonset.net" Date: Wed, 19 Mar 2008 01:37:09 +0000 Subject: [PATCH] Bug 423681. Accessible text events broken. r=sicking, sr=bz, a=schrep git-svn-id: svn://10.0.0.236/trunk@248163 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsPresShell.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 26459e2e19b..5f00f437a65 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -5563,19 +5563,21 @@ PresShell::HandleEvent(nsIView *aView, { NS_ASSERTION(aView, "null view"); - NS_ASSERTION(nsContentUtils::IsSafeToRunScript(), - "How did we get here if it's not safe to run scripts?"); - - if (mIsDestroying || mIsReflowing || mChangeNestCount || - !nsContentUtils::IsSafeToRunScript()) { + if (mIsDestroying || mIsReflowing || mChangeNestCount) { return NS_OK; } #ifdef ACCESSIBILITY if (aEvent->eventStructType == NS_ACCESSIBLE_EVENT) { + // Accessibility events come through OS requests and not from scripts, + // so it is safe to handle here return HandleEventInternal(aEvent, aView, aEventStatus); } #endif + if (!nsContentUtils::IsSafeToRunScript()) { + NS_ERROR("How did we get here if it's not safe to run scripts?"); + return NS_OK; + } // Check for a theme change up front, since the frame type is irrelevant if (aEvent->message == NS_THEMECHANGED && mPresContext) {