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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 class CSSStyleSheet; | 38 class CSSStyleSheet; |
39 class CSSStyleSheetResource; | 39 class CSSStyleSheetResource; |
40 class Document; | 40 class Document; |
41 class Node; | 41 class Node; |
42 class SecurityOrigin; | 42 class SecurityOrigin; |
43 class StyleRuleBase; | 43 class StyleRuleBase; |
| 44 class StyleRuleFontFace; |
44 class StyleRuleImport; | 45 class StyleRuleImport; |
45 | 46 |
46 class StyleSheetContents : public RefCounted<StyleSheetContents> { | 47 class StyleSheetContents : public RefCounted<StyleSheetContents> { |
47 public: | 48 public: |
48 static PassRefPtr<StyleSheetContents> create(const CSSParserContext& context
= CSSParserContext(HTMLStandardMode)) | 49 static PassRefPtr<StyleSheetContents> create(const CSSParserContext& context
= CSSParserContext(HTMLStandardMode)) |
49 { | 50 { |
50 return adoptRef(new StyleSheetContents(0, String(), context)); | 51 return adoptRef(new StyleSheetContents(0, String(), context)); |
51 } | 52 } |
52 static PassRefPtr<StyleSheetContents> create(const String& originalURL, cons
t CSSParserContext& context) | 53 static PassRefPtr<StyleSheetContents> create(const String& originalURL, cons
t CSSParserContext& context) |
53 { | 54 { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 bool hasFailedOrCanceledSubresources() const; | 87 bool hasFailedOrCanceledSubresources() const; |
87 | 88 |
88 KURL completeURL(const String& url) const; | 89 KURL completeURL(const String& url) const; |
89 void addSubresourceStyleURLs(ListHashSet<KURL>&); | 90 void addSubresourceStyleURLs(ListHashSet<KURL>&); |
90 | 91 |
91 void setHasSyntacticallyValidCSSHeader(bool b) { m_hasSyntacticallyValidCSSH
eader = b; } | 92 void setHasSyntacticallyValidCSSHeader(bool b) { m_hasSyntacticallyValidCSSH
eader = b; } |
92 bool hasSyntacticallyValidCSSHeader() const { return m_hasSyntacticallyValid
CSSHeader; } | 93 bool hasSyntacticallyValidCSSHeader() const { return m_hasSyntacticallyValid
CSSHeader; } |
93 | 94 |
94 void setHasFontFaceRule(bool b) { m_hasFontFaceRule = b; } | 95 void setHasFontFaceRule(bool b) { m_hasFontFaceRule = b; } |
95 bool hasFontFaceRule() const { return m_hasFontFaceRule; } | 96 bool hasFontFaceRule() const { return m_hasFontFaceRule; } |
| 97 void findFontFaceRules(Vector<const StyleRuleFontFace*>& fontFaceRules); |
96 | 98 |
97 void parserAddNamespace(const AtomicString& prefix, const AtomicString& uri)
; | 99 void parserAddNamespace(const AtomicString& prefix, const AtomicString& uri)
; |
98 void parserAppendRule(PassRefPtr<StyleRuleBase>); | 100 void parserAppendRule(PassRefPtr<StyleRuleBase>); |
99 void parserSetEncodingFromCharsetRule(const String& encoding); | 101 void parserSetEncodingFromCharsetRule(const String& encoding); |
100 void parserSetUsesRemUnits(bool b) { m_usesRemUnits = b; } | 102 void parserSetUsesRemUnits(bool b) { m_usesRemUnits = b; } |
101 | 103 |
102 void clearRules(); | 104 void clearRules(); |
103 | 105 |
104 bool hasCharsetRule() const { return !m_encodingFromCharsetRule.isNull(); } | 106 bool hasCharsetRule() const { return !m_encodingFromCharsetRule.isNull(); } |
105 String encodingFromCharsetRule() const { return m_encodingFromCharsetRule; } | 107 String encodingFromCharsetRule() const { return m_encodingFromCharsetRule; } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 bool hasMediaQueries() { return m_hasMediaQueries; } | 148 bool hasMediaQueries() { return m_hasMediaQueries; } |
147 | 149 |
148 void shrinkToFit(); | 150 void shrinkToFit(); |
149 RuleSet& ruleSet() { ASSERT(m_ruleSet); return *m_ruleSet.get(); } | 151 RuleSet& ruleSet() { ASSERT(m_ruleSet); return *m_ruleSet.get(); } |
150 RuleSet& ensureRuleSet(const MediaQueryEvaluator&, AddRuleFlags); | 152 RuleSet& ensureRuleSet(const MediaQueryEvaluator&, AddRuleFlags); |
151 void clearRuleSet(); | 153 void clearRuleSet(); |
152 | 154 |
153 private: | 155 private: |
154 StyleSheetContents(StyleRuleImport* ownerRule, const String& originalURL, co
nst CSSParserContext&); | 156 StyleSheetContents(StyleRuleImport* ownerRule, const String& originalURL, co
nst CSSParserContext&); |
155 StyleSheetContents(const StyleSheetContents&); | 157 StyleSheetContents(const StyleSheetContents&); |
| 158 void notifyRemoveFontFaceRule(const StyleRuleFontFace*); |
156 | 159 |
157 void clearCharsetRule(); | 160 void clearCharsetRule(); |
158 | 161 |
159 StyleRuleImport* m_ownerRule; | 162 StyleRuleImport* m_ownerRule; |
160 | 163 |
161 String m_originalURL; | 164 String m_originalURL; |
162 | 165 |
163 String m_encodingFromCharsetRule; | 166 String m_encodingFromCharsetRule; |
164 Vector<RefPtr<StyleRuleImport> > m_importRules; | 167 Vector<RefPtr<StyleRuleImport> > m_importRules; |
165 Vector<RefPtr<StyleRuleBase> > m_childRules; | 168 Vector<RefPtr<StyleRuleBase> > m_childRules; |
(...skipping 11 matching lines...) Expand all Loading... |
177 | 180 |
178 CSSParserContext m_parserContext; | 181 CSSParserContext m_parserContext; |
179 | 182 |
180 Vector<CSSStyleSheet*> m_clients; | 183 Vector<CSSStyleSheet*> m_clients; |
181 OwnPtr<RuleSet> m_ruleSet; | 184 OwnPtr<RuleSet> m_ruleSet; |
182 }; | 185 }; |
183 | 186 |
184 } // namespace | 187 } // namespace |
185 | 188 |
186 #endif | 189 #endif |
OLD | NEW |