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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 CSSStyleSheet* styleSheet = parentStyleSheet(); | 71 CSSStyleSheet* styleSheet = parentStyleSheet(); |
72 CSSParserContext context(parserContext(), UseCounter::getFrom(styleSheet)); | 72 CSSParserContext context(parserContext(), UseCounter::getFrom(styleSheet)); |
73 RefPtrWillBeRawPtr<StyleRuleBase> newRule = CSSParser::parseRule(context, st
yleSheet ? styleSheet->contents() : 0, ruleString); | 73 RefPtrWillBeRawPtr<StyleRuleBase> newRule = CSSParser::parseRule(context, st
yleSheet ? styleSheet->contents() : 0, ruleString); |
74 if (!newRule) { | 74 if (!newRule) { |
75 exceptionState.throwDOMException(SyntaxError, "the rule '" + ruleString
+ "' is invalid and cannot be parsed."); | 75 exceptionState.throwDOMException(SyntaxError, "the rule '" + ruleString
+ "' is invalid and cannot be parsed."); |
76 return 0; | 76 return 0; |
77 } | 77 } |
78 | 78 |
79 if (newRule->isImportRule()) { | 79 if (newRule->isImportRule()) { |
80 // FIXME: an HierarchyRequestError should also be thrown for a @charset
or a nested | 80 // FIXME: an HierarchyRequestError should also be thrown for a nested @m
edia rule. They are |
81 // @media rule. They are currently not getting parsed, resulting in a Sy
ntaxError | 81 // currently not getting parsed, resulting in a SyntaxError to get raise
d above. |
82 // to get raised above. | |
83 exceptionState.throwDOMException(HierarchyRequestError, "'@import' rules
cannot be inserted inside a group rule."); | 82 exceptionState.throwDOMException(HierarchyRequestError, "'@import' rules
cannot be inserted inside a group rule."); |
84 return 0; | 83 return 0; |
85 } | 84 } |
86 CSSStyleSheet::RuleMutationScope mutationScope(this); | 85 CSSStyleSheet::RuleMutationScope mutationScope(this); |
87 | 86 |
88 m_groupRule->wrapperInsertRule(index, newRule); | 87 m_groupRule->wrapperInsertRule(index, newRule); |
89 | 88 |
90 m_childRuleCSSOMWrappers.insert(index, RefPtrWillBeMember<CSSRule>(nullptr))
; | 89 m_childRuleCSSOMWrappers.insert(index, RefPtrWillBeMember<CSSRule>(nullptr))
; |
91 return index; | 90 return index; |
92 } | 91 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 { | 155 { |
157 CSSRule::trace(visitor); | 156 CSSRule::trace(visitor); |
158 #if ENABLE(OILPAN) | 157 #if ENABLE(OILPAN) |
159 visitor->trace(m_childRuleCSSOMWrappers); | 158 visitor->trace(m_childRuleCSSOMWrappers); |
160 #endif | 159 #endif |
161 visitor->trace(m_groupRule); | 160 visitor->trace(m_groupRule); |
162 visitor->trace(m_ruleListCSSOMWrapper); | 161 visitor->trace(m_ruleListCSSOMWrapper); |
163 } | 162 } |
164 | 163 |
165 } // namespace blink | 164 } // namespace blink |
OLD | NEW |