Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: LayoutTests/fast/text/justification-padding-mid-word.html

Issue 1204023002: Deflake tests using ahem font with @font-face. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaseline and fix an svg test Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <script src="../../resources/ahem.js"></script>
1 <div id="test" style="width: 200px; font-family: Ahem; font-size: 40px; text-ren dering: optimizelegibility; text-align: justify;">a&shy;b c de</div> 2 <div id="test" style="width: 200px; font-family: Ahem; font-size: 40px; text-ren dering: optimizelegibility; text-align: justify;">a&shy;b c de</div>
2 <div id="reference" style="width: 200px; font-family: Ahem; font-size: 40px; tex t-align: justify;">a&shy;b c de</div> 3 <div id="reference" style="width: 200px; font-family: Ahem; font-size: 40px; tex t-align: justify;">a&shy;b c de</div>
3 <div id="result"></div> 4 <div id="result"></div>
4 <script> 5 <script>
5 if (window.testRunner) 6 if (window.testRunner)
6 testRunner.dumpAsText(); 7 testRunner.dumpAsText();
7 8
8 function widthOfFirstThreeCharacters(id) 9 function widthOfFirstThreeCharacters(id)
9 { 10 {
10 var text = document.getElementById(id).firstChild; 11 var text = document.getElementById(id).firstChild;
11 var range = document.createRange(); 12 var range = document.createRange();
12 range.setStart(text, 0); 13 range.setStart(text, 0);
13 range.setEnd(text, 3); 14 range.setEnd(text, 3);
14 return range.getBoundingClientRect().width; 15 return range.getBoundingClientRect().width;
15 } 16 }
16 17
17 document.getElementById("result").innerText = widthOfFirstThreeCharacters("t est") === widthOfFirstThreeCharacters("reference") ? "PASS" : "FAIL"; 18 document.getElementById("result").innerText = widthOfFirstThreeCharacters("t est") === widthOfFirstThreeCharacters("reference") ? "PASS" : "FAIL";
18 </script> 19 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/text/fixed-pitch-control-characters.html ('k') | LayoutTests/fast/text/justify-nbsp.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698