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

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

Issue 2683233005: Set caret width based on device scale factor (Closed)
Patch Set: Sync with ToT again 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 09baabe4299cb92198933bcdacf623e7404015d9..167b5be6937f5afe3d160deb7263c4bfff0a66b8 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -1176,6 +1176,7 @@ LayoutRect LayoutBoxModelObject::localCaretRectForEmptyElement(
LayoutUnit x = borderLeft() + paddingLeft();
LayoutUnit maxX = width - borderRight() - paddingRight();
+ LayoutUnit caretWidth = frameView()->caretWidth();
switch (alignment) {
case AlignLeft:
@@ -1190,12 +1191,12 @@ LayoutRect LayoutBoxModelObject::localCaretRectForEmptyElement(
x -= textIndentOffset / 2;
break;
case AlignRight:
- x = maxX - caretWidth();
+ x = maxX - caretWidth;
if (!currentStyle.isLeftToRightDirection())
x -= textIndentOffset;
break;
}
- x = std::min(x, (maxX - caretWidth()).clampNegativeToZero());
+ x = std::min(x, (maxX - caretWidth).clampNegativeToZero());
const Font& font = style()->font();
const SimpleFontData* fontData = font.primaryFont();
@@ -1211,8 +1212,8 @@ 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, height)
+ : LayoutRect(y, x, height, caretWidth);
}
const LayoutObject* LayoutBoxModelObject::pushMappingToContainer(
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698