diff --git a/accessible/src/base/nsAccessibilityAtomList.h b/accessible/src/base/nsAccessibilityAtomList.h index b482c285596..96d1419ea34 100755 --- a/accessible/src/base/nsAccessibilityAtomList.h +++ b/accessible/src/base/nsAccessibilityAtomList.h @@ -104,7 +104,6 @@ ACCESSIBILITY_ATOM(label, "label") ACCESSIBILITY_ATOM(li, "li") ACCESSIBILITY_ATOM(link, "link") ACCESSIBILITY_ATOM(math, "math") -ACCESSIBILITY_ATOM(menu, "menu") // XUL ACCESSIBILITY_ATOM(object, "object") ACCESSIBILITY_ATOM(ol, "ol") ACCESSIBILITY_ATOM(optgroup, "optgroup") diff --git a/accessible/src/base/nsAccessibilityService.cpp b/accessible/src/base/nsAccessibilityService.cpp index 0c8428e6ad6..e3dac6b277e 100644 --- a/accessible/src/base/nsAccessibilityService.cpp +++ b/accessible/src/base/nsAccessibilityService.cpp @@ -1192,26 +1192,10 @@ nsAccessibilityService::CreateXULMenuitemAccessible(nsIDOMNode *aNode, nsIAccess NS_IMETHODIMP nsAccessibilityService::CreateXULMenupopupAccessible(nsIDOMNode *aNode, nsIAccessible **_retval) { - *_retval = nsnull; #ifdef MOZ_XUL nsCOMPtr weakShell; GetShellFromNode(aNode, getter_AddRefs(weakShell)); - nsCOMPtr content = do_QueryInterface(aNode); -#ifdef MOZ_ACCESSIBILITY_ATK - // ATK considers this node to be redundant when within menubars, and it makes menu - // navigation with assistive technologies more difficult - // XXX In the future we will should this for consistency across the nsIAccessible - // implementations on each platform for a consistent scripting environment, but - // then strip out redundant accessibles in the nsAccessibleWrap class for each platform. - if (content) { - nsIContent *parent = content->GetParent(); - if (parent && parent->Tag() == nsAccessibilityAtoms::menu && - parent->GetNameSpaceID() == kNameSpaceID_XUL) { - return NS_OK; - } - } -#endif - + *_retval = new nsXULMenupopupAccessible(aNode, weakShell); if (! *_retval) return NS_ERROR_OUT_OF_MEMORY; diff --git a/layout/xul/base/src/nsBoxFrame.cpp b/layout/xul/base/src/nsBoxFrame.cpp index c31222cbb25..f7493514dbb 100644 --- a/layout/xul/base/src/nsBoxFrame.cpp +++ b/layout/xul/base/src/nsBoxFrame.cpp @@ -2208,30 +2208,6 @@ nsBoxFrame::RegUnregAccessKey(PRBool aDoReg) return rv; } -void -nsBoxFrame::FireDOMEventSynch(const nsAString& aDOMEventName, nsIContent *aContent) -{ - // XXX This will be deprecated, because it is not good to fire synchronous DOM events - // from layout. It's better to use nsFrame::FireDOMEvent() which is asynchronous. - nsPresContext *presContext = GetPresContext(); - nsIContent *content = aContent ? aContent : mContent; - if (content && presContext) { - // Fire a DOM event - nsCOMPtr event; - nsCOMPtr manager; - content->GetListenerManager(PR_TRUE, getter_AddRefs(manager)); - if (manager && NS_SUCCEEDED(manager->CreateEvent(presContext, nsnull, - NS_LITERAL_STRING("Events"), - getter_AddRefs(event)))) { - event->InitEvent(aDOMEventName, PR_TRUE, PR_TRUE); - - nsCOMPtr privateEvent(do_QueryInterface(event)); - privateEvent->SetTrusted(PR_TRUE); - - nsEventDispatcher::Dispatch(content, presContext, nsnull, event); - } - } -} void nsBoxFrame::CheckBoxOrder(nsBoxLayoutState& aState) diff --git a/layout/xul/base/src/nsBoxFrame.h b/layout/xul/base/src/nsBoxFrame.h index 00deb430765..1947c98144c 100644 --- a/layout/xul/base/src/nsBoxFrame.h +++ b/layout/xul/base/src/nsBoxFrame.h @@ -199,11 +199,6 @@ public: static nsresult LayoutChildAt(nsBoxLayoutState& aState, nsIBox* aBox, const nsRect& aRect); - // Fire DOM event. If no aContent argument use frame's mContent. - // XXX This will be deprecated, because it is not good to fire synchronous DOM events - // from layout. It's better to use nsFrame::FireDOMEvent() which is asynchronous. - void FireDOMEventSynch(const nsAString& aDOMEventName, nsIContent *aContent = nsnull); - /** * Utility method to redirect events on descendants to this frame. * Supports 'allowevents' attribute on descendant elements to allow those diff --git a/layout/xul/base/src/nsMenuBarFrame.cpp b/layout/xul/base/src/nsMenuBarFrame.cpp index 5c94a419a79..fc05e64b200 100644 --- a/layout/xul/base/src/nsMenuBarFrame.cpp +++ b/layout/xul/base/src/nsMenuBarFrame.cpp @@ -241,7 +241,7 @@ nsMenuBarFrame::SetActive(PRBool aActiveFlag) NS_NAMED_LITERAL_STRING(active, "DOMMenuBarActive"); NS_NAMED_LITERAL_STRING(inactive, "DOMMenuBarInactive"); - FireDOMEventSynch(mIsActive ? active : inactive); + FireDOMEvent(mIsActive ? active : inactive); return NS_OK; } diff --git a/layout/xul/base/src/nsMenuFrame.cpp b/layout/xul/base/src/nsMenuFrame.cpp index 6f1ec28f730..59ee0892b11 100644 --- a/layout/xul/base/src/nsMenuFrame.cpp +++ b/layout/xul/base/src/nsMenuFrame.cpp @@ -588,7 +588,7 @@ nsMenuFrame::SelectMenu(PRBool aActivateFlag) domEventToFire.AssignLiteral("DOMMenuItemInactive"); } - FireDOMEventSynch(domEventToFire); + FireDOMEvent(domEventToFire); return NS_OK; } @@ -675,7 +675,7 @@ nsMenuFrame::ActivateMenu(PRBool aActivateFlag) } else { if (mMenuOpen) { - FireDOMEventSynch(NS_LITERAL_STRING("DOMMenuInactive"), menuPopup->GetContent()); + FireDOMEvent(NS_LITERAL_STRING("DOMMenuInactive"), menuPopup->GetContent()); } nsIView* view = menuPopup->GetView(); NS_ASSERTION(view, "View is gone, looks like someone forgot to rollup the popup!"); diff --git a/layout/xul/base/src/nsPopupSetFrame.cpp b/layout/xul/base/src/nsPopupSetFrame.cpp index 7db5c588d4a..0381f54f046 100644 --- a/layout/xul/base/src/nsPopupSetFrame.cpp +++ b/layout/xul/base/src/nsPopupSetFrame.cpp @@ -549,7 +549,7 @@ nsPopupSetFrame::ActivatePopup(nsPopupFrameList* aEntry, PRBool aActivateFlag) viewManager->ResizeView(view, r); if (aEntry->mIsOpen) { aEntry->mIsOpen = PR_FALSE; - FireDOMEventSynch(NS_LITERAL_STRING("DOMMenuInactive"), aEntry->mPopupContent); + FireDOMEvent(NS_LITERAL_STRING("DOMMenuInactive"), aEntry->mPopupContent); } } } diff --git a/toolkit/content/widgets/popup.xml b/toolkit/content/widgets/popup.xml index 37045e89a9f..263dfd0ab88 100644 --- a/toolkit/content/widgets/popup.xml +++ b/toolkit/content/widgets/popup.xml @@ -23,8 +23,11 @@