Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: Source/core/css/StyleSheetContents.h

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: with missing files Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(WillBeHeapVector<RawPtrWillBeMember<const StyleRuleFo ntFace>>& fontFaceRules); 97 void findFontFaceRules(WillBeHeapVector<RawPtrWillBeMember<const StyleRuleFo ntFace>>& fontFaceRules);
98 98
99 void parserAddNamespace(const AtomicString& prefix, const AtomicString& uri) ; 99 void parserAddNamespace(const AtomicString& prefix, const AtomicString& uri) ;
100 void parserAppendRule(PassRefPtrWillBeRawPtr<StyleRuleBase>); 100 void parserAppendRule(PassRefPtrWillBeRawPtr<StyleRuleBase>);
101 void parserSetUsesRemUnits(bool b) { m_usesRemUnits = b; } 101 void parserSetUsesRemUnits(bool b) { m_usesRemUnits = b; }
102 void parserSetUsesVariables(bool b) { m_usesVariables = b; }
102 103
103 void clearRules(); 104 void clearRules();
104 105
105 // Rules other than @import. 106 // Rules other than @import.
106 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& childRules() cons t { return m_childRules; } 107 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& childRules() cons t { return m_childRules; }
107 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport>>& importRules() c onst { return m_importRules; } 108 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport>>& importRules() c onst { return m_importRules; }
108 109
109 void notifyLoadedSheet(const CSSStyleSheetResource*); 110 void notifyLoadedSheet(const CSSStyleSheetResource*);
110 111
111 StyleSheetContents* parentStyleSheet() const; 112 StyleSheetContents* parentStyleSheet() const;
112 StyleRuleImport* ownerRule() const { return m_ownerRule; } 113 StyleRuleImport* ownerRule() const { return m_ownerRule; }
113 void clearOwnerRule() { m_ownerRule = nullptr; } 114 void clearOwnerRule() { m_ownerRule = nullptr; }
114 115
115 // Note that href is the URL that started the redirect chain that led to 116 // 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 117 // this style sheet. This property probably isn't useful for much except
117 // the JavaScript binding (which needs to use this value for security). 118 // the JavaScript binding (which needs to use this value for security).
118 String originalURL() const { return m_originalURL; } 119 String originalURL() const { return m_originalURL; }
119 const KURL& baseURL() const { return m_parserContext.baseURL(); } 120 const KURL& baseURL() const { return m_parserContext.baseURL(); }
120 121
121 unsigned ruleCount() const; 122 unsigned ruleCount() const;
122 StyleRuleBase* ruleAt(unsigned index) const; 123 StyleRuleBase* ruleAt(unsigned index) const;
123 124
124 bool usesRemUnits() const { return m_usesRemUnits; } 125 bool usesRemUnits() const { return m_usesRemUnits; }
126 bool usesVariables() const { return m_usesVariables; }
125 127
126 unsigned estimatedSizeInBytes() const; 128 unsigned estimatedSizeInBytes() const;
127 129
128 bool wrapperInsertRule(PassRefPtrWillBeRawPtr<StyleRuleBase>, unsigned index ); 130 bool wrapperInsertRule(PassRefPtrWillBeRawPtr<StyleRuleBase>, unsigned index );
129 void wrapperDeleteRule(unsigned index); 131 void wrapperDeleteRule(unsigned index);
130 132
131 PassRefPtrWillBeRawPtr<StyleSheetContents> copy() const 133 PassRefPtrWillBeRawPtr<StyleSheetContents> copy() const
132 { 134 {
133 return adoptRefWillBeNoop(new StyleSheetContents(*this)); 135 return adoptRefWillBeNoop(new StyleSheetContents(*this));
134 } 136 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 String m_originalURL; 179 String m_originalURL;
178 180
179 WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport>> m_importRules; 181 WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport>> m_importRules;
180 WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>> m_childRules; 182 WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>> m_childRules;
181 typedef HashMap<AtomicString, AtomicString> PrefixNamespaceURIMap; 183 typedef HashMap<AtomicString, AtomicString> PrefixNamespaceURIMap;
182 PrefixNamespaceURIMap m_namespaces; 184 PrefixNamespaceURIMap m_namespaces;
183 185
184 bool m_hasSyntacticallyValidCSSHeader : 1; 186 bool m_hasSyntacticallyValidCSSHeader : 1;
185 bool m_didLoadErrorOccur : 1; 187 bool m_didLoadErrorOccur : 1;
186 bool m_usesRemUnits : 1; 188 bool m_usesRemUnits : 1;
189 bool m_usesVariables : 1;
187 bool m_isMutable : 1; 190 bool m_isMutable : 1;
188 bool m_isInMemoryCache : 1; 191 bool m_isInMemoryCache : 1;
189 bool m_hasFontFaceRule : 1; 192 bool m_hasFontFaceRule : 1;
190 bool m_hasMediaQueries : 1; 193 bool m_hasMediaQueries : 1;
191 bool m_hasSingleOwnerDocument : 1; 194 bool m_hasSingleOwnerDocument : 1;
192 195
193 CSSParserContext m_parserContext; 196 CSSParserContext m_parserContext;
194 197
195 WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet>> m_loadingClients; 198 WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet>> m_loadingClients;
196 WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet>> m_completedClients; 199 WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet>> m_completedClients;
197 200
198 OwnPtrWillBeMember<RuleSet> m_ruleSet; 201 OwnPtrWillBeMember<RuleSet> m_ruleSet;
199 String m_sourceMapURL; 202 String m_sourceMapURL;
200 }; 203 };
201 204
202 } // namespace 205 } // namespace
203 206
204 #endif 207 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698