| 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 17 matching lines...) Expand all Loading... |
| 28 #include "core/css/CSSImportRule.h" | 28 #include "core/css/CSSImportRule.h" |
| 29 #include "core/css/CSSParser.h" | 29 #include "core/css/CSSParser.h" |
| 30 #include "core/css/CSSRuleList.h" | 30 #include "core/css/CSSRuleList.h" |
| 31 #include "core/css/CSSStyleRule.h" | 31 #include "core/css/CSSStyleRule.h" |
| 32 #include "core/css/MediaList.h" | 32 #include "core/css/MediaList.h" |
| 33 #include "core/css/StyleRule.h" | 33 #include "core/css/StyleRule.h" |
| 34 #include "core/css/StyleSheetContents.h" | 34 #include "core/css/StyleSheetContents.h" |
| 35 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
| 36 #include "core/dom/ExceptionCode.h" | 36 #include "core/dom/ExceptionCode.h" |
| 37 #include "core/dom/Node.h" | 37 #include "core/dom/Node.h" |
| 38 #include "core/page/UseCounter.h" |
| 38 #include "weborigin/SecurityOrigin.h" | 39 #include "weborigin/SecurityOrigin.h" |
| 39 #include "wtf/text/StringBuilder.h" | 40 #include "wtf/text/StringBuilder.h" |
| 40 | 41 |
| 41 namespace WebCore { | 42 namespace WebCore { |
| 42 | 43 |
| 43 class StyleSheetCSSRuleList : public CSSRuleList { | 44 class StyleSheetCSSRuleList : public CSSRuleList { |
| 44 public: | 45 public: |
| 45 StyleSheetCSSRuleList(CSSStyleSheet* sheet) : m_styleSheet(sheet) { } | 46 StyleSheetCSSRuleList(CSSStyleSheet* sheet) : m_styleSheet(sheet) { } |
| 46 | 47 |
| 47 private: | 48 private: |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 if (!success) { | 311 if (!success) { |
| 311 es.throwUninformativeAndGenericDOMException(HierarchyRequestError); | 312 es.throwUninformativeAndGenericDOMException(HierarchyRequestError); |
| 312 return 0; | 313 return 0; |
| 313 } | 314 } |
| 314 if (!m_childRuleCSSOMWrappers.isEmpty()) | 315 if (!m_childRuleCSSOMWrappers.isEmpty()) |
| 315 m_childRuleCSSOMWrappers.insert(index, RefPtr<CSSRule>()); | 316 m_childRuleCSSOMWrappers.insert(index, RefPtr<CSSRule>()); |
| 316 | 317 |
| 317 return index; | 318 return index; |
| 318 } | 319 } |
| 319 | 320 |
| 321 unsigned CSSStyleSheet::insertRule(const String& rule, ExceptionState& exception
State) |
| 322 { |
| 323 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::CSSStyleS
heetInsertRuleOptionalArg); |
| 324 return insertRule(rule, 0, exceptionState); |
| 325 } |
| 326 |
| 320 void CSSStyleSheet::deleteRule(unsigned index, ExceptionState& es) | 327 void CSSStyleSheet::deleteRule(unsigned index, ExceptionState& es) |
| 321 { | 328 { |
| 322 ASSERT(m_childRuleCSSOMWrappers.isEmpty() || m_childRuleCSSOMWrappers.size()
== m_contents->ruleCount()); | 329 ASSERT(m_childRuleCSSOMWrappers.isEmpty() || m_childRuleCSSOMWrappers.size()
== m_contents->ruleCount()); |
| 323 | 330 |
| 324 if (index >= length()) { | 331 if (index >= length()) { |
| 325 es.throwUninformativeAndGenericDOMException(IndexSizeError); | 332 es.throwUninformativeAndGenericDOMException(IndexSizeError); |
| 326 return; | 333 return; |
| 327 } | 334 } |
| 328 RuleMutationScope mutationScope(this); | 335 RuleMutationScope mutationScope(this); |
| 329 | 336 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 root = root->parentStyleSheet(); | 410 root = root->parentStyleSheet(); |
| 404 return root->ownerNode() ? &root->ownerNode()->document() : 0; | 411 return root->ownerNode() ? &root->ownerNode()->document() : 0; |
| 405 } | 412 } |
| 406 | 413 |
| 407 void CSSStyleSheet::clearChildRuleCSSOMWrappers() | 414 void CSSStyleSheet::clearChildRuleCSSOMWrappers() |
| 408 { | 415 { |
| 409 m_childRuleCSSOMWrappers.clear(); | 416 m_childRuleCSSOMWrappers.clear(); |
| 410 } | 417 } |
| 411 | 418 |
| 412 } | 419 } |
| OLD | NEW |