michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "XULMenuAccessible.h" michael@0: michael@0: #include "Accessible-inl.h" michael@0: #include "nsAccessibilityService.h" michael@0: #include "nsAccUtils.h" michael@0: #include "DocAccessible.h" michael@0: #include "Role.h" michael@0: #include "States.h" michael@0: #include "XULFormControlAccessible.h" michael@0: michael@0: #include "nsIDOMElement.h" michael@0: #include "nsIDOMXULElement.h" michael@0: #include "nsIMutableArray.h" michael@0: #include "nsIDOMXULContainerElement.h" michael@0: #include "nsIDOMXULSelectCntrlItemEl.h" michael@0: #include "nsIDOMXULMultSelectCntrlEl.h" michael@0: #include "nsIDOMKeyEvent.h" michael@0: #include "nsIServiceManager.h" michael@0: #include "nsIPresShell.h" michael@0: #include "nsIContent.h" michael@0: #include "nsMenuBarFrame.h" michael@0: #include "nsMenuPopupFrame.h" michael@0: michael@0: #include "mozilla/Preferences.h" michael@0: #include "mozilla/LookAndFeel.h" michael@0: #include "mozilla/dom/Element.h" michael@0: michael@0: using namespace mozilla; michael@0: using namespace mozilla::a11y; michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: // XULMenuitemAccessible michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: XULMenuitemAccessible:: michael@0: XULMenuitemAccessible(nsIContent* aContent, DocAccessible* aDoc) : michael@0: AccessibleWrap(aContent, aDoc) michael@0: { michael@0: } michael@0: michael@0: uint64_t michael@0: XULMenuitemAccessible::NativeState() michael@0: { michael@0: uint64_t state = Accessible::NativeState(); michael@0: michael@0: // Has Popup? michael@0: if (mContent->NodeInfo()->Equals(nsGkAtoms::menu, kNameSpaceID_XUL)) { michael@0: state |= states::HASPOPUP; michael@0: if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::open)) michael@0: state |= states::EXPANDED; michael@0: else michael@0: state |= states::COLLAPSED; michael@0: } michael@0: michael@0: // Checkable/checked? michael@0: static nsIContent::AttrValuesArray strings[] = michael@0: { &nsGkAtoms::radio, &nsGkAtoms::checkbox, nullptr }; michael@0: michael@0: if (mContent->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type, strings, michael@0: eCaseMatters) >= 0) { michael@0: michael@0: // Checkable? michael@0: state |= states::CHECKABLE; michael@0: michael@0: // Checked? michael@0: if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::checked, michael@0: nsGkAtoms::_true, eCaseMatters)) michael@0: state |= states::CHECKED; michael@0: } michael@0: michael@0: // Combo box listitem michael@0: bool isComboboxOption = (Role() == roles::COMBOBOX_OPTION); michael@0: if (isComboboxOption) { michael@0: // Is selected? michael@0: bool isSelected = false; michael@0: nsCOMPtr michael@0: item(do_QueryInterface(mContent)); michael@0: NS_ENSURE_TRUE(item, state); michael@0: item->GetSelected(&isSelected); michael@0: michael@0: // Is collapsed? michael@0: bool isCollapsed = false; michael@0: Accessible* parent = Parent(); michael@0: if (parent && parent->State() & states::INVISIBLE) michael@0: isCollapsed = true; michael@0: michael@0: if (isSelected) { michael@0: state |= states::SELECTED; michael@0: michael@0: // Selected and collapsed? michael@0: if (isCollapsed) { michael@0: // Set selected option offscreen/invisible according to combobox state michael@0: Accessible* grandParent = parent->Parent(); michael@0: if (!grandParent) michael@0: return state; michael@0: NS_ASSERTION(grandParent->Role() == roles::COMBOBOX, michael@0: "grandparent of combobox listitem is not combobox"); michael@0: uint64_t grandParentState = grandParent->State(); michael@0: state &= ~(states::OFFSCREEN | states::INVISIBLE); michael@0: state |= (grandParentState & states::OFFSCREEN) | michael@0: (grandParentState & states::INVISIBLE) | michael@0: (grandParentState & states::OPAQUE1); michael@0: } // isCollapsed michael@0: } // isSelected michael@0: } // ROLE_COMBOBOX_OPTION michael@0: michael@0: return state; michael@0: } michael@0: michael@0: uint64_t michael@0: XULMenuitemAccessible::NativeInteractiveState() const michael@0: { michael@0: if (NativelyUnavailable()) { michael@0: // Note: keep in sinc with nsXULPopupManager::IsValidMenuItem() logic. michael@0: bool skipNavigatingDisabledMenuItem = true; michael@0: nsMenuFrame* menuFrame = do_QueryFrame(GetFrame()); michael@0: if (!menuFrame || !menuFrame->IsOnMenuBar()) { michael@0: skipNavigatingDisabledMenuItem = LookAndFeel:: michael@0: GetInt(LookAndFeel::eIntID_SkipNavigatingDisabledMenuItem, 0) != 0; michael@0: } michael@0: michael@0: if (skipNavigatingDisabledMenuItem) michael@0: return states::UNAVAILABLE; michael@0: michael@0: return states::UNAVAILABLE | states::FOCUSABLE | states::SELECTABLE; michael@0: } michael@0: michael@0: return states::FOCUSABLE | states::SELECTABLE; michael@0: } michael@0: michael@0: ENameValueFlag michael@0: XULMenuitemAccessible::NativeName(nsString& aName) michael@0: { michael@0: mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName); michael@0: return eNameOK; michael@0: } michael@0: michael@0: void michael@0: XULMenuitemAccessible::Description(nsString& aDescription) michael@0: { michael@0: mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::description, michael@0: aDescription); michael@0: } michael@0: michael@0: KeyBinding michael@0: XULMenuitemAccessible::AccessKey() const michael@0: { michael@0: // Return menu accesskey: N or Alt+F. michael@0: static int32_t gMenuAccesskeyModifier = -1; // magic value of -1 indicates unitialized state michael@0: michael@0: // We do not use nsCoreUtils::GetAccesskeyFor() because accesskeys for michael@0: // menu are't registered by EventStateManager. michael@0: nsAutoString accesskey; michael@0: mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey, michael@0: accesskey); michael@0: if (accesskey.IsEmpty()) michael@0: return KeyBinding(); michael@0: michael@0: uint32_t modifierKey = 0; michael@0: michael@0: Accessible* parentAcc = Parent(); michael@0: if (parentAcc) { michael@0: if (parentAcc->NativeRole() == roles::MENUBAR) { michael@0: // If top level menu item, add Alt+ or whatever modifier text to string michael@0: // No need to cache pref service, this happens rarely michael@0: if (gMenuAccesskeyModifier == -1) { michael@0: // Need to initialize cached global accesskey pref michael@0: gMenuAccesskeyModifier = Preferences::GetInt("ui.key.menuAccessKey", 0); michael@0: } michael@0: michael@0: switch (gMenuAccesskeyModifier) { michael@0: case nsIDOMKeyEvent::DOM_VK_CONTROL: michael@0: modifierKey = KeyBinding::kControl; michael@0: break; michael@0: case nsIDOMKeyEvent::DOM_VK_ALT: michael@0: modifierKey = KeyBinding::kAlt; michael@0: break; michael@0: case nsIDOMKeyEvent::DOM_VK_META: michael@0: modifierKey = KeyBinding::kMeta; michael@0: break; michael@0: case nsIDOMKeyEvent::DOM_VK_WIN: michael@0: modifierKey = KeyBinding::kOS; michael@0: break; michael@0: } michael@0: } michael@0: } michael@0: michael@0: return KeyBinding(accesskey[0], modifierKey); michael@0: } michael@0: michael@0: KeyBinding michael@0: XULMenuitemAccessible::KeyboardShortcut() const michael@0: { michael@0: nsAutoString keyElmId; michael@0: mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::key, keyElmId); michael@0: if (keyElmId.IsEmpty()) michael@0: return KeyBinding(); michael@0: michael@0: nsIContent* keyElm = mContent->OwnerDoc()->GetElementById(keyElmId); michael@0: if (!keyElm) michael@0: return KeyBinding(); michael@0: michael@0: uint32_t key = 0; michael@0: michael@0: nsAutoString keyStr; michael@0: keyElm->GetAttr(kNameSpaceID_None, nsGkAtoms::key, keyStr); michael@0: if (keyStr.IsEmpty()) { michael@0: nsAutoString keyCodeStr; michael@0: keyElm->GetAttr(kNameSpaceID_None, nsGkAtoms::keycode, keyCodeStr); michael@0: nsresult errorCode; michael@0: key = keyStr.ToInteger(&errorCode, kAutoDetect); michael@0: } else { michael@0: key = keyStr[0]; michael@0: } michael@0: michael@0: nsAutoString modifiersStr; michael@0: keyElm->GetAttr(kNameSpaceID_None, nsGkAtoms::modifiers, modifiersStr); michael@0: michael@0: uint32_t modifierMask = 0; michael@0: if (modifiersStr.Find("shift") != -1) michael@0: modifierMask |= KeyBinding::kShift; michael@0: if (modifiersStr.Find("alt") != -1) michael@0: modifierMask |= KeyBinding::kAlt; michael@0: if (modifiersStr.Find("meta") != -1) michael@0: modifierMask |= KeyBinding::kMeta; michael@0: if (modifiersStr.Find("os") != -1) michael@0: modifierMask |= KeyBinding::kOS; michael@0: if (modifiersStr.Find("control") != -1) michael@0: modifierMask |= KeyBinding::kControl; michael@0: if (modifiersStr.Find("accel") != -1) { michael@0: // Get the accelerator key value from prefs, overriding the default. michael@0: switch (Preferences::GetInt("ui.key.accelKey", 0)) { michael@0: case nsIDOMKeyEvent::DOM_VK_META: michael@0: modifierMask |= KeyBinding::kMeta; michael@0: break; michael@0: michael@0: case nsIDOMKeyEvent::DOM_VK_WIN: michael@0: modifierMask |= KeyBinding::kOS; michael@0: break; michael@0: michael@0: case nsIDOMKeyEvent::DOM_VK_ALT: michael@0: modifierMask |= KeyBinding::kAlt; michael@0: break; michael@0: michael@0: case nsIDOMKeyEvent::DOM_VK_CONTROL: michael@0: modifierMask |= KeyBinding::kControl; michael@0: break; michael@0: michael@0: default: michael@0: #ifdef XP_MACOSX michael@0: modifierMask |= KeyBinding::kMeta; michael@0: #else michael@0: modifierMask |= KeyBinding::kControl; michael@0: #endif michael@0: } michael@0: } michael@0: michael@0: return KeyBinding(key, modifierMask); michael@0: } michael@0: michael@0: role michael@0: XULMenuitemAccessible::NativeRole() michael@0: { michael@0: nsCOMPtr xulContainer(do_QueryInterface(mContent)); michael@0: if (xulContainer) michael@0: return roles::PARENT_MENUITEM; michael@0: michael@0: if (mParent && mParent->Role() == roles::COMBOBOX_LIST) michael@0: return roles::COMBOBOX_OPTION; michael@0: michael@0: if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type, michael@0: nsGkAtoms::radio, eCaseMatters)) michael@0: return roles::RADIO_MENU_ITEM; michael@0: michael@0: if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type, michael@0: nsGkAtoms::checkbox, michael@0: eCaseMatters)) michael@0: return roles::CHECK_MENU_ITEM; michael@0: michael@0: return roles::MENUITEM; michael@0: } michael@0: michael@0: int32_t michael@0: XULMenuitemAccessible::GetLevelInternal() michael@0: { michael@0: return nsAccUtils::GetLevelForXULContainerItem(mContent); michael@0: } michael@0: michael@0: bool michael@0: XULMenuitemAccessible::CanHaveAnonChildren() michael@0: { michael@0: // That indicates we don't walk anonymous children for menuitems michael@0: return false; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: XULMenuitemAccessible::DoAction(uint8_t index) michael@0: { michael@0: if (index == eAction_Click) { // default action michael@0: DoCommand(); michael@0: return NS_OK; michael@0: } michael@0: michael@0: return NS_ERROR_INVALID_ARG; michael@0: } michael@0: michael@0: /** select us! close combo box if necessary*/ michael@0: NS_IMETHODIMP michael@0: XULMenuitemAccessible::GetActionName(uint8_t aIndex, nsAString& aName) michael@0: { michael@0: if (aIndex == eAction_Click) { michael@0: aName.AssignLiteral("click"); michael@0: return NS_OK; michael@0: } michael@0: return NS_ERROR_INVALID_ARG; michael@0: } michael@0: michael@0: uint8_t michael@0: XULMenuitemAccessible::ActionCount() michael@0: { michael@0: return 1; michael@0: } michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: // XULMenuitemAccessible: Widgets michael@0: michael@0: bool michael@0: XULMenuitemAccessible::IsActiveWidget() const michael@0: { michael@0: // Parent menu item is a widget, it's active when its popup is open. michael@0: nsIContent* menuPopupContent = mContent->GetFirstChild(); michael@0: if (menuPopupContent) { michael@0: nsMenuPopupFrame* menuPopupFrame = michael@0: do_QueryFrame(menuPopupContent->GetPrimaryFrame()); michael@0: return menuPopupFrame && menuPopupFrame->IsOpen(); michael@0: } michael@0: return false; michael@0: } michael@0: michael@0: bool michael@0: XULMenuitemAccessible::AreItemsOperable() const michael@0: { michael@0: // Parent menu item is a widget, its items are operable when its popup is open. michael@0: nsIContent* menuPopupContent = mContent->GetFirstChild(); michael@0: if (menuPopupContent) { michael@0: nsMenuPopupFrame* menuPopupFrame = michael@0: do_QueryFrame(menuPopupContent->GetPrimaryFrame()); michael@0: return menuPopupFrame && menuPopupFrame->IsOpen(); michael@0: } michael@0: return false; michael@0: } michael@0: michael@0: Accessible* michael@0: XULMenuitemAccessible::ContainerWidget() const michael@0: { michael@0: nsMenuFrame* menuFrame = do_QueryFrame(GetFrame()); michael@0: if (menuFrame) { michael@0: nsMenuParent* menuParent = menuFrame->GetMenuParent(); michael@0: if (menuParent) { michael@0: if (menuParent->IsMenuBar()) // menubar menu michael@0: return mParent; michael@0: michael@0: // a menupoup or parent menu item michael@0: if (menuParent->IsMenu()) michael@0: return mParent; michael@0: michael@0: // otherwise it's different kind of popups (like panel or tooltip), it michael@0: // shouldn't be a real case. michael@0: } michael@0: } michael@0: return nullptr; michael@0: } michael@0: michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: // XULMenuSeparatorAccessible michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: XULMenuSeparatorAccessible:: michael@0: XULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc) : michael@0: XULMenuitemAccessible(aContent, aDoc) michael@0: { michael@0: } michael@0: michael@0: uint64_t michael@0: XULMenuSeparatorAccessible::NativeState() michael@0: { michael@0: // Isn't focusable, but can be offscreen/invisible -- only copy those states michael@0: return XULMenuitemAccessible::NativeState() & michael@0: (states::OFFSCREEN | states::INVISIBLE); michael@0: } michael@0: michael@0: ENameValueFlag michael@0: XULMenuSeparatorAccessible::NativeName(nsString& aName) michael@0: { michael@0: return eNameOK; michael@0: } michael@0: michael@0: role michael@0: XULMenuSeparatorAccessible::NativeRole() michael@0: { michael@0: return roles::SEPARATOR; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: XULMenuSeparatorAccessible::DoAction(uint8_t index) michael@0: { michael@0: return NS_ERROR_NOT_IMPLEMENTED; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: XULMenuSeparatorAccessible::GetActionName(uint8_t aIndex, nsAString& aName) michael@0: { michael@0: return NS_ERROR_NOT_IMPLEMENTED; michael@0: } michael@0: michael@0: uint8_t michael@0: XULMenuSeparatorAccessible::ActionCount() michael@0: { michael@0: return 0; michael@0: } michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: // XULMenupopupAccessible michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: XULMenupopupAccessible:: michael@0: XULMenupopupAccessible(nsIContent* aContent, DocAccessible* aDoc) : michael@0: XULSelectControlAccessible(aContent, aDoc) michael@0: { michael@0: nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame()); michael@0: if (menuPopupFrame && menuPopupFrame->IsMenu()) michael@0: mType = eMenuPopupType; michael@0: michael@0: // May be the anonymous inside (a combobox) michael@0: mSelectControl = do_QueryInterface(mContent->GetFlattenedTreeParent()); michael@0: if (!mSelectControl) michael@0: mGenericTypes &= ~eSelect; michael@0: } michael@0: michael@0: uint64_t michael@0: XULMenupopupAccessible::NativeState() michael@0: { michael@0: uint64_t state = Accessible::NativeState(); michael@0: michael@0: #ifdef DEBUG michael@0: // We are onscreen if our parent is active michael@0: bool isActive = mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::menuactive); michael@0: if (!isActive) { michael@0: Accessible* parent = Parent(); michael@0: if (parent) { michael@0: nsIContent* parentContent = parent->GetContent(); michael@0: if (parentContent) michael@0: isActive = parentContent->HasAttr(kNameSpaceID_None, nsGkAtoms::open); michael@0: } michael@0: } michael@0: michael@0: NS_ASSERTION(isActive || (state & states::INVISIBLE), michael@0: "XULMenupopup doesn't have INVISIBLE when it's inactive"); michael@0: #endif michael@0: michael@0: if (state & states::INVISIBLE) michael@0: state |= states::OFFSCREEN | states::COLLAPSED; michael@0: michael@0: return state; michael@0: } michael@0: michael@0: ENameValueFlag michael@0: XULMenupopupAccessible::NativeName(nsString& aName) michael@0: { michael@0: nsIContent* content = mContent; michael@0: while (content && aName.IsEmpty()) { michael@0: content->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName); michael@0: content = content->GetFlattenedTreeParent(); michael@0: } michael@0: michael@0: return eNameOK; michael@0: } michael@0: michael@0: role michael@0: XULMenupopupAccessible::NativeRole() michael@0: { michael@0: // If accessible is not bound to the tree (this happens while children are michael@0: // cached) return general role. michael@0: if (mParent) { michael@0: roles::Role role = mParent->Role(); michael@0: if (role == roles::COMBOBOX || role == roles::AUTOCOMPLETE) michael@0: return roles::COMBOBOX_LIST; michael@0: michael@0: if (role == roles::PUSHBUTTON) { michael@0: // Some widgets like the search bar have several popups, owned by buttons. michael@0: Accessible* grandParent = mParent->Parent(); michael@0: if (grandParent && grandParent->Role() == roles::AUTOCOMPLETE) michael@0: return roles::COMBOBOX_LIST; michael@0: } michael@0: } michael@0: michael@0: return roles::MENUPOPUP; michael@0: } michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: // XULMenupopupAccessible: Widgets michael@0: michael@0: bool michael@0: XULMenupopupAccessible::IsWidget() const michael@0: { michael@0: return true; michael@0: } michael@0: michael@0: bool michael@0: XULMenupopupAccessible::IsActiveWidget() const michael@0: { michael@0: // If menupopup is a widget (the case of context menus) then active when open. michael@0: nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame()); michael@0: return menuPopupFrame && menuPopupFrame->IsOpen(); michael@0: } michael@0: michael@0: bool michael@0: XULMenupopupAccessible::AreItemsOperable() const michael@0: { michael@0: nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame()); michael@0: return menuPopupFrame && menuPopupFrame->IsOpen(); michael@0: } michael@0: michael@0: Accessible* michael@0: XULMenupopupAccessible::ContainerWidget() const michael@0: { michael@0: DocAccessible* document = Document(); michael@0: michael@0: nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame()); michael@0: while (menuPopupFrame) { michael@0: Accessible* menuPopup = michael@0: document->GetAccessible(menuPopupFrame->GetContent()); michael@0: if (!menuPopup) // shouldn't be a real case michael@0: return nullptr; michael@0: michael@0: nsMenuFrame* menuFrame = do_QueryFrame(menuPopupFrame->GetParent()); michael@0: if (!menuFrame) // context menu or popups michael@0: return nullptr; michael@0: michael@0: nsMenuParent* menuParent = menuFrame->GetMenuParent(); michael@0: if (!menuParent) // menulist or menubutton michael@0: return menuPopup->Parent(); michael@0: michael@0: if (menuParent->IsMenuBar()) { // menubar menu michael@0: nsMenuBarFrame* menuBarFrame = static_cast(menuParent); michael@0: return document->GetAccessible(menuBarFrame->GetContent()); michael@0: } michael@0: michael@0: // different kind of popups like panel or tooltip michael@0: if (!menuParent->IsMenu()) michael@0: return nullptr; michael@0: michael@0: menuPopupFrame = static_cast(menuParent); michael@0: } michael@0: michael@0: NS_NOTREACHED("Shouldn't be a real case."); michael@0: return nullptr; michael@0: } michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: // XULMenubarAccessible michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: XULMenubarAccessible:: michael@0: XULMenubarAccessible(nsIContent* aContent, DocAccessible* aDoc) : michael@0: AccessibleWrap(aContent, aDoc) michael@0: { michael@0: } michael@0: michael@0: ENameValueFlag michael@0: XULMenubarAccessible::NativeName(nsString& aName) michael@0: { michael@0: aName.AssignLiteral("Application"); michael@0: return eNameOK; michael@0: } michael@0: michael@0: role michael@0: XULMenubarAccessible::NativeRole() michael@0: { michael@0: return roles::MENUBAR; michael@0: } michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: // XULMenubarAccessible: Widgets michael@0: michael@0: bool michael@0: XULMenubarAccessible::IsActiveWidget() const michael@0: { michael@0: nsMenuBarFrame* menuBarFrame = do_QueryFrame(GetFrame()); michael@0: return menuBarFrame && menuBarFrame->IsActive(); michael@0: } michael@0: michael@0: bool michael@0: XULMenubarAccessible::AreItemsOperable() const michael@0: { michael@0: return true; michael@0: } michael@0: michael@0: Accessible* michael@0: XULMenubarAccessible::CurrentItem() michael@0: { michael@0: nsMenuBarFrame* menuBarFrame = do_QueryFrame(GetFrame()); michael@0: if (menuBarFrame) { michael@0: nsMenuFrame* menuFrame = menuBarFrame->GetCurrentMenuItem(); michael@0: if (menuFrame) { michael@0: nsIContent* menuItemNode = menuFrame->GetContent(); michael@0: return mDoc->GetAccessible(menuItemNode); michael@0: } michael@0: } michael@0: return nullptr; michael@0: } michael@0: michael@0: void michael@0: XULMenubarAccessible::SetCurrentItem(Accessible* aItem) michael@0: { michael@0: NS_ERROR("XULMenubarAccessible::SetCurrentItem not implemented"); michael@0: }