forked from bromite/bromite
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable CSS blink-feature support: disables the possibility of using …
…the internal css function blink-feature() the function is not currently exposed to websites but is only allowed for testing. disabled as it is an advanced fingerprinting mechanism. also fixed the possibility of using internal selectors (-internal-*) for speculation rules.
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
From: uazo <uazo@users.noreply.github.com> | ||
Date: Mon, 29 Jul 2024 06:48:25 +0000 | ||
Subject: Disable CSS blink-feature support | ||
|
||
the function is not currently exposed to websites but is only allowed for testing. | ||
disabled as it is an potentially advanced fingerprinting mechanism. | ||
also fixed the possibility of using internal selectors for speculation rules. | ||
see https://chromium-review.googlesource.com/c/chromium/src/+/5540782 | ||
|
||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html | ||
--- | ||
.../blink/renderer/core/css/parser/css_supports_parser.cc | 2 +- | ||
.../renderer/core/speculation_rules/document_rule_predicate.cc | 2 +- | ||
2 files changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/third_party/blink/renderer/core/css/parser/css_supports_parser.cc b/third_party/blink/renderer/core/css/parser/css_supports_parser.cc | ||
--- a/third_party/blink/renderer/core/css/parser/css_supports_parser.cc | ||
+++ b/third_party/blink/renderer/core/css/parser/css_supports_parser.cc | ||
@@ -322,7 +322,7 @@ CSSSupportsParser::Result CSSSupportsParser::ConsumeBlinkFeatureFn( | ||
stream.ConsumeUntilPeekedTypeIs<kRightParenthesisToken>(); | ||
return RuntimeEnabledFeatures::IsFeatureEnabledFromString( | ||
feature_name_block.Peek().Value().Utf8()) | ||
- ? Result::kSupported | ||
+ ? Result::kUnsupported | ||
: Result::kUnsupported; | ||
} | ||
|
||
diff --git a/third_party/blink/renderer/core/speculation_rules/document_rule_predicate.cc b/third_party/blink/renderer/core/speculation_rules/document_rule_predicate.cc | ||
--- a/third_party/blink/renderer/core/speculation_rules/document_rule_predicate.cc | ||
+++ b/third_party/blink/renderer/core/speculation_rules/document_rule_predicate.cc | ||
@@ -604,7 +604,7 @@ DocumentRulePredicate* DocumentRulePredicate::Parse( | ||
HeapVector<Member<StyleRule>> selectors; | ||
HeapVector<CSSSelector> arena; | ||
CSSPropertyValueSet* empty_properties = | ||
- ImmutableCSSPropertyValueSet::Create(nullptr, 0, kUASheetMode); | ||
+ ImmutableCSSPropertyValueSet::Create(nullptr, 0, kHTMLStandardMode); | ||
CSSParserContext* css_parser_context = | ||
MakeGarbageCollected<CSSParserContext>(*execution_context); | ||
for (auto* raw_selector : raw_selectors) { | ||
-- |