| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 inline bool isUnitLessLengthParsingEnabledForMode(CSSParserMode mode) | 60 inline bool isUnitLessLengthParsingEnabledForMode(CSSParserMode mode) |
| 61 { | 61 { |
| 62 return false; | 62 return false; |
| 63 } | 63 } |
| 64 | 64 |
| 65 inline bool isCSSViewportParsingEnabledForMode(CSSParserMode mode) | 65 inline bool isCSSViewportParsingEnabledForMode(CSSParserMode mode) |
| 66 { | 66 { |
| 67 return false; | 67 return false; |
| 68 } | 68 } |
| 69 | 69 |
| 70 class UseCounter; | |
| 71 | |
| 72 class CSSParserContext { | 70 class CSSParserContext { |
| 73 WTF_MAKE_FAST_ALLOCATED; | 71 WTF_MAKE_FAST_ALLOCATED; |
| 74 public: | 72 public: |
| 75 explicit CSSParserContext(UseCounter*); | 73 explicit CSSParserContext(); |
| 76 // FIXME: We shouldn't need the UseCounter argument as we could infer it fro
m the Document | 74 CSSParserContext(const Document&, const KURL& baseURL = KURL()); |
| 77 // but some callers want to disable use counting (e.g. the WebInspector). | 75 CSSParserContext(const CSSParserContext&); |
| 78 CSSParserContext(const Document&, UseCounter*, const KURL& baseURL = KURL())
; | |
| 79 // FIXME: This constructor shouldn't exist if we properly piped the UseCount
er through the CSS | |
| 80 // subsystem. Currently the UseCounter life time is too crazy and we need a
way to override it. | |
| 81 CSSParserContext(const CSSParserContext&, UseCounter*); | |
| 82 | 76 |
| 83 bool operator==(const CSSParserContext&) const; | 77 bool operator==(const CSSParserContext&) const; |
| 84 bool operator!=(const CSSParserContext& other) const { return !(*this == oth
er); } | 78 bool operator!=(const CSSParserContext& other) const { return !(*this == oth
er); } |
| 85 | 79 |
| 86 CSSParserMode mode() const { return HTMLStandardMode; } | 80 CSSParserMode mode() const { return HTMLStandardMode; } |
| 87 const KURL& baseURL() const { return m_baseURL; } | 81 const KURL& baseURL() const { return m_baseURL; } |
| 88 const Referrer& referrer() const { return m_referrer; } | 82 const Referrer& referrer() const { return m_referrer; } |
| 89 | 83 |
| 90 // This causes CSS parsing to be case insensitive and should be removed. | 84 // This causes CSS parsing to be case insensitive and should be removed. |
| 91 bool isHTMLDocument() const { return true; } | 85 bool isHTMLDocument() const { return true; } |
| 92 | 86 |
| 93 // FIXME: These setters shouldn't exist, however the current lifetime of CSS
ParserContext | 87 // FIXME: These setters shouldn't exist, however the current lifetime of CSS
ParserContext |
| 94 // is not well understood and thus we sometimes need to override these field
s. | 88 // is not well understood and thus we sometimes need to override these field
s. |
| 95 void setBaseURL(const KURL& baseURL) { m_baseURL = baseURL; } | 89 void setBaseURL(const KURL& baseURL) { m_baseURL = baseURL; } |
| 96 void setReferrer(const Referrer& referrer) { m_referrer = referrer; } | 90 void setReferrer(const Referrer& referrer) { m_referrer = referrer; } |
| 97 | 91 |
| 98 KURL completeURL(const String& url) const; | 92 KURL completeURL(const String& url) const; |
| 99 | 93 |
| 100 UseCounter* useCounter() const { return m_useCounter; } | |
| 101 | |
| 102 private: | 94 private: |
| 103 KURL m_baseURL; | 95 KURL m_baseURL; |
| 104 Referrer m_referrer; | 96 Referrer m_referrer; |
| 105 | |
| 106 UseCounter* m_useCounter; | |
| 107 }; | 97 }; |
| 108 | 98 |
| 109 const CSSParserContext& strictCSSParserContext(); | 99 const CSSParserContext& strictCSSParserContext(); |
| 110 | 100 |
| 111 }; | 101 }; |
| 112 | 102 |
| 113 #endif // SKY_ENGINE_CORE_CSS_PARSER_CSSPARSERMODE_H_ | 103 #endif // SKY_ENGINE_CORE_CSS_PARSER_CSSPARSERMODE_H_ |
| OLD | NEW |