Chromium Code Reviews| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 | 55 |
| 56 if (index > m_groupRule->childRules().size()) { | 56 if (index > m_groupRule->childRules().size()) { |
| 57 exceptionState.throwDOMException( | 57 exceptionState.throwDOMException( |
| 58 IndexSizeError, | 58 IndexSizeError, |
| 59 "the index " + String::number(index) + | 59 "the index " + String::number(index) + |
| 60 " must be less than or equal to the length of the rule list."); | 60 " must be less than or equal to the length of the rule list."); |
| 61 return 0; | 61 return 0; |
| 62 } | 62 } |
| 63 | 63 |
| 64 CSSStyleSheet* styleSheet = parentStyleSheet(); | 64 CSSStyleSheet* styleSheet = parentStyleSheet(); |
| 65 CSSParserContext context(parserContext(), UseCounter::getFrom(styleSheet)); | 65 CSSParserContext* context = |
| 66 new CSSParserContext(parserContext(), UseCounter::getFrom(styleSheet)); | |
|
haraken
2017/01/11 02:42:18
Maybe we want to have a factory method. CSSParserC
rune
2017/01/11 12:59:26
+1
Bret
2017/01/11 23:05:15
Added for CSSStyleSheet and StyleSheetContents. Th
| |
| 66 StyleRuleBase* newRule = CSSParser::parseRule( | 67 StyleRuleBase* newRule = CSSParser::parseRule( |
| 67 context, styleSheet ? styleSheet->contents() : nullptr, ruleString); | 68 context, styleSheet ? styleSheet->contents() : nullptr, ruleString); |
| 68 if (!newRule) { | 69 if (!newRule) { |
| 69 exceptionState.throwDOMException( | 70 exceptionState.throwDOMException( |
| 70 SyntaxError, | 71 SyntaxError, |
| 71 "the rule '" + ruleString + "' is invalid and cannot be parsed."); | 72 "the rule '" + ruleString + "' is invalid and cannot be parsed."); |
| 72 return 0; | 73 return 0; |
| 73 } | 74 } |
| 74 | 75 |
| 75 if (newRule->isNamespaceRule()) { | 76 if (newRule->isNamespaceRule()) { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 } | 158 } |
| 158 | 159 |
| 159 DEFINE_TRACE(CSSGroupingRule) { | 160 DEFINE_TRACE(CSSGroupingRule) { |
| 160 CSSRule::trace(visitor); | 161 CSSRule::trace(visitor); |
| 161 visitor->trace(m_childRuleCSSOMWrappers); | 162 visitor->trace(m_childRuleCSSOMWrappers); |
| 162 visitor->trace(m_groupRule); | 163 visitor->trace(m_groupRule); |
| 163 visitor->trace(m_ruleListCSSOMWrapper); | 164 visitor->trace(m_ruleListCSSOMWrapper); |
| 164 } | 165 } |
| 165 | 166 |
| 166 } // namespace blink | 167 } // namespace blink |
| OLD | NEW |