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

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

Issue 42543007: StyleResolver should update RuleSets lazily. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revised Created 7 years, 1 month 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 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2002, 2006, 2008, 2012, 2013 Apple Inc. All rights reserved. 4 * Copyright (C) 2002, 2006, 2008, 2012, 2013 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 PassRefPtr<StyleRuleFontFace> copy() const { return adoptRef(new StyleRuleFo ntFace(*this)); } 150 PassRefPtr<StyleRuleFontFace> copy() const { return adoptRef(new StyleRuleFo ntFace(*this)); }
151 151
152 private: 152 private:
153 StyleRuleFontFace(); 153 StyleRuleFontFace();
154 StyleRuleFontFace(const StyleRuleFontFace&); 154 StyleRuleFontFace(const StyleRuleFontFace&);
155 155
156 RefPtr<StylePropertySet> m_properties; 156 RefPtr<StylePropertySet> m_properties;
157 }; 157 };
158 158
159 inline const StyleRuleFontFace* toStyleRuleFontFace(const StyleRuleBase* rule)
160 {
161 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isFontFaceRule());
162 return static_cast<const StyleRuleFontFace*>(rule);
163 }
164
159 class StyleRulePage : public StyleRuleBase { 165 class StyleRulePage : public StyleRuleBase {
160 public: 166 public:
161 static PassRefPtr<StyleRulePage> create() { return adoptRef(new StyleRulePag e); } 167 static PassRefPtr<StyleRulePage> create() { return adoptRef(new StyleRulePag e); }
162 168
163 ~StyleRulePage(); 169 ~StyleRulePage();
164 170
165 const CSSSelector* selector() const { return m_selectorList.first(); } 171 const CSSSelector* selector() const { return m_selectorList.first(); }
166 const StylePropertySet* properties() const { return m_properties.get(); } 172 const StylePropertySet* properties() const { return m_properties.get(); }
167 MutableStylePropertySet* mutableProperties(); 173 MutableStylePropertySet* mutableProperties();
168 174
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 289
284 RefPtr<StylePropertySet> m_properties; 290 RefPtr<StylePropertySet> m_properties;
285 }; 291 };
286 292
287 inline const StyleRuleMedia* toStyleRuleMedia(const StyleRuleGroup* rule) 293 inline const StyleRuleMedia* toStyleRuleMedia(const StyleRuleGroup* rule)
288 { 294 {
289 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isMediaRule()); 295 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isMediaRule());
290 return static_cast<const StyleRuleMedia*>(rule); 296 return static_cast<const StyleRuleMedia*>(rule);
291 } 297 }
292 298
299 inline const StyleRuleMedia* toStyleRuleMedia(const StyleRuleBase* rule)
300 {
301 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isMediaRule());
302 return static_cast<const StyleRuleMedia*>(rule);
303 }
304
293 inline const StyleRuleSupports* toStyleRuleSupports(const StyleRuleGroup* rule) 305 inline const StyleRuleSupports* toStyleRuleSupports(const StyleRuleGroup* rule)
294 { 306 {
295 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isSupportsRule()); 307 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isSupportsRule());
296 return static_cast<const StyleRuleSupports*>(rule); 308 return static_cast<const StyleRuleSupports*>(rule);
297 } 309 }
298 310
299 inline const StyleRuleRegion* toStyleRuleRegion(const StyleRuleGroup* rule) 311 inline const StyleRuleRegion* toStyleRuleRegion(const StyleRuleGroup* rule)
300 { 312 {
301 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isRegionRule()); 313 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isRegionRule());
302 return static_cast<const StyleRuleRegion*>(rule); 314 return static_cast<const StyleRuleRegion*>(rule);
303 } 315 }
304 316
317 inline StyleRuleViewport* toStyleRuleViewport(StyleRuleBase* rule)
318 {
319 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isViewportRule());
320 return static_cast<StyleRuleViewport*>(rule);
321 }
322
305 class StyleRuleFilter : public StyleRuleBase { 323 class StyleRuleFilter : public StyleRuleBase {
306 public: 324 public:
307 static PassRefPtr<StyleRuleFilter> create(const String& filterName) { return adoptRef(new StyleRuleFilter(filterName)); } 325 static PassRefPtr<StyleRuleFilter> create(const String& filterName) { return adoptRef(new StyleRuleFilter(filterName)); }
308 326
309 ~StyleRuleFilter(); 327 ~StyleRuleFilter();
310 328
311 const String& filterName() const { return m_filterName; } 329 const String& filterName() const { return m_filterName; }
312 330
313 const StylePropertySet* properties() const { return m_properties.get(); } 331 const StylePropertySet* properties() const { return m_properties.get(); }
314 MutableStylePropertySet* mutableProperties(); 332 MutableStylePropertySet* mutableProperties();
315 333
316 void setProperties(PassRefPtr<StylePropertySet>); 334 void setProperties(PassRefPtr<StylePropertySet>);
317 335
318 PassRefPtr<StyleRuleFilter> copy() const { return adoptRef(new StyleRuleFilt er(*this)); } 336 PassRefPtr<StyleRuleFilter> copy() const { return adoptRef(new StyleRuleFilt er(*this)); }
319 337
320 private: 338 private:
321 StyleRuleFilter(const String&); 339 StyleRuleFilter(const String&);
322 StyleRuleFilter(const StyleRuleFilter&); 340 StyleRuleFilter(const StyleRuleFilter&);
323 341
324 String m_filterName; 342 String m_filterName;
325 RefPtr<StylePropertySet> m_properties; 343 RefPtr<StylePropertySet> m_properties;
326 }; 344 };
327 345
328 } // namespace WebCore 346 } // namespace WebCore
329 347
330 #endif // StyleRule_h 348 #endif // StyleRule_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698