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); |