Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Unified Diff: Source/core/css/CSSStyleSheet.cpp

Issue 337343002: IDL: make optional arguments (without default) explicit sometimes Base URL: https://chromium.googlesource.com/chromium/blink.git@idl-default-arguments-next
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSStyleSheet.h ('k') | Source/core/css/CSSStyleSheet.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
{
« no previous file with comments | « Source/core/css/CSSStyleSheet.h ('k') | Source/core/css/CSSStyleSheet.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698