OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 } | 282 } |
283 | 283 |
284 unsigned CSSStyleSheet::insertRule(const String& ruleString, unsigned index, Exc
eptionState& exceptionState) | 284 unsigned CSSStyleSheet::insertRule(const String& ruleString, unsigned index, Exc
eptionState& exceptionState) |
285 { | 285 { |
286 ASSERT(m_childRuleCSSOMWrappers.isEmpty() || m_childRuleCSSOMWrappers.size()
== m_contents->ruleCount()); | 286 ASSERT(m_childRuleCSSOMWrappers.isEmpty() || m_childRuleCSSOMWrappers.size()
== m_contents->ruleCount()); |
287 | 287 |
288 if (index > length()) { | 288 if (index > length()) { |
289 exceptionState.throwDOMException(IndexSizeError, "The index provided ("
+ String::number(index) + ") is larger than the maximum index (" + String::numbe
r(length()) + ")."); | 289 exceptionState.throwDOMException(IndexSizeError, "The index provided ("
+ String::number(index) + ") is larger than the maximum index (" + String::numbe
r(length()) + ")."); |
290 return 0; | 290 return 0; |
291 } | 291 } |
292 Document* ownerDoc = ownerDocument(); | 292 CSSParserContext context(m_contents->parserContext(), UseCounter::getFrom(th
is)); |
293 CSSParserContext context(m_contents->parserContext(), ownerDoc ? ownerDoc->f
rame() : 0, UseCounter::getFrom(this)); | |
294 RefPtrWillBeRawPtr<StyleRuleBase> rule = CSSParser::parseRule(context, m_con
tents.get(), ruleString); | 293 RefPtrWillBeRawPtr<StyleRuleBase> rule = CSSParser::parseRule(context, m_con
tents.get(), ruleString); |
295 | 294 |
296 // FIXME: @namespace rules have special handling in the CSSOM spec, but it | 295 // FIXME: @namespace rules have special handling in the CSSOM spec, but it |
297 // mostly doesn't make sense since we don't support CSSNamespaceRule | 296 // mostly doesn't make sense since we don't support CSSNamespaceRule |
298 if (!rule || rule->isNamespaceRule()) { | 297 if (!rule || rule->isNamespaceRule()) { |
299 exceptionState.throwDOMException(SyntaxError, "Failed to parse the rule
'" + ruleString + "'."); | 298 exceptionState.throwDOMException(SyntaxError, "Failed to parse the rule
'" + ruleString + "'."); |
300 return 0; | 299 return 0; |
301 } | 300 } |
302 RuleMutationScope mutationScope(this); | 301 RuleMutationScope mutationScope(this); |
303 | 302 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 visitor->trace(m_mediaQueries); | 446 visitor->trace(m_mediaQueries); |
448 visitor->trace(m_ownerNode); | 447 visitor->trace(m_ownerNode); |
449 visitor->trace(m_ownerRule); | 448 visitor->trace(m_ownerRule); |
450 visitor->trace(m_mediaCSSOMWrapper); | 449 visitor->trace(m_mediaCSSOMWrapper); |
451 visitor->trace(m_childRuleCSSOMWrappers); | 450 visitor->trace(m_childRuleCSSOMWrappers); |
452 visitor->trace(m_ruleListCSSOMWrapper); | 451 visitor->trace(m_ruleListCSSOMWrapper); |
453 StyleSheet::trace(visitor); | 452 StyleSheet::trace(visitor); |
454 } | 453 } |
455 | 454 |
456 } // namespace blink | 455 } // namespace blink |
OLD | NEW |