summaryrefslogtreecommitdiff
path: root/layout/base
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-10-07 19:46:00 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-10-07 19:46:00 +0200
commita84e3f6f3d045c36224695eb32ce53046890fb16 (patch)
treed3be71eed0097a8328bc8fb5652bf6a923ee8c86 /layout/base
parentffb7506d6d9d96744b9a89b84582ba562ea5f139 (diff)
downloaduxp-a84e3f6f3d045c36224695eb32ce53046890fb16.tar.gz
Make caret width normal/thick behind CJK char configurable.
Fixes #820 (regression).
Diffstat (limited to 'layout/base')
-rw-r--r--layout/base/nsCaret.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/layout/base/nsCaret.cpp b/layout/base/nsCaret.cpp
index 8ad4359501..eca22f3ba5 100644
--- a/layout/base/nsCaret.cpp
+++ b/layout/base/nsCaret.cpp
@@ -117,6 +117,12 @@ IsBidiUI()
return Preferences::GetBool("bidi.browser.ui");
}
+static bool
+CjkThickCaret()
+{
+ return Preferences::GetBool("layout.cjkthickcaret");
+}
+
nsCaret::nsCaret()
: mOverrideOffset(0)
, mBlinkCount(-1)
@@ -190,7 +196,7 @@ nsCaret::ComputeMetrics(nsIFrame* aFrame, int32_t aOffset, nscoord aCaretHeight)
nsPresContext::CSSPixelsToAppUnits(
LookAndFeel::GetInt(LookAndFeel::eIntID_CaretWidth, 1));
- if (DrawCJKCaret(aFrame, aOffset)) {
+ if (DrawCJKCaret(aFrame, aOffset) && CjkThickCaret()) {
caretWidth += nsPresContext::CSSPixelsToAppUnits(1);
}
nscoord bidiIndicatorSize = nsPresContext::CSSPixelsToAppUnits(kMinBidiIndicatorPixels);