return mode != UASheetMode;
}
+class UseCounter;
+
class CSSParserContext {
WTF_MAKE_FAST_ALLOCATED;
public:
- CSSParserContext(CSSParserMode);
- CSSParserContext(const Document&, const KURL& baseURL = KURL(), const String& charset = emptyString());
+ 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 WebInspector).
+ CSSParserContext(const Document&, UseCounter*, const KURL& baseURL = KURL(), const String& charset = emptyString());
+ // 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.
+ CSSParserContext(const CSSParserContext&, UseCounter*);
bool operator==(const CSSParserContext&) const;
bool operator!=(const CSSParserContext& other) const { return !(*this == other); }
KURL completeURL(const String& url) const;
+ UseCounter* useCounter() const { return m_useCounter; }
+
private:
KURL m_baseURL;
String m_charset;
CSSParserMode m_mode;
bool m_isHTMLDocument;
bool m_useLegacyBackgroundSizeShorthandBehavior;
+
+ UseCounter* m_useCounter;
};
const CSSParserContext& strictCSSParserContext();