summaryrefslogtreecommitdiff
path: root/layout/style/nsCSSParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layout/style/nsCSSParser.cpp')
-rw-r--r--layout/style/nsCSSParser.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp
index 6a65f06646..b981a553f3 100644
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -257,7 +257,8 @@ public:
bool EvaluateSupportsCondition(const nsAString& aCondition,
nsIURI* aDocURL,
nsIURI* aBaseURL,
- nsIPrincipal* aDocPrincipal);
+ nsIPrincipal* aDocPrincipal,
+ SupportsParsingSettings aSettings = SupportsParsingSettings::Normal);
bool ParseCounterStyleName(const nsAString& aBuffer,
nsIURI* aURL,
@@ -2457,7 +2458,8 @@ bool
CSSParserImpl::EvaluateSupportsCondition(const nsAString& aDeclaration,
nsIURI* aDocURL,
nsIURI* aBaseURL,
- nsIPrincipal* aDocPrincipal)
+ nsIPrincipal* aDocPrincipal,
+ SupportsParsingSettings aSettings)
{
nsCSSScanner scanner(aDeclaration, 0);
css::ErrorReporter reporter(scanner, mSheet, mChildLoader, aDocURL);
@@ -2465,7 +2467,13 @@ CSSParserImpl::EvaluateSupportsCondition(const nsAString& aDeclaration,
nsAutoSuppressErrors suppressErrors(this);
bool conditionMet;
- bool parsedOK = ParseSupportsCondition(conditionMet) && !GetToken(true);
+ bool parsedOK;
+
+ if (aSettings == SupportsParsingSettings::ImpliedParentheses) {
+ parsedOK = ParseSupportsConditionInParensInsideParens(conditionMet) && !GetToken(true);
+ } else {
+ parsedOK = ParseSupportsCondition(conditionMet) && !GetToken(true);
+ }
CLEAR_ERROR();
ReleaseScanner();
@@ -18245,10 +18253,11 @@ bool
nsCSSParser::EvaluateSupportsCondition(const nsAString& aCondition,
nsIURI* aDocURL,
nsIURI* aBaseURL,
- nsIPrincipal* aDocPrincipal)
+ nsIPrincipal* aDocPrincipal,
+ SupportsParsingSettings aSettings)
{
return static_cast<CSSParserImpl*>(mImpl)->
- EvaluateSupportsCondition(aCondition, aDocURL, aBaseURL, aDocPrincipal);
+ EvaluateSupportsCondition(aCondition, aDocURL, aBaseURL, aDocPrincipal, aSettings);
}
bool