Backout 0b205d34aefc (bug 673405), 3327d251ce49 (bug 672504) for mochitest-other leaks

This commit is contained in:
Ed Morley 2012-02-08 01:23:12 +00:00
Родитель 9e5d1c9ab6
Коммит 3f6fc388b8
105 изменённых файлов: 862 добавлений и 875 удалений

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

@ -162,9 +162,9 @@ mai_atk_socket_get_extents(AtkComponent* aComponent,
}
AtkSocketAccessible::AtkSocketAccessible(nsIContent* aContent,
nsDocAccessible* aDoc,
nsIWeakReference* aShell,
const nsCString& aPlugId) :
nsAccessibleWrap(aContent, aDoc)
nsAccessibleWrap(aContent, aShell)
{
mAtkObject = mai_atk_socket_new(this);
if (!mAtkObject)

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

@ -72,7 +72,7 @@ public:
*/
static bool gCanEmbed;
AtkSocketAccessible(nsIContent* aContent, nsDocAccessible* aDoc,
AtkSocketAccessible(nsIContent* aContent, nsIWeakReference* aShell,
const nsCString& aPlugId);
// nsAccessNode

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

@ -55,8 +55,8 @@
//-----------------------------------------------------
nsAccessNodeWrap::
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessNode(aContent, aDoc)
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessNode(aContent, aShell)
{
}

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

@ -49,11 +49,12 @@
class nsAccessNodeWrap : public nsAccessNode
{
public: // construction, destruction
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsAccessNodeWrap();
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsAccessNodeWrap();
static void InitAccessibility();
static void ShutdownAccessibility();
static void InitAccessibility();
static void ShutdownAccessibility();
};
#endif

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

@ -281,8 +281,8 @@ PRInt32 nsAccessibleWrap::mAccWrapDeleted = 0;
#endif
nsAccessibleWrap::
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessible(aContent, aDoc), mAtkObject(nsnull)
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessible(aContent, aShell), mAtkObject(nsnull)
{
#ifdef MAI_LOGGING
++mAccWrapCreated;
@ -362,7 +362,7 @@ NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface(void **aOutAccessible)
*aOutAccessible = nsnull;
if (!mAtkObject) {
if (IsDefunct() || !nsAccUtils::IsEmbeddedObject(this)) {
if (!mWeakShell || !nsAccUtils::IsEmbeddedObject(this)) {
// We don't create ATK objects for node which has been shutdown, or
// nsIAccessible plain text leaves
return NS_ERROR_FAILURE;

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

@ -84,7 +84,7 @@ class MaiHyperlink;
class nsAccessibleWrap: public nsAccessible
{
public:
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsAccessibleWrap();
void ShutdownAtkObject();

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

@ -63,11 +63,8 @@ FocusManager::FocusedAccessible() const
return mActiveItem;
nsINode* focusedNode = FocusedDOMNode();
if (focusedNode) {
nsDocAccessible* doc =
GetAccService()->GetDocAccessible(focusedNode->OwnerDoc());
return doc ? doc->GetAccessibleOrContainer(focusedNode) : nsnull;
}
if (focusedNode)
return GetAccService()->GetAccessibleOrContainer(focusedNode, nsnull);
return nsnull;
}
@ -87,10 +84,8 @@ FocusManager::IsFocused(const nsAccessible* aAccessible) const
// FocusedAccessible() method call. Make sure this issue is fixed in
// bug 638465.
if (focusedNode->OwnerDoc() == aAccessible->GetNode()->OwnerDoc()) {
nsDocAccessible* doc =
GetAccService()->GetDocAccessible(focusedNode->OwnerDoc());
return aAccessible ==
(doc ? doc->GetAccessibleOrContainer(focusedNode) : nsnull);
GetAccService()->GetAccessibleOrContainer(focusedNode, nsnull);
}
}
return false;
@ -214,7 +209,7 @@ FocusManager::ActiveItemChanged(nsAccessible* aItem, bool aCheckIfActive)
// DOM focus.
nsAccessible* target = FocusedAccessible();
if (target)
DispatchFocusEvent(target->Document(), target);
DispatchFocusEvent(target->GetDocAccessible(), target);
}
void
@ -256,11 +251,11 @@ FocusManager::ProcessDOMFocus(nsINode* aTarget)
GetAccService()->GetDocAccessible(aTarget->OwnerDoc());
nsAccessible* target = document->GetAccessibleOrContainer(aTarget);
if (target && document) {
if (target) {
// Check if still focused. Otherwise we can end up with storing the active
// item for control that isn't focused anymore.
nsAccessible* DOMFocus =
document->GetAccessibleOrContainer(FocusedDOMNode());
GetAccService()->GetAccessibleOrContainer(FocusedDOMNode(), nsnull);
if (target != DOMFocus)
return;
@ -290,8 +285,7 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
// Check if still focused. Otherwise we can end up with storing the active
// item for control that isn't focused anymore.
nsAccessible* DOMFocus =
GetAccService()->GetAccessibleOrContainer(FocusedDOMNode(),
aEvent->GetDocAccessible());
GetAccService()->GetAccessibleOrContainer(FocusedDOMNode(), nsnull);
if (target != DOMFocus)
return;
@ -347,7 +341,7 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
// Fire scrolling_start event when the document receives the focus if it has
// an anchor jump. If an accessible within the document receive the focus
// then null out the anchor jump because it no longer applies.
nsDocAccessible* targetDocument = target->Document();
nsDocAccessible* targetDocument = target->GetDocAccessible();
nsAccessible* anchorJump = targetDocument->AnchorJump();
if (anchorJump) {
if (target == targetDocument) {

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

@ -671,7 +671,7 @@ NotificationController::CreateTextChangeEventFor(AccMutationEvent* aEvent)
{
nsAccessible* container =
GetAccService()->GetContainerAccessible(aEvent->mNode,
aEvent->GetDocAccessible());
aEvent->mAccessible->GetWeakShell());
if (!container)
return;

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

@ -57,8 +57,8 @@ using namespace mozilla::a11y;
// Constructor
nsARIAGridAccessible::
nsARIAGridAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsARIAGridAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}
@ -932,8 +932,8 @@ nsARIAGridAccessible::GetSelectedColumnsArray(PRUint32 *acolumnCount,
// Constructor
nsARIAGridCellAccessible::
nsARIAGridCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsARIAGridCellAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}

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

@ -50,7 +50,7 @@ class nsARIAGridAccessible : public nsAccessibleWrap,
public nsIAccessibleTable
{
public:
nsARIAGridAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsARIAGridAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -110,7 +110,7 @@ class nsARIAGridCellAccessible : public nsHyperTextAccessibleWrap,
public nsIAccessibleTableCell
{
public:
nsARIAGridCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsARIAGridCellAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED

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

@ -353,11 +353,11 @@ nsAccUtils::GetARIAToken(dom::Element* aElement, nsIAtom* aAttr)
return nsnull;
}
nsAccessible*
nsAccessible *
nsAccUtils::GetAncestorWithRole(nsAccessible *aDescendant, PRUint32 aRole)
{
nsAccessible* document = aDescendant->Document();
nsAccessible* parent = aDescendant;
nsAccessible *document = aDescendant->GetDocAccessible();
nsAccessible *parent = aDescendant;
while ((parent = parent->Parent())) {
PRUint32 testRole = parent->Role();
if (testRole == aRole)
@ -425,12 +425,11 @@ nsAccUtils::GetTextAccessibleFromSelection(nsISelection* aSelection)
nsCOMPtr<nsINode> focusNode(do_QueryInterface(focusDOMNode));
nsCOMPtr<nsINode> resultNode =
nsCoreUtils::GetDOMNodeFromDOMPoint(focusNode, focusOffset);
nsCOMPtr<nsIWeakReference> weakShell(nsCoreUtils::GetWeakShellFor(resultNode));
// Get text accessible containing the result node.
nsDocAccessible* doc =
GetAccService()->GetDocAccessible(resultNode->OwnerDoc());
nsAccessible* accessible = doc ?
doc->GetAccessibleOrContainer(resultNode) : nsnull;
nsAccessible* accessible =
GetAccService()->GetAccessibleOrContainer(resultNode, weakShell);
if (!accessible) {
NS_NOTREACHED("No nsIAccessibleText for selection change event!");
return nsnull;
@ -526,8 +525,9 @@ nsAccUtils::GetScreenCoordsForWindow(nsAccessNode *aAccessNode)
nsIntPoint
nsAccUtils::GetScreenCoordsForParent(nsAccessNode *aAccessNode)
{
nsDocAccessible* document = aAccessNode->Document();
nsAccessible* parent = document->GetContainerAccessible(aAccessNode->GetNode());
nsAccessible *parent =
GetAccService()->GetContainerAccessible(aAccessNode->GetNode(),
aAccessNode->GetWeakShell());
if (!parent)
return nsIntPoint(0, 0);

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

@ -156,10 +156,11 @@ public:
/**
* Return document accessible for the given presshell.
*/
static nsDocAccessible* GetDocAccessibleFor(const nsIPresShell* aPresShell)
static nsDocAccessible *GetDocAccessibleFor(nsIWeakReference *aWeakShell)
{
return aPresShell ?
GetAccService()->GetDocAccessible(aPresShell->GetDocument()) : nsnull;
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(aWeakShell));
return presShell ?
GetAccService()->GetDocAccessible(presShell->GetDocument()) : nsnull;
}
/**

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

@ -89,8 +89,8 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_DESTROY(nsAccessNode, LastRelease())
// nsAccessNode construction/desctruction
nsAccessNode::
nsAccessNode(nsIContent* aContent, nsDocAccessible* aDoc) :
mContent(aContent), mDoc(aDoc)
nsAccessNode(nsIContent *aContent, nsIWeakReference *aShell) :
mContent(aContent), mWeakShell(aShell)
{
#ifdef DEBUG_A11Y
mIsInitialized = false;
@ -99,15 +99,15 @@ nsAccessNode::
nsAccessNode::~nsAccessNode()
{
NS_ASSERTION(!mDoc, "LastRelease was never called!?!");
NS_ASSERTION(!mWeakShell, "LastRelease was never called!?!");
}
void nsAccessNode::LastRelease()
{
// First cleanup if needed...
if (mDoc) {
if (mWeakShell) {
Shutdown();
NS_ASSERTION(!mDoc, "A Shutdown() impl forgot to call its parent's Shutdown?");
NS_ASSERTION(!mWeakShell, "A Shutdown() impl forgot to call its parent's Shutdown?");
}
// ... then die.
delete this;
@ -133,7 +133,7 @@ void
nsAccessNode::Shutdown()
{
mContent = nsnull;
mDoc = nsnull;
mWeakShell = nsnull;
}
nsApplicationAccessible*
@ -215,15 +215,31 @@ void nsAccessNode::ShutdownXPAccessibility()
NotifyA11yInitOrShutdown(false);
}
already_AddRefed<nsIPresShell>
nsAccessNode::GetPresShell()
{
nsIPresShell* presShell = nsnull;
if (mWeakShell)
CallQueryReferent(mWeakShell.get(), &presShell);
return presShell;
}
// nsAccessNode protected
nsPresContext* nsAccessNode::GetPresContext()
{
if (IsDefunct())
nsCOMPtr<nsIPresShell> presShell(GetPresShell());
if (!presShell) {
return nsnull;
}
return presShell->GetPresContext();
}
nsIPresShell* presShell(mDoc->PresShell());
return presShell ? presShell->GetPresContext() : nsnull;
nsDocAccessible *
nsAccessNode::GetDocAccessible() const
{
return mContent ?
GetAccService()->GetDocAccessible(mContent->OwnerDoc()) : nsnull;
}
nsRootAccessible*
@ -265,7 +281,7 @@ nsAccessNode::ScrollTo(PRUint32 aScrollType)
if (IsDefunct())
return;
nsIPresShell* shell = mDoc->PresShell();
nsCOMPtr<nsIPresShell> shell(GetPresShell());
if (!shell)
return;
@ -289,7 +305,9 @@ nsAccessNode::GetCurrentFocus()
{
// XXX: consider to use nsFocusManager directly, it allows us to avoid
// unnecessary query interface calls.
nsIDocument* doc = GetDocumentNode();
nsCOMPtr<nsIPresShell> shell = GetPresShell();
NS_ENSURE_TRUE(shell, nsnull);
nsIDocument *doc = shell->GetDocument();
NS_ENSURE_TRUE(doc, nsnull);
nsIDOMWindow* win = doc->GetWindow();

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

@ -71,7 +71,7 @@ class nsAccessNode: public nsISupports
{
public:
nsAccessNode(nsIContent* aContent, nsDocAccessible* aDoc);
nsAccessNode(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsAccessNode();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@ -88,7 +88,7 @@ public:
/**
* Return the document accessible for this access node.
*/
nsDocAccessible* Document() const { return mDoc; }
nsDocAccessible *GetDocAccessible() const;
/**
* Return the root document accessible for this accessnode.
@ -147,6 +147,16 @@ public:
return GetNode() && GetNode()->IsNodeOfType(nsINode::eDOCUMENT);
}
/**
* Return the corresponding press shell for this accessible.
*/
already_AddRefed<nsIPresShell> GetPresShell();
/**
* Return presentation shell for the accessible.
*/
nsIWeakReference* GetWeakShell() const { return mWeakShell; }
/**
* Return the unique identifier of the accessible.
*/
@ -179,7 +189,7 @@ protected:
void LastRelease();
nsCOMPtr<nsIContent> mContent;
nsDocAccessible* mDoc;
nsCOMPtr<nsIWeakReference> mWeakShell;
/**
* Notify global nsIObserver's that a11y is getting init'd or shutdown

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

@ -205,15 +205,14 @@ nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell,
}
return nsnull;
}
already_AddRefed<nsAccessible>
nsAccessibilityService::CreateOuterDocAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsOuterDocAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsOuterDocAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -221,10 +220,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTML4ButtonAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTML4ButtonAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTML4ButtonAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -232,10 +230,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLButtonAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLButtonAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLButtonAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -243,10 +240,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLLIAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLLIAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLLIAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -254,10 +250,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHyperTextAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHyperTextAccessibleWrap(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHyperTextAccessibleWrap(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -265,10 +260,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLCheckboxAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLCheckboxAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLCheckboxAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -276,10 +270,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLComboboxAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLComboboxAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLComboboxAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -287,10 +280,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLCanvasAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLCanvasAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLCanvasAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -298,10 +290,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLFileInputAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLFileInputAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLFileInputAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -316,13 +307,11 @@ nsAccessibilityService::CreateHTMLImageAccessible(nsIContent* aContent,
mapElm = do_QueryInterface(document->FindImageMap(mapElmName));
}
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = mapElm ?
new nsHTMLImageMapAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell),
mapElm) :
new nsHTMLImageAccessibleWrap(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
new nsHTMLImageMapAccessible(aContent, weakShell, mapElm) :
new nsHTMLImageAccessibleWrap(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -330,10 +319,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLGroupboxAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLGroupboxAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLGroupboxAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -341,10 +329,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLListboxAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLSelectListAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLSelectListAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -352,11 +339,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLMediaAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsEnumRoleAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell),
roles::GROUPING);
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsEnumRoleAccessible(aContent, weakShell,
roles::GROUPING);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -376,6 +362,7 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
if (aFrame->GetRect().IsEmpty())
return nsnull;
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
// 1) for object elements containing either HTML or TXT documents
nsCOMPtr<nsIDOMHTMLObjectElement> obj(do_QueryInterface(aContent));
@ -396,11 +383,10 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
HWND pluginPort = nsnull;
aFrame->GetPluginPort(&pluginPort);
nsAccessible* accessible =
new nsHTMLWin32ObjectOwnerAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell),
pluginPort);
NS_ADDREF(accessible);
nsAccessible* accessible = new nsHTMLWin32ObjectOwnerAccessible(aContent,
weakShell,
pluginPort);
NS_IF_ADDREF(accessible);
return accessible;
#elif MOZ_ACCESSIBILITY_ATK
@ -412,11 +398,9 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
NPPVpluginNativeAccessibleAtkPlugId, &plugId);
if (NS_SUCCEEDED(rv) && !plugId.IsEmpty()) {
AtkSocketAccessible* socketAccessible =
new AtkSocketAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell),
plugId);
new AtkSocketAccessible(aContent, weakShell, plugId);
NS_ADDREF(socketAccessible);
NS_IF_ADDREF(socketAccessible);
return socketAccessible;
}
#endif
@ -433,10 +417,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLRadioButtonAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLRadioButtonAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLRadioButtonAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -444,10 +427,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLTableAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLTableAccessibleWrap(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLTableAccessibleWrap(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -455,10 +437,10 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLTableCellAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLTableCellAccessibleWrap(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLTableCellAccessibleWrap(aContent,
weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -466,10 +448,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLTextAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLTextAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLTextAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -477,10 +458,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLTextFieldAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLTextFieldAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLTextFieldAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -488,10 +468,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLLabelAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLLabelAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLLabelAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -499,10 +478,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLHRAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLHRAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLHRAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -510,10 +488,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLBRAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLBRAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLBRAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -521,10 +498,9 @@ already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLCaptionAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsHTMLCaptionAccessible(aContent,
nsAccUtils::GetDocAccessibleFor(aPresShell));
NS_ADDREF(accessible);
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
nsAccessible* accessible = new nsHTMLCaptionAccessible(aContent, weakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -931,14 +907,15 @@ nsAccessibilityService::GetAccessible(nsINode* aNode)
}
nsAccessible*
nsAccessibilityService::GetAccessibleOrContainer(nsINode* aNode, nsDocAccessible* aDoc)
nsAccessibilityService::GetAccessibleOrContainer(nsINode* aNode,
nsIWeakReference* aWeakShell)
{
if (!aNode)
return nsnull;
NS_PRECONDITION(aDoc, "Must pass a document accessible.");
return aDoc ? aDoc->GetAccessibleOrContainer(aNode) : nsnull;
// XXX: weak shell is ignored until multiple shell documents are supported.
nsDocAccessible* document = GetDocAccessible(aNode->OwnerDoc());
return document ? document->GetAccessibleOrContainer(aNode) : nsnull;
}
static bool HasRelatedContent(nsIContent *aContent)
@ -1080,7 +1057,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
return nsnull;
}
newAcc = new nsHyperTextAccessibleWrap(content, docAcc);
newAcc = new nsHyperTextAccessibleWrap(content, aWeakShell);
if (docAcc->BindToDocument(newAcc, nsAccUtils::GetRoleMapEntry(aNode)))
return newAcc;
return nsnull;
@ -1174,12 +1151,12 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
if (roleMapEntry->role == roles::TABLE ||
roleMapEntry->role == roles::TREE_TABLE) {
newAcc = new nsARIAGridAccessibleWrap(content, docAcc);
newAcc = new nsARIAGridAccessibleWrap(content, aWeakShell);
} else if (roleMapEntry->role == roles::GRID_CELL ||
roleMapEntry->role == roles::ROWHEADER ||
roleMapEntry->role == roles::COLUMNHEADER) {
newAcc = new nsARIAGridCellAccessibleWrap(content, docAcc);
newAcc = new nsARIAGridCellAccessibleWrap(content, aWeakShell);
}
}
}
@ -1191,7 +1168,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// we do not call it if accessibles for table related content are
// prevented above.
newAcc = CreateHTMLAccessibleByMarkup(weakFrame.GetFrame(), content,
docAcc);
aWeakShell);
if (!newAcc) {
// Do not create accessible object subtrees for non-rendered table
@ -1223,24 +1200,24 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
if (!newAcc) {
// Elements may implement nsIAccessibleProvider via XBL. This allows them to
// say what kind of accessible to create.
newAcc = CreateAccessibleByType(content, docAcc);
newAcc = CreateAccessibleByType(content, aWeakShell);
}
if (!newAcc) {
// Create generic accessibles for SVG and MathML nodes.
if (content->IsSVG(nsGkAtoms::svg)) {
newAcc = new nsEnumRoleAccessible(content, docAcc,
newAcc = new nsEnumRoleAccessible(content, aWeakShell,
roles::DIAGRAM);
}
else if (content->IsMathML(nsGkAtoms::math)) {
newAcc = new nsEnumRoleAccessible(content, docAcc,
newAcc = new nsEnumRoleAccessible(content, aWeakShell,
roles::EQUATION);
}
}
if (!newAcc) {
newAcc = CreateAccessibleForDeckChild(weakFrame.GetFrame(), content,
docAcc);
aWeakShell);
}
// If no accessible, see if we need to create a generic accessible because
@ -1257,11 +1234,11 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// other accessibles can point to it, or so that it can hold a state, etc.
if (isHTML) {
// Interesting HTML container which may have selectable text and/or embedded objects
newAcc = new nsHyperTextAccessibleWrap(content, docAcc);
newAcc = new nsHyperTextAccessibleWrap(content, aWeakShell);
}
else { // XUL, SVG, MathML etc.
// Interesting generic non-HTML container
newAcc = new nsAccessibleWrap(content, docAcc);
newAcc = new nsAccessibleWrap(content, aWeakShell);
}
}
@ -1342,7 +1319,7 @@ nsAccessibilityService::HasUniversalAriaProperty(nsIContent *aContent)
already_AddRefed<nsAccessible>
nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
nsDocAccessible* aDoc)
nsIWeakReference* aWeakShell)
{
nsCOMPtr<nsIAccessibleProvider> accessibleProvider(do_QueryInterface(aContent));
if (!accessibleProvider)
@ -1354,7 +1331,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
return nsnull;
if (type == nsIAccessibleProvider::OuterDoc) {
nsAccessible* accessible = new nsOuterDocAccessible(aContent, aDoc);
nsAccessible* accessible = new nsOuterDocAccessible(aContent, aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -1368,35 +1345,35 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
// XUL controls
case nsIAccessibleProvider::XULAlert:
accessible = new nsXULAlertAccessible(aContent, aDoc);
accessible = new nsXULAlertAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULButton:
accessible = new nsXULButtonAccessible(aContent, aDoc);
accessible = new nsXULButtonAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULCheckbox:
accessible = new nsXULCheckboxAccessible(aContent, aDoc);
accessible = new nsXULCheckboxAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULColorPicker:
accessible = new nsXULColorPickerAccessible(aContent, aDoc);
accessible = new nsXULColorPickerAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULColorPickerTile:
accessible = new nsXULColorPickerTileAccessible(aContent, aDoc);
accessible = new nsXULColorPickerTileAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULCombobox:
accessible = new nsXULComboboxAccessible(aContent, aDoc);
accessible = new nsXULComboboxAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULDropmarker:
accessible = new nsXULDropmarkerAccessible(aContent, aDoc);
accessible = new nsXULDropmarkerAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULGroupbox:
accessible = new nsXULGroupboxAccessible(aContent, aDoc);
accessible = new nsXULGroupboxAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULImage:
@ -1406,40 +1383,40 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
nsGkAtoms::tooltiptext))
return nsnull;
accessible = new nsHTMLImageAccessibleWrap(aContent, aDoc);
accessible = new nsHTMLImageAccessibleWrap(aContent, aWeakShell);
break;
}
case nsIAccessibleProvider::XULLink:
accessible = new nsXULLinkAccessible(aContent, aDoc);
accessible = new nsXULLinkAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULListbox:
accessible = new nsXULListboxAccessibleWrap(aContent, aDoc);
accessible = new nsXULListboxAccessibleWrap(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULListCell:
accessible = new nsXULListCellAccessibleWrap(aContent, aDoc);
accessible = new nsXULListCellAccessibleWrap(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULListHead:
accessible = new nsXULColumnsAccessible(aContent, aDoc);
accessible = new nsXULColumnsAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULListHeader:
accessible = new nsXULColumnItemAccessible(aContent, aDoc);
accessible = new nsXULColumnItemAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULListitem:
accessible = new nsXULListitemAccessible(aContent, aDoc);
accessible = new nsXULListitemAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULMenubar:
accessible = new nsXULMenubarAccessible(aContent, aDoc);
accessible = new nsXULMenubarAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULMenuitem:
accessible = new nsXULMenuitemAccessibleWrap(aContent, aDoc);
accessible = new nsXULMenuitemAccessibleWrap(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULMenupopup:
@ -1455,167 +1432,167 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
kNameSpaceID_XUL))
return nsnull;
#endif
accessible = new nsXULMenupopupAccessible(aContent, aDoc);
accessible = new nsXULMenupopupAccessible(aContent, aWeakShell);
break;
}
case nsIAccessibleProvider::XULMenuSeparator:
accessible = new nsXULMenuSeparatorAccessible(aContent, aDoc);
accessible = new nsXULMenuSeparatorAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULPane:
accessible = new nsEnumRoleAccessible(aContent, aDoc,
accessible = new nsEnumRoleAccessible(aContent, aWeakShell,
roles::PANE);
break;
case nsIAccessibleProvider::XULProgressMeter:
accessible = new XULProgressMeterAccessible(aContent, aDoc);
accessible = new XULProgressMeterAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULStatusBar:
accessible = new nsXULStatusBarAccessible(aContent, aDoc);
accessible = new nsXULStatusBarAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULScale:
accessible = new nsXULSliderAccessible(aContent, aDoc);
accessible = new nsXULSliderAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULRadioButton:
accessible = new nsXULRadioButtonAccessible(aContent, aDoc);
accessible = new nsXULRadioButtonAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULRadioGroup:
accessible = new nsXULRadioGroupAccessible(aContent, aDoc);
accessible = new nsXULRadioGroupAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULTab:
accessible = new nsXULTabAccessible(aContent, aDoc);
accessible = new nsXULTabAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULTabs:
accessible = new nsXULTabsAccessible(aContent, aDoc);
accessible = new nsXULTabsAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULTabpanels:
accessible = new nsXULTabpanelsAccessible(aContent, aDoc);
accessible = new nsXULTabpanelsAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULText:
accessible = new nsXULTextAccessible(aContent, aDoc);
accessible = new nsXULTextAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULTextBox:
accessible = new nsXULTextFieldAccessible(aContent, aDoc);
accessible = new nsXULTextFieldAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULThumb:
accessible = new nsXULThumbAccessible(aContent, aDoc);
accessible = new nsXULThumbAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULTree:
return CreateAccessibleForXULTree(aContent, aDoc);
return CreateAccessibleForXULTree(aContent, aWeakShell);
case nsIAccessibleProvider::XULTreeColumns:
accessible = new nsXULTreeColumnsAccessible(aContent, aDoc);
accessible = new nsXULTreeColumnsAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULTreeColumnItem:
accessible = new nsXULColumnItemAccessible(aContent, aDoc);
accessible = new nsXULColumnItemAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULToolbar:
accessible = new nsXULToolbarAccessible(aContent, aDoc);
accessible = new nsXULToolbarAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULToolbarSeparator:
accessible = new nsXULToolbarSeparatorAccessible(aContent, aDoc);
accessible = new nsXULToolbarSeparatorAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULTooltip:
accessible = new nsXULTooltipAccessible(aContent, aDoc);
accessible = new nsXULTooltipAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XULToolbarButton:
accessible = new nsXULToolbarButtonAccessible(aContent, aDoc);
accessible = new nsXULToolbarButtonAccessible(aContent, aWeakShell);
break;
#endif // MOZ_XUL
// XForms elements
case nsIAccessibleProvider::XFormsContainer:
accessible = new nsXFormsContainerAccessible(aContent, aDoc);
accessible = new nsXFormsContainerAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsLabel:
accessible = new nsXFormsLabelAccessible(aContent, aDoc);
accessible = new nsXFormsLabelAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsOutput:
accessible = new nsXFormsOutputAccessible(aContent, aDoc);
accessible = new nsXFormsOutputAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsTrigger:
accessible = new nsXFormsTriggerAccessible(aContent, aDoc);
accessible = new nsXFormsTriggerAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsInput:
accessible = new nsXFormsInputAccessible(aContent, aDoc);
accessible = new nsXFormsInputAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsInputBoolean:
accessible = new nsXFormsInputBooleanAccessible(aContent, aDoc);
accessible = new nsXFormsInputBooleanAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsInputDate:
accessible = new nsXFormsInputDateAccessible(aContent, aDoc);
accessible = new nsXFormsInputDateAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsSecret:
accessible = new nsXFormsSecretAccessible(aContent, aDoc);
accessible = new nsXFormsSecretAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsSliderRange:
accessible = new nsXFormsRangeAccessible(aContent, aDoc);
accessible = new nsXFormsRangeAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsSelect:
accessible = new nsXFormsSelectAccessible(aContent, aDoc);
accessible = new nsXFormsSelectAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsChoices:
accessible = new nsXFormsChoicesAccessible(aContent, aDoc);
accessible = new nsXFormsChoicesAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsSelectFull:
accessible = new nsXFormsSelectFullAccessible(aContent, aDoc);
accessible = new nsXFormsSelectFullAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsItemCheckgroup:
accessible = new nsXFormsItemCheckgroupAccessible(aContent, aDoc);
accessible = new nsXFormsItemCheckgroupAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsItemRadiogroup:
accessible = new nsXFormsItemRadiogroupAccessible(aContent, aDoc);
accessible = new nsXFormsItemRadiogroupAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsSelectCombobox:
accessible = new nsXFormsSelectComboboxAccessible(aContent, aDoc);
accessible = new nsXFormsSelectComboboxAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsItemCombobox:
accessible = new nsXFormsItemComboboxAccessible(aContent, aDoc);
accessible = new nsXFormsItemComboboxAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsDropmarkerWidget:
accessible = new nsXFormsDropmarkerWidgetAccessible(aContent, aDoc);
accessible = new nsXFormsDropmarkerWidgetAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsCalendarWidget:
accessible = new nsXFormsCalendarWidgetAccessible(aContent, aDoc);
accessible = new nsXFormsCalendarWidgetAccessible(aContent, aWeakShell);
break;
case nsIAccessibleProvider::XFormsComboboxPopupWidget:
accessible = new nsXFormsComboboxPopupWidgetAccessible(aContent, aDoc);
accessible = new nsXFormsComboboxPopupWidgetAccessible(aContent, aWeakShell);
break;
default:
@ -1629,45 +1606,46 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
nsIContent* aContent,
nsDocAccessible* aDoc)
nsIWeakReference* aWeakShell)
{
// This method assumes we're in an HTML namespace.
nsIAtom* tag = aContent->Tag();
if (tag == nsGkAtoms::figcaption) {
nsAccessible* accessible =
new nsHTMLFigcaptionAccessible(aContent, aDoc);
new nsHTMLFigcaptionAccessible(aContent, aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::figure) {
nsAccessible* accessible = new nsHTMLFigureAccessible(aContent, aDoc);
nsAccessible* accessible = new nsHTMLFigureAccessible(aContent, aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::legend) {
nsAccessible* accessible = new nsHTMLLegendAccessible(aContent, aDoc);
nsAccessible* accessible = new nsHTMLLegendAccessible(aContent, aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::option) {
nsAccessible* accessible = new nsHTMLSelectOptionAccessible(aContent, aDoc);
nsAccessible* accessible = new nsHTMLSelectOptionAccessible(aContent,
aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::optgroup) {
nsAccessible* accessible = new nsHTMLSelectOptGroupAccessible(aContent,
aDoc);
aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::ul || tag == nsGkAtoms::ol ||
tag == nsGkAtoms::dl) {
nsAccessible* accessible = new nsHTMLListAccessible(aContent, aDoc);
nsAccessible* accessible = new nsHTMLListAccessible(aContent, aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -1678,12 +1656,13 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
nsRoleMapEntry *roleMapEntry = nsAccUtils::GetRoleMapEntry(aContent);
if (roleMapEntry && roleMapEntry->role != roles::NOTHING &&
roleMapEntry->role != roles::LINK) {
nsAccessible* accessible = new nsHyperTextAccessibleWrap(aContent, aDoc);
nsAccessible* accessible = new nsHyperTextAccessibleWrap(aContent,
aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
nsAccessible* accessible = new nsHTMLLinkAccessible(aContent, aDoc);
nsAccessible* accessible = new nsHTMLLinkAccessible(aContent, aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -1694,7 +1673,7 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
// Normally for li, it is created by the list item frame (in nsBlockFrame)
// which knows about the bullet frame; however, in this case the list item
// must have been styled using display: foo
nsAccessible* accessible = new nsHTMLLIAccessible(aContent, aDoc);
nsAccessible* accessible = new nsHTMLLIAccessible(aContent, aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -1711,13 +1690,13 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
tag == nsGkAtoms::h5 ||
tag == nsGkAtoms::h6 ||
tag == nsGkAtoms::q) {
nsAccessible* accessible = new nsHyperTextAccessibleWrap(aContent, aDoc);
nsAccessible* accessible = new nsHyperTextAccessibleWrap(aContent, aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::tr) {
nsAccessible* accessible = new nsEnumRoleAccessible(aContent, aDoc,
nsAccessible* accessible = new nsEnumRoleAccessible(aContent, aWeakShell,
roles::ROW);
NS_IF_ADDREF(accessible);
return accessible;
@ -1725,20 +1704,20 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
if (nsCoreUtils::IsHTMLTableHeader(aContent)) {
nsAccessible* accessible = new nsHTMLTableHeaderCellAccessibleWrap(aContent,
aDoc);
aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::output) {
nsAccessible* accessible = new nsHTMLOutputAccessible(aContent, aDoc);
nsAccessible* accessible = new nsHTMLOutputAccessible(aContent, aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::progress) {
nsAccessible* accessible =
new HTMLProgressMeterAccessible(aContent, aDoc);
new HTMLProgressMeterAccessible(aContent, aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
@ -1822,7 +1801,7 @@ NS_GetAccessibilityService(nsIAccessibilityService** aResult)
already_AddRefed<nsAccessible>
nsAccessibilityService::CreateAccessibleForDeckChild(nsIFrame* aFrame,
nsIContent* aContent,
nsDocAccessible* aDoc)
nsIWeakReference* aWeakShell)
{
if (aFrame->GetType() == nsGkAtoms::boxFrame ||
aFrame->GetType() == nsGkAtoms::scrollFrame) {
@ -1835,12 +1814,13 @@ nsAccessibilityService::CreateAccessibleForDeckChild(nsIFrame* aFrame,
#ifdef MOZ_XUL
if (parentContent->NodeInfo()->Equals(nsGkAtoms::tabpanels,
kNameSpaceID_XUL)) {
nsAccessible* accessible = new nsXULTabpanelAccessible(aContent, aDoc);
nsAccessible* accessible = new nsXULTabpanelAccessible(aContent,
aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
#endif
nsAccessible* accessible = new nsEnumRoleAccessible(aContent, aDoc,
nsAccessible* accessible = new nsEnumRoleAccessible(aContent, aWeakShell,
roles::PROPERTYPAGE);
NS_IF_ADDREF(accessible);
return accessible;
@ -1853,7 +1833,7 @@ nsAccessibilityService::CreateAccessibleForDeckChild(nsIFrame* aFrame,
#ifdef MOZ_XUL
already_AddRefed<nsAccessible>
nsAccessibilityService::CreateAccessibleForXULTree(nsIContent* aContent,
nsDocAccessible* aDoc)
nsIWeakReference* aWeakShell)
{
nsCOMPtr<nsITreeBoxObject> treeBoxObj = nsCoreUtils::GetTreeBoxObject(aContent);
if (!treeBoxObj)
@ -1869,13 +1849,13 @@ nsAccessibilityService::CreateAccessibleForXULTree(nsIContent* aContent,
// Outline of list accessible.
if (count == 1) {
nsAccessible* accessible = new nsXULTreeAccessible(aContent, aDoc);
nsAccessible* accessible = new nsXULTreeAccessible(aContent, aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}
// Table or tree table accessible.
nsAccessible* accessible = new nsXULTreeGridAccessibleWrap(aContent, aDoc);
nsAccessible* accessible = new nsXULTreeGridAccessibleWrap(aContent, aWeakShell);
NS_IF_ADDREF(accessible);
return accessible;
}

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

@ -216,19 +216,18 @@ public:
/**
* Return an accessible for the given DOM node or container accessible if
* the node is not accessible.
*
* @param aNode [in] the given node
* @param aDoc [in] the document accessible. Can't be null.
*/
nsAccessible* GetAccessibleOrContainer(nsINode* aNode, nsDocAccessible* aDoc);
nsAccessible* GetAccessibleOrContainer(nsINode* aNode,
nsIWeakReference* aWeakShell);
/**
* Return a container accessible for the given DOM node.
*/
nsAccessible* GetContainerAccessible(nsINode* aNode, nsDocAccessible* aDoc)
inline nsAccessible* GetContainerAccessible(nsINode* aNode,
nsIWeakReference* aWeakShell)
{
return aNode ?
GetAccessibleOrContainer(aNode->GetNodeParent(), aDoc) : nsnull;
GetAccessibleOrContainer(aNode->GetNodeParent(), aWeakShell) : nsnull;
}
private:
@ -254,28 +253,28 @@ private:
* interface.
*/
already_AddRefed<nsAccessible>
CreateAccessibleByType(nsIContent* aContent, nsDocAccessible* aDoc);
CreateAccessibleByType(nsIContent* aContent, nsIWeakReference* aWeakShell);
/**
* Create accessible for HTML node by tag name.
*/
already_AddRefed<nsAccessible>
CreateHTMLAccessibleByMarkup(nsIFrame* aFrame, nsIContent* aContent,
nsDocAccessible* aDoc);
nsIWeakReference* aWeakShell);
/**
* Create accessible if parent is a deck frame.
*/
already_AddRefed<nsAccessible>
CreateAccessibleForDeckChild(nsIFrame* aFrame, nsIContent* aContent,
nsDocAccessible* aDoc);
nsIWeakReference* aWeakShell);
#ifdef MOZ_XUL
/**
* Create accessible for XUL tree element.
*/
already_AddRefed<nsAccessible>
CreateAccessibleForXULTree(nsIContent* aContent, nsDocAccessible* aDoc);
CreateAccessibleForXULTree(nsIContent* aContent, nsIWeakReference* aWeakShell);
#endif
/**

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

@ -193,8 +193,8 @@ nsresult nsAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return nsAccessNodeWrap::QueryInterface(aIID, aInstancePtr);
}
nsAccessible::nsAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessNodeWrap(aContent, aDoc),
nsAccessible::nsAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessNodeWrap(aContent, aShell),
mParent(nsnull), mIndexInParent(-1), mFlags(eChildrenUninitialized),
mIndexOfEmbeddedChild(-1), mRoleMapEntry(nsnull)
{
@ -273,7 +273,7 @@ nsAccessible::GetDocument(nsIAccessibleDocument **aDocument)
{
NS_ENSURE_ARG_POINTER(aDocument);
NS_IF_ADDREF(*aDocument = Document());
NS_IF_ADDREF(*aDocument = GetDocAccessible());
return NS_OK;
}
@ -400,7 +400,7 @@ nsAccessible::Description(nsString& aDescription)
bool isXUL = mContent->IsXUL();
if (isXUL) {
// Try XUL <description control="[id]">description text</description>
XULDescriptionIterator iter(Document(), mContent);
XULDescriptionIterator iter(GetDocAccessible(), mContent);
nsAccessible* descr = nsnull;
while ((descr = iter.Next()))
nsTextEquivUtils::AppendTextEquivFromContent(this, descr->GetContent(),
@ -446,12 +446,12 @@ nsAccessible::AccessKey() const
if (mContent->IsHTML()) {
// Unless it is labeled via an ancestor <label>, in which case that would
// be redundant.
HTMLLabelIterator iter(Document(), this,
HTMLLabelIterator iter(GetDocAccessible(), this,
HTMLLabelIterator::eSkipAncestorLabel);
label = iter.Next();
} else if (mContent->IsXUL()) {
XULLabelIterator iter(Document(), mContent);
XULLabelIterator iter(GetDocAccessible(), mContent);
label = iter.Next();
}
@ -686,7 +686,7 @@ nsAccessible::VisibilityState()
if (!frame)
return vstates;
nsIPresShell* shell(mDoc->PresShell());
const nsCOMPtr<nsIPresShell> shell(GetPresShell());
if (!shell)
return vstates;
@ -729,7 +729,7 @@ nsAccessible::NativeState()
{
PRUint64 state = 0;
nsDocAccessible* document = Document();
nsDocAccessible* document = GetDocAccessible();
if (!document || !document->IsInDocument(this))
state |= states::STALE;
@ -831,7 +831,7 @@ nsAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
// therefore accessible for containing block may be different from accessible
// for DOM parent but GetFrameForPoint() should be called for containing block
// to get an out of flow element.
nsDocAccessible* accDocument = Document();
nsDocAccessible *accDocument = GetDocAccessible();
NS_ENSURE_TRUE(accDocument, nsnull);
nsIFrame *frame = accDocument->GetFrame();
@ -853,7 +853,7 @@ nsAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
// Get accessible for the node with the point or the first accessible in
// the DOM parent chain.
nsAccessible* accessible =
GetAccService()->GetAccessibleOrContainer(content, accDocument);
GetAccService()->GetAccessibleOrContainer(content, mWeakShell);
if (!accessible)
return fallbackAnswer;
@ -1040,7 +1040,7 @@ nsAccessible::GetBounds(PRInt32* aX, PRInt32* aY,
if (IsDefunct())
return NS_ERROR_FAILURE;
nsIPresShell* presShell = mDoc->PresShell();
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
// This routine will get the entire rectangle for all the frames in this node.
// -------------------------------------------------------------------------
@ -1160,7 +1160,7 @@ nsAccessible::GetHTMLName(nsAString& aLabel)
nsAutoString label;
nsAccessible* labelAcc = nsnull;
HTMLLabelIterator iter(Document(), this);
HTMLLabelIterator iter(GetDocAccessible(), this);
while ((labelAcc = iter.Next())) {
nsresult rv = nsTextEquivUtils::
AppendTextEquivFromContent(this, labelAcc->GetContent(), &label);
@ -1222,7 +1222,7 @@ nsAccessible::GetXULName(nsAString& aLabel)
label.Truncate();
nsAccessible* labelAcc = nsnull;
XULLabelIterator iter(Document(), mContent);
XULLabelIterator iter(GetDocAccessible(), mContent);
while ((labelAcc = iter.Next())) {
nsCOMPtr<nsIDOMXULLabelElement> xulLabel =
do_QueryInterface(labelAcc->GetContent());
@ -1743,7 +1743,7 @@ nsAccessible::GetValue(nsAString& aValue)
// Check if it's a simple xlink.
if (nsCoreUtils::IsXLink(mContent)) {
nsIPresShell* presShell = mDoc->PresShell();
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
if (presShell) {
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
return presShell->GetLinkLocation(DOMNode, aValue);
@ -2058,7 +2058,7 @@ nsAccessible::RelationByType(PRUint32 aType)
// defined on.
switch (aType) {
case nsIAccessibleRelation::RELATION_LABEL_FOR: {
Relation rel(new RelatedAccIterator(Document(), mContent,
Relation rel(new RelatedAccIterator(GetDocAccessible(), mContent,
nsGkAtoms::aria_labelledby));
if (mContent->Tag() == nsGkAtoms::label)
rel.AppendIter(new IDRefsIterator(mContent, mContent->IsHTML() ?
@ -2071,9 +2071,9 @@ nsAccessible::RelationByType(PRUint32 aType)
Relation rel(new IDRefsIterator(mContent,
nsGkAtoms::aria_labelledby));
if (mContent->IsHTML()) {
rel.AppendIter(new HTMLLabelIterator(Document(), this));
rel.AppendIter(new HTMLLabelIterator(GetDocAccessible(), this));
} else if (mContent->IsXUL()) {
rel.AppendIter(new XULLabelIterator(Document(), mContent));
rel.AppendIter(new XULLabelIterator(GetDocAccessible(), mContent));
}
return rel;
@ -2082,13 +2082,13 @@ nsAccessible::RelationByType(PRUint32 aType)
Relation rel(new IDRefsIterator(mContent,
nsGkAtoms::aria_describedby));
if (mContent->IsXUL())
rel.AppendIter(new XULDescriptionIterator(Document(), mContent));
rel.AppendIter(new XULDescriptionIterator(GetDocAccessible(), mContent));
return rel;
}
case nsIAccessibleRelation::RELATION_DESCRIPTION_FOR: {
Relation rel(new RelatedAccIterator(Document(), mContent,
nsGkAtoms::aria_describedby));
Relation rel(new RelatedAccIterator(GetDocAccessible(), mContent,
nsGkAtoms::aria_describedby));
// This affectively adds an optional control attribute to xul:description,
// which only affects accessibility, by allowing the description to be
@ -2101,13 +2101,13 @@ nsAccessible::RelationByType(PRUint32 aType)
return rel;
}
case nsIAccessibleRelation::RELATION_NODE_CHILD_OF: {
Relation rel(new RelatedAccIterator(Document(), mContent,
nsGkAtoms::aria_owns));
Relation rel(new RelatedAccIterator(GetDocAccessible(), mContent,
nsGkAtoms::aria_owns));
// This is an ARIA tree or treegrid that doesn't use owns, so we need to
// get the parent the hard way.
if (mRoleMapEntry && (mRoleMapEntry->role == roles::OUTLINEITEM ||
mRoleMapEntry->role == roles::ROW)) {
mRoleMapEntry->role == roles::ROW)) {
AccGroupInfo* groupInfo = GetGroupInfo();
if (!groupInfo)
return rel;
@ -2134,19 +2134,19 @@ nsAccessible::RelationByType(PRUint32 aType)
return rel;
}
case nsIAccessibleRelation::RELATION_CONTROLLED_BY:
return Relation(new RelatedAccIterator(Document(), mContent,
return Relation(new RelatedAccIterator(GetDocAccessible(), mContent,
nsGkAtoms::aria_controls));
case nsIAccessibleRelation::RELATION_CONTROLLER_FOR: {
Relation rel(new IDRefsIterator(mContent,
nsGkAtoms::aria_controls));
rel.AppendIter(new HTMLOutputIterator(Document(), mContent));
rel.AppendIter(new HTMLOutputIterator(GetDocAccessible(), mContent));
return rel;
}
case nsIAccessibleRelation::RELATION_FLOWS_TO:
return Relation(new IDRefsIterator(mContent,
nsGkAtoms::aria_flowto));
case nsIAccessibleRelation::RELATION_FLOWS_FROM:
return Relation(new RelatedAccIterator(Document(), mContent,
return Relation(new RelatedAccIterator(GetDocAccessible(), mContent,
nsGkAtoms::aria_flowto));
case nsIAccessibleRelation::RELATION_DEFAULT_BUTTON: {
if (mContent->IsHTML()) {
@ -2273,7 +2273,7 @@ nsAccessible::DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex)
if (IsDefunct())
return;
nsIPresShell* presShell = mDoc->PresShell();
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
// Scroll into view.
presShell->ScrollContentIntoView(aContent, NS_PRESSHELL_SCROLL_ANYWHERE,
@ -3033,7 +3033,7 @@ nsAccessible::CurrentItem()
nsIDocument* DOMDoc = mContent->OwnerDoc();
dom::Element* activeDescendantElm = DOMDoc->GetElementById(id);
if (activeDescendantElm) {
nsDocAccessible* document = Document();
nsDocAccessible* document = GetDocAccessible();
if (document)
return document->GetAccessible(activeDescendantElm);
}
@ -3079,10 +3079,7 @@ nsAccessible::ContainerWidget() const
void
nsAccessible::CacheChildren()
{
nsDocAccessible* doc = Document();
NS_ENSURE_TRUE(doc,);
nsAccTreeWalker walker(doc->GetWeakShell(), mContent, GetAllowsAnonChildAccessibles());
nsAccTreeWalker walker(mWeakShell, mContent, GetAllowsAnonChildAccessibles());
nsAccessible* child = nsnull;
while ((child = walker.NextChild()) && AppendChild(child));
@ -3155,7 +3152,8 @@ nsAccessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError) const
nsAccessible *
nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
{
nsAccessible* accessible = mDoc->GetAccessible(aStartNode);
nsAccessible* accessible =
GetAccService()->GetAccessibleInWeakShell(aStartNode, mWeakShell);
if (accessible)
return accessible;
@ -3177,7 +3175,8 @@ nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
return nsnull;
nsCOMPtr<nsINode> node(do_QueryInterface(currentNode));
nsAccessible* accessible = mDoc->GetAccessible(node);
nsAccessible* accessible =
GetAccService()->GetAccessibleInWeakShell(node, mWeakShell);
if (accessible)
return accessible;
}

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

@ -104,7 +104,7 @@ class nsAccessible : public nsAccessNodeWrap,
public nsIAccessibleValue
{
public:
nsAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsAccessible(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsAccessible();
NS_DECL_ISUPPORTS_INHERITED

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

@ -59,8 +59,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsLeafAccessible::
nsLeafAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsLeafAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}
@ -92,8 +92,8 @@ nsLeafAccessible::CacheChildren()
////////////////////////////////////////////////////////////////////////////////
nsLinkableAccessible::
nsLinkableAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc),
nsLinkableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell),
mActionAcc(nsnull),
mIsLink(false),
mIsOnclick(false)
@ -253,9 +253,9 @@ nsLinkableAccessible::BindToParent(nsAccessible* aParent,
////////////////////////////////////////////////////////////////////////////////
nsEnumRoleAccessible::
nsEnumRoleAccessible(nsIContent* aNode, nsDocAccessible* aDoc,
nsEnumRoleAccessible(nsIContent *aNode, nsIWeakReference *aShell,
roles::Role aRole) :
nsAccessibleWrap(aNode, aDoc), mRole(aRole)
nsAccessibleWrap(aNode, aShell), mRole(aRole)
{
}

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

@ -56,7 +56,7 @@ class nsLeafAccessible : public nsAccessibleWrap
{
public:
nsLeafAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsLeafAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -82,7 +82,7 @@ class nsLinkableAccessible : public nsAccessibleWrap
public:
enum { eAction_Jump = 0 };
nsLinkableAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsLinkableAccessible(nsIContent *aContent, nsIWeakReference *aShell);
NS_DECL_ISUPPORTS_INHERITED
@ -123,7 +123,7 @@ protected:
class nsEnumRoleAccessible : public nsAccessibleWrap
{
public:
nsEnumRoleAccessible(nsIContent* aContent, nsDocAccessible* aDoc,
nsEnumRoleAccessible(nsIContent *aContent, nsIWeakReference *aShell,
mozilla::a11y::role aRole);
virtual ~nsEnumRoleAccessible() { }

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

@ -296,7 +296,7 @@ nsCaretAccessible::NormalSelectionChanged(nsISelection* aSelection)
nsRefPtr<AccEvent> event =
new AccCaretMoveEvent(mLastTextAccessible->GetNode());
if (event)
mLastTextAccessible->Document()->FireDelayedAccessibleEvent(event);
mLastTextAccessible->GetDocAccessible()->FireDelayedAccessibleEvent(event);
}
void
@ -316,7 +316,7 @@ nsCaretAccessible::SpellcheckSelectionChanged(nsISelection* aSelection)
nsRefPtr<AccEvent> event =
new AccEvent(nsIAccessibleEvent::EVENT_TEXT_ATTRIBUTE_CHANGED, textAcc);
if (event)
textAcc->Document()->FireDelayedAccessibleEvent(event);
textAcc->GetDocAccessible()->FireDelayedAccessibleEvent(event);
}
nsIntRect

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

@ -102,13 +102,12 @@ static const PRUint32 kRelationAttrsLen = NS_ARRAY_LENGTH(kRelationAttrs);
// Constructor/desctructor
nsDocAccessible::
nsDocAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
nsIWeakReference* aShell) :
nsHyperTextAccessibleWrap(aRootContent, this),
nsDocAccessible(nsIDocument *aDocument, nsIContent *aRootContent,
nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aRootContent, aShell),
mDocument(aDocument), mScrollPositionChangedTicks(0),
mLoadState(eTreeConstructionPending), mLoadEventType(0),
mVirtualCursor(nsnull),
mPresShell(nsCOMPtr<nsIPresShell>(do_QueryReferent(aShell)).get())
mVirtualCursor(nsnull)
{
mFlags |= eDocAccessible;
@ -136,7 +135,6 @@ nsDocAccessible::
nsDocAccessible::~nsDocAccessible()
{
NS_ASSERTION(!mPresShell, "LastRelease was never called!?!");
}
@ -210,6 +208,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDocAccessible)
NS_IMPL_ADDREF_INHERITED(nsDocAccessible, nsHyperTextAccessible)
NS_IMPL_RELEASE_INHERITED(nsDocAccessible, nsHyperTextAccessible)
////////////////////////////////////////////////////////////////////////////////
// nsIAccessible
@ -623,7 +622,8 @@ nsDocAccessible::Init()
NS_LOG_ACCDOCCREATE_FOR("document initialize", mDocument, this)
// Initialize notification controller.
mNotificationController = new NotificationController(this, mPresShell);
nsCOMPtr<nsIPresShell> shell(GetPresShell());
mNotificationController = new NotificationController(this, shell);
if (!mNotificationController)
return false;
@ -640,7 +640,7 @@ nsDocAccessible::Init()
void
nsDocAccessible::Shutdown()
{
if (!mPresShell) // already shutdown
if (!mWeakShell) // already shutdown
return;
NS_LOG_ACCDOCDESTROY_FOR("document shutdown", mDocument, this)
@ -658,7 +658,7 @@ nsDocAccessible::Shutdown()
mDocument = nsnull;
if (mParent) {
nsDocAccessible* parentDocument = mParent->Document();
nsDocAccessible* parentDocument = mParent->GetDocAccessible();
if (parentDocument)
parentDocument->RemoveChildDocument(this);
@ -678,7 +678,7 @@ nsDocAccessible::Shutdown()
mVirtualCursor = nsnull;
}
mPresShell = nsnull; // Avoid reentrancy
mWeakShell = nsnull; // Avoid reentrancy
mDependentIDsHash.Clear();
mNodeToAccessibleMap.Clear();
@ -692,9 +692,11 @@ nsDocAccessible::Shutdown()
nsIFrame*
nsDocAccessible::GetFrame() const
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
nsIFrame* root = nsnull;
if (mPresShell)
root = mPresShell->GetRootFrame();
if (shell)
root = shell->GetRootFrame();
return root;
}
@ -752,7 +754,8 @@ nsresult nsDocAccessible::AddEventListeners()
// 1) Set up scroll position listener
// 2) Check for editor and listen for changes to editor
NS_ENSURE_TRUE(mPresShell, NS_ERROR_FAILURE);
nsCOMPtr<nsIPresShell> presShell(GetPresShell());
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
nsCOMPtr<nsISupports> container = mDocument->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(do_QueryInterface(container));
@ -780,7 +783,7 @@ nsresult nsDocAccessible::AddEventListeners()
NS_ENSURE_TRUE(rootAccessible, NS_ERROR_FAILURE);
nsRefPtr<nsCaretAccessible> caretAccessible = rootAccessible->GetCaretAccessible();
if (caretAccessible) {
caretAccessible->AddDocSelectionListener(mPresShell);
caretAccessible->AddDocSelectionListener(presShell);
}
}
@ -826,8 +829,11 @@ nsresult nsDocAccessible::RemoveEventListeners()
nsRootAccessible* rootAccessible = RootAccessible();
if (rootAccessible) {
nsRefPtr<nsCaretAccessible> caretAccessible = rootAccessible->GetCaretAccessible();
if (caretAccessible)
caretAccessible->RemoveDocSelectionListener(mPresShell);
if (caretAccessible) {
// Don't use GetPresShell() which can call Shutdown() if it sees dead pres shell
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
caretAccessible->RemoveDocSelectionListener(presShell);
}
}
return NS_OK;
@ -857,10 +863,11 @@ void nsDocAccessible::ScrollTimerCallback(nsITimer *aTimer, void *aClosure)
// nsDocAccessible protected member
void nsDocAccessible::AddScrollListener()
{
if (!mPresShell)
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
if (!presShell)
return;
nsIScrollableFrame* sf = mPresShell->GetRootScrollFrameAsScrollableExternal();
nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollableExternal();
if (sf) {
sf->AddScrollPositionListener(this);
NS_LOG_ACCDOCCREATE_TEXT("add scroll listener")
@ -870,10 +877,11 @@ void nsDocAccessible::AddScrollListener()
// nsDocAccessible protected member
void nsDocAccessible::RemoveScrollListener()
{
if (!mPresShell)
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
if (!presShell)
return;
nsIScrollableFrame* sf = mPresShell->GetRootScrollFrameAsScrollableExternal();
nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollableExternal();
if (sf) {
sf->RemoveScrollPositionListener(this);
}
@ -1325,10 +1333,11 @@ nsDocAccessible::HandleAccEvent(AccEvent* aAccEvent)
void*
nsDocAccessible::GetNativeWindow() const
{
if (!mPresShell)
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
if (!shell)
return nsnull;
nsIViewManager* vm = mPresShell->GetViewManager();
nsIViewManager* vm = shell->GetViewManager();
if (!vm)
return nsnull;
@ -1515,7 +1524,7 @@ nsDocAccessible::CacheChildren()
{
// Search for accessible children starting from the document element since
// some web pages tend to insert elements under it rather than document body.
nsAccTreeWalker walker(do_GetWeakReference(mPresShell).get(), mDocument->GetRootElement(),
nsAccTreeWalker walker(mWeakShell, mDocument->GetRootElement(),
GetAllowsAnonChildAccessibles());
nsAccessible* child = nsnull;
@ -1871,7 +1880,7 @@ nsDocAccessible::UpdateTree(nsAccessible* aContainer, nsIContent* aChildNode,
updateFlags |= UpdateTreeInternal(child, aIsInsert);
} else {
nsAccTreeWalker walker(do_GetWeakReference(mPresShell).get(), aChildNode,
nsAccTreeWalker walker(mWeakShell, aChildNode,
aContainer->GetAllowsAnonChildAccessibles(), true);
while ((child = walker.NextChild()))

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

@ -138,17 +138,6 @@ public:
// nsDocAccessible
/**
* Return presentation shell for this document accessible.
*/
nsIPresShell* PresShell() const { return mPresShell; }
/**
* Return weak reference to presentation shell for this document accessible.
*/
nsIWeakReference* GetWeakShell() const
{ return do_GetWeakReference(mPresShell).get(); }
/**
* Return true if associated DOM document was loaded and isn't unloading.
*/
@ -181,8 +170,7 @@ public:
* Return true if the document has given document state.
*/
bool HasLoadState(LoadState aState) const
{ return (mLoadState & static_cast<PRUint32>(aState)) ==
static_cast<PRUint32>(aState); }
{ return (mLoadState & aState) == aState; }
/**
* Return a native window handler or pointer depending on platform.
@ -193,7 +181,7 @@ public:
* Return the parent document.
*/
nsDocAccessible* ParentDocument() const
{ return mParent ? mParent->Document() : nsnull; }
{ return mParent ? mParent->GetDocAccessible() : nsnull; }
/**
* Return the child document count.
@ -389,8 +377,6 @@ public:
protected:
void LastRelease();
// nsAccessible
virtual void CacheChildren();
@ -667,10 +653,6 @@ protected:
*/
nsRefPtr<NotificationController> mNotificationController;
friend class NotificationController;
private:
nsIPresShell* mPresShell;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsDocAccessible,

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

@ -201,8 +201,8 @@ ProgressMeterAccessible<Max>::SetCurrentValue(double aValue)
////////////////////////////////////////////////////////////////////////////////
nsRadioButtonAccessible::
nsRadioButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsFormControlAccessible(aContent, aDoc)
nsRadioButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsFormControlAccessible(aContent, aShell)
{
}

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

@ -50,8 +50,8 @@ template<int Max>
class ProgressMeterAccessible: public nsFormControlAccessible
{
public:
ProgressMeterAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsFormControlAccessible(aContent, aDoc)
ProgressMeterAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsFormControlAccessible(aContent, aShell)
{
}
@ -75,7 +75,7 @@ class nsRadioButtonAccessible : public nsFormControlAccessible
{
public:
nsRadioButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsRadioButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);

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

@ -50,8 +50,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsOuterDocAccessible::
nsOuterDocAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsOuterDocAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}

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

@ -53,7 +53,7 @@
class nsOuterDocAccessible : public nsAccessibleWrap
{
public:
nsOuterDocAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsOuterDocAccessible(nsIContent *aContent, nsIWeakReference *aShell);
NS_DECL_ISUPPORTS_INHERITED

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

@ -371,20 +371,24 @@ nsRootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
nsAutoString eventType;
aDOMEvent->GetType(eventType);
nsCOMPtr<nsIWeakReference> weakShell =
nsCoreUtils::GetWeakShellFor(origTargetNode);
if (!weakShell)
return;
if (eventType.EqualsLiteral("popuphiding")) {
HandlePopupHidingEvent(origTargetNode);
return;
}
nsDocAccessible* targetDocument = GetAccService()->
GetDocAccessible(origTargetNode->OwnerDoc());
NS_ASSERTION(targetDocument, "No document while accessible is in document?!");
nsAccessible* accessible =
targetDocument->GetAccessibleOrContainer(origTargetNode);
nsAccessible* accessible =
GetAccService()->GetAccessibleOrContainer(origTargetNode, weakShell);
if (!accessible)
return;
nsDocAccessible* targetDocument = accessible->GetDocAccessible();
NS_ASSERTION(targetDocument, "No document while accessible is in document?!");
nsINode* targetNode = accessible->GetNode();
#ifdef MOZ_XUL
@ -564,7 +568,7 @@ void
nsRootAccessible::Shutdown()
{
// Called manually or by nsAccessNode::LastRelease()
if (!PresShell())
if (!mWeakShell)
return; // Already shutdown
nsDocAccessibleWrap::Shutdown();

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

@ -49,8 +49,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsTextAccessible::
nsTextAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsLinkableAccessible(aContent, aDoc)
nsTextAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsLinkableAccessible(aContent, aShell)
{
mFlags |= eTextLeafAccessible;
}

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

@ -47,7 +47,7 @@
class nsTextAccessible : public nsLinkableAccessible
{
public:
nsTextAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsTextAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();

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

@ -42,8 +42,8 @@
using namespace mozilla::a11y;
nsHTMLCanvasAccessible::
nsHTMLCanvasAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessible(aContent, aDoc)
nsHTMLCanvasAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsHyperTextAccessible(aContent, aShell)
{
}

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

@ -46,7 +46,7 @@
class nsHTMLCanvasAccessible : public nsHyperTextAccessible
{
public:
nsHTMLCanvasAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLCanvasAccessible(nsIContent* aContent, nsIWeakReference* aShell);
virtual ~nsHTMLCanvasAccessible() { }
// nsAccessible

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

@ -68,8 +68,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLCheckboxAccessible::
nsHTMLCheckboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsFormControlAccessible(aContent, aDoc)
nsHTMLCheckboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsFormControlAccessible(aContent, aShell)
{
}
@ -154,8 +154,8 @@ nsHTMLCheckboxAccessible::IsWidget() const
////////////////////////////////////////////////////////////////////////////////
nsHTMLRadioButtonAccessible::
nsHTMLRadioButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsRadioButtonAccessible(aContent, aDoc)
nsHTMLRadioButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsRadioButtonAccessible(aContent, aShell)
{
}
@ -243,8 +243,8 @@ nsHTMLRadioButtonAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet,
////////////////////////////////////////////////////////////////////////////////
nsHTMLButtonAccessible::
nsHTMLButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsHTMLButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}
@ -358,8 +358,8 @@ nsHTMLButtonAccessible::IsWidget() const
////////////////////////////////////////////////////////////////////////////////
nsHTML4ButtonAccessible::
nsHTML4ButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsHTML4ButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}
@ -423,8 +423,8 @@ nsHTML4ButtonAccessible::IsWidget() const
////////////////////////////////////////////////////////////////////////////////
nsHTMLTextFieldAccessible::
nsHTMLTextFieldAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsHTMLTextFieldAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}
@ -655,8 +655,8 @@ nsHTMLTextFieldAccessible::ContainerWidget() const
////////////////////////////////////////////////////////////////////////////////
nsHTMLFileInputAccessible::
nsHTMLFileInputAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsHTMLFileInputAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
mFlags |= eHTMLFileInputAccessible;
}
@ -710,8 +710,8 @@ nsHTMLFileInputAccessible::HandleAccEvent(AccEvent* aEvent)
////////////////////////////////////////////////////////////////////////////////
nsHTMLGroupboxAccessible::
nsHTMLGroupboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsHTMLGroupboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}
@ -770,8 +770,8 @@ nsHTMLGroupboxAccessible::RelationByType(PRUint32 aType)
////////////////////////////////////////////////////////////////////////////////
nsHTMLLegendAccessible::
nsHTMLLegendAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsHTMLLegendAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}
@ -800,8 +800,8 @@ nsHTMLLegendAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsHTMLFigureAccessible::
nsHTMLFigureAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsHTMLFigureAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}
@ -870,8 +870,8 @@ nsHTMLFigureAccessible::Caption() const
////////////////////////////////////////////////////////////////////////////////
nsHTMLFigcaptionAccessible::
nsHTMLFigcaptionAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsHTMLFigcaptionAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}

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

@ -56,7 +56,7 @@ class nsHTMLCheckboxAccessible : public nsFormControlAccessible
public:
enum { eAction_Click = 0 };
nsHTMLCheckboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLCheckboxAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -81,7 +81,7 @@ class nsHTMLRadioButtonAccessible : public nsRadioButtonAccessible
{
public:
nsHTMLRadioButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLRadioButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual PRUint64 NativeState();
@ -100,7 +100,7 @@ class nsHTMLButtonAccessible : public nsHyperTextAccessibleWrap
public:
enum { eAction_Click = 0 };
nsHTMLButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -129,7 +129,7 @@ class nsHTML4ButtonAccessible : public nsHyperTextAccessibleWrap
public:
enum { eAction_Click = 0 };
nsHTML4ButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTML4ButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -156,7 +156,7 @@ class nsHTMLTextFieldAccessible : public nsHyperTextAccessibleWrap
public:
enum { eAction_Click = 0 };
nsHTMLTextFieldAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLTextFieldAccessible(nsIContent *aContent, nsIWeakReference *aShell);
NS_DECL_ISUPPORTS_INHERITED
@ -190,7 +190,7 @@ public:
class nsHTMLFileInputAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLFileInputAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLFileInputAccessible(nsIContent* aContent, nsIWeakReference* aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -203,7 +203,7 @@ public:
class nsHTMLGroupboxAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLGroupboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLGroupboxAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
@ -221,7 +221,7 @@ protected:
class nsHTMLLegendAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLLegendAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLLegendAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -234,7 +234,7 @@ public:
class nsHTMLFigureAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLFigureAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLFigureAccessible(nsIContent* aContent, nsIWeakReference* aShell);
// nsAccessible
virtual nsresult GetAttributesInternal(nsIPersistentProperties* aAttributes);
@ -253,7 +253,7 @@ protected:
class nsHTMLFigcaptionAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLFigcaptionAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLFigcaptionAccessible(nsIContent* aContent, nsIWeakReference* aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();

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

@ -60,8 +60,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLImageAccessible::
nsHTMLImageAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsLinkableAccessible(aContent, aDoc)
nsHTMLImageAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsLinkableAccessible(aContent, aShell)
{
}

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

@ -51,7 +51,7 @@ class nsHTMLImageAccessible : public nsLinkableAccessible,
public nsIAccessibleImage
{
public:
nsHTMLImageAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLImageAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED

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

@ -57,9 +57,9 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLImageMapAccessible::
nsHTMLImageMapAccessible(nsIContent* aContent, nsDocAccessible* aDoc,
nsIDOMHTMLMapElement* aMapElm) :
nsHTMLImageAccessibleWrap(aContent, aDoc), mMapElement(aMapElm)
nsHTMLImageMapAccessible(nsIContent *aContent, nsIWeakReference *aShell,
nsIDOMHTMLMapElement *aMapElm) :
nsHTMLImageAccessibleWrap(aContent, aShell), mMapElement(aMapElm)
{
}
@ -117,7 +117,7 @@ nsHTMLImageMapAccessible::CacheChildren()
if (!mapAreas)
return;
nsDocAccessible* document = Document();
nsDocAccessible* document = GetDocAccessible();
PRUint32 areaCount = 0;
mapAreas->GetLength(&areaCount);
@ -130,7 +130,7 @@ nsHTMLImageMapAccessible::CacheChildren()
nsCOMPtr<nsIContent> areaContent(do_QueryInterface(areaNode));
nsRefPtr<nsAccessible> area =
new nsHTMLAreaAccessible(areaContent, mDoc);
new nsHTMLAreaAccessible(areaContent, mWeakShell);
if (!document->BindToDocument(area, nsAccUtils::GetRoleMapEntry(areaContent)) ||
!AppendChild(area)) {
@ -145,8 +145,8 @@ nsHTMLImageMapAccessible::CacheChildren()
////////////////////////////////////////////////////////////////////////////////
nsHTMLAreaAccessible::
nsHTMLAreaAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHTMLLinkAccessible(aContent, aDoc)
nsHTMLAreaAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHTMLLinkAccessible(aContent, aShell)
{
}

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

@ -51,8 +51,8 @@
class nsHTMLImageMapAccessible : public nsHTMLImageAccessibleWrap
{
public:
nsHTMLImageMapAccessible(nsIContent* aContent, nsDocAccessible* aDoc,
nsIDOMHTMLMapElement* aMapElm);
nsHTMLImageMapAccessible(nsIContent *aContent, nsIWeakReference *aShell,
nsIDOMHTMLMapElement *aMapElm);
// nsISupports and cycle collector
NS_DECL_ISUPPORTS_INHERITED
@ -83,7 +83,7 @@ class nsHTMLAreaAccessible : public nsHTMLLinkAccessible
{
public:
nsHTMLAreaAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLAreaAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible

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

@ -43,7 +43,6 @@
#include "Role.h"
#include "States.h"
#include "nsDocAccessible.h"
#include "nsEventStates.h"
#include "mozilla/dom/Element.h"
@ -54,8 +53,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLLinkAccessible::
nsHTMLLinkAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsHTMLLinkAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}
@ -117,7 +116,7 @@ nsHTMLLinkAccessible::GetValue(nsAString& aValue)
if (!aValue.IsEmpty())
return NS_OK;
nsIPresShell* presShell(mDoc->PresShell());
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
return presShell->GetLinkLocation(DOMNode, aValue);
}

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

@ -45,7 +45,7 @@
class nsHTMLLinkAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLLinkAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLLinkAccessible(nsIContent *aContent, nsIWeakReference *aShell);
NS_DECL_ISUPPORTS_INHERITED

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

@ -65,8 +65,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLSelectListAccessible::
nsHTMLSelectListAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsHTMLSelectListAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
mFlags |= eListControlAccessible;
}
@ -144,7 +144,7 @@ nsHTMLSelectListAccessible::CurrentItem()
if (listControlFrame) {
nsCOMPtr<nsIContent> activeOptionNode = listControlFrame->GetCurrentOption();
if (activeOptionNode) {
nsDocAccessible* document = Document();
nsDocAccessible* document = GetDocAccessible();
if (document)
return document->GetAccessible(activeOptionNode);
}
@ -179,7 +179,7 @@ nsHTMLSelectListAccessible::CacheChildren()
void
nsHTMLSelectListAccessible::CacheOptSiblings(nsIContent *aParentContent)
{
nsIPresShell* presShell(mDoc->PresShell());
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
for (nsIContent* childContent = aParentContent->GetFirstChild(); childContent;
childContent = childContent->GetNextSibling()) {
if (!childContent->IsHTML()) {
@ -193,7 +193,7 @@ nsHTMLSelectListAccessible::CacheOptSiblings(nsIContent *aParentContent)
// Get an accessible for option or optgroup and cache it.
nsRefPtr<nsAccessible> accessible =
GetAccService()->GetOrCreateAccessible(childContent, presShell,
mDoc->GetWeakShell());
mWeakShell);
if (accessible)
AppendChild(accessible);
@ -210,8 +210,8 @@ nsHTMLSelectListAccessible::CacheOptSiblings(nsIContent *aParentContent)
////////////////////////////////////////////////////////////////////////////////
nsHTMLSelectOptionAccessible::
nsHTMLSelectOptionAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsHTMLSelectOptionAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}
@ -454,9 +454,9 @@ nsHTMLSelectOptionAccessible::GetSelectState(PRUint64* aState)
////////////////////////////////////////////////////////////////////////////////
nsHTMLSelectOptGroupAccessible::
nsHTMLSelectOptGroupAccessible(nsIContent* aContent,
nsDocAccessible* aDoc) :
nsHTMLSelectOptionAccessible(aContent, aDoc)
nsHTMLSelectOptGroupAccessible(nsIContent *aContent,
nsIWeakReference *aShell) :
nsHTMLSelectOptionAccessible(aContent, aShell)
{
}
@ -511,8 +511,8 @@ nsHTMLSelectOptGroupAccessible::CacheChildren()
////////////////////////////////////////////////////////////////////////////////
nsHTMLComboboxAccessible::
nsHTMLComboboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsHTMLComboboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
mFlags |= eComboboxAccessible;
}
@ -552,10 +552,10 @@ nsHTMLComboboxAccessible::CacheChildren()
if (!mListAccessible) {
mListAccessible =
new nsHTMLComboboxListAccessible(mParent, mContent, mDoc);
new nsHTMLComboboxListAccessible(mParent, mContent, mWeakShell);
// Initialize and put into cache.
if (!Document()->BindToDocument(mListAccessible, nsnull))
if (!GetDocAccessible()->BindToDocument(mListAccessible, nsnull))
return;
}
@ -718,7 +718,7 @@ nsHTMLComboboxAccessible::SelectedOption() const
if (listControlFrame) {
nsCOMPtr<nsIContent> activeOptionNode = listControlFrame->GetCurrentOption();
if (activeOptionNode) {
nsDocAccessible* document = Document();
nsDocAccessible* document = GetDocAccessible();
if (document)
return document->GetAccessible(activeOptionNode);
}
@ -733,9 +733,9 @@ nsHTMLComboboxAccessible::SelectedOption() const
////////////////////////////////////////////////////////////////////////////////
nsHTMLComboboxListAccessible::
nsHTMLComboboxListAccessible(nsIAccessible* aParent, nsIContent* aContent,
nsDocAccessible* aDoc) :
nsHTMLSelectListAccessible(aContent, aDoc)
nsHTMLComboboxListAccessible(nsIAccessible *aParent, nsIContent *aContent,
nsIWeakReference *aShell) :
nsHTMLSelectListAccessible(aContent, aShell)
{
}

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

@ -68,7 +68,7 @@ class nsHTMLSelectListAccessible : public nsAccessibleWrap
{
public:
nsHTMLSelectListAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLSelectListAccessible(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsHTMLSelectListAccessible() {}
// nsAccessible
@ -108,7 +108,7 @@ class nsHTMLSelectOptionAccessible : public nsHyperTextAccessibleWrap
public:
enum { eAction_Select = 0 };
nsHTMLSelectOptionAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLSelectOptionAccessible(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsHTMLSelectOptionAccessible() {}
// nsIAccessible
@ -152,7 +152,7 @@ class nsHTMLSelectOptGroupAccessible : public nsHTMLSelectOptionAccessible
{
public:
nsHTMLSelectOptGroupAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLSelectOptGroupAccessible(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsHTMLSelectOptGroupAccessible() {}
// nsIAccessible
@ -185,7 +185,7 @@ class nsHTMLComboboxAccessible : public nsAccessibleWrap
public:
enum { eAction_Click = 0 };
nsHTMLComboboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLComboboxAccessible(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsHTMLComboboxAccessible() {}
// nsIAccessible
@ -234,9 +234,9 @@ class nsHTMLComboboxListAccessible : public nsHTMLSelectListAccessible
{
public:
nsHTMLComboboxListAccessible(nsIAccessible* aParent,
nsIContent* aContent,
nsDocAccessible* aDoc);
nsHTMLComboboxListAccessible(nsIAccessible *aParent,
nsIContent *aContent,
nsIWeakReference* aShell);
virtual ~nsHTMLComboboxListAccessible() {}
// nsAccessNode

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

@ -76,8 +76,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLTableCellAccessible::
nsHTMLTableCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsHTMLTableCellAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}
@ -348,7 +348,8 @@ nsHTMLTableCellAccessible::GetHeaderCells(PRInt32 aRowOrColumnHeaderCell,
desiredRole = roles::COLUMNHEADER;
do {
nsAccessible* headerCell = mDoc->GetAccessible(headerCellElm);
nsAccessible* headerCell =
GetAccService()->GetAccessibleInWeakShell(headerCellElm, mWeakShell);
if (headerCell && headerCell->Role() == desiredRole)
headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell),
@ -375,9 +376,9 @@ nsHTMLTableCellAccessible::GetHeaderCells(PRInt32 aRowOrColumnHeaderCell,
////////////////////////////////////////////////////////////////////////////////
nsHTMLTableHeaderCellAccessible::
nsHTMLTableHeaderCellAccessible(nsIContent* aContent,
nsDocAccessible* aDoc) :
nsHTMLTableCellAccessible(aContent, aDoc)
nsHTMLTableHeaderCellAccessible(nsIContent *aContent,
nsIWeakReference *aShell) :
nsHTMLTableCellAccessible(aContent, aShell)
{
}
@ -435,8 +436,8 @@ nsHTMLTableHeaderCellAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsHTMLTableAccessible::
nsHTMLTableAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsHTMLTableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}
@ -457,7 +458,7 @@ nsHTMLTableAccessible::CacheChildren()
// caption only, because nsAccessibilityService ensures we don't create
// accessibles for the other captions, since only the first is actually
// visible.
nsAccTreeWalker walker(mDoc->GetWeakShell(), mContent, GetAllowsAnonChildAccessibles());
nsAccTreeWalker walker(mWeakShell, mContent, GetAllowsAnonChildAccessibles());
nsAccessible* child = nsnull;
while ((child = walker.NextChild())) {
@ -717,7 +718,8 @@ nsHTMLTableAccessible::GetSelectedCells(nsIArray **aCells)
if (NS_SUCCEEDED(rv) && startRowIndex == rowIndex &&
startColIndex == columnIndex && isSelected) {
nsCOMPtr<nsIContent> cellContent(do_QueryInterface(cellElement));
nsAccessible *cell = mDoc->GetAccessible(cellContent);
nsAccessible *cell =
GetAccService()->GetAccessibleInWeakShell(cellContent, mWeakShell);
selCells->AppendElement(static_cast<nsIAccessible*>(cell), false);
}
}
@ -890,7 +892,8 @@ nsHTMLTableAccessible::GetCellAt(PRInt32 aRow, PRInt32 aColumn,
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIContent> cellContent(do_QueryInterface(cellElement));
nsAccessible* cell = mDoc->GetAccessible(cellContent);
nsAccessible *cell =
GetAccService()->GetAccessibleInWeakShell(cellContent, mWeakShell);
if (!cell) {
return NS_ERROR_INVALID_ARG;
@ -1191,7 +1194,7 @@ nsHTMLTableAccessible::AddRowOrColumnToSelection(PRInt32 aIndex,
NS_ENSURE_SUCCESS(rv, rv);
nsIPresShell* presShell(mDoc->PresShell());
nsCOMPtr<nsIPresShell> presShell(GetPresShell());
nsRefPtr<nsFrameSelection> tableSelection =
const_cast<nsFrameSelection*>(presShell->ConstFrameSelection());
@ -1223,7 +1226,7 @@ nsHTMLTableAccessible::RemoveRowsOrColumnsFromSelection(PRInt32 aIndex,
nsITableLayout *tableLayout = GetTableLayout();
NS_ENSURE_STATE(tableLayout);
nsIPresShell* presShell(mDoc->PresShell());
nsCOMPtr<nsIPresShell> presShell(GetPresShell());
nsRefPtr<nsFrameSelection> tableSelection =
const_cast<nsFrameSelection*>(presShell->ConstFrameSelection());
@ -1382,7 +1385,7 @@ nsHTMLTableAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
if (IsDefunct())
return NS_ERROR_FAILURE;
nsDocAccessible* docAccessible = Document();
nsDocAccessible *docAccessible = GetDocAccessible();
if (docAccessible) {
PRUint64 docState = docAccessible->State();
if (docState & states::EDITABLE) { // Need to see all elements while document is being edited
@ -1536,7 +1539,7 @@ nsHTMLTableAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
NS_ENSURE_TRUE(tableFrame , NS_ERROR_FAILURE);
nsSize tableSize = tableFrame->GetSize();
nsDocAccessible* docAccessible = Document();
nsDocAccessible *docAccessible = GetDocAccessible();
NS_ENSURE_TRUE(docAccessible, NS_ERROR_FAILURE);
nsIFrame *docFrame = docAccessible->GetFrame();
NS_ENSURE_TRUE(docFrame , NS_ERROR_FAILURE);

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

@ -52,7 +52,7 @@ class nsHTMLTableCellAccessible : public nsHyperTextAccessibleWrap,
public nsIAccessibleTableCell
{
public:
nsHTMLTableCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLTableCellAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -95,8 +95,8 @@ protected:
class nsHTMLTableHeaderCellAccessible : public nsHTMLTableCellAccessible
{
public:
nsHTMLTableHeaderCellAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
nsHTMLTableHeaderCellAccessible(nsIContent *aContent,
nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -124,7 +124,7 @@ class nsHTMLTableAccessible : public nsAccessibleWrap,
public nsIAccessibleTable
{
public:
nsHTMLTableAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLTableAccessible(nsIContent *aContent, nsIWeakReference *aShell);
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLETABLE
@ -211,9 +211,8 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsHTMLTableAccessible,
class nsHTMLCaptionAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLCaptionAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc) { }
virtual ~nsHTMLCaptionAccessible() { }
nsHTMLCaptionAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell) { }
// nsIAccessible

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

@ -61,8 +61,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLTextAccessible::
nsHTMLTextAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsTextAccessibleWrap(aContent, aDoc)
nsHTMLTextAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsTextAccessibleWrap(aContent, aShell)
{
}
@ -93,7 +93,7 @@ nsHTMLTextAccessible::NativeState()
{
PRUint64 state = nsTextAccessible::NativeState();
nsDocAccessible* docAccessible = Document();
nsDocAccessible *docAccessible = GetDocAccessible();
if (docAccessible) {
PRUint64 docState = docAccessible->State();
if (0 == (docState & states::EDITABLE)) {
@ -122,8 +122,8 @@ nsHTMLTextAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes
////////////////////////////////////////////////////////////////////////////////
nsHTMLHRAccessible::
nsHTMLHRAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsLeafAccessible(aContent, aDoc)
nsHTMLHRAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsLeafAccessible(aContent, aShell)
{
}
@ -139,8 +139,8 @@ nsHTMLHRAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsHTMLBRAccessible::
nsHTMLBRAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsLeafAccessible(aContent, aDoc)
nsHTMLBRAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsLeafAccessible(aContent, aShell)
{
}
@ -168,8 +168,8 @@ nsHTMLBRAccessible::GetNameInternal(nsAString& aName)
////////////////////////////////////////////////////////////////////////////////
nsHTMLLabelAccessible::
nsHTMLLabelAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsHTMLLabelAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}
@ -192,8 +192,8 @@ nsHTMLLabelAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsHTMLOutputAccessible::
nsHTMLOutputAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsHTMLOutputAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}
@ -233,15 +233,15 @@ nsHTMLOutputAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribut
////////////////////////////////////////////////////////////////////////////////
nsHTMLLIAccessible::
nsHTMLLIAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc), mBullet(nsnull)
nsHTMLLIAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsHyperTextAccessibleWrap(aContent, aShell), mBullet(nsnull)
{
mFlags |= eHTMLListItemAccessible;
nsBlockFrame* blockFrame = do_QueryFrame(GetFrame());
if (blockFrame && blockFrame->HasBullet()) {
mBullet = new nsHTMLListBulletAccessible(mContent, mDoc);
if (!Document()->BindToDocument(mBullet, nsnull))
mBullet = new nsHTMLListBulletAccessible(mContent, mWeakShell);
if (!GetDocAccessible()->BindToDocument(mBullet, nsnull))
mBullet = nsnull;
}
}
@ -294,9 +294,9 @@ nsHTMLLIAccessible::UpdateBullet(bool aHasBullet)
return;
}
nsDocAccessible* document = Document();
nsDocAccessible* document = GetDocAccessible();
if (aHasBullet) {
mBullet = new nsHTMLListBulletAccessible(mContent, mDoc);
mBullet = new nsHTMLListBulletAccessible(mContent, mWeakShell);
if (document->BindToDocument(mBullet, nsnull)) {
InsertChildAt(0, mBullet);
}
@ -328,8 +328,8 @@ nsHTMLLIAccessible::CacheChildren()
////////////////////////////////////////////////////////////////////////////////
nsHTMLListBulletAccessible::
nsHTMLListBulletAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsLeafAccessible(aContent, aDoc)
nsHTMLListBulletAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
nsLeafAccessible(aContent, aShell)
{
}
@ -400,8 +400,8 @@ nsHTMLListBulletAccessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset
////////////////////////////////////////////////////////////////////////////////
nsHTMLListAccessible::
nsHTMLListAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsHTMLListAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}

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

@ -50,7 +50,7 @@
class nsHTMLTextAccessible : public nsTextAccessibleWrap
{
public:
nsHTMLTextAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLTextAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -70,7 +70,7 @@ public:
class nsHTMLHRAccessible : public nsLeafAccessible
{
public:
nsHTMLHRAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLHRAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -82,7 +82,7 @@ public:
class nsHTMLBRAccessible : public nsLeafAccessible
{
public:
nsHTMLBRAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLBRAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
@ -96,7 +96,7 @@ public:
class nsHTMLLabelAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLLabelAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLLabelAccessible(nsIContent *aContent, nsIWeakReference *aShell);
NS_DECL_ISUPPORTS_INHERITED
@ -111,7 +111,7 @@ public:
class nsHTMLOutputAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLOutputAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLOutputAccessible(nsIContent* aContent, nsIWeakReference* aShell);
NS_DECL_ISUPPORTS_INHERITED
@ -127,7 +127,7 @@ public:
class nsHTMLListBulletAccessible : public nsLeafAccessible
{
public:
nsHTMLListBulletAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLListBulletAccessible(nsIContent* aContent, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetName(nsAString& aName);
@ -148,7 +148,7 @@ public:
class nsHTMLListAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLListAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLListAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -164,7 +164,7 @@ public:
class nsHTMLLIAccessible : public nsHyperTextAccessibleWrap
{
public:
nsHTMLLIAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsHTMLLIAccessible(nsIContent* aContent, nsIWeakReference* aShell);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED

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

@ -41,7 +41,6 @@
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsDocAccessible.h"
#include "nsTextAttrs.h"
#include "Role.h"
#include "States.h"
@ -72,8 +71,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHyperTextAccessible::
nsHyperTextAccessible(nsIContent* aNode, nsDocAccessible* aDoc) :
nsAccessibleWrap(aNode, aDoc)
nsHyperTextAccessible(nsIContent *aNode, nsIWeakReference *aShell) :
nsAccessibleWrap(aNode, aShell)
{
mFlags |= eHyperTextAccessible;
}
@ -210,8 +209,7 @@ nsIntRect nsHyperTextAccessible::GetBoundsForString(nsIFrame *aFrame, PRUint32 a
&startContentOffsetInFrame, &frame);
NS_ENSURE_SUCCESS(rv, screenRect);
NS_ENSURE_TRUE(mDoc, screenRect);
nsIPresShell* shell = mDoc->PresShell();
nsCOMPtr<nsIPresShell> shell = GetPresShell();
NS_ENSURE_TRUE(shell, screenRect);
nsPresContext *context = shell->GetPresContext();
@ -884,10 +882,7 @@ nsresult nsHyperTextAccessible::GetTextHelper(EGetTextType aType, nsAccessibleTe
NS_ENSURE_ARG_POINTER(aEndOffset);
*aStartOffset = *aEndOffset = 0;
if (!mDoc)
return NS_ERROR_FAILURE;
nsIPresShell* presShell = mDoc->PresShell();
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
if (!presShell) {
return NS_ERROR_FAILURE;
}
@ -1298,10 +1293,7 @@ nsHyperTextAccessible::GetOffsetAtPoint(PRInt32 aX, PRInt32 aY,
PRUint32 aCoordType, PRInt32 *aOffset)
{
*aOffset = -1;
if (!mDoc)
return NS_ERROR_FAILURE;
nsIPresShell* shell = mDoc->PresShell();
nsCOMPtr<nsIPresShell> shell = GetPresShell();
if (!shell) {
return NS_ERROR_FAILURE;
}
@ -1551,12 +1543,14 @@ nsHyperTextAccessible::GetAssociatedEditor(nsIEditor **aEditor)
if (!editingSession)
return NS_OK; // No editing session interface
NS_ENSURE_TRUE(mDoc, NS_ERROR_FAILURE);
nsIDocument* docNode = mDoc->GetDocumentNode();
NS_ENSURE_TRUE(docNode, NS_ERROR_FAILURE);
nsCOMPtr<nsIPresShell> shell = GetPresShell();
NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
nsCOMPtr<nsIDocument> doc = shell->GetDocument();
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
nsCOMPtr<nsIEditor> editor;
return editingSession->GetEditorForWindow(docNode->GetWindow(), aEditor);
return editingSession->GetEditorForWindow(doc->GetWindow(), aEditor);
}
/**
@ -1594,10 +1588,11 @@ nsHyperTextAccessible::SetSelectionRange(PRInt32 aStartPos, PRInt32 aEndPos)
// Now that selection is done, move the focus to the selection.
nsFocusManager* DOMFocusManager = nsFocusManager::GetFocusManager();
if (DOMFocusManager) {
NS_ENSURE_TRUE(mDoc, NS_ERROR_FAILURE);
nsIDocument* docNode = mDoc->GetDocumentNode();
NS_ENSURE_TRUE(docNode, NS_ERROR_FAILURE);
nsCOMPtr<nsPIDOMWindow> window = docNode->GetWindow();
nsCOMPtr<nsIPresShell> shell = GetPresShell();
NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
nsCOMPtr<nsIDocument> doc = shell->GetDocument();
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
nsCOMPtr<nsPIDOMWindow> window = doc->GetWindow();
nsCOMPtr<nsIDOMElement> result;
DOMFocusManager->MoveFocus(window, nsnull, nsIFocusManager::MOVEFOCUS_CARET,
nsIFocusManager::FLAG_BYMOVEFOCUS, getter_AddRefs(result));

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

@ -76,9 +76,7 @@ class nsHyperTextAccessible : public nsAccessibleWrap,
public nsIAccessibleEditableText
{
public:
nsHyperTextAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsHyperTextAccessible() { }
nsHyperTextAccessible(nsIContent *aContent, nsIWeakReference *aShell);
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLETEXT
NS_DECL_NSIACCESSIBLEHYPERTEXT

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

@ -613,7 +613,7 @@ GetNativeFromGeckoAccessible(nsIAccessible *anAccessible)
// Get a pointer to the native window (NSWindow) we reside in.
NSWindow *nativeWindow = nil;
nsDocAccessible* docAcc = accWrap->Document();
nsDocAccessible* docAcc = accWrap->GetDocAccessible();
if (docAcc)
nativeWindow = static_cast<NSWindow*>(docAcc->GetNativeWindow());

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

@ -47,12 +47,12 @@
class nsAccessNodeWrap : public nsAccessNode
{
public:
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc);
virtual ~nsAccessNodeWrap();
public: // construction, destruction
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsAccessNodeWrap();
static void InitAccessibility();
static void ShutdownAccessibility();
static void InitAccessibility();
static void ShutdownAccessibility();
};
#endif

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

@ -52,8 +52,8 @@
//-----------------------------------------------------
nsAccessNodeWrap::
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessNode(aContent, aDoc)
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessNode(aContent, aShell)
{
}

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

@ -62,7 +62,7 @@
class nsAccessibleWrap : public nsAccessible
{
public: // construction, destruction
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
nsAccessibleWrap(nsIContent* aContent, nsIWeakReference* aShell);
virtual ~nsAccessibleWrap();
/**

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

@ -51,8 +51,8 @@
using namespace mozilla::a11y;
nsAccessibleWrap::
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessible(aContent, aDoc), mNativeObject(nil),
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessible(aContent, aShell), mNativeObject(nil),
mNativeInited(false)
{
}

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

@ -53,8 +53,8 @@ class nsARIAGridAccessibleWrap : public nsARIAGridAccessible,
public CAccessibleTable
{
public:
nsARIAGridAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsARIAGridAccessible(aContent, aDoc) {}
nsARIAGridAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsARIAGridAccessible(aContent, aShell) {}
// IUnknown
DECL_IUNKNOWN_INHERITED
@ -71,8 +71,8 @@ class nsARIAGridCellAccessibleWrap : public nsARIAGridCellAccessible,
public CAccessibleTableCell
{
public:
nsARIAGridCellAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsARIAGridCellAccessible(aContent, aDoc) {}
nsARIAGridCellAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsARIAGridCellAccessible(aContent, aShell) {}
// IUnknown
DECL_IUNKNOWN_INHERITED

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

@ -70,8 +70,8 @@ AccTextChangeEvent* nsAccessNodeWrap::gTextEvent = nsnull;
////////////////////////////////////////////////////////////////////////////////
nsAccessNodeWrap::
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessNode(aContent, aDoc)
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessNode(aContent, aShell)
{
}
@ -412,7 +412,8 @@ nsAccessNodeWrap::MakeAccessNode(nsINode *aNode)
nsAccessNodeWrap *newNode = NULL;
ISimpleDOMNode *iNode = NULL;
nsAccessible* acc = mDoc->GetAccessible(aNode);
nsAccessible *acc =
GetAccService()->GetAccessibleInWeakShell(aNode, mWeakShell);
if (acc) {
IAccessible *msaaAccessible = nsnull;
acc->GetNativeInterface((void**)&msaaAccessible); // addrefs
@ -426,7 +427,7 @@ nsAccessNodeWrap::MakeAccessNode(nsINode *aNode)
return NULL;
}
newNode = new nsAccessNodeWrap(content, mDoc);
newNode = new nsAccessNodeWrap(content, mWeakShell);
if (!newNode)
return NULL;

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

@ -83,7 +83,7 @@ class nsAccessNodeWrap : public nsAccessNode,
STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, void** ppv);
public: // construction, destruction
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc);
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsAccessNodeWrap();
// IUnknown

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

@ -97,8 +97,8 @@ ITypeInfo* nsAccessibleWrap::gTypeInfo = NULL;
// construction
//-----------------------------------------------------
nsAccessibleWrap::
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessible(aContent, aDoc), mEnumVARIANTPosition(0)
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessible(aContent, aShell), mEnumVARIANTPosition(0)
{
}
@ -1516,7 +1516,7 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
return NS_OK;
// Means we're not active.
NS_ENSURE_TRUE(!IsDefunct(), NS_ERROR_FAILURE);
NS_ENSURE_TRUE(mWeakShell, NS_ERROR_FAILURE);
nsAccessible *accessible = aEvent->GetAccessible();
if (!accessible)
@ -1587,10 +1587,6 @@ HWND
nsAccessibleWrap::GetHWNDFor(nsAccessible *aAccessible)
{
if (aAccessible) {
nsDocAccessible* document = aAccessible->Document();
if(!document)
return nsnull;
// Popup lives in own windows, use its HWND until the popup window is
// hidden to make old JAWS versions work with collapsed comboboxes (see
// discussion in bug 379678).
@ -1601,7 +1597,7 @@ nsAccessibleWrap::GetHWNDFor(nsAccessible *aAccessible)
bool isVisible = false;
widget->IsVisible(isVisible);
if (isVisible) {
nsCOMPtr<nsIPresShell> shell(document->PresShell());
nsCOMPtr<nsIPresShell> shell(aAccessible->GetPresShell());
nsIViewManager* vm = shell->GetViewManager();
if (vm) {
nsCOMPtr<nsIWidget> rootWidget;
@ -1616,7 +1612,9 @@ nsAccessibleWrap::GetHWNDFor(nsAccessible *aAccessible)
}
}
return static_cast<HWND>(document->GetNativeWindow());
nsDocAccessible* document = aAccessible->GetDocAccessible();
if (document)
return static_cast<HWND>(document->GetNativeWindow());
}
return nsnull;
}
@ -1744,7 +1742,7 @@ nsAccessibleWrap::GetXPAccessibleFor(const VARIANT& aVarChild)
// ARIA document.
if (ARIARole() == roles::DOCUMENT) {
nsDocAccessible* document = Document();
nsDocAccessible* document = GetDocAccessible();
nsAccessible* child =
document->GetAccessibleByUniqueIDInSubtree(uniqueID);

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

@ -104,7 +104,7 @@ class nsAccessibleWrap : public nsAccessible,
public IEnumVARIANT
{
public: // construction, destruction
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsAccessibleWrap();
// nsISupports

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

@ -48,8 +48,8 @@ class nsHTMLImageAccessibleWrap : public nsHTMLImageAccessible,
public CAccessibleImage
{
public:
nsHTMLImageAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHTMLImageAccessible(aContent, aDoc) {}
nsHTMLImageAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsHTMLImageAccessible(aContent, aShell) {}
// IUnknown
DECL_IUNKNOWN_INHERITED

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

@ -54,8 +54,8 @@ class nsHTMLTableAccessibleWrap : public nsHTMLTableAccessible,
public CAccessibleTable
{
public:
nsHTMLTableAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHTMLTableAccessible(aContent, aDoc) {}
nsHTMLTableAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsHTMLTableAccessible(aContent, aShell) {}
// IUnknown
DECL_IUNKNOWN_INHERITED
@ -73,8 +73,8 @@ class nsHTMLTableCellAccessibleWrap : public nsHTMLTableCellAccessible,
public CAccessibleTableCell
{
public:
nsHTMLTableCellAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHTMLTableCellAccessible(aContent, aDoc) {}
nsHTMLTableCellAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsHTMLTableCellAccessible(aContent, aShell) {}
// IUnknown
DECL_IUNKNOWN_INHERITED
@ -92,9 +92,9 @@ class nsHTMLTableHeaderCellAccessibleWrap : public nsHTMLTableHeaderCellAccessib
public CAccessibleTableCell
{
public:
nsHTMLTableHeaderCellAccessibleWrap(nsIContent* aContent,
nsDocAccessible* aDoc) :
nsHTMLTableHeaderCellAccessible(aContent, aDoc) {}
nsHTMLTableHeaderCellAccessibleWrap(nsIContent *aContent,
nsIWeakReference *aShell) :
nsHTMLTableHeaderCellAccessible(aContent, aShell) {}
// IUnknown
DECL_IUNKNOWN_INHERITED

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

@ -48,9 +48,9 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsHTMLWin32ObjectOwnerAccessible::
nsHTMLWin32ObjectOwnerAccessible(nsIContent* aContent,
nsDocAccessible* aDoc, void* aHwnd) :
nsAccessibleWrap(aContent, aDoc), mHwnd(aHwnd)
nsHTMLWin32ObjectOwnerAccessible(nsIContent *aContent,
nsIWeakReference *aShell, void *aHwnd) :
nsAccessibleWrap(aContent, aShell), mHwnd(aHwnd)
{
// Our only child is a nsHTMLWin32ObjectAccessible object.
mNativeAccessible = new nsHTMLWin32ObjectAccessible(mHwnd);

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

@ -53,8 +53,8 @@ public:
// because the native plugin accessible doesn't know where it exists in the
// Mozilla tree, and returns null for previous and next sibling. This would
// have the effect of cutting off all content after the plugin.
nsHTMLWin32ObjectOwnerAccessible(nsIContent* aContent,
nsDocAccessible* aDoc, void* aHwnd);
nsHTMLWin32ObjectOwnerAccessible(nsIContent *aContent,
nsIWeakReference *aShell, void *aHwnd);
virtual ~nsHTMLWin32ObjectOwnerAccessible() {}
// nsAccessNode

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

@ -51,8 +51,8 @@ class nsHyperTextAccessibleWrap : public nsHyperTextAccessible,
public CAccessibleEditableText
{
public:
nsHyperTextAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessible(aContent, aDoc) {}
nsHyperTextAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessible(aContent, aShell) {}
// IUnknown
DECL_IUNKNOWN_INHERITED

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

@ -56,8 +56,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsTextAccessibleWrap::
nsTextAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsTextAccessible(aContent, aDoc)
nsTextAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsTextAccessible(aContent, aShell)
{
}
@ -129,7 +129,7 @@ __try {
return rv;
}
nsDocAccessible* docAccessible = Document();
nsDocAccessible *docAccessible = GetDocAccessible();
NS_ASSERTION(docAccessible,
"There must always be a doc accessible, but there isn't. Crash!");

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

@ -50,7 +50,7 @@ class nsTextAccessibleWrap : public nsTextAccessible,
public ISimpleDOMText
{
public:
nsTextAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
nsTextAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsTextAccessibleWrap() {}
// IUnknown methods - see iunknown.h for documentation

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

@ -43,8 +43,8 @@
////////////////////////////////////////////////////////////////////////////////
nsXULListboxAccessibleWrap::
nsXULListboxAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXULListboxAccessible(aContent, aDoc)
nsXULListboxAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsXULListboxAccessible(aContent, aShell)
{
}
@ -62,8 +62,8 @@ IMPL_IUNKNOWN_QUERY_TAIL
////////////////////////////////////////////////////////////////////////////////
nsXULListCellAccessibleWrap::
nsXULListCellAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXULListCellAccessible(aContent, aDoc)
nsXULListCellAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsXULListCellAccessible(aContent, aShell)
{
}

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

@ -52,7 +52,7 @@ class nsXULListboxAccessibleWrap : public nsXULListboxAccessible,
public CAccessibleTable
{
public:
nsXULListboxAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULListboxAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
// IUnknown
DECL_IUNKNOWN_INHERITED
@ -69,7 +69,7 @@ class nsXULListCellAccessibleWrap : public nsXULListCellAccessible,
public CAccessibleTableCell
{
public:
nsXULListCellAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULListCellAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
// IUnknown
DECL_IUNKNOWN_INHERITED

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

@ -43,8 +43,8 @@
////////////////////////////////////////////////////////////////////////////////
nsXULMenuitemAccessibleWrap::
nsXULMenuitemAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXULMenuitemAccessible(aContent, aDoc)
nsXULMenuitemAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsXULMenuitemAccessible(aContent, aShell)
{
}

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

@ -43,7 +43,7 @@
class nsXULMenuitemAccessibleWrap : public nsXULMenuitemAccessible
{
public:
nsXULMenuitemAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULMenuitemAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsXULMenuitemAccessibleWrap() {}
// nsIAccessible

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

@ -44,8 +44,8 @@
////////////////////////////////////////////////////////////////////////////////
nsXULTreeGridAccessibleWrap::
nsXULTreeGridAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXULTreeGridAccessible(aContent, aDoc)
nsXULTreeGridAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsXULTreeGridAccessible(aContent, aShell)
{
}
@ -62,13 +62,13 @@ IMPL_IUNKNOWN_INHERITED1(nsXULTreeGridAccessibleWrap,
////////////////////////////////////////////////////////////////////////////////
nsXULTreeGridCellAccessibleWrap::
nsXULTreeGridCellAccessibleWrap(nsIContent* aContent,
nsDocAccessible* aDoc,
nsXULTreeGridRowAccessible* aRowAcc,
nsITreeBoxObject* aTree,
nsITreeView* aTreeView,
nsXULTreeGridCellAccessibleWrap(nsIContent *aContent,
nsIWeakReference *aShell,
nsXULTreeGridRowAccessible *aRowAcc,
nsITreeBoxObject *aTree,
nsITreeView *aTreeView,
PRInt32 aRow, nsITreeColumn* aColumn) :
nsXULTreeGridCellAccessible(aContent, aDoc, aRowAcc, aTree, aTreeView,
nsXULTreeGridCellAccessible(aContent, aShell, aRowAcc, aTree, aTreeView,
aRow, aColumn)
{
}

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

@ -53,7 +53,7 @@ class nsXULTreeGridAccessibleWrap : public nsXULTreeGridAccessible,
public CAccessibleTable
{
public:
nsXULTreeGridAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULTreeGridAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
// IUnknown
DECL_IUNKNOWN_INHERITED
@ -70,11 +70,11 @@ class nsXULTreeGridCellAccessibleWrap : public nsXULTreeGridCellAccessible,
public CAccessibleTableCell
{
public:
nsXULTreeGridCellAccessibleWrap(nsIContent* aContent,
nsDocAccessible* aDoc,
nsXULTreeGridRowAccessible* aRowAcc,
nsITreeBoxObject* aTree,
nsITreeView* aTreeView,
nsXULTreeGridCellAccessibleWrap(nsIContent *aContent,
nsIWeakReference *aShell,
nsXULTreeGridRowAccessible *aRowAcc,
nsITreeBoxObject *aTree,
nsITreeView *aTreeView,
PRInt32 aRow, nsITreeColumn* aColumn);
// IUnknown

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

@ -52,8 +52,8 @@
//-----------------------------------------------------
nsAccessNodeWrap::
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessNode(aContent, aDoc)
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference* aShell) :
nsAccessNode(aContent, aShell)
{
}

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

@ -48,7 +48,7 @@
class nsAccessNodeWrap : public nsAccessNode
{
public: // construction, destruction
nsAccessNodeWrap(nsIContent* aContent, nsDocAccessible* aDoc);
nsAccessNodeWrap(nsIContent *aContent, nsIWeakReference* aShell);
virtual ~nsAccessNodeWrap();
static void InitAccessibility();

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

@ -42,8 +42,8 @@
// construction
//-----------------------------------------------------
nsAccessibleWrap::
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessible(aContent, aDoc)
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessible(aContent, aShell)
{
}

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

@ -49,7 +49,7 @@
class nsAccessibleWrap : public nsAccessible
{
public: // construction, destruction
nsAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc);
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsAccessibleWrap();
protected:

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

@ -40,7 +40,6 @@
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsDocAccessible.h"
#include "nsTextEquivUtils.h"
#include "Role.h"
#include "States.h"
@ -78,8 +77,8 @@ nsXFormsAccessibleBase::nsXFormsAccessibleBase()
////////////////////////////////////////////////////////////////////////////////
nsXFormsAccessible::
nsXFormsAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsXFormsAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}
@ -124,7 +123,7 @@ nsXFormsAccessible::CacheSelectChildren(nsIDOMNode *aContainerNode)
if (!children)
return;
nsIPresShell* presShell(mDoc->PresShell());
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
PRUint32 length = 0;
children->GetLength(&length);
@ -137,7 +136,7 @@ nsXFormsAccessible::CacheSelectChildren(nsIDOMNode *aContainerNode)
nsCOMPtr<nsIContent> child(do_QueryInterface(DOMChild));
nsAccessible* accessible =
GetAccService()->GetOrCreateAccessible(child, presShell, mDoc->GetWeakShell());
GetAccService()->GetOrCreateAccessible(child, presShell, mWeakShell);
if (!accessible)
continue;
@ -225,8 +224,8 @@ nsXFormsAccessible::GetAllowsAnonChildAccessibles()
////////////////////////////////////////////////////////////////////////////////
nsXFormsContainerAccessible::
nsXFormsContainerAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
nsXFormsContainerAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
{
}
@ -248,8 +247,8 @@ nsXFormsContainerAccessible::GetAllowsAnonChildAccessibles()
////////////////////////////////////////////////////////////////////////////////
nsXFormsEditableAccessible::
nsXFormsEditableAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
nsXFormsEditableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
{
}
@ -298,8 +297,8 @@ nsXFormsEditableAccessible::GetAssociatedEditor(nsIEditor **aEditor)
////////////////////////////////////////////////////////////////////////////////
nsXFormsSelectableAccessible::
nsXFormsSelectableAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsEditableAccessible(aContent, aDoc), mIsSelect1Element(nsnull)
nsXFormsSelectableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsEditableAccessible(aContent, aShell), mIsSelect1Element(nsnull)
{
mIsSelect1Element =
mContent->NodeInfo()->Equals(nsGkAtoms::select1);
@ -326,11 +325,12 @@ nsXFormsSelectableAccessible::SelectedItems()
nsCOMPtr<nsIDOMNode> itemDOMNode;
rv = sXFormsService->GetSelectedItemForSelect1(DOMNode,
getter_AddRefs(itemDOMNode));
if (NS_FAILED(rv) || !itemDOMNode || !mDoc)
if (NS_FAILED(rv) || !itemDOMNode)
return nsnull;
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
nsIAccessible* item = mDoc->GetAccessible(itemNode);
nsIAccessible* item = GetAccService()->GetAccessibleInWeakShell(itemNode,
mWeakShell);
if (item)
selectedItems->AppendElement(item, false);
@ -342,12 +342,11 @@ nsXFormsSelectableAccessible::SelectedItems()
nsCOMPtr<nsIDOMNodeList> itemNodeList;
rv = sXFormsService->GetSelectedItemsForSelect(DOMNode,
getter_AddRefs(itemNodeList));
if (NS_FAILED(rv) || !itemNodeList || !mDoc)
if (NS_FAILED(rv) || !itemNodeList)
return nsnull;
PRUint32 length = 0;
itemNodeList->GetLength(&length);
for (PRUint32 index = 0; index < length; index++) {
nsCOMPtr<nsIDOMNode> itemDOMNode;
itemNodeList->Item(index, getter_AddRefs(itemDOMNode));
@ -355,7 +354,8 @@ nsXFormsSelectableAccessible::SelectedItems()
return nsnull;
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
nsIAccessible* item = mDoc->GetAccessible(itemNode);
nsIAccessible* item = GetAccService()->GetAccessibleInWeakShell(itemNode,
mWeakShell);
if (item)
selectedItems->AppendElement(item, false);
}
@ -430,9 +430,6 @@ nsXFormsSelectableAccessible::RemoveItemFromSelection(PRUint32 aIndex)
nsAccessible*
nsXFormsSelectableAccessible::GetSelectedItem(PRUint32 aIndex)
{
if (!mDoc)
return nsnull;
nsresult rv;
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
if (mIsSelect1Element) {
@ -444,7 +441,7 @@ nsXFormsSelectableAccessible::GetSelectedItem(PRUint32 aIndex)
getter_AddRefs(itemDOMNode));
if (NS_SUCCEEDED(rv) && itemDOMNode) {
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
return mDoc->GetAccessible(itemNode);
return GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
}
return nsnull;
}
@ -459,7 +456,7 @@ nsXFormsSelectableAccessible::GetSelectedItem(PRUint32 aIndex)
itemNodeList->Item(aIndex, getter_AddRefs(itemDOMNode));
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
return mDoc->GetAccessible(itemNode);
return GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
}
bool
@ -537,9 +534,9 @@ nsXFormsSelectableAccessible::GetItemByIndex(PRUint32* aIndex,
////////////////////////////////////////////////////////////////////////////////
nsXFormsSelectableItemAccessible::
nsXFormsSelectableItemAccessible(nsIContent* aContent,
nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
nsXFormsSelectableItemAccessible(nsIContent *aContent,
nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
{
}

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

@ -70,7 +70,7 @@ class nsXFormsAccessible : public nsHyperTextAccessibleWrap,
public nsXFormsAccessibleBase
{
public:
nsXFormsAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
@ -124,7 +124,7 @@ protected:
class nsXFormsContainerAccessible : public nsXFormsAccessible
{
public:
nsXFormsContainerAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsContainerAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -142,7 +142,7 @@ public:
class nsXFormsEditableAccessible : public nsXFormsAccessible
{
public:
nsXFormsEditableAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsEditableAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessibleEditableText
NS_IMETHOD GetAssociatedEditor(nsIEditor **aEditor);
@ -159,7 +159,7 @@ public:
class nsXFormsSelectableAccessible : public nsXFormsEditableAccessible
{
public:
nsXFormsSelectableAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsSelectableAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// SelectAccessible
virtual bool IsSelect();
@ -186,8 +186,8 @@ protected:
class nsXFormsSelectableItemAccessible : public nsXFormsAccessible
{
public:
nsXFormsSelectableItemAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
nsXFormsSelectableItemAccessible(nsIContent *aContent,
nsIWeakReference *aShell);
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD DoAction(PRUint8 aIndex);

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

@ -49,8 +49,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsXFormsLabelAccessible::
nsXFormsLabelAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
nsXFormsLabelAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
{
}
@ -81,8 +81,8 @@ nsXFormsLabelAccessible::Description(nsString& aDescription)
////////////////////////////////////////////////////////////////////////////////
nsXFormsOutputAccessible::
nsXFormsOutputAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
nsXFormsOutputAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
{
}
@ -98,8 +98,8 @@ nsXFormsOutputAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsXFormsTriggerAccessible::
nsXFormsTriggerAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
nsXFormsTriggerAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
{
}
@ -148,8 +148,8 @@ nsXFormsTriggerAccessible::DoAction(PRUint8 aIndex)
////////////////////////////////////////////////////////////////////////////////
nsXFormsInputAccessible::
nsXFormsInputAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsEditableAccessible(aContent, aDoc)
nsXFormsInputAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsEditableAccessible(aContent, aShell)
{
}
@ -193,8 +193,8 @@ nsXFormsInputAccessible::DoAction(PRUint8 aIndex)
////////////////////////////////////////////////////////////////////////////////
nsXFormsInputBooleanAccessible::
nsXFormsInputBooleanAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
nsXFormsInputBooleanAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
{
}
@ -261,8 +261,8 @@ nsXFormsInputBooleanAccessible::DoAction(PRUint8 aIndex)
////////////////////////////////////////////////////////////////////////////////
nsXFormsInputDateAccessible::
nsXFormsInputDateAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsContainerAccessible(aContent, aDoc)
nsXFormsInputDateAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsContainerAccessible(aContent, aShell)
{
}
@ -278,8 +278,8 @@ nsXFormsInputDateAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsXFormsSecretAccessible::
nsXFormsSecretAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsInputAccessible(aContent, aDoc)
nsXFormsSecretAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsInputAccessible(aContent, aShell)
{
}
@ -307,8 +307,8 @@ nsXFormsSecretAccessible::GetValue(nsAString& aValue)
////////////////////////////////////////////////////////////////////////////////
nsXFormsRangeAccessible::
nsXFormsRangeAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
nsXFormsRangeAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
{
}
@ -400,8 +400,8 @@ nsXFormsRangeAccessible::GetCurrentValue(double *aCurrentValue)
////////////////////////////////////////////////////////////////////////////////
nsXFormsSelectAccessible::
nsXFormsSelectAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsContainerAccessible(aContent, aDoc)
nsXFormsSelectAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsContainerAccessible(aContent, aShell)
{
}
@ -427,8 +427,8 @@ nsXFormsSelectAccessible::NativeState()
////////////////////////////////////////////////////////////////////////////////
nsXFormsChoicesAccessible::
nsXFormsChoicesAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
nsXFormsChoicesAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
{
}
@ -457,8 +457,8 @@ nsXFormsChoicesAccessible::CacheChildren()
////////////////////////////////////////////////////////////////////////////////
nsXFormsSelectFullAccessible::
nsXFormsSelectFullAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsSelectableAccessible(aContent, aDoc)
nsXFormsSelectFullAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsSelectableAccessible(aContent, aShell)
{
}
@ -480,8 +480,8 @@ nsXFormsSelectFullAccessible::CacheChildren()
////////////////////////////////////////////////////////////////////////////////
nsXFormsItemCheckgroupAccessible::
nsXFormsItemCheckgroupAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsSelectableItemAccessible(aContent, aDoc)
nsXFormsItemCheckgroupAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsSelectableItemAccessible(aContent, aShell)
{
}
@ -522,8 +522,8 @@ nsXFormsItemCheckgroupAccessible::GetActionName(PRUint8 aIndex, nsAString& aName
////////////////////////////////////////////////////////////////////////////////
nsXFormsItemRadiogroupAccessible::
nsXFormsItemRadiogroupAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsSelectableItemAccessible(aContent, aDoc)
nsXFormsItemRadiogroupAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsSelectableItemAccessible(aContent, aShell)
{
}
@ -560,8 +560,8 @@ nsXFormsItemRadiogroupAccessible::GetActionName(PRUint8 aIndex, nsAString& aName
////////////////////////////////////////////////////////////////////////////////
nsXFormsSelectComboboxAccessible::
nsXFormsSelectComboboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsSelectableAccessible(aContent, aDoc)
nsXFormsSelectComboboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsSelectableAccessible(aContent, aShell)
{
}
@ -601,8 +601,8 @@ nsXFormsSelectComboboxAccessible::GetAllowsAnonChildAccessibles()
////////////////////////////////////////////////////////////////////////////////
nsXFormsItemComboboxAccessible::
nsXFormsItemComboboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXFormsSelectableItemAccessible(aContent, aDoc)
nsXFormsItemComboboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXFormsSelectableItemAccessible(aContent, aShell)
{
}

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

@ -48,7 +48,7 @@
class nsXFormsLabelAccessible : public nsXFormsAccessible
{
public:
nsXFormsLabelAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsLabelAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual void Description(nsString& aDescription);
@ -63,7 +63,7 @@ public:
class nsXFormsOutputAccessible : public nsXFormsAccessible
{
public:
nsXFormsOutputAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsOutputAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -76,7 +76,7 @@ public:
class nsXFormsTriggerAccessible : public nsXFormsAccessible
{
public:
nsXFormsTriggerAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsTriggerAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
@ -98,7 +98,7 @@ public:
class nsXFormsInputAccessible : public nsXFormsEditableAccessible
{
public:
nsXFormsInputAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsInputAccessible(nsIContent *aContent, nsIWeakReference *aShell);
NS_DECL_ISUPPORTS_INHERITED
@ -120,7 +120,7 @@ public:
class nsXFormsInputBooleanAccessible : public nsXFormsAccessible
{
public:
nsXFormsInputBooleanAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsInputBooleanAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -141,7 +141,7 @@ public:
class nsXFormsInputDateAccessible : public nsXFormsContainerAccessible
{
public:
nsXFormsInputDateAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsInputDateAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -154,7 +154,7 @@ public:
class nsXFormsSecretAccessible : public nsXFormsInputAccessible
{
public:
nsXFormsSecretAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsSecretAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
@ -172,7 +172,7 @@ public:
class nsXFormsRangeAccessible : public nsXFormsAccessible
{
public:
nsXFormsRangeAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsRangeAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessibleValue
NS_IMETHOD GetMaximumValue(double *aMaximumValue);
@ -194,7 +194,7 @@ public:
class nsXFormsSelectAccessible : public nsXFormsContainerAccessible
{
public:
nsXFormsSelectAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsSelectAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual PRUint64 NativeState();
@ -208,7 +208,7 @@ public:
class nsXFormsChoicesAccessible : public nsXFormsAccessible
{
public:
nsXFormsChoicesAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsChoicesAccessible(nsIContent* aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
@ -230,7 +230,7 @@ protected:
class nsXFormsSelectFullAccessible : public nsXFormsSelectableAccessible
{
public:
nsXFormsSelectFullAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXFormsSelectFullAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -250,8 +250,8 @@ protected:
class nsXFormsItemCheckgroupAccessible : public nsXFormsSelectableItemAccessible
{
public:
nsXFormsItemCheckgroupAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
nsXFormsItemCheckgroupAccessible(nsIContent *aContent,
nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -271,8 +271,8 @@ public:
class nsXFormsItemRadiogroupAccessible : public nsXFormsSelectableItemAccessible
{
public:
nsXFormsItemRadiogroupAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
nsXFormsItemRadiogroupAccessible(nsIContent *aContent,
nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -291,8 +291,8 @@ public:
class nsXFormsSelectComboboxAccessible : public nsXFormsSelectableAccessible
{
public:
nsXFormsSelectComboboxAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
nsXFormsSelectComboboxAccessible(nsIContent *aContent,
nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -310,8 +310,8 @@ public:
class nsXFormsItemComboboxAccessible : public nsXFormsSelectableItemAccessible
{
public:
nsXFormsItemComboboxAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
nsXFormsItemComboboxAccessible(nsIContent *aContent,
nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);

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

@ -48,9 +48,9 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsXFormsDropmarkerWidgetAccessible::
nsXFormsDropmarkerWidgetAccessible(nsIContent* aContent,
nsDocAccessible* aDoc) :
nsLeafAccessible(aContent, aDoc)
nsXFormsDropmarkerWidgetAccessible(nsIContent *aContent,
nsIWeakReference *aShell) :
nsLeafAccessible(aContent, aShell)
{
}
@ -113,8 +113,8 @@ nsXFormsDropmarkerWidgetAccessible::DoAction(PRUint8 aIndex)
////////////////////////////////////////////////////////////////////////////////
nsXFormsCalendarWidgetAccessible::
nsXFormsCalendarWidgetAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXFormsCalendarWidgetAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}
@ -130,9 +130,9 @@ nsXFormsCalendarWidgetAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsXFormsComboboxPopupWidgetAccessible::
nsXFormsComboboxPopupWidgetAccessible(nsIContent* aContent,
nsDocAccessible* aDoc) :
nsXFormsAccessible(aContent, aDoc)
nsXFormsComboboxPopupWidgetAccessible(nsIContent *aContent,
nsIWeakReference *aShell) :
nsXFormsAccessible(aContent, aShell)
{
}

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

@ -51,8 +51,8 @@ class nsXFormsDropmarkerWidgetAccessible : public nsLeafAccessible,
public nsXFormsAccessibleBase
{
public:
nsXFormsDropmarkerWidgetAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
nsXFormsDropmarkerWidgetAccessible(nsIContent *aContent,
nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -73,8 +73,8 @@ public:
class nsXFormsCalendarWidgetAccessible : public nsAccessibleWrap
{
public:
nsXFormsCalendarWidgetAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
nsXFormsCalendarWidgetAccessible(nsIContent *aContent,
nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -88,8 +88,8 @@ public:
class nsXFormsComboboxPopupWidgetAccessible : public nsXFormsAccessible
{
public:
nsXFormsComboboxPopupWidgetAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
nsXFormsComboboxPopupWidgetAccessible(nsIContent *aContent,
nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);

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

@ -61,8 +61,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
XULSelectControlAccessible::
XULSelectControlAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
XULSelectControlAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
mSelectControl = do_QueryInterface(aContent);
}
@ -92,7 +92,7 @@ XULSelectControlAccessible::SelectedItems()
{
nsCOMPtr<nsIMutableArray> selectedItems =
do_CreateInstance(NS_ARRAY_CONTRACTID);
if (!selectedItems || !mDoc)
if (!selectedItems)
return nsnull;
// For XUL multi-select control
@ -105,7 +105,8 @@ XULSelectControlAccessible::SelectedItems()
nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
xulMultiSelect->GetSelectedItem(index, getter_AddRefs(itemElm));
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
nsAccessible* item = mDoc->GetAccessible(itemNode);
nsAccessible* item =
GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
if (item)
selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
false);
@ -115,12 +116,13 @@ XULSelectControlAccessible::SelectedItems()
mSelectControl->GetSelectedItem(getter_AddRefs(itemElm));
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
if(itemNode) {
nsAccessible* item = mDoc->GetAccessible(itemNode);
nsAccessible* item =
GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
if (item)
selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
false);
}
}
}
nsIMutableArray* items = nsnull;
selectedItems.forget(&items);
@ -140,7 +142,8 @@ XULSelectControlAccessible::GetSelectedItem(PRUint32 aIndex)
mSelectControl->GetSelectedItem(getter_AddRefs(itemElm));
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
return itemNode && mDoc ? mDoc->GetAccessible(itemNode) : nsnull;
return itemNode ?
GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell) : nsnull;
}
PRUint32
@ -281,7 +284,7 @@ XULSelectControlAccessible::CurrentItem()
DOMNode = do_QueryInterface(currentItemElm);
if (DOMNode) {
nsDocAccessible* document = Document();
nsDocAccessible* document = GetDocAccessible();
if (document)
return document->GetAccessible(DOMNode);
}

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

@ -49,7 +49,7 @@
class XULSelectControlAccessible : public nsAccessibleWrap
{
public:
XULSelectControlAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
XULSelectControlAccessible(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~XULSelectControlAccessible() {}
// nsAccessNode

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

@ -47,8 +47,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsXULAlertAccessible::
nsXULAlertAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULAlertAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}

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

@ -47,7 +47,7 @@
class nsXULAlertAccessible : public nsAccessibleWrap
{
public:
nsXULAlertAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULAlertAccessible(nsIContent *aContent, nsIWeakReference *aShell);
NS_DECL_ISUPPORTS_INHERITED

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

@ -55,8 +55,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsXULColorPickerTileAccessible::
nsXULColorPickerTileAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULColorPickerTileAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}
@ -117,8 +117,8 @@ nsXULColorPickerTileAccessible::ContainerWidget() const
////////////////////////////////////////////////////////////////////////////////
nsXULColorPickerAccessible::
nsXULColorPickerAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXULColorPickerTileAccessible(aContent, aDoc)
nsXULColorPickerAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXULColorPickerTileAccessible(aContent, aShell)
{
mFlags |= eMenuButtonAccessible;
}
@ -177,9 +177,7 @@ nsXULColorPickerAccessible::AreItemsOperable() const
void
nsXULColorPickerAccessible::CacheChildren()
{
NS_ENSURE_TRUE(mDoc,);
nsAccTreeWalker walker(mDoc->GetWeakShell(), mContent, true);
nsAccTreeWalker walker(mWeakShell, mContent, true);
nsAccessible* child = nsnull;
while ((child = walker.NextChild())) {
@ -192,6 +190,6 @@ nsXULColorPickerAccessible::CacheChildren()
}
// Unbind rejected accessibles from the document.
Document()->UnbindFromDocument(child);
GetDocAccessible()->UnbindFromDocument(child);
}
}

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

@ -47,8 +47,8 @@
class nsXULColorPickerTileAccessible : public nsAccessibleWrap
{
public:
nsXULColorPickerTileAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
nsXULColorPickerTileAccessible(nsIContent *aContent,
nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& _retval);
@ -68,7 +68,7 @@ public:
class nsXULColorPickerAccessible : public nsXULColorPickerTileAccessible
{
public:
nsXULColorPickerAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULColorPickerAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();

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

@ -41,7 +41,6 @@
#include "nsXULComboboxAccessible.h"
#include "nsAccessibilityService.h"
#include "nsDocAccessible.h"
#include "nsCoreUtils.h"
#include "Role.h"
#include "States.h"
@ -57,8 +56,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsXULComboboxAccessible::
nsXULComboboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULComboboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
nsGkAtoms::autocomplete, eIgnoreCase))
@ -132,8 +131,9 @@ nsXULComboboxAccessible::Description(nsString& aDescription)
menuListElm->GetSelectedItem(getter_AddRefs(focusedOptionItem));
nsCOMPtr<nsIContent> focusedOptionContent =
do_QueryInterface(focusedOptionItem);
if (focusedOptionContent && mDoc) {
nsAccessible* focusedOptionAcc = mDoc->GetAccessible(focusedOptionContent);
if (focusedOptionContent) {
nsAccessible* focusedOptionAcc = GetAccService()->
GetAccessibleInWeakShell(focusedOptionContent, mWeakShell);
if (focusedOptionAcc)
focusedOptionAcc->Description(aDescription);
}

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

@ -50,7 +50,7 @@ class nsXULComboboxAccessible : public nsAccessibleWrap
public:
enum { eAction_Click = 0 };
nsXULComboboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULComboboxAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);

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

@ -71,8 +71,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsXULButtonAccessible::
nsXULButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
if (ContainsMenu())
mFlags |= eMenuButtonAccessible;
@ -226,14 +226,13 @@ nsXULButtonAccessible::CacheChildren()
mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
nsGkAtoms::menuButton, eCaseMatters);
NS_ENSURE_TRUE(mDoc,);
if (!isMenu && !isMenuButton)
return;
nsAccessible* menupopup = nsnull;
nsAccessible* button = nsnull;
nsAccTreeWalker walker(mDoc->GetWeakShell(), mContent, true);
nsAccTreeWalker walker(mWeakShell, mContent, true);
nsAccessible* child = nsnull;
while ((child = walker.NextChild())) {
@ -251,7 +250,7 @@ nsXULButtonAccessible::CacheChildren()
} else {
// Unbind rejected accessible from document.
Document()->UnbindFromDocument(child);
GetDocAccessible()->UnbindFromDocument(child);
}
}
@ -282,8 +281,8 @@ nsXULButtonAccessible::ContainsMenu()
////////////////////////////////////////////////////////////////////////////////
nsXULDropmarkerAccessible::
nsXULDropmarkerAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsFormControlAccessible(aContent, aDoc)
nsXULDropmarkerAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsFormControlAccessible(aContent, aShell)
{
}
@ -363,8 +362,8 @@ nsXULDropmarkerAccessible::NativeState()
////////////////////////////////////////////////////////////////////////////////
nsXULCheckboxAccessible::
nsXULCheckboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsFormControlAccessible(aContent, aDoc)
nsXULCheckboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsFormControlAccessible(aContent, aShell)
{
}
@ -443,8 +442,8 @@ nsXULCheckboxAccessible::NativeState()
////////////////////////////////////////////////////////////////////////////////
nsXULGroupboxAccessible::
nsXULGroupboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULGroupboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}
@ -500,8 +499,8 @@ nsXULGroupboxAccessible::RelationByType(PRUint32 aType)
////////////////////////////////////////////////////////////////////////////////
nsXULRadioButtonAccessible::
nsXULRadioButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsRadioButtonAccessible(aContent, aDoc)
nsXULRadioButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsRadioButtonAccessible(aContent, aShell)
{
}
@ -559,8 +558,8 @@ nsXULRadioButtonAccessible::ContainerWidget() const
*/
nsXULRadioGroupAccessible::
nsXULRadioGroupAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
XULSelectControlAccessible(aContent, aDoc)
nsXULRadioGroupAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
XULSelectControlAccessible(aContent, aShell)
{
}
@ -606,8 +605,8 @@ nsXULRadioGroupAccessible::AreItemsOperable() const
////////////////////////////////////////////////////////////////////////////////
nsXULStatusBarAccessible::
nsXULStatusBarAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULStatusBarAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}
@ -623,8 +622,8 @@ nsXULStatusBarAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsXULToolbarButtonAccessible::
nsXULToolbarButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXULButtonAccessible(aContent, aDoc)
nsXULToolbarButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXULButtonAccessible(aContent, aShell)
{
}
@ -674,8 +673,8 @@ nsXULToolbarButtonAccessible::IsSeparator(nsAccessible *aAccessible)
////////////////////////////////////////////////////////////////////////////////
nsXULToolbarAccessible::
nsXULToolbarAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULToolbarAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}
@ -703,9 +702,9 @@ nsXULToolbarAccessible::GetNameInternal(nsAString& aName)
////////////////////////////////////////////////////////////////////////////////
nsXULToolbarSeparatorAccessible::
nsXULToolbarSeparatorAccessible(nsIContent* aContent,
nsDocAccessible* aDoc) :
nsLeafAccessible(aContent, aDoc)
nsXULToolbarSeparatorAccessible(nsIContent *aContent,
nsIWeakReference *aShell) :
nsLeafAccessible(aContent, aShell)
{
}
@ -726,8 +725,8 @@ nsXULToolbarSeparatorAccessible::NativeState()
////////////////////////////////////////////////////////////////////////////////
nsXULTextFieldAccessible::
nsXULTextFieldAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsXULTextFieldAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}
@ -777,7 +776,7 @@ nsXULTextFieldAccessible::NativeState()
// Create a temporary accessible from the HTML text field to get
// the accessible state from. Doesn't add to cache into document cache.
nsRefPtr<nsHTMLTextFieldAccessible> tempAccessible =
new nsHTMLTextFieldAccessible(inputField, mDoc);
new nsHTMLTextFieldAccessible(inputField, mWeakShell);
if (!tempAccessible)
return state;
@ -866,14 +865,13 @@ NS_IMETHODIMP nsXULTextFieldAccessible::GetAssociatedEditor(nsIEditor **aEditor)
void
nsXULTextFieldAccessible::CacheChildren()
{
NS_ENSURE_TRUE(mDoc,);
// Create child accessibles for native anonymous content of underlying HTML
// input element.
nsCOMPtr<nsIContent> inputContent(GetInputField());
if (!inputContent)
return;
nsAccTreeWalker walker(mDoc->GetWeakShell(), inputContent, false);
nsAccTreeWalker walker(mWeakShell, inputContent, false);
nsAccessible* child = nsnull;
while ((child = walker.NextChild()) && AppendChild(child));

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

@ -61,7 +61,7 @@ class nsXULButtonAccessible : public nsAccessibleWrap
{
public:
enum { eAction_Click = 0 };
nsXULButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -100,7 +100,7 @@ class nsXULCheckboxAccessible : public nsFormControlAccessible
{
public:
enum { eAction_Click = 0 };
nsXULCheckboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULCheckboxAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -121,7 +121,7 @@ class nsXULDropmarkerAccessible : public nsFormControlAccessible
{
public:
enum { eAction_Click = 0 };
nsXULDropmarkerAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULDropmarkerAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -144,7 +144,7 @@ private:
class nsXULGroupboxAccessible : public nsAccessibleWrap
{
public:
nsXULGroupboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULGroupboxAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -159,7 +159,7 @@ class nsXULRadioButtonAccessible : public nsRadioButtonAccessible
{
public:
nsXULRadioButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULRadioButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual void GetPositionAndSizeInternal(PRInt32 *aPosInSet,
@ -176,7 +176,7 @@ public:
class nsXULRadioGroupAccessible : public XULSelectControlAccessible
{
public:
nsXULRadioGroupAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULRadioGroupAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -194,7 +194,7 @@ public:
class nsXULStatusBarAccessible : public nsAccessibleWrap
{
public:
nsXULStatusBarAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULStatusBarAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -206,7 +206,7 @@ public:
class nsXULToolbarButtonAccessible : public nsXULButtonAccessible
{
public:
nsXULToolbarButtonAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULToolbarButtonAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual void GetPositionAndSizeInternal(PRInt32 *aPosInSet,
@ -222,7 +222,7 @@ public:
class nsXULToolbarAccessible : public nsAccessibleWrap
{
public:
nsXULToolbarAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULToolbarAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -236,7 +236,7 @@ class nsXULToolbarSeparatorAccessible : public nsLeafAccessible
{
public:
nsXULToolbarSeparatorAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -251,7 +251,7 @@ class nsXULTextFieldAccessible : public nsHyperTextAccessibleWrap
public:
enum { eAction_Click = 0 };
nsXULTextFieldAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULTextFieldAccessible(nsIContent* aContent, nsIWeakReference *aShell);
NS_DECL_ISUPPORTS_INHERITED

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

@ -42,7 +42,6 @@
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsDocAccessible.h"
#include "Role.h"
#include "States.h"
@ -62,8 +61,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsXULColumnsAccessible::
nsXULColumnsAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULColumnsAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}
@ -85,8 +84,8 @@ nsXULColumnsAccessible::NativeState()
////////////////////////////////////////////////////////////////////////////////
nsXULColumnItemAccessible::
nsXULColumnItemAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsLeafAccessible(aContent, aDoc)
nsXULColumnItemAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsLeafAccessible(aContent, aShell)
{
}
@ -133,8 +132,8 @@ nsXULColumnItemAccessible::DoAction(PRUint8 aIndex)
////////////////////////////////////////////////////////////////////////////////
nsXULListboxAccessible::
nsXULListboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
XULSelectControlAccessible(aContent, aDoc)
nsXULListboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
XULSelectControlAccessible(aContent, aShell)
{
nsIContent* parentContent = mContent->GetParent();
if (parentContent) {
@ -317,8 +316,9 @@ nsXULListboxAccessible::GetCellAt(PRInt32 aRow, PRInt32 aColumn,
NS_ENSURE_TRUE(item, NS_ERROR_INVALID_ARG);
nsCOMPtr<nsIContent> itemContent(do_QueryInterface(item));
NS_ENSURE_TRUE(mDoc, NS_ERROR_FAILURE);
nsAccessible *row = mDoc->GetAccessible(itemContent);
nsAccessible *row =
GetAccService()->GetAccessibleInWeakShell(itemContent, mWeakShell);
NS_ENSURE_STATE(row);
nsresult rv = row->GetChildAt(aColumn, aAccessibleCell);
@ -601,13 +601,13 @@ nsXULListboxAccessible::GetSelectedCells(nsIArray **aCells)
rv = selectedItems->GetLength(&selectedItemsCount);
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_TRUE(mDoc, NS_ERROR_FAILURE);
PRUint32 index = 0;
for (; index < selectedItemsCount; index++) {
nsCOMPtr<nsIDOMNode> itemNode;
selectedItems->Item(index, getter_AddRefs(itemNode));
nsCOMPtr<nsIContent> itemContent(do_QueryInterface(itemNode));
nsAccessible *item = mDoc->GetAccessible(itemContent);
nsAccessible *item =
GetAccService()->GetAccessibleInWeakShell(itemContent, mWeakShell);
if (item) {
PRInt32 cellCount = item->GetChildCount();
@ -900,8 +900,8 @@ nsXULListboxAccessible::ContainerWidget() const
////////////////////////////////////////////////////////////////////////////////
nsXULListitemAccessible::
nsXULListitemAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXULMenuitemAccessible(aContent, aDoc)
nsXULListitemAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXULMenuitemAccessible(aContent, aShell)
{
mIsCheckbox = mContent->AttrValueIs(kNameSpaceID_None,
nsGkAtoms::type,
@ -929,7 +929,7 @@ nsXULListitemAccessible::GetListAccessible()
if (!listContent)
return nsnull;
return mDoc->GetAccessible(listContent);
return GetAccService()->GetAccessibleInWeakShell(listContent, mWeakShell);
}
////////////////////////////////////////////////////////////////////////////////
@ -1053,8 +1053,8 @@ nsXULListitemAccessible::ContainerWidget() const
////////////////////////////////////////////////////////////////////////////////
nsXULListCellAccessible::
nsXULListCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsXULListCellAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}

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

@ -56,7 +56,7 @@ class nsIWeakReference;
class nsXULColumnsAccessible : public nsAccessibleWrap
{
public:
nsXULColumnsAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULColumnsAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -70,7 +70,7 @@ public:
class nsXULColumnItemAccessible : public nsLeafAccessible
{
public:
nsXULColumnItemAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULColumnItemAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -93,7 +93,7 @@ class nsXULListboxAccessible : public XULSelectControlAccessible,
public nsIAccessibleTable
{
public:
nsXULListboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULListboxAccessible(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsXULListboxAccessible() {}
NS_DECL_ISUPPORTS_INHERITED
@ -127,7 +127,7 @@ public:
NS_DECL_ISUPPORTS_INHERITED
nsXULListitemAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULListitemAccessible(nsIContent *aContent, nsIWeakReference *aShell);
virtual ~nsXULListitemAccessible() {}
// nsIAccessible
@ -163,7 +163,7 @@ class nsXULListCellAccessible : public nsHyperTextAccessibleWrap,
public nsIAccessibleTableCell
{
public:
nsXULListCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULListCellAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED

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

@ -71,8 +71,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsXULMenuitemAccessible::
nsXULMenuitemAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULMenuitemAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}
@ -408,8 +408,8 @@ nsXULMenuitemAccessible::ContainerWidget() const
////////////////////////////////////////////////////////////////////////////////
nsXULMenuSeparatorAccessible::
nsXULMenuSeparatorAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsXULMenuitemAccessible(aContent, aDoc)
nsXULMenuSeparatorAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsXULMenuitemAccessible(aContent, aShell)
{
}
@ -454,8 +454,8 @@ nsXULMenuSeparatorAccessible::ActionCount()
////////////////////////////////////////////////////////////////////////////////
nsXULMenupopupAccessible::
nsXULMenupopupAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
XULSelectControlAccessible(aContent, aDoc)
nsXULMenupopupAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
XULSelectControlAccessible(aContent, aShell)
{
nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame());
if (menuPopupFrame && menuPopupFrame->IsMenu())
@ -556,7 +556,7 @@ nsXULMenupopupAccessible::AreItemsOperable() const
nsAccessible*
nsXULMenupopupAccessible::ContainerWidget() const
{
nsDocAccessible* document = Document();
nsDocAccessible* document = GetDocAccessible();
nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame());
while (menuPopupFrame) {
@ -594,8 +594,8 @@ nsXULMenupopupAccessible::ContainerWidget() const
////////////////////////////////////////////////////////////////////////////////
nsXULMenubarAccessible::
nsXULMenubarAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULMenubarAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}

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

@ -51,7 +51,7 @@ class nsXULMenuitemAccessible : public nsAccessibleWrap
public:
enum { eAction_Click = 0 };
nsXULMenuitemAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULMenuitemAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD DoAction(PRUint8 index);
@ -85,7 +85,7 @@ public:
class nsXULMenuSeparatorAccessible : public nsXULMenuitemAccessible
{
public:
nsXULMenuSeparatorAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULMenuSeparatorAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD DoAction(PRUint8 index);
@ -107,7 +107,7 @@ public:
class nsXULMenupopupAccessible : public XULSelectControlAccessible
{
public:
nsXULMenupopupAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULMenupopupAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
@ -128,7 +128,7 @@ public:
class nsXULMenubarAccessible : public nsAccessibleWrap
{
public:
nsXULMenubarAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULMenubarAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);

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

@ -53,8 +53,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsXULSliderAccessible::
nsXULSliderAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULSliderAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}
@ -289,8 +289,8 @@ nsXULSliderAccessible::SetSliderAttr(nsIAtom *aName, double aValue)
////////////////////////////////////////////////////////////////////////////////
nsXULThumbAccessible::
nsXULThumbAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULThumbAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}

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

@ -49,7 +49,7 @@
class nsXULSliderAccessible : public nsAccessibleWrap
{
public:
nsXULSliderAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULSliderAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -90,7 +90,7 @@ private:
class nsXULThumbAccessible : public nsAccessibleWrap
{
public:
nsXULThumbAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULThumbAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();

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

@ -59,8 +59,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsXULTabAccessible::
nsXULTabAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULTabAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}
@ -178,8 +178,8 @@ nsXULTabAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet,
////////////////////////////////////////////////////////////////////////////////
nsXULTabsAccessible::
nsXULTabsAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
XULSelectControlAccessible(aContent, aDoc)
nsXULTabsAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
XULSelectControlAccessible(aContent, aShell)
{
}
@ -214,8 +214,8 @@ nsXULTabsAccessible::GetNameInternal(nsAString& aName)
////////////////////////////////////////////////////////////////////////////////
nsXULTabpanelsAccessible::
nsXULTabpanelsAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULTabpanelsAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}
@ -231,8 +231,8 @@ nsXULTabpanelsAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsXULTabpanelAccessible::
nsXULTabpanelAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc)
nsXULTabpanelAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessibleWrap(aContent, aShell)
{
}

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

@ -52,7 +52,7 @@ class nsXULTabAccessible : public nsAccessibleWrap
public:
enum { eAction_Switch = 0 };
nsXULTabAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULTabAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -76,7 +76,7 @@ public:
class nsXULTabsAccessible : public XULSelectControlAccessible
{
public:
nsXULTabsAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULTabsAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& _retval);
@ -96,7 +96,7 @@ public:
class nsXULTabpanelsAccessible : public nsAccessibleWrap
{
public:
nsXULTabpanelsAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULTabpanelsAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();
@ -116,7 +116,7 @@ public:
class nsXULTabpanelAccessible : public nsAccessibleWrap
{
public:
nsXULTabpanelAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
nsXULTabpanelAccessible(nsIContent *aContent, nsIWeakReference *aShell);
// nsAccessible
virtual mozilla::a11y::role NativeRole();

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

@ -61,8 +61,8 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
nsXULTextAccessible::
nsXULTextAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsXULTextAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}
@ -112,8 +112,8 @@ nsXULTextAccessible::RelationByType(PRUint32 aType)
////////////////////////////////////////////////////////////////////////////////
nsXULTooltipAccessible::
nsXULTooltipAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsLeafAccessible(aContent, aDoc)
nsXULTooltipAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsLeafAccessible(aContent, aShell)
{
}
@ -139,8 +139,8 @@ nsXULTooltipAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
nsXULLinkAccessible::
nsXULLinkAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
nsXULLinkAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
nsHyperTextAccessibleWrap(aContent, aShell)
{
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше