Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CSSParserTokenRange_h | 5 #ifndef CSSParserTokenRange_h |
| 6 #define CSSParserTokenRange_h | 6 #define CSSParserTokenRange_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/css/parser/CSSParserToken.h" | 9 #include "core/css/parser/CSSParserToken.h" |
| 10 #include "wtf/Vector.h" | 10 #include "wtf/Vector.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 return *m_first++; | 44 return *m_first++; |
| 45 } | 45 } |
| 46 | 46 |
| 47 const CSSParserToken& consumeIncludingWhitespace() | 47 const CSSParserToken& consumeIncludingWhitespace() |
| 48 { | 48 { |
| 49 const CSSParserToken& result = consume(); | 49 const CSSParserToken& result = consume(); |
| 50 consumeWhitespace(); | 50 consumeWhitespace(); |
| 51 return result; | 51 return result; |
| 52 } | 52 } |
| 53 | 53 |
| 54 const CSSParserToken& consumeSkippingWhitespace() | |
|
Timothy Loh
2015/07/28 08:17:41
The CSS parsing code uses a strategy of consuming
| |
| 55 { | |
| 56 consumeWhitespace(); | |
| 57 return consume(); | |
| 58 } | |
| 59 | |
| 54 // The returned range doesn't include the brackets | 60 // The returned range doesn't include the brackets |
| 55 CSSParserTokenRange consumeBlock(); | 61 CSSParserTokenRange consumeBlock(); |
| 56 | 62 |
| 57 void consumeComponentValue(); | 63 void consumeComponentValue(); |
| 58 | 64 |
| 59 void consumeWhitespace() | 65 void consumeWhitespace() |
| 60 { | 66 { |
| 61 while (peek().type() == WhitespaceToken) | 67 while (peek().type() == WhitespaceToken) |
| 62 ++m_first; | 68 ++m_first; |
| 63 } | 69 } |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 75 , m_last(last) | 81 , m_last(last) |
| 76 { } | 82 { } |
| 77 | 83 |
| 78 const CSSParserToken* m_first; | 84 const CSSParserToken* m_first; |
| 79 const CSSParserToken* m_last; | 85 const CSSParserToken* m_last; |
| 80 }; | 86 }; |
| 81 | 87 |
| 82 } // namespace | 88 } // namespace |
| 83 | 89 |
| 84 #endif // CSSParserTokenRange_h | 90 #endif // CSSParserTokenRange_h |
| OLD | NEW |