| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
| 3 * Copyright (C) 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above | 9 * 1. Redistributions of source code must retain the above |
| 10 * copyright notice, this list of conditions and the following | 10 * copyright notice, this list of conditions and the following |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 ASSERT(m_childRuleCSSOMWrappers.size() == m_groupRule->childRules().size()); | 132 ASSERT(m_childRuleCSSOMWrappers.size() == m_groupRule->childRules().size()); |
| 133 RefPtrWillBeMember<CSSRule>& rule = m_childRuleCSSOMWrappers[index]; | 133 RefPtrWillBeMember<CSSRule>& rule = m_childRuleCSSOMWrappers[index]; |
| 134 if (!rule) | 134 if (!rule) |
| 135 rule = m_groupRule->childRules()[index]->createCSSOMWrapper(const_cast<C
SSGroupingRule*>(this)); | 135 rule = m_groupRule->childRules()[index]->createCSSOMWrapper(const_cast<C
SSGroupingRule*>(this)); |
| 136 return rule.get(); | 136 return rule.get(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 CSSRuleList* CSSGroupingRule::cssRules() const | 139 CSSRuleList* CSSGroupingRule::cssRules() const |
| 140 { | 140 { |
| 141 if (!m_ruleListCSSOMWrapper) | 141 if (!m_ruleListCSSOMWrapper) |
| 142 m_ruleListCSSOMWrapper = adoptPtr(new LiveCSSRuleList<CSSGroupingRule>(c
onst_cast<CSSGroupingRule*>(this))); | 142 m_ruleListCSSOMWrapper = LiveCSSRuleList<CSSGroupingRule>::create(const_
cast<CSSGroupingRule*>(this)); |
| 143 return m_ruleListCSSOMWrapper.get(); | 143 return m_ruleListCSSOMWrapper.get(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void CSSGroupingRule::reattach(StyleRuleBase* rule) | 146 void CSSGroupingRule::reattach(StyleRuleBase* rule) |
| 147 { | 147 { |
| 148 ASSERT(rule); | 148 ASSERT(rule); |
| 149 m_groupRule = static_cast<StyleRuleGroup*>(rule); | 149 m_groupRule = static_cast<StyleRuleGroup*>(rule); |
| 150 for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) { | 150 for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) { |
| 151 if (m_childRuleCSSOMWrappers[i]) | 151 if (m_childRuleCSSOMWrappers[i]) |
| 152 m_childRuleCSSOMWrappers[i]->reattach(m_groupRule->childRules()[i].g
et()); | 152 m_childRuleCSSOMWrappers[i]->reattach(m_groupRule->childRules()[i].g
et()); |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 void CSSGroupingRule::trace(Visitor* visitor) | 156 void CSSGroupingRule::trace(Visitor* visitor) |
| 157 { | 157 { |
| 158 CSSRule::trace(visitor); | 158 CSSRule::trace(visitor); |
| 159 #if ENABLE(OILPAN) | 159 #if ENABLE(OILPAN) |
| 160 visitor->trace(m_childRuleCSSOMWrappers); | 160 visitor->trace(m_childRuleCSSOMWrappers); |
| 161 #endif | 161 #endif |
| 162 visitor->trace(m_groupRule); | 162 visitor->trace(m_groupRule); |
| 163 visitor->trace(m_ruleListCSSOMWrapper); |
| 163 } | 164 } |
| 164 | 165 |
| 165 } // namespace WebCore | 166 } // namespace WebCore |
| OLD | NEW |