| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All rights
reserved. | 3 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All rights
reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 void setIsUserStyleSheet(bool b) { m_isUserStyleSheet = b; } | 86 void setIsUserStyleSheet(bool b) { m_isUserStyleSheet = b; } |
| 87 bool isUserStyleSheet() const { return m_isUserStyleSheet; } | 87 bool isUserStyleSheet() const { return m_isUserStyleSheet; } |
| 88 void setHasSyntacticallyValidCSSHeader(bool b) { m_hasSyntacticallyValidCSSH
eader = b; } | 88 void setHasSyntacticallyValidCSSHeader(bool b) { m_hasSyntacticallyValidCSSH
eader = b; } |
| 89 bool hasSyntacticallyValidCSSHeader() const { return m_hasSyntacticallyValid
CSSHeader; } | 89 bool hasSyntacticallyValidCSSHeader() const { return m_hasSyntacticallyValid
CSSHeader; } |
| 90 | 90 |
| 91 void parserAddNamespace(const AtomicString& prefix, const AtomicString& uri)
; | 91 void parserAddNamespace(const AtomicString& prefix, const AtomicString& uri)
; |
| 92 void parserAppendRule(PassRefPtr<StyleRuleBase>); | 92 void parserAppendRule(PassRefPtr<StyleRuleBase>); |
| 93 void parserSetEncodingFromCharsetRule(const String& encoding); | 93 void parserSetEncodingFromCharsetRule(const String& encoding); |
| 94 void parserSetUsesRemUnits(bool b) { m_usesRemUnits = b; } | 94 void parserSetUsesRemUnits(bool b) { m_usesRemUnits = b; } |
| 95 void parserSetUsesViewportUnits(bool b) { m_usesViewportUnits = b; } |
| 95 | 96 |
| 96 void clearRules(); | 97 void clearRules(); |
| 97 | 98 |
| 98 bool hasCharsetRule() const { return !m_encodingFromCharsetRule.isNull(); } | 99 bool hasCharsetRule() const { return !m_encodingFromCharsetRule.isNull(); } |
| 99 String encodingFromCharsetRule() const { return m_encodingFromCharsetRule; } | 100 String encodingFromCharsetRule() const { return m_encodingFromCharsetRule; } |
| 100 // Rules other than @charset and @import. | 101 // Rules other than @charset and @import. |
| 101 const Vector<RefPtr<StyleRuleBase> >& childRules() const { return m_childRul
es; } | 102 const Vector<RefPtr<StyleRuleBase> >& childRules() const { return m_childRul
es; } |
| 102 const Vector<RefPtr<StyleRuleImport> >& importRules() const { return m_impor
tRules; } | 103 const Vector<RefPtr<StyleRuleImport> >& importRules() const { return m_impor
tRules; } |
| 103 | 104 |
| 104 void notifyLoadedSheet(const CachedCSSStyleSheet*); | 105 void notifyLoadedSheet(const CachedCSSStyleSheet*); |
| 105 | 106 |
| 106 StyleSheetContents* parentStyleSheet() const; | 107 StyleSheetContents* parentStyleSheet() const; |
| 107 StyleRuleImport* ownerRule() const { return m_ownerRule; } | 108 StyleRuleImport* ownerRule() const { return m_ownerRule; } |
| 108 void clearOwnerRule() { m_ownerRule = 0; } | 109 void clearOwnerRule() { m_ownerRule = 0; } |
| 109 | 110 |
| 110 // Note that href is the URL that started the redirect chain that led to | 111 // Note that href is the URL that started the redirect chain that led to |
| 111 // this style sheet. This property probably isn't useful for much except | 112 // this style sheet. This property probably isn't useful for much except |
| 112 // the JavaScript binding (which needs to use this value for security). | 113 // the JavaScript binding (which needs to use this value for security). |
| 113 String originalURL() const { return m_originalURL; } | 114 String originalURL() const { return m_originalURL; } |
| 114 const KURL& baseURL() const { return m_parserContext.baseURL; } | 115 const KURL& baseURL() const { return m_parserContext.baseURL; } |
| 115 | 116 |
| 116 unsigned ruleCount() const; | 117 unsigned ruleCount() const; |
| 117 StyleRuleBase* ruleAt(unsigned index) const; | 118 StyleRuleBase* ruleAt(unsigned index) const; |
| 118 | 119 |
| 119 bool usesRemUnits() const { return m_usesRemUnits; } | 120 bool usesRemUnits() const { return m_usesRemUnits; } |
| 121 bool usesViewportUnits() const { return m_usesViewportUnits; } |
| 120 | 122 |
| 121 unsigned estimatedSizeInBytes() const; | 123 unsigned estimatedSizeInBytes() const; |
| 122 | 124 |
| 123 bool wrapperInsertRule(PassRefPtr<StyleRuleBase>, unsigned index); | 125 bool wrapperInsertRule(PassRefPtr<StyleRuleBase>, unsigned index); |
| 124 void wrapperDeleteRule(unsigned index); | 126 void wrapperDeleteRule(unsigned index); |
| 125 | 127 |
| 126 PassRefPtr<StyleSheetContents> copy() const { return adoptRef(new StyleSheet
Contents(*this)); } | 128 PassRefPtr<StyleSheetContents> copy() const { return adoptRef(new StyleSheet
Contents(*this)); } |
| 127 | 129 |
| 128 void registerClient(CSSStyleSheet*); | 130 void registerClient(CSSStyleSheet*); |
| 129 void unregisterClient(CSSStyleSheet*); | 131 void unregisterClient(CSSStyleSheet*); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 154 Vector<RefPtr<StyleRuleImport> > m_importRules; | 156 Vector<RefPtr<StyleRuleImport> > m_importRules; |
| 155 Vector<RefPtr<StyleRuleBase> > m_childRules; | 157 Vector<RefPtr<StyleRuleBase> > m_childRules; |
| 156 typedef HashMap<AtomicString, AtomicString> PrefixNamespaceURIMap; | 158 typedef HashMap<AtomicString, AtomicString> PrefixNamespaceURIMap; |
| 157 PrefixNamespaceURIMap m_namespaces; | 159 PrefixNamespaceURIMap m_namespaces; |
| 158 | 160 |
| 159 bool m_loadCompleted : 1; | 161 bool m_loadCompleted : 1; |
| 160 bool m_isUserStyleSheet : 1; | 162 bool m_isUserStyleSheet : 1; |
| 161 bool m_hasSyntacticallyValidCSSHeader : 1; | 163 bool m_hasSyntacticallyValidCSSHeader : 1; |
| 162 bool m_didLoadErrorOccur : 1; | 164 bool m_didLoadErrorOccur : 1; |
| 163 bool m_usesRemUnits : 1; | 165 bool m_usesRemUnits : 1; |
| 166 bool m_usesViewportUnits : 1; |
| 164 bool m_isMutable : 1; | 167 bool m_isMutable : 1; |
| 165 bool m_isInMemoryCache : 1; | 168 bool m_isInMemoryCache : 1; |
| 166 | 169 |
| 167 CSSParserContext m_parserContext; | 170 CSSParserContext m_parserContext; |
| 168 | 171 |
| 169 Vector<CSSStyleSheet*> m_clients; | 172 Vector<CSSStyleSheet*> m_clients; |
| 170 }; | 173 }; |
| 171 | 174 |
| 172 } // namespace | 175 } // namespace |
| 173 | 176 |
| 174 #endif | 177 #endif |
| OLD | NEW |