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

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: Update TestExpectations 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
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/caret/caret-height-multi-line.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d6cc72e451eedaad34ef2b71ad43a2af188884a5..796646bafef56944887896421c951f0f3f56ce9f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutText.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp
@@ -733,8 +733,8 @@ LayoutRect LayoutText::localCaretRect(InlineBox* inlineBox,
InlineTextBox* box = toInlineTextBox(inlineBox);
- int height = box->root().selectionHeight().toInt();
- int top = box->root().selectionTop().toInt();
+ int height = style()->font().primaryFont()->getFontMetrics().height();
yosin_UTC9 2016/11/30 01:44:02 Could you use font ascendant and descendant instea
joone 2016/12/02 01:24:43 But, we need the height value and can get it easil
yosin_UTC9 2016/12/02 01:42:35 This function returns rectangle rather than height
+ int top = box->root().selectionBottom().toInt() - height;
// Go ahead and round left to snap it to the nearest pixel.
LayoutUnit left = box->positionForOffset(caretOffset);
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/caret/caret-height-multi-line.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698