Bug 1542807 part 7 - Update a11y tests. r=eeejay

Differential Revision: https://phabricator.services.mozilla.com/D114129
This commit is contained in:
Mats Palmgren 2021-06-11 18:10:40 +00:00
Родитель 0b9e531f56
Коммит 084b2c17dd
5 изменённых файлов: 29 добавлений и 7 удалений

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

@ -96,7 +96,7 @@ const kEmbedChar = String.fromCharCode(0xfffc);
const kDiscBulletChar = String.fromCharCode(0x2022);
const kDiscBulletText = kDiscBulletChar + " ";
const kCircleBulletText = String.fromCharCode(0x25e6) + " ";
const kSquareBulletText = String.fromCharCode(0x25fe) + " ";
const kSquareBulletText = String.fromCharCode(0x25aa) + " ";
const MAX_TRIM_LENGTH = 100;

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

@ -35,7 +35,18 @@
this.finalCheck = function bulletUpdate_finalCheck() {
testName("li_start", "1. list start");
testName("li_end", "2. list end");
};
this.getID = function bulletUpdate_getID() {
return "insertBefore new list item";
};
}
function bulletUpdate2() {
this.eventSeq = [
new invokerChecker(EVENT_REORDER, getNode("li_end")),
];
this.invoke = function bulletUpdate2_invoke() {
// change list style type
var list = getNode("list");
list.setAttribute("style", "list-style-type: disc;");
@ -46,13 +57,15 @@
// nsTextFrame::GetRenderedText to report the text of a text
// frame is empty.
list.offsetWidth; // flush layout (which also flushes style)
};
this.finalCheck = function bulletUpdate2_finalCheck() {
testName("li_start", kDiscBulletText + "list start");
testName("li_end", kDiscBulletText + "list end");
};
this.getID = function bulletUpdate_getID() {
return "Update bullet of list items";
this.getID = function bulletUpdate2_getID() {
return "Update list item style";
};
}
@ -60,6 +73,7 @@
function doTest() {
gQueue = new eventQueue();
gQueue.push(new bulletUpdate());
gQueue.push(new bulletUpdate2());
gQueue.invoke(); // SimpleTest.finish();
}

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

@ -56,7 +56,9 @@
[[0, 0, kEmbedChar, 0, 1],
[1, 2, kEmbedChar, 1, 2]]);
testTextAtOffset("li1", BOUNDARY_PARAGRAPH,
[[0, 3, "• a", 0, 3]]);
[[0, 0, "• ", 0, 2], [2, 3, "a", 2, 3]]);
testTextAtOffset("li2", BOUNDARY_PARAGRAPH,
[[0, 0, "• ", 0, 2], [2, 3, "a", 2, 3]]);
// Test line breaks in a textarea.
testTextAtOffset("textarea", BOUNDARY_PARAGRAPH,
@ -125,6 +127,8 @@
<p id="pWithLink">a<a id="link" href="https://example.com/">bc</a>d</p>
<p id="pWithLinkWithBr">a<a href="#">b<br>c</a>d</p>
<ul id="ul"><li id="li1">a</li><li>b</li></ul>
<style>#li2::marker { content:'\2022\0020'; }</style>
<ul id="ul"><li id="li2">a</li><li>b</li></ul>
<textarea id="textarea">a
b

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

@ -538,9 +538,13 @@
attrs = {
"auto-generated": "true",
"font-family": "-moz-bullet-font",
};
testTextAttrs(ID, 0, attrs, defAttrs, 0, 3);
testTextAttrs(ID, 0, attrs, defAttrs, 0, 2);
testTextAttrs(ID, 3, { }, defAttrs, 3, 7);
attrs = {
"auto-generated": "true",
};
testTextAttrs(ID, 7, attrs, defAttrs, 7, 8);
// ////////////////////////////////////////////////////////////////////////

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

@ -190,7 +190,7 @@
children: [
{ // ::marker content text and counter
role: ROLE_LISTITEM_MARKER,
name: "foo 1",
name: "foo1",
},
{
role: ROLE_TEXT_LEAF,
@ -203,7 +203,7 @@
children: [
{ // ::marker content text and counter
role: ROLE_LISTITEM_MARKER,
name: "foo 2",
name: "foo2",
},
{
role: ROLE_TEXT_LEAF,