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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutText.cpp

Issue 2517383002: Use the font height as caret height instead of the line height (Closed)
Patch Set: fix rebase fail Created 4 years, 1 month 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/Source/core/layout/LayoutText.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutText.cpp b/third_party/WebKit/Source/core/layout/LayoutText.cpp
index a9ee24e75b8780537e5ceabc1b923e9a3775df45..950d189cf64fab7e3f440c588a4a854cd49d0ff5 100644
--- a/third_party/WebKit/Source/core/layout/LayoutText.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp
@@ -731,8 +731,9 @@ LayoutRect LayoutText::localCaretRect(InlineBox* inlineBox,
InlineTextBox* box = toInlineTextBox(inlineBox);
- int height = box->root().selectionHeight().toInt();
- int top = box->root().selectionTop().toInt();
+ int height = (box->root().selectionBottom() -
+ box->root().lineTop()).clampNegativeToZero().toInt();
+ int top = box->root().lineTop().toInt();
// Go ahead and round left to snap it to the nearest pixel.
LayoutUnit left = box->positionForOffset(caretOffset);

Powered by Google App Engine
This is Rietveld 408576698