disable-WebView-variations-support.patch

This commit is contained in:
none 2021-03-07 09:08:57 +01:00
parent 3fd5e3f18d
commit faf61b5d2e
2 changed files with 33 additions and 34 deletions

View file

@ -3,56 +3,54 @@ Date: Sat, 22 Aug 2020 12:46:20 +0200
Subject: Disable text fragments by default
Revert "[Text Fragment] Unflag fragment directive removal."
FILE:Disable-text-fragments-by-default.patch
---
chrome/browser/about_flags.cc | 1 +
chrome/browser/flag-metadata.json | 2 +-
chrome/browser/ui/prefs/prefs_tab_helper.cc | 2 +-
content/child/runtime_features.cc | 1 +
third_party/blink/common/features.cc | 2 +-
.../blink/renderer/core/dom/document.cc | 5 ++++
.../text_fragment_anchor_metrics_test.cc | 29 +++++++------------
.../platform/runtime_enabled_features.json5 | 3 +-
8 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 52aba00b94..fbe0f7696d 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -5164,6 +5164,7 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kEnableImplicitRootScrollerDescription, kOsAll,
FEATURE_VALUE_TYPE(blink::features::kImplicitRootScroller)},
@@ -4955,6 +4955,7 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kEnableLayoutNGTableDescription, kOsAll,
FEATURE_VALUE_TYPE(blink::features::kLayoutNGTable)},
+ // will override runtime text fragment identifiers setting too
{"enable-text-fragment-anchor",
flag_descriptions::kEnableTextFragmentAnchorName,
flag_descriptions::kEnableTextFragmentAnchorDescription, kOsAll,
{"enable-lazy-image-loading",
flag_descriptions::kEnableLazyImageLoadingName,
flag_descriptions::kEnableLazyImageLoadingDescription, kOsAll,
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index f0583f813e..09688d88db 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -2267,7 +2267,7 @@
{
"name": "enable-text-fragment-anchor",
"owners": [ "bokan", "input-dev" ],
- "expiry_milestone": 83
+ "expiry_milestone": -1
@@ -2338,6 +2338,11 @@
"owners": [ "atotic@google.com" ],
"expiry_milestone": 96
},
+ {
+ "name": "enable-text-fragment-anchor",
+ "owners": [ "bokan", "input-dev" ],
+ "expiry_milestone": -1
+ },
{
"name": "enable-tls13-early-data",
"owners": [ "svaldez" ],
diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc
index 5b89ba63e7..7f158a6595 100644
--- 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,
@@ -360,7 +360,7 @@ void PrefsTabHelper::RegisterProfilePrefs(
!base::FeatureList::IsEnabled(features::kNoReferrers));
registry->RegisterBooleanPref(prefs::kEnableEncryptedMedia, true);
registry->RegisterBooleanPref(prefs::kEnableDRM, 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/child/runtime_features.cc b/content/child/runtime_features.cc
index cdf5eaed7e..b38e898c62 100644
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -269,6 +269,7 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
@@ -273,6 +273,7 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
{wf::EnableBackgroundFetch, features::kBackgroundFetch},
{wf::EnableForcedColors, features::kForcedColors},
{wf::EnableFractionalScrollOffsets, features::kFractionalScrollOffsets},
@ -61,9 +59,10 @@ diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.
{wf::EnableGetDisplayMedia, features::kUserMediaScreenCapturing},
#endif
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
index e0b59bb977..84871c7447 100644
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -289,7 +289,7 @@ const base::Feature kStorageAccessAPI{"StorageAccessAPI",
@@ -301,7 +301,7 @@ const base::Feature kStorageAccessAPI{"StorageAccessAPI",
// Enable text snippets in URL fragments. https://crbug.com/919204.
const base::Feature kTextFragmentAnchor{"TextFragmentAnchor",
@ -73,9 +72,10 @@ diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/fea
// File handling integration. https://crbug.com/829689
const base::Feature kFileHandlingAPI{"FileHandlingAPI",
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
index 977b5f7429..2a0ca4817a 100644
--- a/third_party/blink/renderer/core/dom/document.cc
+++ b/third_party/blink/renderer/core/dom/document.cc
@@ -4462,6 +4462,10 @@ void Document::SetURL(const KURL& url) {
@@ -4383,6 +4383,10 @@ void Document::SetURL(const KURL& url) {
}
}
@ -86,7 +86,7 @@ diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink
// Strip the fragment directive from the URL fragment. E.g. "#id:~:text=a"
// --> "#id". See https://github.com/WICG/scroll-to-text-fragment.
String fragment = new_url.FragmentIdentifier();
@@ -4475,6 +4479,7 @@ void Document::SetURL(const KURL& url) {
@@ -4396,6 +4400,7 @@ void Document::SetURL(const KURL& url) {
else
new_url.SetFragmentIdentifier(fragment.Substring(0, start_pos));
}
@ -95,9 +95,10 @@ diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink
url_ = new_url;
access_entry_from_url_ = nullptr;
diff --git a/third_party/blink/renderer/core/page/scrolling/text_fragment_anchor_metrics_test.cc b/third_party/blink/renderer/core/page/scrolling/text_fragment_anchor_metrics_test.cc
index f1300e5bfb..ac0d73ccfa 100644
--- a/third_party/blink/renderer/core/page/scrolling/text_fragment_anchor_metrics_test.cc
+++ b/third_party/blink/renderer/core/page/scrolling/text_fragment_anchor_metrics_test.cc
@@ -1164,34 +1164,25 @@ TEST_P(TextFragmentRelatedMetricTest, ElementIdSuccessFailureCounts) {
@@ -1254,34 +1254,25 @@ TEST_P(TextFragmentRelatedMetricTest, ElementIdSuccessFailureCounts) {
// result of the element-id fragment if a text directive is successfully
// parsed. If the feature is off we treat the text directive as an element-id
// and should count the result.
@ -143,9 +144,10 @@ diff --git a/third_party/blink/renderer/core/page/scrolling/text_fragment_anchor
const int kNotFoundSample = 0;
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
index fb78b828c1..b0c28f8cce 100644
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1926,8 +1926,7 @@
@@ -1973,8 +1973,7 @@
},
{
name: "TextFragmentIdentifiers",
@ -155,6 +157,3 @@ diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5
},
{
name: "ThirdPartyOriginTrials",
--
2.17.1

View file

@ -24,7 +24,7 @@ diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewC
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
--- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
+++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
@@ -373,8 +373,6 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider {
@@ -390,8 +390,6 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider {
AwContentsStatics.logFlagOverridesWithNative(flagOverrides);
}