зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1475068 - If accessible's parent has text interface, use it in pivot move by text. r=surkov
This commit is contained in:
Родитель
117e86643a
Коммит
16dbdcb14b
|
@ -825,13 +825,17 @@ nsAccessiblePivot::SearchForText(Accessible* aAccessible, bool aBackward)
|
|||
if (temp == root)
|
||||
break;
|
||||
|
||||
// Unlike traditional pre-order traversal we revisit the parent
|
||||
// nodes when we go up the tree. This is because our starting point
|
||||
// may be a subtree or a leaf. If it's parent matches, it should
|
||||
// take precedent over a sibling.
|
||||
if (temp != aAccessible && temp->IsHyperText())
|
||||
return temp->AsHyperText();
|
||||
|
||||
sibling = aBackward ? temp->PrevSibling() : temp->NextSibling();
|
||||
|
||||
if (sibling)
|
||||
break;
|
||||
|
||||
sibling = aBackward ? temp->PrevSibling() : temp->NextSibling();
|
||||
} while ((temp = temp->Parent()));
|
||||
|
||||
if (!sibling)
|
||||
|
|
|
@ -104,7 +104,7 @@ function VCChangedChecker(aDocAcc, aIdOrNameOrAcc, aTextOffsets, aPivotMoveMetho
|
|||
var accMatches = position == aIdOrNameOrAcc;
|
||||
|
||||
SimpleTest.ok(idMatches || nameMatches || accMatches, "id or name matches",
|
||||
"expecting " + aIdOrNameOrAcc + ", got '" +
|
||||
"expecting " + prettyName(aIdOrNameOrAcc) + ", got '" +
|
||||
prettyName(position));
|
||||
|
||||
SimpleTest.is(aEvent.isFromUserInput, aIsFromUserInput,
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
</table>
|
||||
<div id="section-3">Endless fun!</div>
|
||||
<p id="paragraph-3">Objects<a id="p3-link-1" href="#">adjacent</a>to <a id="p3-link-2" href="#">each</a><a id="p3-link-3" href="#">other</a> should be separate.</p>
|
||||
<p id="paragraph-4">Hello <strong>real</strong><a href="#"> world</p>
|
||||
<div id="end-block">End!</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -213,6 +213,21 @@
|
|||
getAccessible(doc.getElementById("start-block"))));
|
||||
gQueue.push(new setVCTextInvoker(docAcc, "movePreviousByText", WORD_BOUNDARY, null, false));
|
||||
|
||||
gQueue.push(new setVCPosInvoker(docAcc, null, null,
|
||||
getAccessible(doc.getElementById("paragraph-3")).firstChild));
|
||||
gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [0, 7],
|
||||
getAccessible(doc.getElementById("paragraph-3"), nsIAccessibleText)));
|
||||
|
||||
gQueue.push(new setVCPosInvoker(docAcc, null, null,
|
||||
getAccessible(doc.getElementById("s1-link-1")).nextSibling));
|
||||
gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [4, 6],
|
||||
getAccessible(doc.getElementById("section-1"), nsIAccessibleText)));
|
||||
|
||||
gQueue.push(new setVCPosInvoker(docAcc, null, null,
|
||||
getAccessible(doc.getElementById("paragraph-4")).firstChild.nextSibling));
|
||||
gQueue.push(new setVCTextInvoker(docAcc, "moveNextByText", WORD_BOUNDARY, [6, 10],
|
||||
getAccessible(doc.getElementById("paragraph-4"), nsIAccessibleText)));
|
||||
|
||||
gQueue.invoke();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче