Index: Source/core/css/CSSStyleSheet.cpp |
diff --git a/Source/core/css/CSSStyleSheet.cpp b/Source/core/css/CSSStyleSheet.cpp |
index 6add0d9bd607dedfe887bac7410fa41a9551046d..f1116abfd08e90185e910d20bb4bdbe37eb0bf16 100644 |
--- a/Source/core/css/CSSStyleSheet.cpp |
+++ b/Source/core/css/CSSStyleSheet.cpp |
@@ -334,7 +334,6 @@ unsigned CSSStyleSheet::insertRule(const String& ruleString, unsigned index, Exc |
unsigned CSSStyleSheet::insertRule(const String& rule, ExceptionState& exceptionState) |
{ |
- UseCounter::countDeprecation(callingExecutionContext(V8PerIsolateData::mainThreadIsolate()), UseCounter::CSSStyleSheetInsertRuleOptionalArg); |
return insertRule(rule, 0, exceptionState); |
} |
@@ -357,7 +356,7 @@ void CSSStyleSheet::deleteRule(unsigned index, ExceptionState& exceptionState) |
} |
} |
-int CSSStyleSheet::addRule(const String& selector, const String& style, int index, ExceptionState& exceptionState) |
+int CSSStyleSheet::addRule(const String& selector, const String& style, Optional<int> index, ExceptionState& exceptionState) |
{ |
StringBuilder text; |
text.append(selector); |
@@ -366,17 +365,12 @@ int CSSStyleSheet::addRule(const String& selector, const String& style, int inde |
if (!style.isEmpty()) |
text.append(' '); |
text.append('}'); |
- insertRule(text.toString(), index, exceptionState); |
+ insertRule(text.toString(), index.isMissing() ? length() : index.get(), exceptionState); |
// As per Microsoft documentation, always return -1. |
return -1; |
} |
-int CSSStyleSheet::addRule(const String& selector, const String& style, ExceptionState& exceptionState) |
-{ |
- return addRule(selector, style, length(), exceptionState); |
-} |
- |
PassRefPtrWillBeRawPtr<CSSRuleList> CSSStyleSheet::cssRules() |
{ |