Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSParserMode.h

Issue 2493003003: Introduce CSS parser mode for distinguishing static/dynamic profile (Closed)
Patch Set: Address review comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSParserMode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/parser/CSSParserMode.h
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserMode.h b/third_party/WebKit/Source/core/css/parser/CSSParserMode.h
index 442dbc86ce6a55b5e180648ea8b349a6de415681..9b2c770c632e96e6ce2cd8512c1b9779e6c7d14d 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserMode.h
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserMode.h
@@ -85,6 +85,9 @@ class CORE_EXPORT CSSParserContext {
USING_FAST_MALLOC(CSSParserContext);
public:
+ // https://drafts.csswg.org/selectors/#profiles
+ enum SelectorProfile { DynamicProfile, StaticProfile };
+
CSSParserContext(CSSParserMode, UseCounter*);
// FIXME: We shouldn't need the UseCounter argument as we could infer it from
// the Document but some callers want to disable use counting (e.g. the
@@ -92,7 +95,8 @@ class CORE_EXPORT CSSParserContext {
CSSParserContext(const Document&,
UseCounter*,
const KURL& baseURL = KURL(),
- const String& charset = emptyString());
+ const String& charset = emptyString(),
+ SelectorProfile = DynamicProfile);
// FIXME: This constructor shouldn't exist if we properly piped the UseCounter
// through the CSS subsystem. Currently the UseCounter life time is too crazy
// and we need a way to override it.
@@ -109,6 +113,8 @@ class CORE_EXPORT CSSParserContext {
const String& charset() const { return m_charset; }
const Referrer& referrer() const { return m_referrer; }
bool isHTMLDocument() const { return m_isHTMLDocument; }
+ bool isDynamicProfile() const { return m_profile == DynamicProfile; }
+ bool isStaticProfile() const { return m_profile == StaticProfile; }
// This quirk is to maintain compatibility with Android apps built on
// the Android SDK prior to and including version 18. Presumably, this
@@ -140,6 +146,7 @@ class CORE_EXPORT CSSParserContext {
String m_charset;
CSSParserMode m_mode;
CSSParserMode m_matchMode;
+ SelectorProfile m_profile = DynamicProfile;
Referrer m_referrer;
bool m_isHTMLDocument;
bool m_useLegacyBackgroundSizeShorthandBehavior;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSParserMode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698