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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 73 } |
74 | 74 |
75 if (newRule->isNamespaceRule()) { | 75 if (newRule->isNamespaceRule()) { |
76 exceptionState.throwDOMException( | 76 exceptionState.throwDOMException( |
77 HierarchyRequestError, | 77 HierarchyRequestError, |
78 "'@namespace' rules cannot be inserted inside a group rule."); | 78 "'@namespace' rules cannot be inserted inside a group rule."); |
79 return 0; | 79 return 0; |
80 } | 80 } |
81 | 81 |
82 if (newRule->isImportRule()) { | 82 if (newRule->isImportRule()) { |
83 // FIXME: an HierarchyRequestError should also be thrown for a nested @media
rule. They are | 83 // FIXME: an HierarchyRequestError should also be thrown for a nested @media |
84 // currently not getting parsed, resulting in a SyntaxError to get raised ab
ove. | 84 // rule. They are currently not getting parsed, resulting in a SyntaxError |
| 85 // to get raised above. |
85 exceptionState.throwDOMException( | 86 exceptionState.throwDOMException( |
86 HierarchyRequestError, | 87 HierarchyRequestError, |
87 "'@import' rules cannot be inserted inside a group rule."); | 88 "'@import' rules cannot be inserted inside a group rule."); |
88 return 0; | 89 return 0; |
89 } | 90 } |
90 CSSStyleSheet::RuleMutationScope mutationScope(this); | 91 CSSStyleSheet::RuleMutationScope mutationScope(this); |
91 | 92 |
92 m_groupRule->wrapperInsertRule(index, newRule); | 93 m_groupRule->wrapperInsertRule(index, newRule); |
93 | 94 |
94 m_childRuleCSSOMWrappers.insert(index, Member<CSSRule>(nullptr)); | 95 m_childRuleCSSOMWrappers.insert(index, Member<CSSRule>(nullptr)); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 157 } |
157 | 158 |
158 DEFINE_TRACE(CSSGroupingRule) { | 159 DEFINE_TRACE(CSSGroupingRule) { |
159 CSSRule::trace(visitor); | 160 CSSRule::trace(visitor); |
160 visitor->trace(m_childRuleCSSOMWrappers); | 161 visitor->trace(m_childRuleCSSOMWrappers); |
161 visitor->trace(m_groupRule); | 162 visitor->trace(m_groupRule); |
162 visitor->trace(m_ruleListCSSOMWrapper); | 163 visitor->trace(m_ruleListCSSOMWrapper); |
163 } | 164 } |
164 | 165 |
165 } // namespace blink | 166 } // namespace blink |
OLD | NEW |