#include "third_party/blink/renderer/core/css/parser/css_variable_parser.h"
#include "base/containers/contains.h"
#include "third_party/blink/renderer/core/css/css_attr_type.h"
#include "third_party/blink/renderer/core/css/css_unparsed_declaration_value.h"
#include "third_party/blink/renderer/core/css/parser/css_parser_token.h"
#include "third_party/blink/renderer/core/css/parser/css_parser_token_range.h"
#include "third_party/blink/renderer/core/css/properties/css_parsing_utils.h"
#include "third_party/blink/renderer/core/css/resolver/style_cascade.h"
#include "third_party/blink/renderer/core/css_value_keywords.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/html/parser/html_parser_idioms.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
namespace blink {
bool CSSVariableParser::IsValidVariableName(const CSSParserToken& token) { … }
bool CSSVariableParser::IsValidVariableName(StringView string) { … }
const CSSValue* CSSVariableParser::ParseDeclarationIncludingCSSWide(
CSSParserTokenStream& stream,
bool is_animation_tainted,
const CSSParserContext& context) { … }
CSSUnparsedDeclarationValue* CSSVariableParser::ParseDeclarationValue(
StringView text,
bool is_animation_tainted,
const CSSParserContext& context) { … }
static bool ConsumeUnparsedValue(CSSParserTokenStream& stream,
bool restricted_value,
bool comma_ends_declaration,
bool& has_references,
bool& has_font_units,
bool& has_root_font_units,
bool& has_line_height_units,
const ExecutionContext* context);
static bool ConsumeVariableReference(CSSParserTokenStream& stream,
bool& has_references,
bool& has_font_units,
bool& has_root_font_units,
bool& has_line_height_units,
const ExecutionContext* context) { … }
static bool ConsumeEnvVariableReference(CSSParserTokenStream& stream,
bool& has_references,
bool& has_font_units,
bool& has_root_font_units,
bool& has_line_height_units,
const ExecutionContext* context) { … }
static bool ConsumeAttributeReference(CSSParserTokenStream& stream,
bool& has_references,
bool& has_font_units,
bool& has_root_font_units,
bool& has_line_height_units,
const ExecutionContext* context) { … }
static bool ConsumeUnparsedValue(CSSParserTokenStream& stream,
bool restricted_value,
bool comma_ends_declaration,
bool& has_references,
bool& has_font_units,
bool& has_root_font_units,
bool& has_line_height_units,
const ExecutionContext* context) { … }
CSSVariableData* CSSVariableParser::ConsumeUnparsedDeclaration(
CSSParserTokenStream& stream,
bool allow_important_annotation,
bool is_animation_tainted,
bool must_contain_variable_reference,
bool restricted_value,
bool comma_ends_declaration,
bool& important,
const ExecutionContext* context) { … }
CSSUnparsedDeclarationValue* CSSVariableParser::ParseUniversalSyntaxValue(
StringView text,
const CSSParserContext& context,
bool is_animation_tainted) { … }
StringView CSSVariableParser::StripTrailingWhitespaceAndComments(
StringView text) { … }
}