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