Bug 872338 - Add virtualCursor to nsIAccessibleDocument. r=tbsaunde r=surkov

This commit is contained in:
Eitan Isaacson 2013-05-17 19:10:29 -07:00
Родитель 0c190ee3ec
Коммит 62c083694e
6 изменённых файлов: 10 добавлений и 48 удалений

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

@ -17,7 +17,7 @@
#
# Modifying this file will now automatically clobber the buildbot machines \o/
#
Bug 848530 - Added a dependency file for moz.build traversal.
Bug 872338 - Needs a clobber at least on Windows due to bug 873809
Alternative to clobber is to run ./config.status from the objdir and to
touch the CLOBBER file in the objdir.

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

@ -11,7 +11,6 @@ XPIDL_SOURCES += [
'nsIAccessible.idl',
'nsIAccessibleApplication.idl',
'nsIAccessibleCaretMoveEvent.idl',
'nsIAccessibleCursorable.idl',
'nsIAccessibleDocument.idl',
'nsIAccessibleEditableText.idl',
'nsIAccessibleEvent.idl',

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

@ -1,26 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
interface nsIAccessiblePivot;
/**
* An interface implemented by an accessible object that has an associated
* virtual cursor. Typically, a top-level application or content document.
* A virtual cursor is an implementation of nsIAccessiblePivot that provides an
* exclusive spot in the cursorable's subtree, this could be used to create a
* pseudo-focus or caret browsing experience that is centered around the
* accessibility API.
*/
[scriptable, uuid(5452dea5-d235-496f-8757-3ca016ff49ff)]
interface nsIAccessibleCursorable : nsISupports
{
/**
* The virtual cursor pivot this object manages.
*/
readonly attribute nsIAccessiblePivot virtualCursor;
};

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

@ -6,6 +6,7 @@
#include "nsISupports.idl"
interface nsIAccessible;
interface nsIAccessiblePivot;
interface nsIDOMDocument;
interface nsIDOMNode;
interface nsIDOMWindow;
@ -21,7 +22,7 @@ interface nsIDOMWindow;
* nsIAccessible::GetAccessibleDocument() or
* nsIAccessibleEvent::GetAccessibleDocument()
*/
[scriptable, uuid(451242bd-8a0c-4198-ae88-c053609a4e5d)]
[scriptable, uuid(fe5b3886-2b6a-491a-80cd-a3e6342c451d)]
interface nsIAccessibleDocument : nsISupports
{
/**
@ -75,6 +76,11 @@ interface nsIAccessibleDocument : nsISupports
*/
readonly attribute unsigned long childDocumentCount;
/**
* The virtual cursor pivot this document manages.
*/
readonly attribute nsIAccessiblePivot virtualCursor;
/**
* Return the child document accessible at the given index.
*/

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

@ -130,8 +130,6 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DocAccessible)
NS_INTERFACE_MAP_ENTRY(nsIObserver)
NS_INTERFACE_MAP_ENTRY(nsIAccessiblePivotObserver)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAccessibleDocument)
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIAccessibleCursorable,
(mDocFlags & eCursorable))
foundInterface = 0;
nsresult status;
@ -477,7 +475,6 @@ DocAccessible::GetChildDocumentAt(uint32_t aIndex,
return *aDocument ? NS_OK : NS_ERROR_INVALID_ARG;
}
// nsIAccessibleVirtualCursor method
NS_IMETHODIMP
DocAccessible::GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor)
{
@ -487,9 +484,6 @@ DocAccessible::GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor)
if (IsDefunct())
return NS_ERROR_FAILURE;
if (!(mDocFlags & eCursorable))
return NS_OK;
if (!mVirtualCursor) {
mVirtualCursor = new nsAccessiblePivot(this);
mVirtualCursor->AddObserver(this);
@ -1465,10 +1459,6 @@ DocAccessible::DoInitialUpdate()
if (nsCoreUtils::IsTabDocument(mDocumentNode))
mDocFlags |= eTabDocument;
// We provide a virtual cursor if this is a root doc or if it's a tab doc.
if (!mDocumentNode->GetParentDocument() || (mDocFlags & eTabDocument))
mDocFlags |= eCursorable;
mLoadState |= eTreeConstructed;
// The content element may be changed before the initial update and then we

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

@ -6,7 +6,6 @@
#ifndef mozilla_a11y_DocAccessible_h__
#define mozilla_a11y_DocAccessible_h__
#include "nsIAccessibleCursorable.h"
#include "nsIAccessibleDocument.h"
#include "nsIAccessiblePivot.h"
@ -45,7 +44,6 @@ class DocAccessible : public HyperTextAccessibleWrap,
public nsIObserver,
public nsIScrollPositionListener,
public nsSupportsWeakReference,
public nsIAccessibleCursorable,
public nsIAccessiblePivotObserver
{
NS_DECL_ISUPPORTS_INHERITED
@ -55,8 +53,6 @@ class DocAccessible : public HyperTextAccessibleWrap,
NS_DECL_NSIOBSERVER
NS_DECL_NSIACCESSIBLECURSORABLE
NS_DECL_NSIACCESSIBLEPIVOTOBSERVER
public:
@ -492,11 +488,8 @@ protected:
// Whether scroll listeners were added.
eScrollInitialized = 1 << 0,
// Whether we support nsIAccessibleCursorable.
eCursorable = 1 << 1,
// Whether the document is a tab document.
eTabDocument = 1 << 2
eTabDocument = 1 << 1
};
/**
@ -539,7 +532,7 @@ protected:
nsTArray<nsRefPtr<DocAccessible> > mChildDocuments;
/**
* The virtual cursor of the document when it supports nsIAccessibleCursorable.
* The virtual cursor of the document.
*/
nsRefPtr<nsAccessiblePivot> mVirtualCursor;