OLD | NEW |
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, 2007, 2012 Apple Inc. All rights reserved. | 4 * Copyright (C) 2002, 2006, 2007, 2012 Apple Inc. All rights reserved. |
5 * Copyright (C) 2011 Andreas Kling (kling@webkit.org) | 5 * Copyright (C) 2011 Andreas Kling (kling@webkit.org) |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 m_parentIsRule = false; | 67 m_parentIsRule = false; |
68 m_parentStyleSheet = styleSheet; | 68 m_parentStyleSheet = styleSheet; |
69 } | 69 } |
70 | 70 |
71 void setParentRule(CSSRule* rule) | 71 void setParentRule(CSSRule* rule) |
72 { | 72 { |
73 m_parentIsRule = true; | 73 m_parentIsRule = true; |
74 m_parentRule = rule; | 74 m_parentRule = rule; |
75 } | 75 } |
76 | 76 |
77 virtual void trace(Visitor*); | 77 DECLARE_VIRTUAL_TRACE(); |
78 | 78 |
79 CSSStyleSheet* parentStyleSheet() const | 79 CSSStyleSheet* parentStyleSheet() const |
80 { | 80 { |
81 if (m_parentIsRule) | 81 if (m_parentIsRule) |
82 return m_parentRule ? m_parentRule->parentStyleSheet() : 0; | 82 return m_parentRule ? m_parentRule->parentStyleSheet() : 0; |
83 return m_parentStyleSheet; | 83 return m_parentStyleSheet; |
84 } | 84 } |
85 | 85 |
86 CSSRule* parentRule() const { return m_parentIsRule ? m_parentRule : 0; } | 86 CSSRule* parentRule() const { return m_parentIsRule ? m_parentRule : 0; } |
87 | 87 |
(...skipping 23 matching lines...) Expand all Loading... |
111 CSSStyleSheet* m_parentStyleSheet; | 111 CSSStyleSheet* m_parentStyleSheet; |
112 }; | 112 }; |
113 }; | 113 }; |
114 | 114 |
115 #define DEFINE_CSS_RULE_TYPE_CASTS(ToType, TYPE_NAME) \ | 115 #define DEFINE_CSS_RULE_TYPE_CASTS(ToType, TYPE_NAME) \ |
116 DEFINE_TYPE_CASTS(ToType, CSSRule, rule, rule->type() == CSSRule::TYPE_NAME,
rule.type() == CSSRule::TYPE_NAME) | 116 DEFINE_TYPE_CASTS(ToType, CSSRule, rule, rule->type() == CSSRule::TYPE_NAME,
rule.type() == CSSRule::TYPE_NAME) |
117 | 117 |
118 } // namespace blink | 118 } // namespace blink |
119 | 119 |
120 #endif // CSSRule_h | 120 #endif // CSSRule_h |
OLD | NEW |