Backing out changeset f640af4933fc and changeset ca15d173817d (fix for bug 285167) to investigate TXul regression

--HG--
extra : rebase_source : ab3f98729c513c54e11f1dc0ab520bfa5adfc614
This commit is contained in:
David Bolter 2009-05-11 11:20:03 -04:00
Родитель 2cb429884b
Коммит 8ae02a93d0
18 изменённых файлов: 139 добавлений и 499 удалений

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

@ -45,7 +45,7 @@
object. For that XBL binding of element should implement the interface.
*/
[scriptable, uuid(18ba74e1-0751-41c8-81c6-c903e22491d3)]
[scriptable, uuid(3f7f9194-c625-4a85-8148-6d92d34897fa)]
interface nsIAccessibleProvider : nsISupports
{
/**
@ -62,130 +62,56 @@ interface nsIAccessibleProvider : nsISupports
<xul:iframe>, <xul:browser> and <xul:editor>. */
const long OuterDoc = 0x00000001;
/**
* Constants set is used by XUL controls.
*/
/** popup@noautofocus="true" and notification elements */
const long XULAlert = 0x00001001;
const long XULAlert = 0x00001001;
const long XULButton = 0x00001002;
const long XULCheckbox = 0x00001003;
const long XULColorPicker = 0x00001004;
const long XULColorPickerTile = 0x00001005;
const long XULCombobox = 0x00001006;
const long XULDropmarker = 0x00001007;
const long XULGroupbox = 0x00001008;
const long XULImage = 0x00001009;
const long XULLink = 0x0000100A;
const long XULListbox = 0x0000100B;
const long XULListCell = 0x00001026;
const long XULListHead = 0x00001024;
const long XULListHeader = 0x00001025;
const long XULListitem = 0x0000100C;
const long XULMenubar = 0x0000100D;
const long XULMenuitem = 0x0000100E;
const long XULMenupopup = 0x0000100F;
const long XULMenuSeparator = 0x00001010;
const long XULPane = 0x00001011;
const long XULProgressMeter = 0x00001012;
const long XULScale = 0x00001013;
const long XULStatusBar = 0x00001014;
const long XULRadioButton = 0x00001015;
const long XULRadioGroup = 0x00001016;
/** button element */
const long XULButton = 0x00001002;
/** The single tab in a dialog or tabbrowser/editor interface */
const long XULTab = 0x00001017;
/** checkbox element */
const long XULCheckbox = 0x00001003;
/** A combination of a tabs object and a tabpanels object */
const long XULTabBox = 0x00001018;
/** colorpicker element */
const long XULColorPicker = 0x00001004;
/** The collection of tab objects, useable in the TabBox and independant of
as well */
const long XULTabs = 0x00001019;
/** colorpickertile element */
const long XULColorPickerTile = 0x00001005;
/** menulist element */
const long XULCombobox = 0x00001006;
/** dropmarker element */
const long XULDropmarker = 0x00001007;
/** groupbox element */
const long XULGroupbox = 0x00001008;
/** image element */
const long XULImage = 0x00001009;
/** label@class="text-link" and label@onclick elements */
const long XULLink = 0x0000100A;
/** listbox and richlistbox elements */
const long XULListbox = 0x0000100B;
/** listcell element */
const long XULListCell = 0x0000100C;
/** listheader element */
const long XULListHead = 0x0000100D;
/** listhead element */
const long XULListHeader = 0x0000100E;
/** listitem and richlistitem elements */
const long XULListitem = 0x0000100F;
/** menubar element */
const long XULMenubar = 0x00001010;
/** menuitem element */
const long XULMenuitem = 0x00001011;
/** popup, menupopup element */
const long XULMenupopup = 0x00001012;
/** menuseparator element */
const long XULMenuSeparator = 0x00001013;
/** panel element */
const long XULPane = 0x00001014;
/** progressmeter element */
const long XULProgressMeter = 0x00001015;
/** scale element */
const long XULScale = 0x00001016;
/** scrollbar element */
const long XULScrollbar = 0x00001017;
/** slider element */
const long XULSlider = 0x00001018;
/** statusbar element */
const long XULStatusBar = 0x00001019;
/** radio element */
const long XULRadioButton = 0x0000101A;
/** radiogroup element */
const long XULRadioGroup = 0x0000101B;
/** tab element */
const long XULTab = 0x0000101C;
/** tabbox element, contains tabs and tabpanels elements */
const long XULTabBox = 0x0000101D;
/** tabs element, a collection of tab elements */
const long XULTabs = 0x0000101E;
/** label or description elements */
const long XULText = 0x0000101F;
/** textbox and numberbox elements */
const long XULTextBox = 0x00001020;
/** thumb element, child of scale element */
const long XULThumb = 0x00001021;
/** tree element */
const long XULTree = 0x00001022;
/** treecols element, child of tree element */
const long XULTreeColumns = 0x00001023;
/** treecol element, child of treecols element */
const long XULTreeColumnItem = 0x00001024;
/** toolbar element */
const long XULToolbar = 0x00001025;
/** toolbarseparator, toolbarspacer and toolbarspring elements */
const long XULToolbarSeparator = 0x00001026;
/** tooltip element */
const long XULTooltip = 0x00001027;
/** toolbarbutton element */
const long XULToolbarButton = 0x00001028;
const long XULText = 0x0000101A;
const long XULTextBox = 0x0000101B;
const long XULThumb = 0x0000101C;
const long XULTree = 0x0000101D;
const long XULTreeColumns = 0x0000101E;
const long XULTreeColumnItem = 0x0000101F;
const long XULToolbar = 0x00001020;
const long XULToolbarSeparator = 0x00001021;
const long XULTooltip = 0x00001022;
const long XULToolbarButton = 0x00001023;
/**

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

@ -1831,14 +1831,6 @@ nsresult nsAccessibilityService::GetAccessibleByType(nsIDOMNode *aNode,
*aAccessible = new nsXULStatusBarAccessible(aNode, weakShell);
break;
case nsIAccessibleProvider::XULScale:
*aAccessible = new nsEnumRoleXBLAccessible(aNode, weakShell,
nsIAccessibleRole::ROLE_GROUPING);
break;
case nsIAccessibleProvider::XULScrollbar:
*aAccessible = new nsEnumRoleXBLAccessible(aNode, weakShell,
nsIAccessibleRole::ROLE_SCROLLBAR);
break;
case nsIAccessibleProvider::XULSlider:
*aAccessible = new nsXULSliderAccessible(aNode, weakShell);
break;
case nsIAccessibleProvider::XULRadioButton:

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

@ -319,10 +319,9 @@ nsLinkableAccessible::GetActionAccessible()
return accessible;
}
////////////////////////////////////////////////////////////////////////////////
//---------------------
// nsEnumRoleAccessible
////////////////////////////////////////////////////////////////////////////////
//---------------------
nsEnumRoleAccessible::nsEnumRoleAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell, PRUint32 aRole) :
nsAccessibleWrap(aNode, aShell),
@ -338,26 +337,3 @@ nsEnumRoleAccessible::GetRoleInternal(PRUint32 *aRole)
*aRole = mRole;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsEnumRoleXBLAccessible
////////////////////////////////////////////////////////////////////////////////
nsEnumRoleXBLAccessible::nsEnumRoleXBLAccessible(nsIDOMNode* aNode,
nsIWeakReference* aShell,
PRUint32 aRole) :
nsEnumRoleAccessible(aNode, aShell, aRole)
{
}
// nsPIAccessible
NS_IMETHODIMP
nsEnumRoleXBLAccessible::GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren)
{
NS_ENSURE_ARG_POINTER(aAllowsAnonChildren);
// Allow accessibles for anonymous content.
*aAllowsAnonChildren = PR_TRUE;
return NS_OK;
}

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

@ -142,21 +142,4 @@ protected:
PRUint32 mRole;
};
/**
* A simple accessible that gets its enumerated role passed into constructor and
* allows children from anonymous content.
*/
class nsEnumRoleXBLAccessible : public nsEnumRoleAccessible
{
public:
nsEnumRoleXBLAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell,
PRUint32 aRole);
virtual ~nsEnumRoleXBLAccessible() { }
// nsPIAccessible
NS_IMETHOD GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren);
};
#endif

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

@ -41,10 +41,7 @@
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentXBL.h"
////////////////////////////////////////////////////////////////////////////////
// nsXULSliderAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULSliderAccessible::nsXULSliderAccessible(nsIDOMNode* aNode,
nsIWeakReference* aShell) :
@ -135,8 +132,50 @@ nsXULSliderAccessible::SetCurrentValue(double aValue)
return SetSliderAttr(nsAccessibilityAtoms::curpos, aValue);
}
// nsPIAccessible
NS_IMETHODIMP
nsXULSliderAccessible::GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren)
{
NS_ENSURE_ARG_POINTER(aAllowsAnonChildren);
// Allow anonymous xul:thumb inside xul:slider.
*aAllowsAnonChildren = PR_TRUE;
return NS_OK;
}
// Utils
already_AddRefed<nsIContent>
nsXULSliderAccessible::GetSliderNode()
{
if (!mDOMNode)
return nsnull;
if (!mSliderNode) {
nsCOMPtr<nsIDOMDocument> document;
mDOMNode->GetOwnerDocument(getter_AddRefs(document));
if (!document)
return nsnull;
nsCOMPtr<nsIDOMDocumentXBL> xblDoc(do_QueryInterface(document));
if (!xblDoc)
return nsnull;
// XXX: we depend on anonymous content.
nsCOMPtr<nsIDOMElement> domElm(do_QueryInterface(mDOMNode));
if (!domElm)
return nsnull;
xblDoc->GetAnonymousElementByAttribute(domElm, NS_LITERAL_STRING("anonid"),
NS_LITERAL_STRING("slider"),
getter_AddRefs(mSliderNode));
}
nsIContent *sliderNode = nsnull;
nsresult rv = CallQueryInterface(mSliderNode, &sliderNode);
return NS_FAILED(rv) ? nsnull : sliderNode;
}
nsresult
nsXULSliderAccessible::GetSliderAttr(nsIAtom *aName, nsAString& aValue)
{
@ -145,7 +184,9 @@ nsXULSliderAccessible::GetSliderAttr(nsIAtom *aName, nsAString& aValue)
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIContent> sliderNode(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIContent> sliderNode(GetSliderNode());
NS_ENSURE_STATE(sliderNode);
sliderNode->GetAttr(kNameSpaceID_None, aName, aValue);
return NS_OK;
}
@ -156,7 +197,9 @@ nsXULSliderAccessible::SetSliderAttr(nsIAtom *aName, const nsAString& aValue)
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIContent> sliderNode(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIContent> sliderNode(GetSliderNode());
NS_ENSURE_STATE(sliderNode);
sliderNode->SetAttr(kNameSpaceID_None, aName, aValue, PR_TRUE);
return NS_OK;
}
@ -193,15 +236,14 @@ nsXULSliderAccessible::SetSliderAttr(nsIAtom *aName, double aValue)
}
////////////////////////////////////////////////////////////////////////////////
// nsXULThumbAccessible
////////////////////////////////////////////////////////////////////////////////
nsXULThumbAccessible::nsXULThumbAccessible(nsIDOMNode* aNode,
nsIWeakReference* aShell) :
nsAccessibleWrap(aNode, aShell) {}
// nsAccessible
// nsIAccessible
nsresult
nsXULThumbAccessible::GetRoleInternal(PRUint32 *aRole)
{

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

@ -57,15 +57,23 @@ public:
// nsIAccessibleValue
NS_DECL_NSIACCESSIBLEVALUE
// nsPIAccessible
NS_IMETHOD GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
protected:
already_AddRefed<nsIContent> GetSliderNode();
nsresult GetSliderAttr(nsIAtom *aName, nsAString& aValue);
nsresult SetSliderAttr(nsIAtom *aName, const nsAString& aValue);
nsresult GetSliderAttr(nsIAtom *aName, double *aValue);
nsresult SetSliderAttr(nsIAtom *aName, double aValue);
private:
nsCOMPtr<nsIDOMElement> mSliderNode;
};

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

@ -82,8 +82,6 @@ _TEST_FILES =\
test_descr.html \
test_elm_filectrl.html \
test_elm_media.html \
test_elm_scale.xul \
test_elm_scrollbar.html \
test_elm_txtcntnr.html \
test_events_caretmove.html \
test_events_mutation.html \

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

@ -57,7 +57,6 @@ const STATE_EXTSELECTABLE = nsIAccessibleStates.STATE_EXTSELECTABLE;
const STATE_FOCUSABLE = nsIAccessibleStates.STATE_FOCUSABLE;
const STATE_FOCUSED = nsIAccessibleStates.STATE_FOCUSED;
const STATE_HASPOPUP = nsIAccessibleStates.STATE_HASPOPUP;
const STATE_INVISIBLE = nsIAccessibleStates.STATE_INVISIBLE;
const STATE_LINKED = nsIAccessibleStates.STATE_LINKED;
const STATE_MIXED = nsIAccessibleStates.STATE_MIXED;
const STATE_MULTISELECTABLE = nsIAccessibleStates.STATE_MULTISELECTABLE;
@ -281,26 +280,17 @@ function testAccessibleTree(aAccOrElmOrID, aAccTree)
return;
for (var prop in aAccTree) {
var msg = "Wrong value of property '" + prop + "' of " +
prettyName(acc) + ".";
if (prop == "role") {
var msg = "Wrong value of property '" + prop + "'.";
if (prop == "role")
is(roleToString(acc[prop]), roleToString(aAccTree[prop]), msg);
} else if (prop == "states") {
var statesObj = aAccTree[prop];
testStates(acc, statesObj.states, statesObj.extraStates,
statesObj.absentStates, statesObj.absentExtraStates);
} else if (prop != "children") {
else if (prop != "children")
is(acc[prop], aAccTree[prop], msg);
}
}
if ("children" in aAccTree && aAccTree["children"] instanceof Array) {
if ("children" in aAccTree) {
var children = acc.children;
is(children.length, aAccTree.children.length,
"Different amount of expected children of " + prettyName(acc) + ".");
"Different amount of expected children.");
if (aAccTree.children.length == children.length) {
for (var i = 0; i < children.length; i++) {

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

@ -15,59 +15,55 @@ function testStates(aAccOrElmOrID, aState, aExtraState, aAbsentState,
{
var [state, extraState] = getStates(aAccOrElmOrID);
var id = prettyName(aAccOrElmOrID);
is(state & aState, aState,
"wrong state bits for " + id + "!");
"wrong state bits for " + aAccOrElmOrID + "!");
if (aExtraState)
is(extraState & aExtraState, aExtraState,
"wrong extra state bits for " + id + "!");
"wrong extra state bits for " + aAccOrElmOrID + "!");
if (aAbsentState)
is(state & aAbsentState, 0,
"state bits should not be present in ID " + id + "!");
"state bits should not be present in ID " + aAccOrElmOrID + "!");
if (aAbsentExtraState)
is(extraState & aAbsentExtraState, 0,
"extraState bits should not be present in ID " + id + "!");
"extraState bits should not be present in ID " + aAccOrElmOrID + "!");
if (state & STATE_READONLY)
is(extraState & EXT_STATE_EDITABLE, 0,
"Read-only " + id + " cannot be editable!");
"Read-only " + aAccOrElmOrID + " cannot be editable!");
if (extraState & EXT_STATE_EDITABLE)
is(state & STATE_READONLY, 0,
"Editable " + id + " cannot be readonly!");
"Editable " + aAccOrElmOrID + " cannot be readonly!");
if (state & STATE_COLLAPSED || state & STATE_EXPANDED)
is(extraState & EXT_STATE_EXPANDABLE, EXT_STATE_EXPANDABLE,
"Collapsed or expanded " + id + " should be expandable!");
"Collapsed or expanded " + aAccOrElmOrID + " should be expandable!");
if (state & STATE_COLLAPSED)
is(state & STATE_EXPANDED, 0,
"Collapsed " + id + " cannot be expanded!");
"Collapsed " + aAccOrElmOrID + " cannot be expanded!");
if (state & STATE_EXPANDED)
is(state & STATE_COLLAPSED, 0,
"Expanded " + id + " cannot be collapsed!");
"Expanded " + aAccOrElmOrID + " cannot be collapsed!");
if (state & STATE_CHECKED || state & STATE_MIXED)
is(state & STATE_CHECKABLE, STATE_CHECKABLE,
"Checked or mixed " + id + " must be checkable!");
"Checked or mixed element must be checkable!");
if (state & STATE_CHECKED)
is(state & STATE_MIXED, 0,
"Checked " + id + " cannot be state mixed!");
is(state & STATE_MIXED, 0, "Checked element cannot be state mixed!");
if (state & STATE_MIXED)
is(state & STATE_CHECKED, 0,
"Mixed " + id + " cannot be state checked!");
is(state & STATE_CHECKED, 0, "Mixed element cannot be state checked!");
if ((state & STATE_UNAVAILABLE) && !(state & STATE_INVISIBLE)
if ((state & STATE_UNAVAILABLE)
&& (getRole(aAccOrElmOrID) != ROLE_GROUPING))
is(state & STATE_FOCUSABLE, STATE_FOCUSABLE,
"Disabled " + id + " must be focusable!");
"Disabled " + aAccOrElmOrID + " must be focusable!");
}
/**

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

@ -17,7 +17,6 @@ const ROLE_GRID_CELL = nsIAccessibleRole.ROLE_GRID_CELL;
const ROLE_GROUPING = nsIAccessibleRole.ROLE_GROUPING;
const ROLE_HEADING = nsIAccessibleRole.ROLE_HEADING;
const ROLE_IMAGE_MAP = nsIAccessibleRole.ROLE_IMAGE_MAP;
const ROLE_INDICATOR = nsIAccessibleRole.ROLE_INDICATOR;
const ROLE_INTERNAL_FRAME = nsIAccessibleRole.ROLE_INTERNAL_FRAME;
const ROLE_LABEL = nsIAccessibleRole.ROLE_LABEL;
const ROLE_LINK = nsIAccessibleRole.ROLE_LINK;
@ -30,7 +29,6 @@ const ROLE_PASSWORD_TEXT = nsIAccessibleRole.ROLE_PASSWORD_TEXT;
const ROLE_PROGRESSBAR = nsIAccessibleRole.ROLE_PROGRESSBAR;
const ROLE_PUSHBUTTON = nsIAccessibleRole.ROLE_PUSHBUTTON;
const ROLE_ROW = nsIAccessibleRole.ROLE_ROW;
const ROLE_SCROLLBAR = nsIAccessibleRole.ROLE_SCROLLBAR;
const ROLE_SECTION = nsIAccessibleRole.ROLE_SECTION;
const ROLE_SLIDER = nsIAccessibleRole.ROLE_SLIDER;
const ROLE_TABLE = nsIAccessibleRole.ROLE_TABLE;

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

@ -61,13 +61,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=483573
{ // progress bar
role: ROLE_PROGRESSBAR
},
{ // scale of progress bar
role: ROLE_GROUPING,
children: [
{ // slider of scale
role: ROLE_SLIDER
}
]
{ // slider of progress bar
role: ROLE_SLIDER
},
{ // duration label
role: ROLE_LABEL

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

@ -1,66 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/a11y/accessible/nsIAccessible_name.css"
type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="XUL scale element testing">
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js" />
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js" />
<script type="application/javascript">
<![CDATA[
function doTest()
{
var accTree = {
role: ROLE_GROUPING,
children: [
{
role: ROLE_SLIDER,
children: [
{
role: ROLE_INDICATOR
}
]
}
]
};
testAccessibleTree("scale", accTree);
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
]]>
</script>
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=285167"
title="Mozilla doesn't support Scrollbar accessible">
Mozilla Bug 285167
</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<scale id="scale" min="0" max="10" value="2"/>
</window>

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

@ -1,135 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>scrollbar tests</title>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/nsIAccessible_states.js"></script>
<script type="application/javascript">
/**
* Return states object for scrollbar depending on it is visible or not.
*/
function getScrollbarStates(aVisible)
{
var states = {
states: aVisible ? 0 : STATE_INVISIBLE,
extraStates: 0,
absentStates: aVisible ? STATE_INVISIBLE : 0,
absentExtraStates: 0
};
return states;
}
/**
* Return structure describing subtree of scrollbar
*/
function getScrollbarChildren(aVisible)
{
var children =
[
{
role: ROLE_PUSHBUTTON
},
{
role: ROLE_SLIDER,
children: (aVisible ? [ { role: ROLE_INDICATOR } ] : null)
},
{
role: ROLE_PUSHBUTTON
}
];
return children;
}
/**
* Return accessible tree for testing (passed into testAccessibleTree
* function).
*
* @param aHorizontalScrollbar true if horizontal scrollbar is presented
* @param aVerticalScrollbar true if vertical scrollbar is presented
*/
function getAccTreeForScrollableArea(aHorizontalScrollbar,
aVerticalScrollbar)
{
var accTree = {
role: ROLE_SECTION,
children: [
{ // horizontal scrollbar
role: ROLE_SCROLLBAR,
states: getScrollbarStates(aHorizontalScrollbar),
children: getScrollbarChildren(aHorizontalScrollbar)
},
{ // vertical scrollbar
role: ROLE_SCROLLBAR,
states: getScrollbarStates(aVerticalScrollbar),
children: getScrollbarChildren(aVerticalScrollbar)
},
{ // text child
role: ROLE_TEXT_LEAF,
}
]
};
return accTree;
}
function doTest()
{
//XXX: fail on linux:
// ERROR TEST-UNEXPECTED-FAIL |
// chrome://mochikit/content/a11y/accessible/test_elm_scrollbar.html |
// wrong state bits for no node info, role: scrollbar! - got 0, expected
if (!LINUX) {
testAccessibleTree("c1", getAccTreeForScrollableArea(false, true));
testAccessibleTree("c2", getAccTreeForScrollableArea(true, false));
testAccessibleTree("c3", getAccTreeForScrollableArea(true, true));
}
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
<a target="_blank"
title="Mozilla doesn't support Scrollbar accessible"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=285167">Mozilla Bug 285167</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<div id="c1" style="width: 100px; height: 100px; overflow: auto;">
1hellohello 2hellohello 3hellohello 4hellohello 5hellohello 6hellohello 7hellohello
</div>
<br>
<div id="c2" style="width: 100px; height: 100px; overflow: auto;">
1hellohellohellohello 2hellohellohellohello 3hellohellohellohello
</div>
<br>
<div id="c3" style="width: 100px; height: 100px; overflow: auto;">
1hellohellohellohello 2hellohellohellohello 3hellohellohellohello 4hellohellohellohello 5hellohellohellohello 6hellohellohellohello 7hellohellohellohello
</div>
<br>
</body>
</html>

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

@ -18,24 +18,7 @@
<script type="application/javascript">
function doTest()
{
var c1Tree = {
role: ROLE_SECTION,
children: [
{ // horizontal scrollbar
role: ROLE_SCROLLBAR,
},
{ // vertical scrollbar
role: ROLE_SCROLLBAR,
},
{ // text child
role: ROLE_TEXT_LEAF
}
]
};
testAccessibleTree("c1", c1Tree);
var c2Tree = {
var accTree = {
role: ROLE_SECTION,
children: [
{ // text child
@ -44,7 +27,8 @@
]
};
testAccessibleTree("c2", c2Tree);
testAccessibleTree("c1", accTree);
testAccessibleTree("c2", accTree);
SimpleTest.finish();
}

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

@ -26,10 +26,8 @@
testValue("pm3", "0%", 0, 0, 1, 0);
// scale
var sc1 = getAccessible("sc1").firstChild;
testValue(sc1, "500", 500, 0, 1000, 10);
var sc2 = getAccessible("sc2").firstChild;
testValue(sc2, "", 0, 0, 0, 0);
testValue("sc1", "500", 500, 0, 1000, 10);
testValue("sc2", "", 0, 0, 0, 0);
// aria progressbar
testValue("ariapb1", "500", 500, 0, 1000, 0);

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

@ -5,15 +5,7 @@
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="scalethumb"
extends="chrome://global/content/bindings/scrollbar.xml#thumb">
<resources>
<stylesheet src="chrome://global/skin/scale.css"/>
</resources>
</binding>
<binding id="scaleslider" display="xul:slider"
extends="chrome://global/content/bindings/general.xml#basecontrol">
<binding id="scalethumb" extends="xul:button">
<resources>
<stylesheet src="chrome://global/skin/scale.css"/>
</resources>
@ -21,12 +13,19 @@
<implementation implements="nsIAccessibleProvider">
<property name="accessibleType" readonly="true">
<getter>
return Components.interfaces.nsIAccessibleProvider.XULSlider;
return Components.interfaces.nsIAccessibleProvider.XULThumb;
</getter>
</property>
</implementation>
</binding>
<binding id="scaleslider" display="xul:slider"
extends="chrome://global/content/bindings/general.xml#basecontrol">
<resources>
<stylesheet src="chrome://global/skin/scale.css"/>
</resources>
</binding>
<binding id="scale"
extends="chrome://global/content/bindings/general.xml#basecontrol">
<resources>

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

@ -5,35 +5,7 @@
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="thumb" extends="xul:button">
<implementation implements="nsIAccessibleProvider">
<property name="accessibleType" readonly="true">
<getter>
return Components.interfaces.nsIAccessibleProvider.XULThumb;
</getter>
</property>
</implementation>
</binding>
<binding id="slider">
<implementation implements="nsIAccessibleProvider">
<property name="accessibleType" readonly="true">
<getter>
return Components.interfaces.nsIAccessibleProvider.XULSlider;
</getter>
</property>
</implementation>
</binding>
<binding id="scrollbarbutton">
<implementation implements="nsIAccessibleProvider">
<property name="accessibleType" readonly="true">
<getter>
return Components.interfaces.nsIAccessibleProvider.XULButton;
</getter>
</property>
</implementation>
</binding>
<binding id="thumb" extends="xul:button" />
<binding id="scrollbar-base">
<handlers>
@ -55,13 +27,5 @@
<xul:scrollbarbutton sbattr="scrollbar-up-bottom" type="decrement" xbl:inherits="curpos,maxpos,disabled,sborient=orient"/>
<xul:scrollbarbutton sbattr="scrollbar-down-bottom" type="increment" xbl:inherits="curpos,maxpos,disabled,sborient=orient"/>
</content>
<implementation implements="nsIAccessibleProvider">
<property name="accessibleType" readonly="true">
<getter>
return Components.interfaces.nsIAccessibleProvider.XULScrollbar;
</getter>
</property>
</implementation>
</binding>
</bindings>

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

@ -886,18 +886,10 @@ scrollbar[value="hidden"] {
visibility: hidden;
}
scrollbarbutton {
-moz-binding: url(chrome://global/content/bindings/scrollbar.xml#scrollbarbutton);
}
scale {
-moz-binding: url(chrome://global/content/bindings/scale.xml#scale);
}
slider {
-moz-binding: url(chrome://global/content/bindings/scrollbar.xml#slider);
}
.scale-slider {
-moz-binding: url(chrome://global/content/bindings/scale.xml#scaleslider);
-moz-user-focus: normal;