From ef3f8b9010c832bc4dd762ea369cc5760e2a6e18 Mon Sep 17 00:00:00 2001 From: "aaronleventhal%moonset.net" Date: Wed, 1 Sep 2004 14:58:34 +0000 Subject: [PATCH] Bug 254966. Make css scrollable elements tab navigable. r=mats, sr=roc git-svn-id: svn://10.0.0.236/trunk@161578 18797224-902f-48f8-a5cc-f745e15eee43 --- .../public/nsIAccessibilityService.idl | 3 +- .../src/base/nsAccessibilityService.cpp | 26 ++++++++++++++--- .../src/base/nsBaseWidgetAccessible.cpp | 2 +- mozilla/content/base/src/nsGenericElement.cpp | 10 +++++-- .../events/public/nsIEventStateManager.h | 9 ++---- .../events/src/nsEventStateManager.cpp | 19 +++++------- .../content/events/src/nsEventStateManager.h | 3 +- mozilla/layout/base/nsPresShell.cpp | 29 +++++++++---------- .../layout/forms/nsComboboxControlFrame.cpp | 2 +- mozilla/layout/generic/nsFrame.cpp | 22 ++++++++++++++ mozilla/layout/generic/nsGfxScrollFrame.cpp | 21 ++++++++++++++ mozilla/layout/generic/nsGfxScrollFrame.h | 4 +++ mozilla/layout/html/base/src/nsFrame.cpp | 22 ++++++++++++++ .../layout/html/base/src/nsGfxScrollFrame.cpp | 21 ++++++++++++++ .../layout/html/base/src/nsGfxScrollFrame.h | 4 +++ mozilla/layout/html/base/src/nsPresShell.cpp | 29 +++++++++---------- .../html/forms/src/nsComboboxControlFrame.cpp | 2 +- 17 files changed, 170 insertions(+), 58 deletions(-) diff --git a/mozilla/accessible/public/nsIAccessibilityService.idl b/mozilla/accessible/public/nsIAccessibilityService.idl index 6b4cd62aa67..016f163c7e6 100644 --- a/mozilla/accessible/public/nsIAccessibilityService.idl +++ b/mozilla/accessible/public/nsIAccessibilityService.idl @@ -44,7 +44,7 @@ interface nsIDocument; interface nsIFrame; interface nsObjectFrame; -[scriptable, uuid(68D9720A-0984-42b6-A3F5-8237ED925727)] +[scriptable, uuid(a5f0a449-41a5-4040-bb67-56e2eafcffd7)] interface nsIAccessibilityService : nsIAccessibleRetrieval { nsIAccessible createOuterDocAccessible(in nsIDOMNode aNode); @@ -60,6 +60,7 @@ interface nsIAccessibilityService : nsIAccessibleRetrieval nsIAccessible createHTMLCheckboxAccessible(in nsISupports aFrame); nsIAccessible createHTMLCheckboxAccessibleXBL(in nsIDOMNode aNode); nsIAccessible createHTMLComboboxAccessible(in nsIDOMNode aNode, in nsISupports aPresShell); + nsIAccessible createHTMLGenericAccessible(in nsISupports aFrame); nsIAccessible createHTMLGroupboxAccessible(in nsISupports aFrame); nsIAccessible createHTMLHRAccessible(in nsISupports aFrame); nsIAccessible createHTMLImageAccessible(in nsISupports aFrame); diff --git a/mozilla/accessible/src/base/nsAccessibilityService.cpp b/mozilla/accessible/src/base/nsAccessibilityService.cpp index 66dc489ed01..0ca91c41e3c 100644 --- a/mozilla/accessible/src/base/nsAccessibilityService.cpp +++ b/mozilla/accessible/src/base/nsAccessibilityService.cpp @@ -521,13 +521,13 @@ nsAccessibilityService::CreateHTMLCheckboxAccessibleXBL(nsIDOMNode *aNode, nsIAc } NS_IMETHODIMP -nsAccessibilityService::CreateHTMLComboboxAccessible(nsIDOMNode* aDOMNode, nsISupports* aPresContext, nsIAccessible **_retval) +nsAccessibilityService::CreateHTMLComboboxAccessible(nsIDOMNode* aDOMNode, nsISupports* aPresShell, nsIAccessible **_retval) { - nsCOMPtr presContext(do_QueryInterface(aPresContext)); - NS_ASSERTION(presContext,"Error non prescontext passed to accessible factory!!!"); + nsCOMPtr presShell(do_QueryInterface(aPresShell)); + NS_ASSERTION(presShell,"Error non prescontext passed to accessible factory!!!"); nsCOMPtr weakShell = - do_GetWeakReference(presContext->PresShell()); + do_GetWeakReference(presShell); *_retval = new nsHTMLComboboxAccessible(aDOMNode, weakShell); if (! *_retval) @@ -569,6 +569,24 @@ nsAccessibilityService::CreateHTMLImageAccessible(nsISupports *aFrame, nsIAccess return NS_OK; } +NS_IMETHODIMP +nsAccessibilityService::CreateHTMLGenericAccessible(nsISupports *aFrame, nsIAccessible **_retval) +{ + nsIFrame* frame; + nsCOMPtr node; + nsCOMPtr weakShell; + nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); + if (NS_FAILED(rv)) + return rv; + + *_retval = new nsGenericAccessible(node, weakShell); + if (! *_retval) + return NS_ERROR_OUT_OF_MEMORY; + + NS_ADDREF(*_retval); + return NS_OK; +} + NS_IMETHODIMP nsAccessibilityService::CreateHTMLGroupboxAccessible(nsISupports *aFrame, nsIAccessible **_retval) { diff --git a/mozilla/accessible/src/base/nsBaseWidgetAccessible.cpp b/mozilla/accessible/src/base/nsBaseWidgetAccessible.cpp index e97f8204f3f..5d426a8212d 100644 --- a/mozilla/accessible/src/base/nsBaseWidgetAccessible.cpp +++ b/mozilla/accessible/src/base/nsBaseWidgetAccessible.cpp @@ -338,7 +338,7 @@ NS_IMETHODIMP nsGenericAccessible::GetRole(PRUint32 *aRole) { // XXX todo: use DHTML role attribs to fill in accessible role - *aRole = ROLE_NOTHING; + *aRole = ROLE_PANE; return NS_OK; } diff --git a/mozilla/content/base/src/nsGenericElement.cpp b/mozilla/content/base/src/nsGenericElement.cpp index 94c9a85c563..d3a226244d4 100644 --- a/mozilla/content/base/src/nsGenericElement.cpp +++ b/mozilla/content/base/src/nsGenericElement.cpp @@ -2400,9 +2400,15 @@ nsGenericElement::SetFocus(nsPresContext* aPresContext) { // Traditionally focusable elements can take focus as long as they don't set // the disabled attribute - if (IsFocusable()) { + + nsIFrame* frame = nsnull; + nsIPresShell *presShell = aPresContext->PresShell(); + presShell->GetPrimaryFrameFor(this, &frame); + if (frame && frame->IsFocusable()) { aPresContext->EventStateManager()->SetContentState(this, - NS_EVENT_STATE_FOCUS); + NS_EVENT_STATE_FOCUS); + presShell->ScrollFrameIntoView(frame, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE, + NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); } } diff --git a/mozilla/content/events/public/nsIEventStateManager.h b/mozilla/content/events/public/nsIEventStateManager.h index b609dbd6fa4..3f0e59aa762 100644 --- a/mozilla/content/events/public/nsIEventStateManager.h +++ b/mozilla/content/events/public/nsIEventStateManager.h @@ -53,9 +53,9 @@ class nsIWidget; * Event listener manager interface. */ #define NS_IEVENTSTATEMANAGER_IID \ -{ /* 80a98c80-2036-11d2-bd89-00805f8ae3f4 */ \ -0x80a98c80, 0x2036, 0x11d2, \ -{0xbd, 0x89, 0x00, 0x80, 0x5f, 0x8a, 0xe3, 0xf4} } +{ /* 08bd45d8-db4a-4e06-918c-cebffb002fef */ \ +0x08bd45d8, 0xdb4a, 0x4e06, \ +{ 0x91, 0x8c, 0xce, 0xbf, 0xfb, 0x0, 0x2f, 0xef} }; #define NS_EVENT_NEEDS_FRAME(event) (!NS_IS_FOCUS_EVENT(event)) @@ -123,9 +123,6 @@ public: // Method for moving the focus forward/back. NS_IMETHOD ShiftFocus(PRBool aDirection, nsIContent* aStart)=0; - - // Return the location of the caret - NS_IMETHOD GetDocSelectionLocation(nsIContent **startContent, nsIContent **endContent, nsIFrame **startFrame, PRUint32 *startOffset) = 0; }; #define NS_EVENT_STATE_UNSPECIFIED 0x0000 diff --git a/mozilla/content/events/src/nsEventStateManager.cpp b/mozilla/content/events/src/nsEventStateManager.cpp index e9982b5ec12..a101aca26d5 100644 --- a/mozilla/content/events/src/nsEventStateManager.cpp +++ b/mozilla/content/events/src/nsEventStateManager.cpp @@ -4387,7 +4387,7 @@ nsEventStateManager::FlushPendingEvents(nsPresContext* aPresContext) } } -NS_IMETHODIMP +nsresult nsEventStateManager::GetDocSelectionLocation(nsIContent **aStartContent, nsIContent **aEndContent, nsIFrame **aStartFrame, @@ -4431,7 +4431,8 @@ nsEventStateManager::GetDocSelectionLocation(nsIContent **aStartContent, nsIContent *childContent = nsnull; startContent = do_QueryInterface(startNode); - if (startContent->IsContentOfType(nsIContent::eELEMENT)) { + if (*aStartOffset > 0 && + startContent->IsContentOfType(nsIContent::eELEMENT)) { childContent = startContent->GetChildAt(*aStartOffset); if (childContent) startContent = childContent; @@ -4441,9 +4442,11 @@ nsEventStateManager::GetDocSelectionLocation(nsIContent **aStartContent, if (endContent->IsContentOfType(nsIContent::eELEMENT)) { PRInt32 endOffset = 0; domRange->GetEndOffset(&endOffset); - childContent = endContent->GetChildAt(endOffset); - if (childContent) - endContent = childContent; + if (endOffset > 0) { + childContent = endContent->GetChildAt(endOffset); + if (childContent) + endContent = childContent; + } } } } @@ -4737,12 +4740,6 @@ nsEventStateManager::MoveCaretToFocus() GetDocSelectionLocation(getter_AddRefs(selectionContent), getter_AddRefs(endSelectionContent), &selectionFrame, &selectionOffset); - while (selectionContent) { - nsIContent* parentContent = selectionContent->GetParent(); - if (mCurrentFocus == selectionContent && parentContent) - return NS_OK; // selection is already within focus node that isn't the root content - selectionContent = parentContent; // Keep checking up chain of parents, focus may be in a link above us - } nsIPresShell *shell = mPresContext->GetPresShell(); if (shell) { diff --git a/mozilla/content/events/src/nsEventStateManager.h b/mozilla/content/events/src/nsEventStateManager.h index ce687bf8cc1..8f7d44da736 100644 --- a/mozilla/content/events/src/nsEventStateManager.h +++ b/mozilla/content/events/src/nsEventStateManager.h @@ -236,7 +236,8 @@ protected: void FocusElementButNotDocument(nsIContent *aElement); // Return the location of the caret - NS_IMETHOD GetDocSelectionLocation(nsIContent **startContent, nsIContent **endContent, nsIFrame **startFrame, PRUint32 *startOffset); + nsresult GetDocSelectionLocation(nsIContent **start, nsIContent **end, + nsIFrame **startFrame, PRUint32 *startOffset); void GetSelection ( nsIFrame* inFrame, nsPresContext* inPresContext, nsIFrameSelection** outSelection ) ; diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 333000fdc45..24d9d391529 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -3665,22 +3665,21 @@ nsIScrollableView* PresShell::GetViewToScroll() { nsCOMPtr esm = mPresContext->EventStateManager(); - nsIFrame* selectionFrame = nsnull; nsIScrollableView* scrollView = nsnull; - nsCOMPtr selectionContent, endSelectionContent; // NOT USED - PRUint32 selectionOffset; // NOT USED - esm->GetDocSelectionLocation(getter_AddRefs(selectionContent), - getter_AddRefs(endSelectionContent), - &selectionFrame, - &selectionOffset); - if (selectionFrame) { - nsCOMPtr svp = do_QueryInterface(selectionFrame); - if (svp) { - svp->GetScrollableView(mPresContext, &scrollView); - } else { - nsIView* selectionView = selectionFrame->GetClosestView(); - if (selectionView) - scrollView = nsLayoutUtils::GetNearestScrollingView(selectionView); + nsCOMPtr focusedContent; + esm->GetFocusedContent(getter_AddRefs(focusedContent)); + if (focusedContent) { + nsIFrame* startFrame = nsnull; + GetPrimaryFrameFor(focusedContent, &startFrame); + if (startFrame) { + nsCOMPtr svp = do_QueryInterface(startFrame); + if (svp) { + svp->GetScrollableView(mPresContext, &scrollView); + } else { + nsIView* startView = startFrame->GetClosestView(); + if (startView) + scrollView = nsLayoutUtils::GetNearestScrollingView(startView); + } } } if (!scrollView) { diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index 4ffff02f002..97fe5a5cf20 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -361,7 +361,7 @@ NS_IMETHODIMP nsComboboxControlFrame::GetAccessible(nsIAccessible** aAccessible) if (accService) { nsCOMPtr node = do_QueryInterface(mContent); - return accService->CreateHTMLComboboxAccessible(node, mPresContext, aAccessible); + return accService->CreateHTMLComboboxAccessible(node, mPresContext->PresShell(), aAccessible); } return NS_ERROR_FAILURE; diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 886cd632b89..4a2935fec82 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -49,6 +49,7 @@ #include "nsReflowPath.h" #include "nsIView.h" #include "nsIViewManager.h" +#include "nsIScrollableFrame.h" #include "nsPresContext.h" #include "nsCRT.h" #include "nsGUIEvent.h" @@ -4554,6 +4555,27 @@ nsIFrame::IsFocusable(PRInt32 *aTabIndex) tabIndex = 0; } isFocusable = mContent->IsFocusable(&tabIndex); + if (!isFocusable && GetType() == nsLayoutAtoms::scrollFrame && + mContent->IsContentOfType(nsIContent::eHTML) && + !mContent->IsNativeAnonymous() && mContent->GetParent() && + !mContent->HasAttr(kNameSpaceID_None, nsHTMLAtoms::tabindex)) { + // Elements with scrollable view always focusable & tabbable + // Otherwise you couldn't scroll them with keyboard, which is + // an accessibility issue (e.g. Section 508 rules) + nsCOMPtr scrollFrame = do_QueryInterface(this); + if (scrollFrame) { + nsIScrollableFrame::ScrollbarStyles styles = + scrollFrame->GetScrollbarStyles(); + if (styles.mVertical == NS_STYLE_OVERFLOW_SCROLL || + styles.mVertical == NS_STYLE_OVERFLOW_AUTO || + styles.mHorizontal == NS_STYLE_OVERFLOW_SCROLL || + styles.mHorizontal == NS_STYLE_OVERFLOW_AUTO) { + // Scroll bars will be used for overflow + isFocusable = PR_TRUE; + tabIndex = 0; + } + } + } } } diff --git a/mozilla/layout/generic/nsGfxScrollFrame.cpp b/mozilla/layout/generic/nsGfxScrollFrame.cpp index c33f6f3272c..5b632fcc8b1 100644 --- a/mozilla/layout/generic/nsGfxScrollFrame.cpp +++ b/mozilla/layout/generic/nsGfxScrollFrame.cpp @@ -69,6 +69,9 @@ #include "nsIURI.h" #include "nsGUIEvent.h" #include "nsContentCreatorFunctions.h" +#ifdef ACCESSIBILITY +#include "nsIAccessibilityService.h" +#endif //---------------------------------------------------------------------- //----------nsHTMLScrollFrame------------------------------------------- @@ -574,6 +577,24 @@ nsHTMLScrollFrame::GetFrameName(nsAString& aResult) const } #endif +#ifdef ACCESSIBILITY +NS_IMETHODIMP nsHTMLScrollFrame::GetAccessible(nsIAccessible** aAccessible) +{ + *aAccessible = nsnull; + if (!IsFocusable()) { + return NS_OK; + } + // Focusable via CSS, so needs to be in accessibility hierarchy + nsCOMPtr accService = do_GetService("@mozilla.org/accessibilityService;1"); + + if (accService) { + return accService->CreateHTMLGenericAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible); + } + + return NS_ERROR_FAILURE; +} +#endif + NS_IMETHODIMP nsHTMLScrollFrame::CurPosAttributeChanged(nsPresContext* aPresContext, nsIContent* aChild, diff --git a/mozilla/layout/generic/nsGfxScrollFrame.h b/mozilla/layout/generic/nsGfxScrollFrame.h index 0faf48ee878..f739ab5aa54 100644 --- a/mozilla/layout/generic/nsGfxScrollFrame.h +++ b/mozilla/layout/generic/nsGfxScrollFrame.h @@ -279,6 +279,10 @@ public: virtual nsresult GetContentOf(nsIContent** aContent); +#ifdef ACCESSIBILITY + NS_IMETHOD GetAccessible(nsIAccessible** aAccessible); +#endif + protected: nsHTMLScrollFrame(nsIPresShell* aShell, PRBool aIsRoot); virtual PRIntn GetSkipSides() const; diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index 886cd632b89..4a2935fec82 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -49,6 +49,7 @@ #include "nsReflowPath.h" #include "nsIView.h" #include "nsIViewManager.h" +#include "nsIScrollableFrame.h" #include "nsPresContext.h" #include "nsCRT.h" #include "nsGUIEvent.h" @@ -4554,6 +4555,27 @@ nsIFrame::IsFocusable(PRInt32 *aTabIndex) tabIndex = 0; } isFocusable = mContent->IsFocusable(&tabIndex); + if (!isFocusable && GetType() == nsLayoutAtoms::scrollFrame && + mContent->IsContentOfType(nsIContent::eHTML) && + !mContent->IsNativeAnonymous() && mContent->GetParent() && + !mContent->HasAttr(kNameSpaceID_None, nsHTMLAtoms::tabindex)) { + // Elements with scrollable view always focusable & tabbable + // Otherwise you couldn't scroll them with keyboard, which is + // an accessibility issue (e.g. Section 508 rules) + nsCOMPtr scrollFrame = do_QueryInterface(this); + if (scrollFrame) { + nsIScrollableFrame::ScrollbarStyles styles = + scrollFrame->GetScrollbarStyles(); + if (styles.mVertical == NS_STYLE_OVERFLOW_SCROLL || + styles.mVertical == NS_STYLE_OVERFLOW_AUTO || + styles.mHorizontal == NS_STYLE_OVERFLOW_SCROLL || + styles.mHorizontal == NS_STYLE_OVERFLOW_AUTO) { + // Scroll bars will be used for overflow + isFocusable = PR_TRUE; + tabIndex = 0; + } + } + } } } diff --git a/mozilla/layout/html/base/src/nsGfxScrollFrame.cpp b/mozilla/layout/html/base/src/nsGfxScrollFrame.cpp index c33f6f3272c..5b632fcc8b1 100644 --- a/mozilla/layout/html/base/src/nsGfxScrollFrame.cpp +++ b/mozilla/layout/html/base/src/nsGfxScrollFrame.cpp @@ -69,6 +69,9 @@ #include "nsIURI.h" #include "nsGUIEvent.h" #include "nsContentCreatorFunctions.h" +#ifdef ACCESSIBILITY +#include "nsIAccessibilityService.h" +#endif //---------------------------------------------------------------------- //----------nsHTMLScrollFrame------------------------------------------- @@ -574,6 +577,24 @@ nsHTMLScrollFrame::GetFrameName(nsAString& aResult) const } #endif +#ifdef ACCESSIBILITY +NS_IMETHODIMP nsHTMLScrollFrame::GetAccessible(nsIAccessible** aAccessible) +{ + *aAccessible = nsnull; + if (!IsFocusable()) { + return NS_OK; + } + // Focusable via CSS, so needs to be in accessibility hierarchy + nsCOMPtr accService = do_GetService("@mozilla.org/accessibilityService;1"); + + if (accService) { + return accService->CreateHTMLGenericAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible); + } + + return NS_ERROR_FAILURE; +} +#endif + NS_IMETHODIMP nsHTMLScrollFrame::CurPosAttributeChanged(nsPresContext* aPresContext, nsIContent* aChild, diff --git a/mozilla/layout/html/base/src/nsGfxScrollFrame.h b/mozilla/layout/html/base/src/nsGfxScrollFrame.h index 0faf48ee878..f739ab5aa54 100644 --- a/mozilla/layout/html/base/src/nsGfxScrollFrame.h +++ b/mozilla/layout/html/base/src/nsGfxScrollFrame.h @@ -279,6 +279,10 @@ public: virtual nsresult GetContentOf(nsIContent** aContent); +#ifdef ACCESSIBILITY + NS_IMETHOD GetAccessible(nsIAccessible** aAccessible); +#endif + protected: nsHTMLScrollFrame(nsIPresShell* aShell, PRBool aIsRoot); virtual PRIntn GetSkipSides() const; diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 333000fdc45..24d9d391529 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -3665,22 +3665,21 @@ nsIScrollableView* PresShell::GetViewToScroll() { nsCOMPtr esm = mPresContext->EventStateManager(); - nsIFrame* selectionFrame = nsnull; nsIScrollableView* scrollView = nsnull; - nsCOMPtr selectionContent, endSelectionContent; // NOT USED - PRUint32 selectionOffset; // NOT USED - esm->GetDocSelectionLocation(getter_AddRefs(selectionContent), - getter_AddRefs(endSelectionContent), - &selectionFrame, - &selectionOffset); - if (selectionFrame) { - nsCOMPtr svp = do_QueryInterface(selectionFrame); - if (svp) { - svp->GetScrollableView(mPresContext, &scrollView); - } else { - nsIView* selectionView = selectionFrame->GetClosestView(); - if (selectionView) - scrollView = nsLayoutUtils::GetNearestScrollingView(selectionView); + nsCOMPtr focusedContent; + esm->GetFocusedContent(getter_AddRefs(focusedContent)); + if (focusedContent) { + nsIFrame* startFrame = nsnull; + GetPrimaryFrameFor(focusedContent, &startFrame); + if (startFrame) { + nsCOMPtr svp = do_QueryInterface(startFrame); + if (svp) { + svp->GetScrollableView(mPresContext, &scrollView); + } else { + nsIView* startView = startFrame->GetClosestView(); + if (startView) + scrollView = nsLayoutUtils::GetNearestScrollingView(startView); + } } } if (!scrollView) { diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp index 4ffff02f002..97fe5a5cf20 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -361,7 +361,7 @@ NS_IMETHODIMP nsComboboxControlFrame::GetAccessible(nsIAccessible** aAccessible) if (accService) { nsCOMPtr node = do_QueryInterface(mContent); - return accService->CreateHTMLComboboxAccessible(node, mPresContext, aAccessible); + return accService->CreateHTMLComboboxAccessible(node, mPresContext->PresShell(), aAccessible); } return NS_ERROR_FAILURE;