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

Side by Side Diff: sky/engine/core/css/StyleRule.h

Issue 780483002: Remove the CSSOM. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « sky/engine/core/css/StylePropertySet.cpp ('k') | sky/engine/core/css/StyleRule.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 * (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 10 matching lines...) Expand all
21 21
22 #ifndef SKY_ENGINE_CORE_CSS_STYLERULE_H_ 22 #ifndef SKY_ENGINE_CORE_CSS_STYLERULE_H_
23 #define SKY_ENGINE_CORE_CSS_STYLERULE_H_ 23 #define SKY_ENGINE_CORE_CSS_STYLERULE_H_
24 24
25 #include "sky/engine/core/css/CSSSelectorList.h" 25 #include "sky/engine/core/css/CSSSelectorList.h"
26 #include "sky/engine/core/css/MediaList.h" 26 #include "sky/engine/core/css/MediaList.h"
27 #include "sky/engine/wtf/RefPtr.h" 27 #include "sky/engine/wtf/RefPtr.h"
28 28
29 namespace blink { 29 namespace blink {
30 30
31 class CSSRule;
32 class CSSStyleRule;
33 class CSSStyleSheet; 31 class CSSStyleSheet;
34 class MutableStylePropertySet; 32 class MutableStylePropertySet;
35 class StylePropertySet; 33 class StylePropertySet;
36 34
37 class StyleRuleBase : public RefCounted<StyleRuleBase> { 35 class StyleRuleBase : public RefCounted<StyleRuleBase> {
38 WTF_MAKE_FAST_ALLOCATED; 36 WTF_MAKE_FAST_ALLOCATED;
39 public: 37 public:
40 enum Type { 38 enum Type {
41 Unknown, // Not used. 39 Unknown, // Not used.
42 Style, 40 Style,
(...skipping 15 matching lines...) Expand all
58 bool isFilterRule() const { return type() == Filter; } 56 bool isFilterRule() const { return type() == Filter; }
59 57
60 PassRefPtr<StyleRuleBase> copy() const; 58 PassRefPtr<StyleRuleBase> copy() const;
61 59
62 void deref() 60 void deref()
63 { 61 {
64 if (derefBase()) 62 if (derefBase())
65 destroy(); 63 destroy();
66 } 64 }
67 65
68 // FIXME: There shouldn't be any need for the null parent version.
69 PassRefPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet = 0) const ;
70 PassRefPtr<CSSRule> createCSSOMWrapper(CSSRule* parentRule) const;
71
72 protected: 66 protected:
73 StyleRuleBase(Type type) : m_type(type) { } 67 StyleRuleBase(Type type) : m_type(type) { }
74 StyleRuleBase(const StyleRuleBase& o) : m_type(o.m_type) { } 68 StyleRuleBase(const StyleRuleBase& o) : m_type(o.m_type) { }
75 69
76 ~StyleRuleBase() { } 70 ~StyleRuleBase() { }
77 71
78 private: 72 private:
79 void destroy(); 73 void destroy();
80 74
81 PassRefPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const;
82
83 unsigned m_type : 5; 75 unsigned m_type : 5;
84 }; 76 };
85 77
86 class StyleRule : public StyleRuleBase { 78 class StyleRule : public StyleRuleBase {
87 WTF_MAKE_FAST_ALLOCATED; 79 WTF_MAKE_FAST_ALLOCATED;
88 public: 80 public:
89 static PassRefPtr<StyleRule> create() { return adoptRef(new StyleRule()); } 81 static PassRefPtr<StyleRule> create() { return adoptRef(new StyleRule()); }
90 82
91 ~StyleRule(); 83 ~StyleRule();
92 84
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 202
211 DEFINE_TYPE_CASTS(StyleRule, StyleRuleBase, rule, rule->isStyleRule(), rule.isSt yleRule()); 203 DEFINE_TYPE_CASTS(StyleRule, StyleRuleBase, rule, rule->isStyleRule(), rule.isSt yleRule());
212 DEFINE_STYLE_RULE_TYPE_CASTS(FontFace); 204 DEFINE_STYLE_RULE_TYPE_CASTS(FontFace);
213 DEFINE_STYLE_RULE_TYPE_CASTS(Media); 205 DEFINE_STYLE_RULE_TYPE_CASTS(Media);
214 DEFINE_STYLE_RULE_TYPE_CASTS(Supports); 206 DEFINE_STYLE_RULE_TYPE_CASTS(Supports);
215 DEFINE_STYLE_RULE_TYPE_CASTS(Filter); 207 DEFINE_STYLE_RULE_TYPE_CASTS(Filter);
216 208
217 } // namespace blink 209 } // namespace blink
218 210
219 #endif // SKY_ENGINE_CORE_CSS_STYLERULE_H_ 211 #endif // SKY_ENGINE_CORE_CSS_STYLERULE_H_
OLDNEW
« no previous file with comments | « sky/engine/core/css/StylePropertySet.cpp ('k') | sky/engine/core/css/StyleRule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698