From 57b27c083025bb9a2fc16200867ef91bead034b5 Mon Sep 17 00:00:00 2001 From: "aaronleventhal%moonset.net" Date: Tue, 18 Oct 2005 19:45:14 +0000 Subject: [PATCH] Bug 312788. Crash when exposing plugins with width or height of 0. r=parente, sr=bryner --- accessible/src/base/nsAccessibilityService.cpp | 4 ++++ accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp | 2 +- accessible/src/msaa/nsHTMLWin32ObjectAccessible.h | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/accessible/src/base/nsAccessibilityService.cpp b/accessible/src/base/nsAccessibilityService.cpp index 7ae065b735c..ddde4afa440 100644 --- a/accessible/src/base/nsAccessibilityService.cpp +++ b/accessible/src/base/nsAccessibilityService.cpp @@ -718,6 +718,10 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame *aFrame, nsIFrame *frame; GetInfo(NS_STATIC_CAST(nsIFrame*, aFrame), &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); + *aAccessible = nsnull; + if (!frame || frame->GetRect().IsEmpty()) { + return NS_ERROR_FAILURE; + } // 1) for object elements containing either HTML or TXT documents nsCOMPtr domDoc; nsCOMPtr obj(do_QueryInterface(node)); diff --git a/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp b/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp index 4f6d924d6fb..c023bfcff6f 100755 --- a/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp +++ b/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp @@ -85,7 +85,7 @@ NS_IMETHODIMP nsHTMLWin32ObjectOwnerAccessible::GetChildCount(PRInt32 *aChildCou } nsHTMLWin32ObjectAccessible::nsHTMLWin32ObjectAccessible(void* aHwnd): -nsAccessibleWrap(nsnull, nsnull) +nsLeafAccessible(nsnull, nsnull) { mHwnd = aHwnd; if (mHwnd) { diff --git a/accessible/src/msaa/nsHTMLWin32ObjectAccessible.h b/accessible/src/msaa/nsHTMLWin32ObjectAccessible.h index 7b6a895c51b..50d3fb9f0a1 100755 --- a/accessible/src/msaa/nsHTMLWin32ObjectAccessible.h +++ b/accessible/src/msaa/nsHTMLWin32ObjectAccessible.h @@ -40,7 +40,7 @@ #define _nsHTMLWin32ObjectAccessible_H_ #include "nsIAccessibleWin32Object.h" -#include "nsAccessibleWrap.h" +#include "nsBaseWidgetAccessible.h" struct IAccessible; @@ -74,7 +74,7 @@ protected: * object returned by us in Accessible::NewAccessible() that gets the IAccessible * from the windows system from the window handle. */ -class nsHTMLWin32ObjectAccessible : public nsAccessibleWrap, +class nsHTMLWin32ObjectAccessible : public nsLeafAccessible, public nsIAccessibleWin32Object { public: