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

Side by Side Diff: LayoutTests/fast/dom/Range/getClientRects-character.html

Issue 24023007: Fix wrong width of Range in vertical text (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Range/getClientRects-character-expected.txt » ('j') | 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 <script src="../../js/resources/js-test-pre.js"></script>
3 <style>
4 .box {
5 line-height: 30px;
6 font-family: monospace;
7 font-size: 20px;
8 }
9
10 .horizontal {
11 width: 400px;
12 }
13
14 .vertical {
15 height: 400px;
16 -webkit-writing-mode: vertical-rl;
17 }
18
19 #console {
20 position:absolute;
21 left: 500px;
22 }
23 </style>
24
25 <div id="console"></div>
26 <div class="box horizontal" id="test-horizontal">ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCD EFGHIJKLMNOPQRSTUVWXYZ</div>
27 <div class="box vertical" id="test-vertical">ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGH IJKLMNOPQRSTUVWXYZ</div>
28
29 <script>
30 debug("Test horizontal");
31 var range = document.createRange();
32 var box = document.getElementById('test-horizontal');
33 range.setStart(box.firstChild, 20);
34 range.setEnd(box.firstChild, 21);
35 var rects = range.getClientRects();
36 shouldBe("1", "rects.length");
37 shouldBeGreaterThanOrEqual("box.offsetWidth / 26", "rects[0].width");
38 shouldBeGreaterThanOrEqual("box.offsetHeight / 2", "rects[0].height");
39
40 debug("Test vertical");
41 box = document.getElementById('test-vertical');
42 range.setStart(box.firstChild, 20);
43 range.setEnd(box.firstChild, 21);
44 rects = range.getClientRects();
45 shouldBe("1", "rects.length");
46 shouldBeGreaterThanOrEqual("box.offsetWidth / 2", "rects[0].width");
47 shouldBeGreaterThanOrEqual("box.offsetHeight / 26", "rects[0].height");
48 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Range/getClientRects-character-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698