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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 | 32 |
33 #include "CSSGroupingRule.h" | 33 #include "CSSGroupingRule.h" |
34 | 34 |
35 #include "CSSParser.h" | 35 #include "CSSParser.h" |
36 #include "CSSRuleList.h" | 36 #include "CSSRuleList.h" |
37 #include "CSSStyleSheet.h" | 37 #include "CSSStyleSheet.h" |
38 #include "ExceptionCode.h" | 38 #include "ExceptionCode.h" |
39 #include "StyleRule.h" | 39 #include "StyleRule.h" |
40 #include "WebCoreMemoryInstrumentation.h" | |
41 #include <wtf/MemoryInstrumentationVector.h> | |
42 #include <wtf/text/StringBuilder.h> | 40 #include <wtf/text/StringBuilder.h> |
43 | 41 |
44 namespace WebCore { | 42 namespace WebCore { |
45 | 43 |
46 CSSGroupingRule::CSSGroupingRule(StyleRuleGroup* groupRule, CSSStyleSheet* paren
t) | 44 CSSGroupingRule::CSSGroupingRule(StyleRuleGroup* groupRule, CSSStyleSheet* paren
t) |
47 : CSSRule(parent) | 45 : CSSRule(parent) |
48 , m_groupRule(groupRule) | 46 , m_groupRule(groupRule) |
49 , m_childRuleCSSOMWrappers(groupRule->childRules().size()) | 47 , m_childRuleCSSOMWrappers(groupRule->childRules().size()) |
50 { | 48 { |
51 } | 49 } |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 void CSSGroupingRule::reattach(StyleRuleBase* rule) | 151 void CSSGroupingRule::reattach(StyleRuleBase* rule) |
154 { | 152 { |
155 ASSERT(rule); | 153 ASSERT(rule); |
156 m_groupRule = static_cast<StyleRuleGroup*>(rule); | 154 m_groupRule = static_cast<StyleRuleGroup*>(rule); |
157 for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) { | 155 for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) { |
158 if (m_childRuleCSSOMWrappers[i]) | 156 if (m_childRuleCSSOMWrappers[i]) |
159 m_childRuleCSSOMWrappers[i]->reattach(m_groupRule->childRules()[i].g
et()); | 157 m_childRuleCSSOMWrappers[i]->reattach(m_groupRule->childRules()[i].g
et()); |
160 } | 158 } |
161 } | 159 } |
162 | 160 |
163 void CSSGroupingRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) cons
t | |
164 { | |
165 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); | |
166 CSSRule::reportMemoryUsage(memoryObjectInfo); | |
167 info.addMember(m_groupRule, "groupRule"); | |
168 info.addMember(m_childRuleCSSOMWrappers, "childRuleCSSOMWrappers"); | |
169 info.addMember(m_ruleListCSSOMWrapper, "ruleListCSSOMWrapper"); | |
170 } | |
171 | |
172 } // namespace WebCore | 161 } // namespace WebCore |
OLD | NEW |