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

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

Issue 1181023004: Move rem handling out of CSSParserValues.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Another attempt Created 5 years, 4 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
« no previous file with comments | « Source/core/css/CSSToLengthConversionData.cpp ('k') | Source/core/css/StyleSheetContents.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 void setHasSyntacticallyValidCSSHeader(bool isValidCss); 90 void setHasSyntacticallyValidCSSHeader(bool isValidCss);
91 bool hasSyntacticallyValidCSSHeader() const { return m_hasSyntacticallyValid CSSHeader; } 91 bool hasSyntacticallyValidCSSHeader() const { return m_hasSyntacticallyValid CSSHeader; }
92 92
93 void setHasFontFaceRule(bool b) { m_hasFontFaceRule = b; } 93 void setHasFontFaceRule(bool b) { m_hasFontFaceRule = b; }
94 bool hasFontFaceRule() const { return m_hasFontFaceRule; } 94 bool hasFontFaceRule() const { return m_hasFontFaceRule; }
95 void findFontFaceRules(WillBeHeapVector<RawPtrWillBeMember<const StyleRuleFo ntFace>>& fontFaceRules); 95 void findFontFaceRules(WillBeHeapVector<RawPtrWillBeMember<const StyleRuleFo ntFace>>& fontFaceRules);
96 96
97 void parserAddNamespace(const AtomicString& prefix, const AtomicString& uri) ; 97 void parserAddNamespace(const AtomicString& prefix, const AtomicString& uri) ;
98 void parserAppendRule(PassRefPtrWillBeRawPtr<StyleRuleBase>); 98 void parserAppendRule(PassRefPtrWillBeRawPtr<StyleRuleBase>);
99 void parserSetUsesRemUnits(bool b) { m_usesRemUnits = b; }
100 99
101 void clearRules(); 100 void clearRules();
102 101
103 // Rules other than @import. 102 // Rules other than @import.
104 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& childRules() cons t { return m_childRules; } 103 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>>& childRules() cons t { return m_childRules; }
105 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport>>& importRules() c onst { return m_importRules; } 104 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport>>& importRules() c onst { return m_importRules; }
106 105
107 void notifyLoadedSheet(const CSSStyleSheetResource*); 106 void notifyLoadedSheet(const CSSStyleSheetResource*);
108 107
109 StyleSheetContents* parentStyleSheet() const; 108 StyleSheetContents* parentStyleSheet() const;
110 StyleRuleImport* ownerRule() const { return m_ownerRule; } 109 StyleRuleImport* ownerRule() const { return m_ownerRule; }
111 void clearOwnerRule() { m_ownerRule = nullptr; } 110 void clearOwnerRule() { m_ownerRule = nullptr; }
112 111
113 // Note that href is the URL that started the redirect chain that led to 112 // Note that href is the URL that started the redirect chain that led to
114 // this style sheet. This property probably isn't useful for much except 113 // this style sheet. This property probably isn't useful for much except
115 // the JavaScript binding (which needs to use this value for security). 114 // the JavaScript binding (which needs to use this value for security).
116 String originalURL() const { return m_originalURL; } 115 String originalURL() const { return m_originalURL; }
117 const KURL& baseURL() const { return m_parserContext.baseURL(); } 116 const KURL& baseURL() const { return m_parserContext.baseURL(); }
118 117
119 unsigned ruleCount() const; 118 unsigned ruleCount() const;
120 StyleRuleBase* ruleAt(unsigned index) const; 119 StyleRuleBase* ruleAt(unsigned index) const;
121 120
122 bool usesRemUnits() const { return m_usesRemUnits; }
123
124 unsigned estimatedSizeInBytes() const; 121 unsigned estimatedSizeInBytes() const;
125 122
126 bool wrapperInsertRule(PassRefPtrWillBeRawPtr<StyleRuleBase>, unsigned index ); 123 bool wrapperInsertRule(PassRefPtrWillBeRawPtr<StyleRuleBase>, unsigned index );
127 void wrapperDeleteRule(unsigned index); 124 void wrapperDeleteRule(unsigned index);
128 125
129 PassRefPtrWillBeRawPtr<StyleSheetContents> copy() const 126 PassRefPtrWillBeRawPtr<StyleSheetContents> copy() const
130 { 127 {
131 return adoptRefWillBeNoop(new StyleSheetContents(*this)); 128 return adoptRefWillBeNoop(new StyleSheetContents(*this));
132 } 129 }
133 130
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 170
174 String m_originalURL; 171 String m_originalURL;
175 172
176 WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport>> m_importRules; 173 WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport>> m_importRules;
177 WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>> m_childRules; 174 WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase>> m_childRules;
178 typedef HashMap<AtomicString, AtomicString> PrefixNamespaceURIMap; 175 typedef HashMap<AtomicString, AtomicString> PrefixNamespaceURIMap;
179 PrefixNamespaceURIMap m_namespaces; 176 PrefixNamespaceURIMap m_namespaces;
180 177
181 bool m_hasSyntacticallyValidCSSHeader : 1; 178 bool m_hasSyntacticallyValidCSSHeader : 1;
182 bool m_didLoadErrorOccur : 1; 179 bool m_didLoadErrorOccur : 1;
183 bool m_usesRemUnits : 1;
184 bool m_isMutable : 1; 180 bool m_isMutable : 1;
185 bool m_isInMemoryCache : 1; 181 bool m_isInMemoryCache : 1;
186 bool m_hasFontFaceRule : 1; 182 bool m_hasFontFaceRule : 1;
187 bool m_hasMediaQueries : 1; 183 bool m_hasMediaQueries : 1;
188 bool m_hasSingleOwnerDocument : 1; 184 bool m_hasSingleOwnerDocument : 1;
189 185
190 CSSParserContext m_parserContext; 186 CSSParserContext m_parserContext;
191 187
192 WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet>> m_loadingClients; 188 WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet>> m_loadingClients;
193 WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet>> m_completedClients; 189 WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet>> m_completedClients;
194 190
195 OwnPtrWillBeMember<RuleSet> m_ruleSet; 191 OwnPtrWillBeMember<RuleSet> m_ruleSet;
196 String m_sourceMapURL; 192 String m_sourceMapURL;
197 }; 193 };
198 194
199 } // namespace 195 } // namespace
200 196
201 #endif 197 #endif
OLDNEW
« no previous file with comments | « Source/core/css/CSSToLengthConversionData.cpp ('k') | Source/core/css/StyleSheetContents.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698