mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-15 13:09:14 +00:00
Bug 855184 part 2: Map IA2_TEXT_BOUNDARY_CHAR to cluster. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D212536
This commit is contained in:
parent
3b3a1815ea
commit
6ffc34fe0a
@ -9,3 +9,5 @@ support-files = ["head.js"]
|
||||
["browser_osPicker.js"]
|
||||
|
||||
["browser_role.js"]
|
||||
|
||||
["browser_text.js"]
|
||||
|
37
accessible/tests/browser/windows/ia2/browser_text.js
Normal file
37
accessible/tests/browser/windows/ia2/browser_text.js
Normal file
@ -0,0 +1,37 @@
|
||||
/* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Test that IA2_TEXT_BOUNDARY_CHAR moves by cluster.
|
||||
*/
|
||||
addAccessibleTask(`<p id="cluster">a🤦♂️c`, async function testChar() {
|
||||
await runPython(`
|
||||
doc = getDocIa2()
|
||||
global cluster
|
||||
cluster = findIa2ByDomId(doc, "cluster")
|
||||
cluster = cluster.QueryInterface(IAccessibleText)
|
||||
`);
|
||||
SimpleTest.isDeeply(
|
||||
await runPython(`cluster.textAtOffset(0, IA2_TEXT_BOUNDARY_CHAR)`),
|
||||
[0, 1, "a"],
|
||||
"textAtOffset at 0 for CHAR correct"
|
||||
);
|
||||
SimpleTest.isDeeply(
|
||||
await runPython(`cluster.textAtOffset(1, IA2_TEXT_BOUNDARY_CHAR)`),
|
||||
[1, 6, "🤦♂️"],
|
||||
"textAtOffset at 1 for CHAR correct"
|
||||
);
|
||||
SimpleTest.isDeeply(
|
||||
await runPython(`cluster.textAtOffset(5, IA2_TEXT_BOUNDARY_CHAR)`),
|
||||
[1, 6, "🤦♂️"],
|
||||
"textAtOffset at 5 for CHAR correct"
|
||||
);
|
||||
SimpleTest.isDeeply(
|
||||
await runPython(`cluster.textAtOffset(6, IA2_TEXT_BOUNDARY_CHAR)`),
|
||||
[6, 7, "c"],
|
||||
"textAtOffset at 6 for CHAR correct"
|
||||
);
|
||||
});
|
@ -434,7 +434,7 @@ AccessibleTextBoundary ia2AccessibleText::GetGeckoTextBoundary(
|
||||
enum IA2TextBoundaryType aBoundaryType) {
|
||||
switch (aBoundaryType) {
|
||||
case IA2_TEXT_BOUNDARY_CHAR:
|
||||
return nsIAccessibleText::BOUNDARY_CHAR;
|
||||
return nsIAccessibleText::BOUNDARY_CLUSTER;
|
||||
case IA2_TEXT_BOUNDARY_WORD:
|
||||
return nsIAccessibleText::BOUNDARY_WORD_START;
|
||||
case IA2_TEXT_BOUNDARY_LINE:
|
||||
|
Loading…
x
Reference in New Issue
Block a user