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

Side by Side Diff: LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-first-letter-style.html

Issue 25668008: Make Document::caretRangeFromPoint() to work with :first-letter style (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-10-04T19:04:13 Created 7 years, 2 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/Document/CaretRangeFromPoint/caretRangeFromPoint-with-first-letter-style-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 <style>
2 p.first-letter:first-letter { color: red; }
3 </style>
4 <div id="container">
5 <p id="description"></p>
6 <p id="sample" class="first-letter"><span>0123456</span></p>
7 </div>
8 <div id="console"></div>
9 <script src="../../../../fast/js/resources/js-test-pre.js"></script>
10 <script>
11 description('caretRangeFromPoint() should work with :first-letter style');
12 function $(id) { return document.getElementById(id); }
13
14 var range;
15 window.onload = function() {
16 var middle = $('sample').offsetTop + $('sample').offsetHeight / 2;
17 var left = $('sample').offsetLeft;
18 var numberOfChars = $('sample').firstChild.firstChild.length;
19 var charWidth = $('sample').firstChild.offsetWidth / numberOfChars;
20 var x = left;
21 for (var i = 0; i < numberOfChars; ++i) {
22 range = document.caretRangeFromPoint(x + 3, middle);
23 shouldBe('range.startOffset', i.toString());
24 x += charWidth;
25 }
26
27 if (window.testRunner) {
28 $('container').outerHTML = '';
29 finishJSTest();
30 }
31 }
32 window.jsTestIsAsync = true;
ojan 2013/10/04 17:36:25 This test doesn't need to be async if you're runni
33 </script>
34 <script src="../../../../fast/js/resources/js-test-post.js"></script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-first-letter-style-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698