Bug 489306 - overflowed content doesn't expose child text accessibles, r=marcoz, davidb
This commit is contained in:
Родитель
a60704bc40
Коммит
9612a8b02c
|
@ -79,7 +79,6 @@ void nsAccessibleTreeWalker::GetKids(nsIDOMNode *aParentNode)
|
|||
mState.frame = nsnull; // Don't walk frames in non-HTML content, just walk the DOM.
|
||||
}
|
||||
|
||||
PushState();
|
||||
UpdateFrame(PR_TRUE);
|
||||
|
||||
// Walk frames? UpdateFrame() sets this when it sees anonymous frames
|
||||
|
@ -213,6 +212,8 @@ NS_IMETHODIMP nsAccessibleTreeWalker::GetFirstChild()
|
|||
}
|
||||
|
||||
nsCOMPtr<nsIDOMNode> parent(mState.domNode);
|
||||
|
||||
PushState();
|
||||
GetKids(parent); // Side effects change our state (mState)
|
||||
|
||||
// Recursive loop: depth first search for first accessible child
|
||||
|
|
|
@ -74,20 +74,61 @@ public:
|
|||
PRBool mWalkAnonymousContent);
|
||||
virtual ~nsAccessibleTreeWalker();
|
||||
|
||||
/**
|
||||
* Moves current state to point to the next child accessible.
|
||||
*/
|
||||
NS_IMETHOD GetNextSibling();
|
||||
|
||||
/**
|
||||
* Moves current state to point to the first child accessible.
|
||||
*/
|
||||
NS_IMETHOD GetFirstChild();
|
||||
|
||||
/**
|
||||
* Current state. Used to initialize a11y tree walker and to get an accessible
|
||||
* current state points to.
|
||||
*/
|
||||
WalkState mState;
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* Return true if currently navigated node/frame is accessible.
|
||||
*/
|
||||
PRBool GetAccessible();
|
||||
|
||||
/**
|
||||
* Prepares current state to navigate through children of node/frame.
|
||||
*/
|
||||
void GetKids(nsIDOMNode *aParent);
|
||||
|
||||
/**
|
||||
* Clears the current state.
|
||||
*/
|
||||
void ClearState();
|
||||
|
||||
/**
|
||||
* Push current state on top of stack. State stack is used to navigate down to
|
||||
* DOM/frame subtree during searching of accessible children.
|
||||
*/
|
||||
NS_IMETHOD PushState();
|
||||
|
||||
/**
|
||||
* Pop state from stack and make it current.
|
||||
*/
|
||||
NS_IMETHOD PopState();
|
||||
|
||||
/**
|
||||
* Change current state so that its frame is changed to next frame.
|
||||
*
|
||||
* @param aTryFirstChild [in] points whether we should move to child or
|
||||
* sibling frame
|
||||
*/
|
||||
void UpdateFrame(PRBool aTryFirstChild);
|
||||
|
||||
/**
|
||||
* Change current state so that its node is changed to next node.
|
||||
*/
|
||||
void GetNextDOMNode();
|
||||
|
||||
nsCOMPtr<nsIWeakReference> mWeakShell;
|
||||
|
|
|
@ -77,6 +77,7 @@ _TEST_FILES =\
|
|||
test_cssattrs.html \
|
||||
test_elm_filectrl.html \
|
||||
test_elm_media.html \
|
||||
test_elm_txtcntnr.html \
|
||||
test_events_caretmove.html \
|
||||
test_events_mutation.html \
|
||||
test_events_tree.xul \
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>HTML text containers 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">
|
||||
function doTest()
|
||||
{
|
||||
var accTree = {
|
||||
role: ROLE_SECTION,
|
||||
children: [
|
||||
{ // text child
|
||||
role: ROLE_TEXT_LEAF
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
testAccessibleTree("c1", accTree);
|
||||
testAccessibleTree("c2", accTree);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a target="_blank"
|
||||
title="overflowed content doesn't expose child text accessibles"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=489306">Mozilla Bug 489306</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>
|
||||
<div id="c2">
|
||||
1hellohello 2hellohello 3hellohello 4hellohello 5hellohello 6hellohello 7hellohello
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче