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

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

Issue 2683233005: Set caret width based on device scale factor (Closed)
Patch Set: Created 3 years, 10 months 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/LayoutBoxModelObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
index c3f9368ccc8c86a72f400ecd57acbec015062842..a45b6ab7694316f44448fa8f699fa265c4551d97 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -1178,12 +1178,14 @@ LayoutRect LayoutBoxModelObject::localCaretRectForEmptyElement(
x -= textIndentOffset / 2;
break;
case AlignRight:
- x = maxX - caretWidth();
+ x = maxX - caretWidth(frameView()->getHostWindow());
oshima 2017/02/10 19:55:16 can you just get once in this function?
malaykeshav 2017/02/10 21:00:54 Done
if (!currentStyle.isLeftToRightDirection())
x -= textIndentOffset;
break;
}
- x = std::min(x, (maxX - caretWidth()).clampNegativeToZero());
+ x = std::min(
+ x,
+ (maxX - caretWidth(frameView()->getHostWindow())).clampNegativeToZero());
const Font& font = style()->font();
const SimpleFontData* fontData = font.primaryFont();
@@ -1199,8 +1201,10 @@ LayoutRect LayoutBoxModelObject::localCaretRectForEmptyElement(
height;
LayoutUnit y = paddingTop() + borderTop() + (verticalSpace / 2);
return currentStyle.isHorizontalWritingMode()
- ? LayoutRect(x, y, caretWidth(), height)
- : LayoutRect(y, x, height, caretWidth());
+ ? LayoutRect(x, y, caretWidth(frameView()->getHostWindow()),
+ height)
+ : LayoutRect(y, x, height,
+ caretWidth(frameView()->getHostWindow()));
}
const LayoutObject* LayoutBoxModelObject::pushMappingToContainer(

Powered by Google App Engine
This is Rietveld 408576698