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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/caret/caret-height-multi-line.html

Issue 2517383002: Use the font height as caret height instead of the line height (Closed)
Patch Set: Get caret height from an InlineBox before caret position Created 4 years 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 <html>
3 <head>
4 <style>
5 div {
6 border: 2px solid red;
7 padding: 12px;
8 line-height: 1.66666667;
9 width: 70px;
10 }
11 </style>
12 <script src="../../resources/testharness.js"></script>
13 <script src="../../resources/testharnessreport.js"></script>
14 </head>
15 <body>
16 <div contenteditable id="editor">
17 The caret
18 <span id="line2"> height should be the same for each line.</span>
19 </div>
20 <script>
21 test(function () {
22 var editor = document.getElementById('editor');
23 editor.focus();
24
25 var caretHeight1 = window.internals.absoluteCaretBounds().height;
26 var sel = window.getSelection();
27 sel.collapse(line2, 0);
28 var caretHeight2 = window.internals.absoluteCaretBounds().height;
29
30 assert_equals(caretHeight1, caretHeight2, 'The caret height is the same for ea ch line.');
31 }, 'Compare the caret height');
32 </script>
33 </body>
34 </html>
35
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698