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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/editing/caret/caret-height-multi-line.html
diff --git a/third_party/WebKit/LayoutTests/editing/caret/caret-height-multi-line.html b/third_party/WebKit/LayoutTests/editing/caret/caret-height-multi-line.html
new file mode 100644
index 0000000000000000000000000000000000000000..2fcb1bb79e307378284f6ee373f842beb4c2eaec
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/caret/caret-height-multi-line.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+div {
+ border: 2px solid red;
+ padding: 12px;
+ line-height: 1.66666667;
+ width: 70px;
+}
+</style>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+</head>
+<body>
+ <div contenteditable id="editor">
+ The caret
+ <span id="line2"> height should be the same for each line.</span>
+ </div>
+<script>
+test(function () {
+ var editor = document.getElementById('editor');
+ editor.focus();
+
+ var caretHeight1 = window.internals.absoluteCaretBounds().height;
+ var sel = window.getSelection();
+ sel.collapse(line2, 0);
+ var caretHeight2 = window.internals.absoluteCaretBounds().height;
+
+ assert_equals(caretHeight1, caretHeight2, 'The caret height is the same for each line.');
+}, 'Compare the caret height');
+</script>
+</body>
+</html>
+

Powered by Google App Engine
This is Rietveld 408576698