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

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

Issue 2683233005: Set caret width based on device scale factor (Closed)
Patch Set: Fix compile error 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/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index e913d31e1340f849c08cc1f8b86a41dd5aee504c..d71183a3dbaf71a6ba527ed95dbf9c4fd00749a5 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -28,6 +28,8 @@
#include "core/layout/LayoutObject.h"
+#include <algorithm>
+#include <memory>
#include "core/animation/ElementAnimations.h"
#include "core/css/resolver/StyleResolver.h"
#include "core/dom/AXObjectCache.h"
@@ -77,6 +79,7 @@
#include "core/paint/PaintLayer.h"
#include "core/style/ContentData.h"
#include "core/style/CursorData.h"
+#include "platform/HostWindow.h"
#include "platform/InstanceCounters.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/geometry/TransformState.h"
@@ -85,8 +88,6 @@
#include "wtf/allocator/Partitions.h"
#include "wtf/text/StringBuilder.h"
#include "wtf/text/WTFString.h"
-#include <algorithm>
-#include <memory>
#ifndef NDEBUG
#include <stdio.h>
#endif
@@ -99,8 +100,8 @@ static bool gModifyLayoutTreeStructureAnyState = false;
} // namespace
-const LayoutUnit& caretWidth() {
- static LayoutUnit gCaretWidth(1);
+const LayoutUnit& caretWidth(HostWindow* host) {
+ static LayoutUnit gCaretWidth(host->windowToViewportScalar(1));
Xianzhu 2017/02/10 22:53:55 Does host->windowToViewportScalar(1) always return
oshima 2017/02/10 22:57:23 No, two tabs may have different scale factor.
Xianzhu 2017/02/10 23:04:13 Then the above code is incorrect because the stati
return gCaretWidth;
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698