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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 271 |
272 ec = 0; | 272 ec = 0; |
273 if (index > length()) { | 273 if (index > length()) { |
274 ec = IndexSizeError; | 274 ec = IndexSizeError; |
275 return 0; | 275 return 0; |
276 } | 276 } |
277 CSSParser p(m_contents->parserContext(), UseCounter::getFrom(this)); | 277 CSSParser p(m_contents->parserContext(), UseCounter::getFrom(this)); |
278 RefPtr<StyleRuleBase> rule = p.parseRule(m_contents.get(), ruleString); | 278 RefPtr<StyleRuleBase> rule = p.parseRule(m_contents.get(), ruleString); |
279 | 279 |
280 if (!rule) { | 280 if (!rule) { |
281 ec = SYNTAX_ERR; | 281 ec = SyntaxError; |
282 return 0; | 282 return 0; |
283 } | 283 } |
284 RuleMutationScope mutationScope(this); | 284 RuleMutationScope mutationScope(this); |
285 | 285 |
286 bool success = m_contents->wrapperInsertRule(rule, index); | 286 bool success = m_contents->wrapperInsertRule(rule, index); |
287 if (!success) { | 287 if (!success) { |
288 ec = HierarchyRequestError; | 288 ec = HierarchyRequestError; |
289 return 0; | 289 return 0; |
290 } | 290 } |
291 if (!m_childRuleCSSOMWrappers.isEmpty()) | 291 if (!m_childRuleCSSOMWrappers.isEmpty()) |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 root = root->parentStyleSheet(); | 381 root = root->parentStyleSheet(); |
382 return root->ownerNode() ? root->ownerNode()->document() : 0; | 382 return root->ownerNode() ? root->ownerNode()->document() : 0; |
383 } | 383 } |
384 | 384 |
385 void CSSStyleSheet::clearChildRuleCSSOMWrappers() | 385 void CSSStyleSheet::clearChildRuleCSSOMWrappers() |
386 { | 386 { |
387 m_childRuleCSSOMWrappers.clear(); | 387 m_childRuleCSSOMWrappers.clear(); |
388 } | 388 } |
389 | 389 |
390 } | 390 } |
OLD | NEW |