Bug 628922 - layout should use cached nsIAccessibilityService, r=davidb, sr=roc, a=roc

This commit is contained in:
Alexander Surkov 2011-01-28 12:38:14 +08:00
Родитель 97c957ca9e
Коммит 5029052452
28 изменённых файлов: 106 добавлений и 118 удалений

Просмотреть файл

@ -81,6 +81,8 @@ CPPSRCS = \
EXPORTS = \
a11yGeneric.h \
nsAccDocManager.h \
nsAccessibilityService.h \
nsAccessible.h \
nsAccessNode.h \
nsARIAMap.h \

Просмотреть файл

@ -38,14 +38,14 @@
#ifndef nsAccDocManager_h_
#define nsAccDocManager_h_
#include "nsAccessible.h"
#include "nsIDocument.h"
#include "nsIDOMEventListener.h"
#include "nsRefPtrHashtable.h"
#include "nsIWebProgress.h"
#include "nsIWebProgressListener.h"
#include "nsWeakReference.h"
class nsAccessible;
class nsDocAccessible;
//#define DEBUG_ACCDOCMGR

Просмотреть файл

@ -39,7 +39,7 @@
#include "nsRelUtils.h"
#include "nsAccessibilityService.h"
#include "nsAccessNode.h"
#include "nsAccessible.h"
#include "nsCoreUtils.h"
#include "nsIDOMDocument.h"

Просмотреть файл

@ -129,7 +129,7 @@
#include "nsIXULDocument.h"
#endif
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsInlineFrame.h"
@ -6740,13 +6740,10 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
#endif
#ifdef ACCESSIBILITY
if (mPresShell->IsAccessibilityActive()) {
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
if (accService) {
accService->ContentRangeInserted(mPresShell, aContainer,
aFirstNewContent, nsnull);
}
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
accService->ContentRangeInserted(mPresShell, aContainer,
aFirstNewContent, nsnull);
}
#endif
@ -6931,13 +6928,10 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
}
#ifdef ACCESSIBILITY
if (mPresShell->IsAccessibilityActive()) {
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
if (accService) {
accService->ContentRangeInserted(mPresShell, aContainer,
aStartChild, aEndChild);
}
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
accService->ContentRangeInserted(mPresShell, aContainer,
aStartChild, aEndChild);
}
#endif
@ -7344,13 +7338,10 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
#endif
#ifdef ACCESSIBILITY
if (mPresShell->IsAccessibilityActive()) {
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
if (accService) {
accService->ContentRangeInserted(mPresShell, aContainer,
aStartChild, aEndChild);
}
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
accService->ContentRangeInserted(mPresShell, aContainer,
aStartChild, aEndChild);
}
#endif
@ -7487,12 +7478,9 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
}
#ifdef ACCESSIBILITY
if (mPresShell->IsAccessibilityActive()) {
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
if (accService) {
accService->ContentRemoved(mPresShell, aContainer, aChild);
}
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
accService->ContentRemoved(mPresShell, aContainer, aChild);
}
#endif

Просмотреть файл

@ -97,7 +97,7 @@
#include "nsFrameManager.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#ifdef DEBUG
@ -1532,8 +1532,7 @@ nsFrameManager::ReResolveStyleContext(nsPresContext *aPresContext,
#ifdef ACCESSIBILITY
// Send notifications about visibility changes.
if (ourA11yNotification == eNotifyShown) {
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
nsIPresShell* presShell = aFrame->PresContext()->GetPresShell();
nsIContent* content = aFrame->GetContent();
@ -1543,8 +1542,7 @@ nsFrameManager::ReResolveStyleContext(nsPresContext *aPresContext,
content->GetNextSibling());
}
} else if (ourA11yNotification == eNotifyHidden) {
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
nsIPresShell* presShell = aFrame->PresContext()->GetPresShell();
nsIContent* content = aFrame->GetContent();

Просмотреть файл

@ -104,6 +104,9 @@ struct nsIntPoint;
struct nsIntRect;
class nsRefreshDriver;
class nsARefreshObserver;
#ifdef ACCESSIBILITY
class nsAccessibilityService;
#endif
typedef short SelectionType;
typedef PRUint64 nsFrameState;
@ -854,6 +857,13 @@ public:
static PRBool gIsAccessibilityActive;
static PRBool IsAccessibilityActive() { return gIsAccessibilityActive; }
#ifdef ACCESSIBILITY
/**
* Return accessibility service if accessibility is active.
*/
static nsAccessibilityService* AccService();
#endif
/**
* Stop all active elements (plugins and the caret) in this presentation and
* in the presentations of subdocuments. Resets painting to a suppressed state.

Просмотреть файл

@ -181,8 +181,7 @@
#include "nsIDOMHTMLLinkElement.h"
#include "nsITimer.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessible.h"
#include "nsAccessibilityService.h"
#endif
// For style data reconstruction
@ -1901,12 +1900,9 @@ PresShell::Destroy()
return;
#ifdef ACCESSIBILITY
if (gIsAccessibilityActive) {
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
if (accService) {
accService->PresShellDestroyed(this);
}
nsAccessibilityService* accService = AccService();
if (accService) {
accService->PresShellDestroyed(this);
}
#endif // ACCESSIBILITY
@ -4030,9 +4026,8 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, PRBool aScroll)
}
#ifdef ACCESSIBILITY
if (anchorTarget && gIsAccessibilityActive) {
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
if (anchorTarget) {
nsAccessibilityService* accService = AccService();
if (accService)
accService->NotifyOfAnchorJumpTo(anchorTarget);
}
@ -9258,6 +9253,23 @@ nsIFrame* nsIPresShell::GetAbsoluteContainingBlock(nsIFrame *aFrame)
return FrameConstructor()->GetAbsoluteContainingBlock(aFrame);
}
#ifdef ACCESSIBILITY
nsAccessibilityService*
nsIPresShell::AccService()
{
#ifdef MOZ_ENABLE_LIBXUL
return GetAccService();
#else
if (gIsAccessibilityActive) {
nsCOMPtr<nsIAccessibilityService> srv =
do_GetService("@mozilla.org/accessibilityService;1");
return static_cast<nsAccessibilityService*>(srv);
}
return nsnull;
#endif
}
#endif
void nsIPresShell::InitializeStatics()
{
NS_ASSERTION(sLiveShells == nsnull, "InitializeStatics called multiple times!");

Просмотреть файл

@ -77,7 +77,7 @@
#include "nsListControlFrame.h"
#include "nsContentCID.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsIServiceManager.h"
#include "nsIDOMNode.h"
@ -305,8 +305,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
already_AddRefed<nsAccessible>
nsComboboxControlFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
return accService->CreateHTMLComboboxAccessible(mContent,
PresContext()->PresShell());

Просмотреть файл

@ -57,7 +57,7 @@
#include "nsFont.h"
#include "nsCOMPtr.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsIServiceManager.h"
#include "nsDisplayList.h"
@ -655,8 +655,7 @@ nsFieldSetFrame::RemoveFrame(nsIAtom* aListName,
already_AddRefed<nsAccessible>
nsFieldSetFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
return accService->CreateHTMLGroupboxAccessible(mContent,
PresContext()->PresShell());

Просмотреть файл

@ -75,7 +75,7 @@
#include "nsIDOM3EventTarget.h"
#include "nsIDOMHTMLInputElement.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsInterfaceHashtable.h"
@ -720,7 +720,7 @@ already_AddRefed<nsAccessible>
nsFileControlFrame::CreateAccessible()
{
// Accessible object exists just to hold onto its children, for later shutdown
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (!accService)
return nsnull;

Просмотреть файл

@ -42,7 +42,7 @@
#include "nsIFormControl.h"
#include "nsINameSpaceManager.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsIServiceManager.h"
#include "nsIDOMNode.h"

Просмотреть файл

@ -40,7 +40,7 @@
#include "nsCOMPtr.h"
#include "nsCSSRendering.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsIServiceManager.h"
#include "nsIDOMHTMLInputElement.h"
@ -123,9 +123,7 @@ nsGfxCheckboxControlFrame::~nsGfxCheckboxControlFrame()
already_AddRefed<nsAccessible>
nsGfxCheckboxControlFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService
= do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
return accService->CreateHTMLCheckboxAccessible(mContent,
PresContext()->PresShell());

Просмотреть файл

@ -40,7 +40,7 @@
#include "nsCOMPtr.h"
#include "nsCSSRendering.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsIServiceManager.h"
#include "nsITheme.h"
@ -68,9 +68,7 @@ nsGfxRadioControlFrame::~nsGfxRadioControlFrame()
already_AddRefed<nsAccessible>
nsGfxRadioControlFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService
= do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
return accService->CreateHTMLRadioButtonAccessible(mContent,
PresContext()->PresShell());

Просмотреть файл

@ -64,7 +64,7 @@
#include "nsIDOMHTMLInputElement.h"
#include "nsStyleSet.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsDisplayList.h"
@ -113,8 +113,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame)
already_AddRefed<nsAccessible>
nsHTMLButtonControlFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
return IsInput() ?
accService->CreateHTMLButtonAccessible(mContent, PresContext()->PresShell()) :

Просмотреть файл

@ -56,7 +56,7 @@
#include "nsContainerFrame.h"
#include "nsLayoutUtils.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
void
@ -167,8 +167,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsImageControlFrameSuper)
already_AddRefed<nsAccessible>
nsImageControlFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
if (mContent->Tag() == nsGkAtoms::button) {
return accService->CreateHTML4ButtonAccessible(mContent, PresContext()->PresShell());

Просмотреть файл

@ -77,7 +77,7 @@
#include "nsIServiceManager.h"
#include "nsINodeInfo.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsISelectElement.h"
#include "nsIPrivateDOMEvent.h"
@ -406,8 +406,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsHTMLScrollFrame)
already_AddRefed<nsAccessible>
nsListControlFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
return accService->CreateHTMLListboxAccessible(mContent,
PresContext()->PresShell());

Просмотреть файл

@ -100,7 +100,7 @@
#include "nsIDOMRange.h" //for selection setting helper func
#include "nsPIDOMWindow.h" //needed for notify selection changed to update the menus ect.
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsIServiceManager.h"
#include "nsIDOMNode.h"
@ -145,8 +145,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame)
already_AddRefed<nsAccessible>
nsTextControlFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
return accService->CreateHTMLTextFieldAccessible(mContent,
PresContext()->PresShell());

Просмотреть файл

@ -50,7 +50,7 @@
#ifdef ACCESSIBILITY
#include "nsIServiceManager.h"
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
//FOR SELECTION
@ -296,7 +296,7 @@ BRFrame::PeekOffsetWord(PRBool aForward, PRBool aWordSelectEatSpace, PRBool aIsK
already_AddRefed<nsAccessible>
BRFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (!accService) {
return nsnull;
}

Просмотреть файл

@ -80,7 +80,7 @@
#include "nsIScrollableFrame.h"
#ifdef ACCESSIBILITY
#include "nsIDOMHTMLDocument.h"
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsLayoutUtils.h"
#include "nsDisplayList.h"
@ -6329,8 +6329,7 @@ nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
already_AddRefed<nsAccessible>
nsBlockFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (!accService) {
return nsnull;
}

Просмотреть файл

@ -74,7 +74,7 @@
#include "nsContentUtils.h"
#include "nsLayoutUtils.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsBidiUtils.h"
#include "nsFrameManager.h"
@ -950,8 +950,7 @@ nsHTMLScrollFrame::CreateAccessible()
return nsnull;
}
// Focusable via CSS, so needs to be in accessibility hierarchy
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
return accService->CreateHyperTextAccessible(mContent,
PresContext()->PresShell());

Просмотреть файл

@ -79,7 +79,7 @@
#include "nsImageMapUtils.h"
#include "nsIScriptSecurityManager.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsIServiceManager.h"
#include "nsIDOMNode.h"
@ -192,8 +192,7 @@ NS_QUERYFRAME_TAIL_INHERITING(ImageFrameSuper)
already_AddRefed<nsAccessible>
nsImageFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
return accService->CreateHTMLImageAccessible(mContent,
PresContext()->PresShell());

Просмотреть файл

@ -54,7 +54,7 @@
#include "nsFrameManager.h"
#ifdef ACCESSIBILITY
#include "nsIServiceManager.h"
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsDisplayList.h"
@ -932,7 +932,8 @@ nsInlineFrame::CreateAccessible()
if ((tagAtom == nsGkAtoms::img || tagAtom == nsGkAtoms::input ||
tagAtom == nsGkAtoms::label) && mContent->IsHTML()) {
// Only get accessibility service if we're going to use it
nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
nsAccessibilityService* accService = nsIPresShell::AccService();
if (!accService)
return nsnull;
if (tagAtom == nsGkAtoms::input) // Broken <input type=image ... />

Просмотреть файл

@ -166,7 +166,7 @@ enum { XKeyPress = KeyPress };
// accessibility support
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#ifdef MOZ_LOGGING
@ -635,7 +635,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsObjectFrameSuper)
already_AddRefed<nsAccessible>
nsObjectFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
return accService ?
accService->CreateHTMLObjectFrameAccessible(this, mContent,
PresContext()->PresShell()) :
@ -2348,12 +2348,9 @@ nsObjectFrame::Instantiate(nsIChannel* aChannel, nsIStreamListener** aStreamList
mPreventInstantiation = PR_FALSE;
#ifdef ACCESSIBILITY
if (PresContext()->PresShell()->IsAccessibilityActive()) {
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
if (accService) {
accService->RecreateAccessible(PresContext()->PresShell(), mContent);
}
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
accService->RecreateAccessible(PresContext()->PresShell(), mContent);
}
#endif
@ -2420,12 +2417,9 @@ nsObjectFrame::Instantiate(const char* aMimeType, nsIURI* aURI)
"Instantiation should still be prevented!");
#ifdef ACCESSIBILITY
if (PresContext()->PresShell()->IsAccessibilityActive()) {
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
if (accService) {
accService->RecreateAccessible(PresContext()->PresShell(), mContent);
}
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
accService->RecreateAccessible(PresContext()->PresShell(), mContent);
}
#endif

Просмотреть файл

@ -100,7 +100,7 @@ using mozilla::layout::RenderFrameParent;
// For Accessibility
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsIServiceManager.h"
@ -131,7 +131,7 @@ nsSubDocumentFrame::nsSubDocumentFrame(nsStyleContext* aContext)
already_AddRefed<nsAccessible>
nsSubDocumentFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
return accService ?
accService->CreateOuterDocAccessible(mContent, PresContext()->PresShell()) :
nsnull;

Просмотреть файл

@ -103,7 +103,7 @@
#include "nsIServiceManager.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsAutoPtr.h"
@ -3546,8 +3546,7 @@ nsTextFrame::CreateAccessible()
}
}
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
return accService->CreateHTMLTextAccessible(mContent,
PresContext()->PresShell());

Просмотреть файл

@ -62,7 +62,7 @@
#ifdef ACCESSIBILITY
#include "nsIServiceManager.h"
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
using namespace mozilla;
@ -468,8 +468,7 @@ nsVideoFrame::GetType() const
already_AddRefed<nsAccessible>
nsVideoFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
return accService ?
accService->CreateHTMLMediaAccessible(mContent, PresContext()->PresShell()) :
nsnull;

Просмотреть файл

@ -54,7 +54,7 @@
#include "nsCOMPtr.h"
#include "nsIDOMHTMLTableCellElement.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsIServiceManager.h"
#include "nsIDOMNode.h"
@ -992,8 +992,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame)
already_AddRefed<nsAccessible>
nsTableCellFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
return accService->CreateHTMLTableCellAccessible(mContent,
PresContext()->PresShell());

Просмотреть файл

@ -48,7 +48,7 @@
#include "nsHTMLParts.h"
#include "nsIPresShell.h"
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#endif
#include "nsIServiceManager.h"
#include "nsIDOMNode.h"
@ -150,7 +150,7 @@ already_AddRefed<nsAccessible>
nsTableCaptionFrame::CreateAccessible()
{
if (!GetRect().IsEmpty()) {
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
return accService->CreateHTMLCaptionAccessible(mContent,
PresContext()->PresShell());
@ -196,8 +196,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame)
already_AddRefed<nsAccessible>
nsTableOuterFrame::CreateAccessible()
{
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
return accService->CreateHTMLTableAccessible(mContent,
PresContext()->PresShell());