| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/css/parser/CSSSupportsParser.h" | 5 #include "core/css/parser/CSSSupportsParser.h" |
| 6 | 6 |
| 7 #include "core/css/parser/CSSParserImpl.h" | 7 #include "core/css/parser/CSSParserImpl.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 return Invalid; | 58 return Invalid; |
| 59 | 59 |
| 60 if (range.consumeIncludingWhitespace().type() != WhitespaceToken) | 60 if (range.consumeIncludingWhitespace().type() != WhitespaceToken) |
| 61 return Invalid; | 61 return Invalid; |
| 62 } | 62 } |
| 63 return result ? Supported : Unsupported; | 63 return result ? Supported : Unsupported; |
| 64 } | 64 } |
| 65 | 65 |
| 66 CSSSupportsParser::SupportsResult CSSSupportsParser::consumeNegation( | 66 CSSSupportsParser::SupportsResult CSSSupportsParser::consumeNegation( |
| 67 CSSParserTokenRange range) { | 67 CSSParserTokenRange range) { |
| 68 ASSERT(range.peek().type() == IdentToken); | 68 DCHECK_EQ(range.peek().type(), IdentToken); |
| 69 if (!equalIgnoringASCIICase(range.consume().value(), "not")) | 69 if (!equalIgnoringASCIICase(range.consume().value(), "not")) |
| 70 return Invalid; | 70 return Invalid; |
| 71 if (range.consumeIncludingWhitespace().type() != WhitespaceToken) | 71 if (range.consumeIncludingWhitespace().type() != WhitespaceToken) |
| 72 return Invalid; | 72 return Invalid; |
| 73 SupportsResult result = consumeConditionInParenthesis(range); | 73 SupportsResult result = consumeConditionInParenthesis(range); |
| 74 range.consumeWhitespace(); | 74 range.consumeWhitespace(); |
| 75 if (!range.atEnd() || result == Invalid) | 75 if (!range.atEnd() || result == Invalid) |
| 76 return Invalid; | 76 return Invalid; |
| 77 return result ? Unsupported : Supported; | 77 return result ? Unsupported : Supported; |
| 78 } | 78 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 90 SupportsResult result = consumeCondition(innerRange); | 90 SupportsResult result = consumeCondition(innerRange); |
| 91 if (result != Invalid) | 91 if (result != Invalid) |
| 92 return result; | 92 return result; |
| 93 return innerRange.peek().type() == IdentToken && | 93 return innerRange.peek().type() == IdentToken && |
| 94 m_parser.supportsDeclaration(innerRange) | 94 m_parser.supportsDeclaration(innerRange) |
| 95 ? Supported | 95 ? Supported |
| 96 : Unsupported; | 96 : Unsupported; |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |