Bug 1343695 Part 2: Expand tests of GetClientRectsAndTexts to test more cases where rendered text differs from DOM text. r=mats

MozReview-Commit-ID: G0NfRJhAh50

--HG--
extra : rebase_source : eeaf09ac6bc08b29586fa28c136045bdda164788
This commit is contained in:
Brad Werth 2017-03-13 13:15:17 -07:00
Родитель 1a39a40cd5
Коммит 4b0debb93b
1 изменённых файлов: 16 добавлений и 1 удалений

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

@ -15,11 +15,17 @@ function runTests()
let attempts = [
{startNode: "one", start:0, endNode:"one", end:0, textList:[], message:"Empty rect"},
{startNode: "one", start:2, endNode:"one", end:6, textList:["l on"], message:"Single line"},
{startNode: "implicit", start:6, endNode:"implicit", end:12, textList:["it\nbre"], message:"Implicit break"},
{startNode: "implicit", start:6, endNode:"implicit", end:12, textList:["it bre"], message:"Implicit break"},
{startNode: "two.a", start:1, endNode:"two.b", end:2, textList:["wo", "", "li"], message:"Two lines"},
{startNode: "embed.a", start:7, endNode:"embed.b", end:2, textList:["th ", "simple nested", " ", "te"], message:"Simple nested"},
{startNode: "deep.a", start:2, endNode:"deep.b", end:2, textList:["ne with ", "complex, more deeply nested", " ", "te"], message:"Complex nested"},
{startNode: "image.a", start:7, endNode:"image.b", end:2, textList:["th inline ", "", " ", "im"], message:"Inline image"},
{startNode: "hyphen1", start:0, endNode:"hyphen1", end:3, textList:["a\u00AD", "b"], message:"Shy hyphen (active)"},
{startNode: "hyphen2", start:0, endNode:"hyphen2", end:3, textList:["c\u00ADd"], message:"Shy hyphen (inactive)"},
{startNode: "hyphen2", start:0, endNode:"hyphen2", end:2, textList:["c\u00AD"], message:"Shy hyphen (inactive, trailing)"},
{startNode: "hyphen2", start:1, endNode:"hyphen2", end:3, textList:["\u00ADd"], message:"Shy hyphen (inactive, leading)"},
{startNode: "uc", start:0, endNode:"uc", end:2, textList:["EF"], message:"UC transform"},
{startNode: "pre", start:0, endNode:"pre", end:3, textList:["g\n", "h"], message:"pre with break"},
];
for (let attempt of attempts) {
@ -56,5 +62,14 @@ break in one line</div>
<div id="image.a">Line with inline <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAG0lEQVR42mP8z0A%2BYKJA76jmUc2jmkc1U0EzACKcASfOgGoMAAAAAElFTkSuQmCC" width="20" height="20"/> <span id="image.b">image</span></div>
<div id="hyphen1" style="width:0">a&shy;b</div>
<div id="hyphen2" style="width:100px">c&shy;d</div>
<div id="uc" style="text-transform:uppercase">ef</div>
<pre id="pre">g
h</pre>
</body>
</html>