// Copyright 2014 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifdef UNSAFE_BUFFERS_BUILD // TODO(crbug.com/351564777): Remove this and convert code to safer constructs. #pragma allow_unsafe_buffers #endif #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_PARSER_CSS_PARSER_TOKEN_RANGE_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_PARSER_CSS_PARSER_TOKEN_RANGE_H_ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/parser/css_parser_token.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/vector.h" #include <algorithm> #include <utility> namespace blink { CORE_EXPORT extern const CSSParserToken& g_static_eof_token; // A CSSParserTokenRange is an iterator over a subrange of a vector of // CSSParserTokens. Accessing outside of the range will return an endless stream // of EOF tokens. This class refers to half-open intervals [first, last). class CORE_EXPORT CSSParserTokenRange { … }; // An auxiliary class that can recover the exact string used for a set of // tokens. It stores per-token offsets (such as from // CSSTokenizer::TokenizeToEOFWithOffsets()) and a pointer to the original // string (which must live for at least as long as this class), and from that, // it can give you the exact string that a given token range came from. class CSSParserTokenOffsets { … }; bool NeedsInsertedComment(const CSSParserToken& a, const CSSParserToken& b); } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_CSS_PARSER_CSS_PARSER_TOKEN_RANGE_H_