mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 860013 part2: mimic WebKitGtk behavior for text_at_offset word_end boundary, r=tbsaunde
This commit is contained in:
parent
e7d3bbfbdf
commit
b284715c05
@ -1084,8 +1084,11 @@ HyperTextAccessible::GetTextAtOffset(int32_t aOffset,
|
||||
return GetText(*aStartOffset, *aEndOffset, aText);
|
||||
|
||||
case BOUNDARY_WORD_END:
|
||||
*aStartOffset = FindWordBoundary(offset, eDirPrevious, eEndWord);
|
||||
*aEndOffset = FindWordBoundary(*aStartOffset, eDirNext, eEndWord);
|
||||
// Ignore the spec and follow what WebKitGtk does because Orca expects it,
|
||||
// i.e. return a next word at word end offset of the current word
|
||||
// (WebKitGtk behavior) instead the current word (AKT spec).
|
||||
*aEndOffset = FindWordBoundary(offset, eDirNext, eEndWord);
|
||||
*aStartOffset = FindWordBoundary(*aEndOffset, eDirPrevious, eEndWord);
|
||||
return GetText(*aStartOffset, *aEndOffset, aText);
|
||||
|
||||
case BOUNDARY_LINE_START:
|
||||
|
@ -336,19 +336,9 @@
|
||||
|
||||
// BOUNDARY_WORD_END
|
||||
testTextAtOffset(0, BOUNDARY_WORD_END, "oneword", 0, 7, IDs);
|
||||
testTextAtOffset(8, BOUNDARY_WORD_END, "\n\ntwo", 7, 12,
|
||||
"div", kOk, kOk, kOk,
|
||||
"divbr", kTodo, kTodo, kTodo,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"editablebr", kTodo, kTodo, kTodo,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextAtOffset(9, BOUNDARY_WORD_END, "\n\ntwo", 7, 12,
|
||||
"div", kOk, kOk, kOk,
|
||||
"divbr", kTodo, kTodo, kTodo,
|
||||
"editable", kOk, kOk, kOk,
|
||||
"editablebr", kTodo, kTodo, kTodo,
|
||||
"textarea", kOk, kOk, kOk);
|
||||
testTextAtOffset(12, BOUNDARY_WORD_END, "\n\ntwo", 7, 12, IDs);
|
||||
testTextAtOffset(8, BOUNDARY_WORD_END, "\n\ntwo", 7, 12, IDs);
|
||||
testTextAtOffset(9, BOUNDARY_WORD_END, "\n\ntwo", 7, 12, IDs);
|
||||
testTextAtOffset(12, BOUNDARY_WORD_END, " words", 12, 18, IDs);
|
||||
testTextAtOffset(13, BOUNDARY_WORD_END, " words", 12, 18,
|
||||
"div", kOk, kOk, kOk,
|
||||
"divbr", kOk, kOk, kOk,
|
||||
|
@ -315,10 +315,10 @@
|
||||
// BOUNDARY_WORD_END
|
||||
testTextAtOffset(0, BOUNDARY_WORD_END, "hello", 0, 5, IDs);
|
||||
testTextAtOffset(1, BOUNDARY_WORD_END, "hello", 0, 5, IDs);
|
||||
testTextAtOffset(5, BOUNDARY_WORD_END, "hello", 0, 5, IDs);
|
||||
testTextAtOffset(5, BOUNDARY_WORD_END, " my", 5, 8, IDs);
|
||||
testTextAtOffset(6, BOUNDARY_WORD_END, " my", 5, 8, IDs);
|
||||
testTextAtOffset(7, BOUNDARY_WORD_END, " my", 5, 8, IDs);
|
||||
testTextAtOffset(8, BOUNDARY_WORD_END, " my", 5, 8, IDs);
|
||||
testTextAtOffset(8, BOUNDARY_WORD_END, " friend", 8, 15, IDs);
|
||||
testTextAtOffset(9, BOUNDARY_WORD_END, " friend", 8, 15, IDs);
|
||||
testTextAtOffset(10, BOUNDARY_WORD_END, " friend", 8, 15, IDs);
|
||||
testTextAtOffset(14, BOUNDARY_WORD_END, " friend", 8, 15, IDs);
|
||||
|
@ -342,20 +342,21 @@
|
||||
// BOUNDARY_WORD_END
|
||||
testTextAtOffset(0, BOUNDARY_WORD_END, "Brave", 0, 5, IDs);
|
||||
testTextAtOffset(4, BOUNDARY_WORD_END, "Brave", 0, 5, IDs);
|
||||
testTextAtOffset(5, BOUNDARY_WORD_END, "Brave", 0, 5, IDs);
|
||||
testTextAtOffset(5, BOUNDARY_WORD_END, " Sir", 5, 9, IDs);
|
||||
testTextAtOffset(6, BOUNDARY_WORD_END, " Sir", 5, 9, IDs);
|
||||
testTextAtOffset(8, BOUNDARY_WORD_END, " Sir", 5, 9, IDs);
|
||||
testTextAtOffset(9, BOUNDARY_WORD_END, " Sir", 5, 9, IDs);
|
||||
testTextAtOffset(9, BOUNDARY_WORD_END, " Robin", 9, 16, IDs);
|
||||
testTextAtOffset(10, BOUNDARY_WORD_END, " Robin", 9, 16, IDs);
|
||||
testTextAtOffset(11, BOUNDARY_WORD_END, " Robin", 9, 16, IDs);
|
||||
testTextAtOffset(15, BOUNDARY_WORD_END, " Robin", 9, 16, IDs);
|
||||
testTextAtOffset(16, BOUNDARY_WORD_END, " Robin", 9, 16, IDs);
|
||||
testTextAtOffset(16, BOUNDARY_WORD_END, " ran", 16, 22, IDs);
|
||||
testTextAtOffset(17, BOUNDARY_WORD_END, " ran", 16, 22, IDs);
|
||||
testTextAtOffset(18, BOUNDARY_WORD_END, " ran", 16, 22, IDs);
|
||||
testTextAtOffset(19, BOUNDARY_WORD_END, " ran", 16, 22, IDs);
|
||||
testTextAtOffset(20, BOUNDARY_WORD_END, " ran", 16, 22, IDs);
|
||||
testTextAtOffset(21, BOUNDARY_WORD_END, " ran", 16, 22, IDs);
|
||||
testTextAtOffset(22, BOUNDARY_WORD_END, " ran", 16, 22, IDs);
|
||||
testTextAtOffset(22, BOUNDARY_WORD_END, " ran", 16, 22, ["input", "div", "editable"]);
|
||||
testTextAtOffset(22, BOUNDARY_WORD_END, " ran\n", 16, 23, [ "textarea" ]);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user