bromite/build/patches/Disable-scroll-to-text-fragment.patch
2020-11-21 17:31:40 +01:00

107 lines
5.7 KiB
Diff

From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 22 Aug 2020 12:46:20 +0200
Subject: Disable scroll-to-text-fragment
---
chrome/browser/chrome_content_browser_client.cc | 4 ++--
chrome/browser/ui/prefs/prefs_tab_helper.cc | 2 +-
content/browser/renderer_host/render_process_host_impl.cc | 2 +-
content/child/runtime_features.cc | 4 ++--
content/public/common/content_switches.cc | 4 ++--
content/public/common/content_switches.h | 2 +-
third_party/blink/common/features.cc | 2 +-
7 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2278,8 +2278,8 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
}
if (prefs->HasPrefPath(prefs::kScrollToTextFragmentEnabled) &&
- !prefs->GetBoolean(prefs::kScrollToTextFragmentEnabled)) {
- command_line->AppendSwitch(switches::kDisableScrollToTextFragment);
+ prefs->GetBoolean(prefs::kScrollToTextFragmentEnabled)) {
+ command_line->AppendSwitch(switches::kEnableScrollToTextFragment);
}
if (prefs->HasPrefPath(prefs::kAppCacheForceEnabled) &&
diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc
--- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -357,7 +357,7 @@ void PrefsTabHelper::RegisterProfilePrefs(
prefs::kEnableReferrers,
!base::FeatureList::IsEnabled(features::kNoReferrers));
registry->RegisterBooleanPref(prefs::kEnableEncryptedMedia, true);
- registry->RegisterBooleanPref(prefs::kScrollToTextFragmentEnabled, true);
+ registry->RegisterBooleanPref(prefs::kScrollToTextFragmentEnabled, false);
#if defined(OS_ANDROID)
registry->RegisterDoublePref(prefs::kWebKitFontScaleFactor, 1.0);
registry->RegisterBooleanPref(prefs::kWebKitForceEnableZoom,
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -3342,7 +3342,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kDisablePermissionsAPI,
switches::kDisablePresentationAPI,
switches::kDisableRTCSmoothnessAlgorithm,
- switches::kDisableScrollToTextFragment,
+ switches::kEnableScrollToTextFragment,
switches::kDisableSharedWorkers,
switches::kDisableSkiaRuntimeOpts,
switches::kDisableSpeechAPI,
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -442,8 +442,8 @@ void SetRuntimeFeaturesFromCommandLine(const base::CommandLine& command_line) {
{wrf::EnablePermissionsAPI, switches::kDisablePermissionsAPI, false},
{wrf::EnableWebGPU, switches::kEnableUnsafeWebGPU, true},
{wrf::EnablePresentationAPI, switches::kDisablePresentationAPI, false},
- {wrf::EnableTextFragmentAnchor, switches::kDisableScrollToTextFragment,
- false},
+ {wrf::EnableTextFragmentAnchor, switches::kEnableScrollToTextFragment,
+ true},
{wrf::EnableRemotePlaybackAPI, switches::kDisableRemotePlaybackAPI,
false},
{wrf::EnableTimerThrottlingForBackgroundTabs,
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -884,8 +884,8 @@ const char kWebRtcStunProbeTrialParameter[] = "webrtc-stun-probe-trial";
// without restarting the browser and relaunching without this flag.
const char kWebRtcLocalEventLogging[] = "webrtc-event-logging";
-// This switch disables the ScrollToTextFragment feature.
-const char kDisableScrollToTextFragment[] = "disable-scroll-to-text-fragment";
+// This switch enables the ScrollToTextFragment feature.
+const char kEnableScrollToTextFragment[] = "enable-scroll-to-text-fragment";
// Forcibly enable and select the specified runtime for webxr.
// Note that this provides an alternative means of enabling a runtime, and will
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -240,7 +240,7 @@ extern const char kWebRtcMaxCaptureFramerate[];
extern const char kWebRtcMaxCpuConsumptionPercentage[];
CONTENT_EXPORT extern const char kWebRtcStunProbeTrialParameter[];
CONTENT_EXPORT extern const char kWebRtcLocalEventLogging[];
-CONTENT_EXPORT extern const char kDisableScrollToTextFragment[];
+CONTENT_EXPORT extern const char kEnableScrollToTextFragment[];
CONTENT_EXPORT extern const char kWebXrForceRuntime[];
CONTENT_EXPORT extern const char kWebXrRuntimeNone[];
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -286,7 +286,7 @@ const base::Feature kStorageAccessAPI{"StorageAccessAPI",
// Enable text snippets in URL fragments. https://crbug.com/919204.
const base::Feature kTextFragmentAnchor{"TextFragmentAnchor",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
// File handling integration. https://crbug.com/829689
const base::Feature kFileHandlingAPI{"FileHandlingAPI",
--
2.17.1