From 2796c1f140a97f8c0696977abb85f8ec9fc8fd25 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Tue, 25 Oct 2022 07:06:55 +0000 Subject: [PATCH] Bug 1796044 - part 2: Make `intl.tsf.hack.allow_to_stop_hacking_on_build_17643_or_later` a static pref r=m_kato Depends on D159804 Differential Revision: https://phabricator.services.mozilla.com/D159805 --- modules/libpref/init/StaticPrefList.yaml | 15 +++++++++++++++ modules/libpref/init/all.js | 16 ---------------- widget/windows/TSFTextStore.cpp | 6 ++---- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index e2d97f65c9d8..be84a08920a2 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -6895,6 +6895,21 @@ value: true mirror: always + # On Windows 10 Build 17643 (an Insider Preview build of RS5), Microsoft + # have fixed the caller of ITextACPStore::GetTextExt() to return + # TS_E_NOLAYOUT to TIP as-is, rather than converting to E_FAIL. + # Therefore, if TIP supports asynchronous layout computation perfectly, we + # can return TS_E_NOLAYOUT and TIP waits next OnLayoutChange() + # notification. However, some TIPs still have some bugs of asynchronous + # layout support. We keep hacking the result of GetTextExt() like running + # on Windows 10, however, there could be unknown TIP bugs if we stop + # hacking the result. So, user can stop checking build ID to make Gecko + # hack the result forcibly. +- name: intl.tsf.hack.allow_to_stop_hacking_on_build_17643_or_later + type: bool + value: @IS_EARLY_BETA_OR_EARLIER@ + mirror: always + # If true, automatically extend selection to cluster boundaries when # TSF/TIP requests to select from/by middle of a cluster. - name: intl.tsf.hack.extend_setting_selection_range_to_cluster_boundaries diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index ba41460c30ed..f27a57de4441 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -2552,22 +2552,6 @@ pref("font.size.monospace.x-math", 13); // Enables/Disables hack for specific TIP. - // On Windows 10 Build 17643 (an Insider Preview build of RS5), Microsoft - // have fixed the caller of ITextACPStore::GetTextExt() to return - // TS_E_NOLAYOUT to TIP as-is, rather than converting to E_FAIL. - // Therefore, if TIP supports asynchronous layout computation perfectly, we - // can return TS_E_NOLAYOUT and TIP waits next OnLayoutChange() - // notification. However, some TIPs still have some bugs of asynchronous - // layout support. We keep hacking the result of GetTextExt() like running - // on Windows 10, however, there could be unknown TIP bugs if we stop - // hacking the result. So, user can stop checking build ID to make Gecko - // hack the result forcibly. - #ifdef EARLY_BETA_OR_EARLIER - pref("intl.tsf.hack.allow_to_stop_hacking_on_build_17643_or_later", true); - #else - pref("intl.tsf.hack.allow_to_stop_hacking_on_build_17643_or_later", false); - #endif - // Whether creates native caret for ATOK or not. pref("intl.tsf.hack.atok.create_native_caret", true); // Whether use available composition string rect for result of diff --git a/widget/windows/TSFTextStore.cpp b/widget/windows/TSFTextStore.cpp index 674b1c5bae78..69adce774da1 100644 --- a/widget/windows/TSFTextStore.cpp +++ b/widget/windows/TSFTextStore.cpp @@ -1753,9 +1753,6 @@ class TSFPrefs final { return s##aName##Value; \ } - DECL_AND_IMPL_BOOL_PREF( - "intl.tsf.hack.allow_to_stop_hacking_on_build_17643_or_later", - AllowToStopHackingOnBuild17643OrLater, false) DECL_AND_IMPL_BOOL_PREF("intl.tsf.hack.atok.create_native_caret", NeedToCreateNativeCaretForLegacyATOK, true) DECL_AND_IMPL_BOOL_PREF( @@ -4680,7 +4677,8 @@ bool TSFTextStore::MaybeHackNoErrorLayoutBugs(LONG& aACPStart, LONG& aACPEnd) { // If TSF does not have the bug, we need to hack only with a few TIPs. static const bool sAlllowToStopHackingIfFine = IsWindows10BuildOrLater(17643) && - TSFPrefs::AllowToStopHackingOnBuild17643OrLater(); + StaticPrefs:: + intl_tsf_hack_allow_to_stop_hacking_on_build_17643_or_later(); // We need to compute active TIP now. This may take a couple of milliseconds, // however, it'll be cached, so, must be faster than check active TIP every