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

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: Fix invalid failure 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 nodes = container.querySelectorAll("div");
18 var expectedNode = nodes[0].firstChild;
eae 2015/08/19 15:38:10 Nit, var expectedNode = container.firstElementChi
kojii 2015/08/20 05:00:30 Done.
19 var targetNode = nodes[1].firstChild;
20 for (var i = 0; i < expectedNode.length; i++) {
21 test(function () {
22 assert_equals(getX(targetNode, i), getX(expectedNode, i));
23 }, "Index " + i);
24 }
25
26 if (window.testRunner)
27 container.style.display = "none";
28 }
29
30 function getX(node, offset) {
31 var range = document.createRange();
32 range.setStart(node, offset);
33 range.setEnd(node, offset + 1);
34 var bounds = range.getBoundingClientRect();
35 return bounds.left;
36 }
37 </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