From 21b5bec8ea84b9f619d2ed4e0060f0bce869f74a Mon Sep 17 00:00:00 2001 From: "aaronleventhal%moonset.net" Date: Wed, 30 Mar 2005 00:53:10 +0000 Subject: [PATCH] Bug 287979. Infinite loop when exposing plugins. r=timeless, sr=jst --- accessible/src/msaa/nsAccessibleWrap.cpp | 2 +- .../src/msaa/nsHTMLWin32ObjectAccessible.cpp | 23 ++----------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/accessible/src/msaa/nsAccessibleWrap.cpp b/accessible/src/msaa/nsAccessibleWrap.cpp index db0134ebde8f..cafa3f578fb7 100644 --- a/accessible/src/msaa/nsAccessibleWrap.cpp +++ b/accessible/src/msaa/nsAccessibleWrap.cpp @@ -914,7 +914,7 @@ IDispatch *nsAccessibleWrap::NativeAccessible(nsIAccessible *aXPAccessible) if (hwnd) { IDispatch *retval = nsnull; AccessibleObjectFromWindow(NS_REINTERPRET_CAST(HWND, hwnd), - OBJID_CLIENT, IID_IAccessible, (void **) &retval); + OBJID_WINDOW, IID_IAccessible, (void **) &retval); return retval; } } diff --git a/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp b/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp index 8fde9bf1237c..c0176335250d 100755 --- a/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp +++ b/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp @@ -42,33 +42,14 @@ nsHTMLWin32ObjectAccessible::nsHTMLWin32ObjectAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell, void* aHwnd): nsAccessibleWrap(aNode, aShell) { - if (aHwnd) { - // XXX - when we get accessible plugins we may have to check here - // for the proper window handle using Win32 APIs so we check - // the proper IAccessible for the information we need. - mHwnd = aHwnd; - } + mHwnd = aHwnd ? ::GetWindow((HWND)aHwnd, GW_CHILD) : 0; } NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLWin32ObjectAccessible, nsAccessible, nsIAccessibleWin32Object) -NS_IMETHODIMP -nsHTMLWin32ObjectAccessible::GetHwnd(void **aHwnd) +NS_IMETHODIMP nsHTMLWin32ObjectAccessible::GetHwnd(void **aHwnd) { *aHwnd = mHwnd; - if (mHwnd) { - // Check for NullPluginClass to avoid infinite loop bug 245878 - // XXX We're going to be doing more work with NullPluginClass at some point to make it - // keyboard accessible (bug 245349, bug 83754 as well as other work going on in - // plugins to make them accessible like bug 93149). - // The eventual goal will be to get rid of this check here so we - // can walk into the null plugin. - const LPCSTR kClassNameNullPlugin = "NullPluginClass"; - HWND nullPluginChild = ::FindWindowEx((HWND)mHwnd, NULL, kClassNameNullPlugin, NULL); - if (nullPluginChild) { - *aHwnd = 0; // Avoid infinite loop by not walking into null plugin - } - } return NS_OK; }