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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/text/international/rtl-selection-rect-with-fallback.html

Issue 1420043007: Fix ShapeResult::selectionRect handles RTL runs in wrong order (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebaseline 1px diff on Mac Created 5 years, 1 month 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script>
5 <style>
6 div {
7 /* Must be a font that causes fallback for Arabic.
8 'MS PGothic' for Windows, TakaoPGothic for Linux, Times for Mac. */
9 font-family: 'MS PGothic', TakaoPGothic, Times;
10 }
11
12 .PASS {
13 background-color: lime;
14 }
15
16 .FAIL {
17 background-color: red;
18 }
19 </style>
20 <div id="container">
21 <div id="ltr">'ص</div>
22 <div id="rtl" dir="rtl">'ص</div>
23 </div>
24 <script>
25 Array.prototype.forEach.call(container.children, function (element) {
26 test(function () {
27 var textNode = element.firstChild;
28 var width0 = getWidth(textNode, 0);
29 var width1 = getWidth(textNode, 1);
30 element.className = width0 < width1 ? "PASS" : "FAIL";
31 assert_less_than(width0, width1);
32 }, element.id);
33 });
34
35 function getWidth(node, offset) {
36 var range = document.createRange();
37 range.setStart(node, offset);
38 range.setEnd(node, offset + 1);
39 var rect = range.getBoundingClientRect();
40 return rect.width;
41 }
42
43 if (window.testRunner)
44 container.style.display = "none";
45 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698