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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 { | 62 { |
63 ASSERT(m_childRuleCSSOMWrappers.size() == m_groupRule->childRules().size()); | 63 ASSERT(m_childRuleCSSOMWrappers.size() == m_groupRule->childRules().size()); |
64 | 64 |
65 if (index > m_groupRule->childRules().size()) { | 65 if (index > m_groupRule->childRules().size()) { |
66 exceptionState.throwDOMException(IndexSizeError, "the index " + String::
number(index) + " must be less than or equal to the length of the rule list."); | 66 exceptionState.throwDOMException(IndexSizeError, "the index " + String::
number(index) + " must be less than or equal to the length of the rule list."); |
67 return 0; | 67 return 0; |
68 } | 68 } |
69 | 69 |
70 CSSStyleSheet* styleSheet = parentStyleSheet(); | 70 CSSStyleSheet* styleSheet = parentStyleSheet(); |
71 CSSParserContext context(parserContext(), UseCounter::getFrom(styleSheet)); | 71 CSSParserContext context(parserContext(), UseCounter::getFrom(styleSheet)); |
72 RawPtr<StyleRuleBase> newRule = CSSParser::parseRule(context, styleSheet ? s
tyleSheet->contents() : nullptr, ruleString); | 72 StyleRuleBase* newRule = CSSParser::parseRule(context, styleSheet ? styleShe
et->contents() : nullptr, ruleString); |
73 if (!newRule) { | 73 if (!newRule) { |
74 exceptionState.throwDOMException(SyntaxError, "the rule '" + ruleString
+ "' is invalid and cannot be parsed."); | 74 exceptionState.throwDOMException(SyntaxError, "the rule '" + ruleString
+ "' is invalid and cannot be parsed."); |
75 return 0; | 75 return 0; |
76 } | 76 } |
77 | 77 |
78 if (newRule->isNamespaceRule()) { | 78 if (newRule->isNamespaceRule()) { |
79 exceptionState.throwDOMException(HierarchyRequestError, "'@namespace' ru
les cannot be inserted inside a group rule."); | 79 exceptionState.throwDOMException(HierarchyRequestError, "'@namespace' ru
les cannot be inserted inside a group rule."); |
80 return 0; | 80 return 0; |
81 } | 81 } |
82 | 82 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 DEFINE_TRACE(CSSGroupingRule) | 158 DEFINE_TRACE(CSSGroupingRule) |
159 { | 159 { |
160 CSSRule::trace(visitor); | 160 CSSRule::trace(visitor); |
161 visitor->trace(m_childRuleCSSOMWrappers); | 161 visitor->trace(m_childRuleCSSOMWrappers); |
162 visitor->trace(m_groupRule); | 162 visitor->trace(m_groupRule); |
163 visitor->trace(m_ruleListCSSOMWrapper); | 163 visitor->trace(m_ruleListCSSOMWrapper); |
164 } | 164 } |
165 | 165 |
166 } // namespace blink | 166 } // namespace blink |
OLD | NEW |