From 62c083694e576b1f49eba4937640649f32bee2a3 Mon Sep 17 00:00:00 2001 From: Eitan Isaacson Date: Fri, 17 May 2013 19:10:29 -0700 Subject: [PATCH] Bug 872338 - Add virtualCursor to nsIAccessibleDocument. r=tbsaunde r=surkov --- CLOBBER | 2 +- accessible/public/moz.build | 1 - accessible/public/nsIAccessibleCursorable.idl | 26 ------------------- accessible/public/nsIAccessibleDocument.idl | 8 +++++- accessible/src/generic/DocAccessible.cpp | 10 ------- accessible/src/generic/DocAccessible.h | 11 ++------ 6 files changed, 10 insertions(+), 48 deletions(-) delete mode 100644 accessible/public/nsIAccessibleCursorable.idl diff --git a/CLOBBER b/CLOBBER index d588bd2335c4..a67737d211bc 100644 --- a/CLOBBER +++ b/CLOBBER @@ -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. diff --git a/accessible/public/moz.build b/accessible/public/moz.build index d32e98933fd1..b9e30c4a9278 100644 --- a/accessible/public/moz.build +++ b/accessible/public/moz.build @@ -11,7 +11,6 @@ XPIDL_SOURCES += [ 'nsIAccessible.idl', 'nsIAccessibleApplication.idl', 'nsIAccessibleCaretMoveEvent.idl', - 'nsIAccessibleCursorable.idl', 'nsIAccessibleDocument.idl', 'nsIAccessibleEditableText.idl', 'nsIAccessibleEvent.idl', diff --git a/accessible/public/nsIAccessibleCursorable.idl b/accessible/public/nsIAccessibleCursorable.idl deleted file mode 100644 index b76b2396c53c..000000000000 --- a/accessible/public/nsIAccessibleCursorable.idl +++ /dev/null @@ -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; -}; diff --git a/accessible/public/nsIAccessibleDocument.idl b/accessible/public/nsIAccessibleDocument.idl index c5b182f3a447..e6d7ef3ccc2e 100644 --- a/accessible/public/nsIAccessibleDocument.idl +++ b/accessible/public/nsIAccessibleDocument.idl @@ -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. */ diff --git a/accessible/src/generic/DocAccessible.cpp b/accessible/src/generic/DocAccessible.cpp index 107d616ab5a0..33da0459cc59 100644 --- a/accessible/src/generic/DocAccessible.cpp +++ b/accessible/src/generic/DocAccessible.cpp @@ -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 diff --git a/accessible/src/generic/DocAccessible.h b/accessible/src/generic/DocAccessible.h index 67d938aa27b8..d87bbe36c5b4 100644 --- a/accessible/src/generic/DocAccessible.h +++ b/accessible/src/generic/DocAccessible.h @@ -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 > mChildDocuments; /** - * The virtual cursor of the document when it supports nsIAccessibleCursorable. + * The virtual cursor of the document. */ nsRefPtr mVirtualCursor;