From 6e48f5e1406913ea87756a971048009e83b46f26 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 7 Oct 2018 19:46:00 +0200 Subject: Make caret width normal/thick behind CJK char configurable. Fixes #820 (regression). --- layout/base/nsCaret.cpp | 8 +++++++- modules/libpref/init/all.js | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/layout/base/nsCaret.cpp b/layout/base/nsCaret.cpp index 8ad435950..eca22f3ba 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); diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index ab9560fba..c23373ad8 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -5399,6 +5399,9 @@ pref("plugins.navigator_hide_disabled_flash", false); // Disable browser frames by default pref("dom.mozBrowserFramesEnabled", false); +// Thick caret when behind CJK characters +pref("layout.cjkthickcaret", true); + // Is support for 'color-adjust' CSS property enabled? pref("layout.css.color-adjust.enabled", true); -- cgit v1.2.3