| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CSSParserContext_h | 5 #ifndef CSSParserContext_h |
| 6 #define CSSParserContext_h | 6 #define CSSParserContext_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/css/parser/CSSParserMode.h" | 9 #include "core/css/parser/CSSParserMode.h" |
| 10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 const CSSStyleSheet*); | 30 const CSSStyleSheet*); |
| 31 static CSSParserContext* createWithStyleSheetContents( | 31 static CSSParserContext* createWithStyleSheetContents( |
| 32 const CSSParserContext*, | 32 const CSSParserContext*, |
| 33 const StyleSheetContents*); | 33 const StyleSheetContents*); |
| 34 // FIXME: This constructor shouldn't exist if we properly piped the UseCounter | 34 // FIXME: This constructor shouldn't exist if we properly piped the UseCounter |
| 35 // through the CSS subsystem. Currently the UseCounter life time is too crazy | 35 // through the CSS subsystem. Currently the UseCounter life time is too crazy |
| 36 // and we need a way to override it. | 36 // and we need a way to override it. |
| 37 static CSSParserContext* create(const CSSParserContext* other, | 37 static CSSParserContext* create(const CSSParserContext* other, |
| 38 const Document* useCounterDocument); | 38 const Document* useCounterDocument); |
| 39 | 39 |
| 40 static CSSParserContext* create(const CSSParserContext* other, |
| 41 const KURL& baseURLOverride, |
| 42 const String& charsetOverride, |
| 43 const Referrer& referrerOverride, |
| 44 const Document* useCounterDocument); |
| 45 |
| 40 static CSSParserContext* create(CSSParserMode, | 46 static CSSParserContext* create(CSSParserMode, |
| 41 SelectorProfile = DynamicProfile, | 47 SelectorProfile = DynamicProfile, |
| 42 const Document* useCounterDocument = nullptr); | 48 const Document* useCounterDocument = nullptr); |
| 43 static CSSParserContext* create(const Document&, | 49 static CSSParserContext* create(const Document&, |
| 44 const Document* useCounterDocument); | 50 const Document* useCounterDocument); |
| 45 static CSSParserContext* create(const Document&, | 51 static CSSParserContext* create(const Document&, |
| 46 const KURL& baseURLOverride = KURL(), | 52 const KURL& baseURLOverride = KURL(), |
| 47 const String& charset = emptyString, | 53 const String& charset = emptyString, |
| 48 SelectorProfile = DynamicProfile, | 54 SelectorProfile = DynamicProfile, |
| 49 const Document* useCounterDocument = nullptr); | 55 const Document* useCounterDocument = nullptr); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 62 bool isDynamicProfile() const { return m_profile == DynamicProfile; } | 68 bool isDynamicProfile() const { return m_profile == DynamicProfile; } |
| 63 bool isStaticProfile() const { return m_profile == StaticProfile; } | 69 bool isStaticProfile() const { return m_profile == StaticProfile; } |
| 64 | 70 |
| 65 // This quirk is to maintain compatibility with Android apps built on | 71 // This quirk is to maintain compatibility with Android apps built on |
| 66 // the Android SDK prior to and including version 18. Presumably, this | 72 // the Android SDK prior to and including version 18. Presumably, this |
| 67 // can be removed any time after 2015. See http://crbug.com/277157. | 73 // can be removed any time after 2015. See http://crbug.com/277157. |
| 68 bool useLegacyBackgroundSizeShorthandBehavior() const { | 74 bool useLegacyBackgroundSizeShorthandBehavior() const { |
| 69 return m_useLegacyBackgroundSizeShorthandBehavior; | 75 return m_useLegacyBackgroundSizeShorthandBehavior; |
| 70 } | 76 } |
| 71 | 77 |
| 72 // FIXME: These setters shouldn't exist, however the current lifetime of | 78 // FIXME: This setter shouldn't exist, however the current lifetime of |
| 73 // CSSParserContext is not well understood and thus we sometimes need to | 79 // CSSParserContext is not well understood and thus we sometimes need to |
| 74 // override these fields. | 80 // override this field. |
| 75 void setMode(CSSParserMode mode) { m_mode = mode; } | 81 void setMode(CSSParserMode mode) { m_mode = mode; } |
| 76 void setBaseURL(const KURL& baseURL) { m_baseURL = baseURL; } | |
| 77 void setCharset(const String& charset) { m_charset = charset; } | |
| 78 void setReferrer(const Referrer& referrer) { m_referrer = referrer; } | |
| 79 | 82 |
| 80 KURL completeURL(const String& url) const; | 83 KURL completeURL(const String& url) const; |
| 81 | 84 |
| 82 void count(UseCounter::Feature) const; | 85 void count(UseCounter::Feature) const; |
| 83 void count(CSSParserMode, CSSPropertyID) const; | 86 void count(CSSParserMode, CSSPropertyID) const; |
| 84 void countDeprecation(UseCounter::Feature) const; | 87 void countDeprecation(UseCounter::Feature) const; |
| 85 bool isUseCounterRecordingEnabled() const { return m_document; } | 88 bool isUseCounterRecordingEnabled() const { return m_document; } |
| 86 bool isDocumentHandleEqual(const Document* other) const; | 89 bool isDocumentHandleEqual(const Document* other) const; |
| 87 | 90 |
| 88 ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy() const { | 91 ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy() const { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 114 ContentSecurityPolicyDisposition m_shouldCheckContentSecurityPolicy; | 117 ContentSecurityPolicyDisposition m_shouldCheckContentSecurityPolicy; |
| 115 | 118 |
| 116 WeakMember<const Document> m_document; | 119 WeakMember<const Document> m_document; |
| 117 }; | 120 }; |
| 118 | 121 |
| 119 CORE_EXPORT const CSSParserContext* strictCSSParserContext(); | 122 CORE_EXPORT const CSSParserContext* strictCSSParserContext(); |
| 120 | 123 |
| 121 } // namespace blink | 124 } // namespace blink |
| 122 | 125 |
| 123 #endif // CSSParserContext_h | 126 #endif // CSSParserContext_h |
| OLD | NEW |