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 30 matching lines...) Expand all Loading... |
41 class Document; | 41 class Document; |
42 class Node; | 42 class Node; |
43 class SecurityOrigin; | 43 class SecurityOrigin; |
44 class StyleRuleBase; | 44 class StyleRuleBase; |
45 class StyleRuleFontFace; | 45 class StyleRuleFontFace; |
46 class StyleRuleImport; | 46 class StyleRuleImport; |
47 class StyleRuleNamespace; | 47 class StyleRuleNamespace; |
48 | 48 |
49 class CORE_EXPORT StyleSheetContents : public GarbageCollectedFinalized<StyleShe
etContents> { | 49 class CORE_EXPORT StyleSheetContents : public GarbageCollectedFinalized<StyleShe
etContents> { |
50 public: | 50 public: |
51 static RawPtr<StyleSheetContents> create(const CSSParserContext& context) | 51 static StyleSheetContents* create(const CSSParserContext& context) |
52 { | 52 { |
53 return new StyleSheetContents(0, String(), context); | 53 return new StyleSheetContents(0, String(), context); |
54 } | 54 } |
55 static RawPtr<StyleSheetContents> create(const String& originalURL, const CS
SParserContext& context) | 55 static StyleSheetContents* create(const String& originalURL, const CSSParser
Context& context) |
56 { | 56 { |
57 return new StyleSheetContents(0, originalURL, context); | 57 return new StyleSheetContents(0, originalURL, context); |
58 } | 58 } |
59 static RawPtr<StyleSheetContents> create(StyleRuleImport* ownerRule, const S
tring& originalURL, const CSSParserContext& context) | 59 static StyleSheetContents* create(StyleRuleImport* ownerRule, const String&
originalURL, const CSSParserContext& context) |
60 { | 60 { |
61 return new StyleSheetContents(ownerRule, originalURL, context); | 61 return new StyleSheetContents(ownerRule, originalURL, context); |
62 } | 62 } |
63 | 63 |
64 ~StyleSheetContents(); | 64 ~StyleSheetContents(); |
65 | 65 |
66 const CSSParserContext& parserContext() const { return m_parserContext; } | 66 const CSSParserContext& parserContext() const { return m_parserContext; } |
67 | 67 |
68 const AtomicString& defaultNamespace() { return m_defaultNamespace; } | 68 const AtomicString& defaultNamespace() { return m_defaultNamespace; } |
69 const AtomicString& namespaceURIFromPrefix(const AtomicString& prefix); | 69 const AtomicString& namespaceURIFromPrefix(const AtomicString& prefix); |
(...skipping 20 matching lines...) Expand all Loading... |
90 bool hasFailedOrCanceledSubresources() const; | 90 bool hasFailedOrCanceledSubresources() const; |
91 | 91 |
92 void setHasSyntacticallyValidCSSHeader(bool isValidCss); | 92 void setHasSyntacticallyValidCSSHeader(bool isValidCss); |
93 bool hasSyntacticallyValidCSSHeader() const { return m_hasSyntacticallyValid
CSSHeader; } | 93 bool hasSyntacticallyValidCSSHeader() const { return m_hasSyntacticallyValid
CSSHeader; } |
94 | 94 |
95 void setHasFontFaceRule(bool b) { m_hasFontFaceRule = b; } | 95 void setHasFontFaceRule(bool b) { m_hasFontFaceRule = b; } |
96 bool hasFontFaceRule() const { return m_hasFontFaceRule; } | 96 bool hasFontFaceRule() const { return m_hasFontFaceRule; } |
97 void findFontFaceRules(HeapVector<Member<const StyleRuleFontFace>>& fontFace
Rules); | 97 void findFontFaceRules(HeapVector<Member<const StyleRuleFontFace>>& fontFace
Rules); |
98 | 98 |
99 void parserAddNamespace(const AtomicString& prefix, const AtomicString& uri)
; | 99 void parserAddNamespace(const AtomicString& prefix, const AtomicString& uri)
; |
100 void parserAppendRule(RawPtr<StyleRuleBase>); | 100 void parserAppendRule(StyleRuleBase*); |
101 | 101 |
102 void clearRules(); | 102 void clearRules(); |
103 | 103 |
104 // Rules other than @import. | 104 // Rules other than @import. |
105 const HeapVector<Member<StyleRuleBase>>& childRules() const { return m_child
Rules; } | 105 const HeapVector<Member<StyleRuleBase>>& childRules() const { return m_child
Rules; } |
106 const HeapVector<Member<StyleRuleImport>>& importRules() const { return m_im
portRules; } | 106 const HeapVector<Member<StyleRuleImport>>& importRules() const { return m_im
portRules; } |
107 const HeapVector<Member<StyleRuleNamespace>>& namespaceRules() const { retur
n m_namespaceRules; } | 107 const HeapVector<Member<StyleRuleNamespace>>& namespaceRules() const { retur
n m_namespaceRules; } |
108 | 108 |
109 void notifyLoadedSheet(const CSSStyleSheetResource*); | 109 void notifyLoadedSheet(const CSSStyleSheetResource*); |
110 | 110 |
111 StyleSheetContents* parentStyleSheet() const; | 111 StyleSheetContents* parentStyleSheet() const; |
112 StyleRuleImport* ownerRule() const { return m_ownerRule; } | 112 StyleRuleImport* ownerRule() const { return m_ownerRule; } |
113 void clearOwnerRule() { m_ownerRule = nullptr; } | 113 void clearOwnerRule() { m_ownerRule = nullptr; } |
114 | 114 |
115 // Note that href is the URL that started the redirect chain that led to | 115 // Note that href is the URL that started the redirect chain that led to |
116 // this style sheet. This property probably isn't useful for much except | 116 // this style sheet. This property probably isn't useful for much except |
117 // the JavaScript binding (which needs to use this value for security). | 117 // the JavaScript binding (which needs to use this value for security). |
118 String originalURL() const { return m_originalURL; } | 118 String originalURL() const { return m_originalURL; } |
119 const KURL& baseURL() const { return m_parserContext.baseURL(); } | 119 const KURL& baseURL() const { return m_parserContext.baseURL(); } |
120 | 120 |
121 unsigned ruleCount() const; | 121 unsigned ruleCount() const; |
122 StyleRuleBase* ruleAt(unsigned index) const; | 122 StyleRuleBase* ruleAt(unsigned index) const; |
123 | 123 |
124 unsigned estimatedSizeInBytes() const; | 124 unsigned estimatedSizeInBytes() const; |
125 | 125 |
126 bool wrapperInsertRule(RawPtr<StyleRuleBase>, unsigned index); | 126 bool wrapperInsertRule(StyleRuleBase*, unsigned index); |
127 bool wrapperDeleteRule(unsigned index); | 127 bool wrapperDeleteRule(unsigned index); |
128 | 128 |
129 RawPtr<StyleSheetContents> copy() const | 129 StyleSheetContents* copy() const |
130 { | 130 { |
131 return new StyleSheetContents(*this); | 131 return new StyleSheetContents(*this); |
132 } | 132 } |
133 | 133 |
134 void registerClient(CSSStyleSheet*); | 134 void registerClient(CSSStyleSheet*); |
135 void unregisterClient(CSSStyleSheet*); | 135 void unregisterClient(CSSStyleSheet*); |
136 size_t clientSize() const { return m_loadingClients.size() + m_completedClie
nts.size(); } | 136 size_t clientSize() const { return m_loadingClients.size() + m_completedClie
nts.size(); } |
137 bool hasOneClient() { return clientSize() == 1; } | 137 bool hasOneClient() { return clientSize() == 1; } |
138 void clientLoadCompleted(CSSStyleSheet*); | 138 void clientLoadCompleted(CSSStyleSheet*); |
139 void clientLoadStarted(CSSStyleSheet*); | 139 void clientLoadStarted(CSSStyleSheet*); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 HeapHashSet<WeakMember<CSSStyleSheet>> m_loadingClients; | 193 HeapHashSet<WeakMember<CSSStyleSheet>> m_loadingClients; |
194 HeapHashSet<WeakMember<CSSStyleSheet>> m_completedClients; | 194 HeapHashSet<WeakMember<CSSStyleSheet>> m_completedClients; |
195 | 195 |
196 Member<RuleSet> m_ruleSet; | 196 Member<RuleSet> m_ruleSet; |
197 String m_sourceMapURL; | 197 String m_sourceMapURL; |
198 }; | 198 }; |
199 | 199 |
200 } // namespace blink | 200 } // namespace blink |
201 | 201 |
202 #endif | 202 #endif |
OLD | NEW |