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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 bool loadCompleted() const; | 88 bool loadCompleted() const; |
89 bool hasFailedOrCanceledSubresources() const; | 89 bool hasFailedOrCanceledSubresources() const; |
90 | 90 |
91 KURL completeURL(const String& url) const; | 91 KURL completeURL(const String& url) const; |
92 | 92 |
93 void setHasSyntacticallyValidCSSHeader(bool isValidCss); | 93 void setHasSyntacticallyValidCSSHeader(bool isValidCss); |
94 bool hasSyntacticallyValidCSSHeader() const { return m_hasSyntacticallyValid CSSHeader; } | 94 bool hasSyntacticallyValidCSSHeader() const { return m_hasSyntacticallyValid CSSHeader; } |
95 | 95 |
96 void setHasFontFaceRule(bool b) { m_hasFontFaceRule = b; } | 96 void setHasFontFaceRule(bool b) { m_hasFontFaceRule = b; } |
97 bool hasFontFaceRule() const { return m_hasFontFaceRule; } | 97 bool hasFontFaceRule() const { return m_hasFontFaceRule; } |
98 void findFontFaceRules(Vector<const StyleRuleFontFace*>& fontFaceRules); | 98 void findFontFaceRules(WillBeHeapVector<RawPtrWillBeMember<const StyleRuleFo ntFace> >& fontFaceRules); |
99 | 99 |
100 void parserAddNamespace(const AtomicString& prefix, const AtomicString& uri) ; | 100 void parserAddNamespace(const AtomicString& prefix, const AtomicString& uri) ; |
101 void parserAppendRule(PassRefPtrWillBeRawPtr<StyleRuleBase>); | 101 void parserAppendRule(PassRefPtrWillBeRawPtr<StyleRuleBase>); |
102 void parserSetEncodingFromCharsetRule(const String& encoding); | 102 void parserSetEncodingFromCharsetRule(const String& encoding); |
103 void parserSetUsesRemUnits(bool b) { m_usesRemUnits = b; } | 103 void parserSetUsesRemUnits(bool b) { m_usesRemUnits = b; } |
104 | 104 |
105 void clearRules(); | 105 void clearRules(); |
106 | 106 |
107 bool hasCharsetRule() const { return !m_encodingFromCharsetRule.isNull(); } | 107 bool hasCharsetRule() const { return !m_encodingFromCharsetRule.isNull(); } |
108 String encodingFromCharsetRule() const { return m_encodingFromCharsetRule; } | 108 String encodingFromCharsetRule() const { return m_encodingFromCharsetRule; } |
109 // Rules other than @charset and @import. | 109 // Rules other than @charset and @import. |
110 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase> >& childRules() con st { return m_childRules; } | 110 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase> >& childRules() con st { return m_childRules; } |
111 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport> >& importRules() const { return m_importRules; } | 111 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport> >& importRules() const { return m_importRules; } |
112 | 112 |
113 void notifyLoadedSheet(const CSSStyleSheetResource*); | 113 void notifyLoadedSheet(const CSSStyleSheetResource*); |
114 | 114 |
115 StyleSheetContents* parentStyleSheet() const; | 115 StyleSheetContents* parentStyleSheet() const; |
116 StyleRuleImport* ownerRule() const { return m_ownerRule; } | 116 StyleRuleImport* ownerRule() const { return m_ownerRule; } |
117 void clearOwnerRule() { m_ownerRule = 0; } | 117 void clearOwnerRule() { m_ownerRule = nullptr; } |
haraken
2014/02/26 02:20:13
This is called from ~StyleRuleImport(). This is da
Vyacheslav Egorov (Chromium)
2014/02/26 13:12:24
Good catch! I asked people to pay attention to fin
| |
118 | 118 |
119 // Note that href is the URL that started the redirect chain that led to | 119 // Note that href is the URL that started the redirect chain that led to |
120 // this style sheet. This property probably isn't useful for much except | 120 // this style sheet. This property probably isn't useful for much except |
121 // the JavaScript binding (which needs to use this value for security). | 121 // the JavaScript binding (which needs to use this value for security). |
122 String originalURL() const { return m_originalURL; } | 122 String originalURL() const { return m_originalURL; } |
123 const KURL& baseURL() const { return m_parserContext.baseURL(); } | 123 const KURL& baseURL() const { return m_parserContext.baseURL(); } |
124 | 124 |
125 unsigned ruleCount() const; | 125 unsigned ruleCount() const; |
126 StyleRuleBase* ruleAt(unsigned index) const; | 126 StyleRuleBase* ruleAt(unsigned index) const; |
127 | 127 |
(...skipping 30 matching lines...) Expand all Loading... | |
158 | 158 |
159 void trace(Visitor*); | 159 void trace(Visitor*); |
160 | 160 |
161 private: | 161 private: |
162 StyleSheetContents(StyleRuleImport* ownerRule, const String& originalURL, co nst CSSParserContext&); | 162 StyleSheetContents(StyleRuleImport* ownerRule, const String& originalURL, co nst CSSParserContext&); |
163 StyleSheetContents(const StyleSheetContents&); | 163 StyleSheetContents(const StyleSheetContents&); |
164 void notifyRemoveFontFaceRule(const StyleRuleFontFace*); | 164 void notifyRemoveFontFaceRule(const StyleRuleFontFace*); |
165 | 165 |
166 void clearCharsetRule(); | 166 void clearCharsetRule(); |
167 | 167 |
168 StyleRuleImport* m_ownerRule; | 168 RawPtrWillBeMember<StyleRuleImport> m_ownerRule; |
169 | 169 |
170 String m_originalURL; | 170 String m_originalURL; |
171 | 171 |
172 String m_encodingFromCharsetRule; | 172 String m_encodingFromCharsetRule; |
173 WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport> > m_importRules; | 173 WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport> > m_importRules; |
174 WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase> > m_childRules; | 174 WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase> > m_childRules; |
175 typedef HashMap<AtomicString, AtomicString> PrefixNamespaceURIMap; | 175 typedef HashMap<AtomicString, AtomicString> PrefixNamespaceURIMap; |
176 PrefixNamespaceURIMap m_namespaces; | 176 PrefixNamespaceURIMap m_namespaces; |
177 | 177 |
178 bool m_hasSyntacticallyValidCSSHeader : 1; | 178 bool m_hasSyntacticallyValidCSSHeader : 1; |
179 bool m_didLoadErrorOccur : 1; | 179 bool m_didLoadErrorOccur : 1; |
180 bool m_usesRemUnits : 1; | 180 bool m_usesRemUnits : 1; |
181 bool m_isMutable : 1; | 181 bool m_isMutable : 1; |
182 bool m_isInMemoryCache : 1; | 182 bool m_isInMemoryCache : 1; |
183 bool m_hasFontFaceRule : 1; | 183 bool m_hasFontFaceRule : 1; |
184 bool m_hasMediaQueries : 1; | 184 bool m_hasMediaQueries : 1; |
185 | 185 |
186 CSSParserContext m_parserContext; | 186 CSSParserContext m_parserContext; |
187 | 187 |
188 Vector<CSSStyleSheet*> m_clients; | 188 Vector<CSSStyleSheet*> m_clients; |
189 OwnPtr<RuleSet> m_ruleSet; | 189 OwnPtr<RuleSet> m_ruleSet; |
190 }; | 190 }; |
191 | 191 |
192 } // namespace | 192 } // namespace |
193 | 193 |
194 #endif | 194 #endif |
OLD | NEW |