#include "third_party/blink/renderer/core/css/parser/media_query_parser.h"
#include "third_party/blink/renderer/core/css/media_feature_names.h"
#include "third_party/blink/renderer/core/css/parser/css_parser_context.h"
#include "third_party/blink/renderer/core/css/parser/css_tokenizer.h"
#include "third_party/blink/renderer/core/css/parser/css_variable_parser.h"
#include "third_party/blink/renderer/core/css/properties/css_parsing_utils.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/execution_context/security_context.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/html/parser/html_parser_idioms.h"
#include "third_party/blink/renderer/core/media_type_names.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
namespace blink {
AtIdent;
ConsumeAnyValue;
ConsumeIfDelimiter;
ConsumeIfIdent;
namespace {
class MediaQueryFeatureSet : public MediaQueryParser::FeatureSet { … };
}
MediaQuerySet* MediaQueryParser::ParseMediaQuerySet(
const String& query_string,
const ExecutionContext* execution_context) { … }
MediaQuerySet* MediaQueryParser::ParseMediaQuerySet(
CSSParserTokenRange range,
const CSSParserTokenOffsets& offsets,
const ExecutionContext* execution_context) { … }
MediaQuerySet* MediaQueryParser::ParseMediaQuerySetInMode(
CSSParserTokenRange range,
const CSSParserTokenOffsets& offsets,
CSSParserMode mode,
const ExecutionContext* execution_context) { … }
MediaQuerySet* MediaQueryParser::ParseMediaCondition(
CSSParserTokenRange range,
const CSSParserTokenOffsets& offsets,
const ExecutionContext* execution_context) { … }
MediaQueryParser::MediaQueryParser(ParserType parser_type,
CSSParserMode mode,
const ExecutionContext* execution_context,
SyntaxLevel syntax_level)
: … { … }
MediaQueryParser::~MediaQueryParser() = default;
namespace {
bool IsRestrictorOrLogicalOperator(const CSSParserToken& token) { … }
bool ConsumeUntilCommaInclusive(CSSParserTokenRange& range) { … }
bool IsComparisonDelimiter(UChar c) { … }
CSSParserTokenRange ConsumeUntilComparisonOrColon(CSSParserTokenRange& range) { … }
bool IsLtLe(MediaQueryOperator op) { … }
bool IsGtGe(MediaQueryOperator op) { … }
}
MediaQuery::RestrictorType MediaQueryParser::ConsumeRestrictor(
CSSParserTokenRange& range) { … }
String MediaQueryParser::ConsumeType(CSSParserTokenRange& range) { … }
MediaQueryOperator MediaQueryParser::ConsumeComparison(
CSSParserTokenRange& range) { … }
String MediaQueryParser::ConsumeAllowedName(CSSParserTokenRange& range,
const FeatureSet& feature_set) { … }
String MediaQueryParser::ConsumeUnprefixedName(CSSParserTokenRange& range,
const FeatureSet& feature_set) { … }
const MediaQueryExpNode* MediaQueryParser::ParseNameValueComparison(
CSSParserTokenRange lhs,
MediaQueryOperator op,
CSSParserTokenRange rhs,
const CSSParserTokenOffsets& offsets,
NameAffinity name_affinity,
const FeatureSet& feature_set) { … }
const MediaQueryExpNode* MediaQueryParser::ConsumeFeature(
CSSParserTokenRange& range,
const CSSParserTokenOffsets& offsets,
const FeatureSet& feature_set) { … }
const MediaQueryExpNode* MediaQueryParser::ConsumeCondition(
CSSParserTokenRange& range,
const CSSParserTokenOffsets& offsets,
ConditionMode mode) { … }
const MediaQueryExpNode* MediaQueryParser::ConsumeInParens(
CSSParserTokenRange& range,
const CSSParserTokenOffsets& offsets) { … }
const MediaQueryExpNode* MediaQueryParser::ConsumeGeneralEnclosed(
CSSParserTokenRange& range) { … }
MediaQuerySet* MediaQueryParser::ConsumeSingleCondition(
CSSParserTokenRange range,
const CSSParserTokenOffsets& offsets) { … }
MediaQuery* MediaQueryParser::ConsumeQuery(
CSSParserTokenRange& range,
const CSSParserTokenOffsets& offsets) { … }
MediaQuerySet* MediaQueryParser::ParseImpl(
CSSParserTokenRange range,
const CSSParserTokenOffsets& offsets) { … }
}