Bug 1343695 Part 3: Expand tests of GetClientRectsAndTexts to test more cases where rendered text differs from DOM text. r=mats
authorBrad Werth <bwerth@mozilla.com>
Mon, 13 Mar 2017 13:15:17 -0700
changeset 347627 31129448027bdc3e5a874c8f10d6d6e6dab9813e
parent 347626 9bf81510d7bcc8b94ab40e90421b6abc56375b5a
child 347628 45616bdf19cdf143df9b2ee82d6dd353eb2e28b8
push id38876
push userbwerth@mozilla.com
push dateWed, 15 Mar 2017 00:46:52 +0000
treeherderautoland@31129448027b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1343695
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1343695 Part 3: Expand tests of GetClientRectsAndTexts to test more cases where rendered text differs from DOM text. r=mats MozReview-Commit-ID: G0NfRJhAh50
dom/base/test/chrome/test_range_getClientRectsAndTexts.html
--- a/dom/base/test/chrome/test_range_getClientRectsAndTexts.html
+++ b/dom/base/test/chrome/test_range_getClientRectsAndTexts.html
@@ -10,21 +10,27 @@ SimpleTest.waitForExplicitFinish();
 
 function runTests()
 {
   let range = document.createRange();
 
   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) {
     range.setStart(document.getElementById(attempt.startNode).childNodes[0], attempt.start);
     range.setEnd(document.getElementById(attempt.endNode).childNodes[0], attempt.end);
 
     let result = range.getClientRectsAndTexts();
 
@@ -51,10 +57,19 @@ break in one line</div>
 ><span id="two.b">lines</span></div>
 
 <div id="embed.a">Line with <span>simple nested</span> <span id="embed.b">text</span></div>
 
 <div id="deep.a">Line with <span>complex, <span>more <span>deeply <span>nested</span></span></span></span> <span id="deep.b">text</span></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>
\ No newline at end of file