mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Back out 576ab48e68c2:84f2c5b57c00 (bug 872338) for Windows build failures and various and sundry test failures
This commit is contained in:
parent
201b1572c8
commit
5cd73f8007
@ -11,6 +11,7 @@ XPIDL_SOURCES += [
|
||||
'nsIAccessible.idl',
|
||||
'nsIAccessibleApplication.idl',
|
||||
'nsIAccessibleCaretMoveEvent.idl',
|
||||
'nsIAccessibleCursorable.idl',
|
||||
'nsIAccessibleDocument.idl',
|
||||
'nsIAccessibleEditableText.idl',
|
||||
'nsIAccessibleEvent.idl',
|
||||
|
26
accessible/public/nsIAccessibleCursorable.idl
Normal file
26
accessible/public/nsIAccessibleCursorable.idl
Normal file
@ -0,0 +1,26 @@
|
||||
/* -*- 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,7 +6,6 @@
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIAccessible;
|
||||
interface nsIAccessiblePivot;
|
||||
interface nsIDOMDocument;
|
||||
interface nsIDOMNode;
|
||||
interface nsIDOMWindow;
|
||||
@ -22,7 +21,7 @@ interface nsIDOMWindow;
|
||||
* nsIAccessible::GetAccessibleDocument() or
|
||||
* nsIAccessibleEvent::GetAccessibleDocument()
|
||||
*/
|
||||
[scriptable, uuid(fe5b3886-2b6a-491a-80cd-a3e6342c451d)]
|
||||
[scriptable, uuid(451242bd-8a0c-4198-ae88-c053609a4e5d)]
|
||||
interface nsIAccessibleDocument : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -76,11 +75,6 @@ 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,6 +130,8 @@ 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;
|
||||
@ -475,6 +477,7 @@ DocAccessible::GetChildDocumentAt(uint32_t aIndex,
|
||||
return *aDocument ? NS_OK : NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
// nsIAccessibleVirtualCursor method
|
||||
NS_IMETHODIMP
|
||||
DocAccessible::GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor)
|
||||
{
|
||||
@ -484,6 +487,9 @@ 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);
|
||||
@ -1459,6 +1465,10 @@ 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,6 +6,7 @@
|
||||
#ifndef mozilla_a11y_DocAccessible_h__
|
||||
#define mozilla_a11y_DocAccessible_h__
|
||||
|
||||
#include "nsIAccessibleCursorable.h"
|
||||
#include "nsIAccessibleDocument.h"
|
||||
#include "nsIAccessiblePivot.h"
|
||||
|
||||
@ -44,6 +45,7 @@ class DocAccessible : public HyperTextAccessibleWrap,
|
||||
public nsIObserver,
|
||||
public nsIScrollPositionListener,
|
||||
public nsSupportsWeakReference,
|
||||
public nsIAccessibleCursorable,
|
||||
public nsIAccessiblePivotObserver
|
||||
{
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
@ -53,6 +55,8 @@ class DocAccessible : public HyperTextAccessibleWrap,
|
||||
|
||||
NS_DECL_NSIOBSERVER
|
||||
|
||||
NS_DECL_NSIACCESSIBLECURSORABLE
|
||||
|
||||
NS_DECL_NSIACCESSIBLEPIVOTOBSERVER
|
||||
|
||||
public:
|
||||
@ -488,8 +492,11 @@ 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 << 1
|
||||
eTabDocument = 1 << 2
|
||||
};
|
||||
|
||||
/**
|
||||
@ -532,7 +539,7 @@ protected:
|
||||
nsTArray<nsRefPtr<DocAccessible> > mChildDocuments;
|
||||
|
||||
/**
|
||||
* The virtual cursor of the document.
|
||||
* The virtual cursor of the document when it supports nsIAccessibleCursorable.
|
||||
*/
|
||||
nsRefPtr<nsAccessiblePivot> mVirtualCursor;
|
||||
|
||||
|
@ -26,17 +26,27 @@
|
||||
|
||||
function doTest()
|
||||
{
|
||||
var rootAcc = getAccessible(browserDocument(), [nsIAccessibleDocument]);
|
||||
ok(rootAcc.virtualCursor,
|
||||
"root document does not have virtualCursor");
|
||||
|
||||
var rootAcc = getRootAccessible(browserWindow().document);
|
||||
try {
|
||||
rootAcc.QueryInterface(nsIAccessibleCursorable);
|
||||
} catch (e) {
|
||||
ok(false, "Root accessible does not support nsIAccessibleCursorable");
|
||||
}
|
||||
var doc = currentTabDocument();
|
||||
var docAcc = getAccessible(doc, [nsIAccessibleDocument]);
|
||||
var docAcc = getAccessible(doc, [nsIAccessibleDocument,
|
||||
nsIAccessibleCursorable]);
|
||||
|
||||
// Test that embedded documents have their own virtual cursor.
|
||||
// Test that embedded documents don't have their own virtual cursor.
|
||||
is(docAcc.childDocumentCount, 1, "Expecting one child document");
|
||||
ok(docAcc.getChildDocumentAt(0).virtualCursor,
|
||||
"child document does not have virtualCursor");
|
||||
var childDoc = docAcc.getChildDocumentAt(0);
|
||||
var supportsVC = true;
|
||||
try {
|
||||
childDoc.QueryInterface(nsIAccessibleCursorable);
|
||||
} catch (e) {
|
||||
supportsVC = false;
|
||||
}
|
||||
|
||||
ok(!supportsVC, "no nsIAccessibleCursorable support in child document");
|
||||
|
||||
gQueue = new eventQueue();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user