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

Side by Side Diff: LayoutTests/fast/text/international/bounds-white-space-pre.html

Issue 1303673005: Add a test of getBoundingClientRect() when white-space:pre for complex scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: eae review Created 5 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #container {
7 font-size: 25px;
8 }
9 </style>
10 <div id="container">
11 <div>شییش ی ی ی ی ی</div>
12 <div style="white-space:pre">شییش ی ی ی ی ی</div>
13 </div>
14 <script>
15 runTests();
16 function runTests() {
17 var expectedNode = container.firstElementChild.firstChild;
18 var targetNode = container.lastElementChild.firstChild;
19 for (var i = 0; i < expectedNode.length; i++) {
20 test(function () {
21 assert_equals(getX(targetNode, i), getX(expectedNode, i));
22 }, "Index " + i);
23 }
24
25 if (window.testRunner)
26 container.style.display = "none";
27 }
28
29 function getX(node, offset) {
30 var range = document.createRange();
31 range.setStart(node, offset);
32 range.setEnd(node, offset + 1);
33 var bounds = range.getBoundingClientRect();
34 return bounds.left;
35 }
36 </script>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698