OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
3 * Copyright (C) 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above | 9 * 1. Redistributions of source code must retain the above |
10 * copyright notice, this list of conditions and the following | 10 * copyright notice, this list of conditions and the following |
(...skipping 14 matching lines...) Expand all Loading... |
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR |
26 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | 26 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
27 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 27 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
28 * SUCH DAMAGE. | 28 * SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef CSSParserMode_h | 31 #ifndef CSSParserMode_h |
32 #define CSSParserMode_h | 32 #define CSSParserMode_h |
33 | 33 |
34 #include "platform/weborigin/KURL.h" | 34 #include "platform/weborigin/KURL.h" |
| 35 #include "platform/weborigin/Referrer.h" |
35 | 36 |
36 namespace WebCore { | 37 namespace WebCore { |
37 | 38 |
38 class Document; | 39 class Document; |
39 | 40 |
40 // Must not grow beyond 3 bits, due to packing in StylePropertySet. | 41 // Must not grow beyond 3 bits, due to packing in StylePropertySet. |
41 enum CSSParserMode { | 42 enum CSSParserMode { |
42 HTMLStandardMode, | 43 HTMLStandardMode, |
43 HTMLQuirksMode, | 44 HTMLQuirksMode, |
44 // HTML attributes are parsed in quirks mode but also allows internal proper
ties and values. | 45 // HTML attributes are parsed in quirks mode but also allows internal proper
ties and values. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // FIXME: This constructor shouldn't exist if we properly piped the UseCount
er through the CSS | 101 // FIXME: This constructor shouldn't exist if we properly piped the UseCount
er through the CSS |
101 // subsystem. Currently the UseCounter life time is too crazy and we need a
way to override it. | 102 // subsystem. Currently the UseCounter life time is too crazy and we need a
way to override it. |
102 CSSParserContext(const CSSParserContext&, UseCounter*); | 103 CSSParserContext(const CSSParserContext&, UseCounter*); |
103 | 104 |
104 bool operator==(const CSSParserContext&) const; | 105 bool operator==(const CSSParserContext&) const; |
105 bool operator!=(const CSSParserContext& other) const { return !(*this == oth
er); } | 106 bool operator!=(const CSSParserContext& other) const { return !(*this == oth
er); } |
106 | 107 |
107 CSSParserMode mode() const { return m_mode; } | 108 CSSParserMode mode() const { return m_mode; } |
108 const KURL& baseURL() const { return m_baseURL; } | 109 const KURL& baseURL() const { return m_baseURL; } |
109 const String& charset() const { return m_charset; } | 110 const String& charset() const { return m_charset; } |
| 111 const Referrer& referrer() const { return m_referrer; } |
110 bool isHTMLDocument() const { return m_isHTMLDocument; } | 112 bool isHTMLDocument() const { return m_isHTMLDocument; } |
111 | 113 |
112 // This quirk is to maintain compatibility with Android apps built on | 114 // This quirk is to maintain compatibility with Android apps built on |
113 // the Android SDK prior to and including version 18. Presumably, this | 115 // the Android SDK prior to and including version 18. Presumably, this |
114 // can be removed any time after 2015. See http://crbug.com/277157. | 116 // can be removed any time after 2015. See http://crbug.com/277157. |
115 bool useLegacyBackgroundSizeShorthandBehavior() const { return m_useLegacyBa
ckgroundSizeShorthandBehavior; } | 117 bool useLegacyBackgroundSizeShorthandBehavior() const { return m_useLegacyBa
ckgroundSizeShorthandBehavior; } |
116 | 118 |
117 // FIXME: These setters shouldn't exist, however the current lifetime of CSS
ParserContext | 119 // FIXME: These setters shouldn't exist, however the current lifetime of CSS
ParserContext |
118 // is not well understood and thus we sometimes need to override these field
s. | 120 // is not well understood and thus we sometimes need to override these field
s. |
119 void setMode(CSSParserMode mode) { m_mode = mode; } | 121 void setMode(CSSParserMode mode) { m_mode = mode; } |
120 void setBaseURL(const KURL& baseURL) { m_baseURL = baseURL; } | 122 void setBaseURL(const KURL& baseURL) { m_baseURL = baseURL; } |
121 void setCharset(const String& charset) { m_charset = charset; } | 123 void setCharset(const String& charset) { m_charset = charset; } |
| 124 void setReferrer(const Referrer& referrer) { m_referrer = referrer; } |
122 | 125 |
123 KURL completeURL(const String& url) const; | 126 KURL completeURL(const String& url) const; |
124 | 127 |
125 UseCounter* useCounter() const { return m_useCounter; } | 128 UseCounter* useCounter() const { return m_useCounter; } |
126 | 129 |
127 private: | 130 private: |
128 KURL m_baseURL; | 131 KURL m_baseURL; |
129 String m_charset; | 132 String m_charset; |
130 CSSParserMode m_mode; | 133 CSSParserMode m_mode; |
| 134 Referrer m_referrer; |
131 bool m_isHTMLDocument; | 135 bool m_isHTMLDocument; |
132 bool m_useLegacyBackgroundSizeShorthandBehavior; | 136 bool m_useLegacyBackgroundSizeShorthandBehavior; |
133 | 137 |
134 UseCounter* m_useCounter; | 138 UseCounter* m_useCounter; |
135 }; | 139 }; |
136 | 140 |
137 const CSSParserContext& strictCSSParserContext(); | 141 const CSSParserContext& strictCSSParserContext(); |
138 | 142 |
139 }; | 143 }; |
140 | 144 |
141 #endif // CSSParserMode_h | 145 #endif // CSSParserMode_h |
OLD | NEW |