Index: Source/core/css/CSSStyleSheet.cpp |
diff --git a/Source/core/css/CSSStyleSheet.cpp b/Source/core/css/CSSStyleSheet.cpp |
index 705d3283da8707459b4002a670ea53176e068975..41ae5b877fed1cdf33ac1a0107ae8f102d5640f9 100644 |
--- a/Source/core/css/CSSStyleSheet.cpp |
+++ b/Source/core/css/CSSStyleSheet.cpp |
@@ -26,7 +26,6 @@ |
#include "bindings/core/v8/V8PerIsolateData.h" |
#include "core/HTMLNames.h" |
#include "core/SVGNames.h" |
-#include "core/css/CSSCharsetRule.h" |
#include "core/css/CSSImportRule.h" |
#include "core/css/CSSRuleList.h" |
#include "core/css/MediaList.h" |
@@ -252,13 +251,8 @@ CSSRule* CSSStyleSheet::item(unsigned index) |
ASSERT(m_childRuleCSSOMWrappers.size() == ruleCount); |
RefPtrWillBeMember<CSSRule>& cssRule = m_childRuleCSSOMWrappers[index]; |
- if (!cssRule) { |
- if (index == 0 && m_contents->hasCharsetRule()) { |
- ASSERT(!m_contents->ruleAt(0)); |
- cssRule = CSSCharsetRule::create(this, m_contents->encodingFromCharsetRule()); |
- } else |
- cssRule = m_contents->ruleAt(index)->createCSSOMWrapper(this); |
- } |
+ if (!cssRule) |
+ cssRule = m_contents->ruleAt(index)->createCSSOMWrapper(this); |
return cssRule.get(); |
} |
@@ -287,18 +281,7 @@ bool CSSStyleSheet::canAccessRules() const |
PassRefPtrWillBeRawPtr<CSSRuleList> CSSStyleSheet::rules() |
{ |
- if (!canAccessRules()) |
- return nullptr; |
- // IE behavior. |
- RefPtrWillBeRawPtr<StaticCSSRuleList> nonCharsetRules(StaticCSSRuleList::create()); |
- unsigned ruleCount = length(); |
- for (unsigned i = 0; i < ruleCount; ++i) { |
- CSSRule* rule = item(i); |
- if (rule->type() == CSSRule::CHARSET_RULE) |
- continue; |
- nonCharsetRules->rules().append(rule); |
- } |
- return nonCharsetRules.release(); |
+ return cssRules(); |
} |
unsigned CSSStyleSheet::insertRule(const String& ruleString, unsigned index, ExceptionState& exceptionState) |