chromium/third_party/blink/renderer/core/css/media_query_exp.cc

/*
 * CSS Media Query
 *
 * Copyright (C) 2006 Kimmo Kinnunen <[email protected]>.
 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 * Copyright (C) 2013 Apple Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "third_party/blink/renderer/core/css/media_query_exp.h"

#include "third_party/blink/renderer/core/css/css_math_expression_node.h"
#include "third_party/blink/renderer/core/css/css_math_function_value.h"
#include "third_party/blink/renderer/core/css/css_numeric_literal_value.h"
#include "third_party/blink/renderer/core/css/css_primitive_value.h"
#include "third_party/blink/renderer/core/css/css_unparsed_declaration_value.h"
#include "third_party/blink/renderer/core/css/parser/css_parser_context.h"
#include "third_party/blink/renderer/core/css/parser/css_parser_impl.h"
#include "third_party/blink/renderer/core/css/parser/css_parser_token_range.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/html/parser/html_parser_idioms.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/wtf/decimal.h"
#include "third_party/blink/renderer/platform/wtf/text/string_buffer.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"

namespace blink {

kMaxDeviceAspectRatioMediaFeature;
kMaxDevicePixelRatioMediaFeature;
kMinDeviceAspectRatioMediaFeature;

static inline bool FeatureWithValidIdent(const String& media_feature,
                                         CSSValueID ident,
                                         const CSSParserContext& context) {}

static inline bool FeatureWithValidLength(const String& media_feature,
                                          const CSSPrimitiveValue* value) {}

static inline bool FeatureWithValidDensity(const String& media_feature,
                                           const CSSPrimitiveValue* value) {}

static inline bool FeatureExpectingInteger(const String& media_feature,
                                           const CSSParserContext& context) {}

static inline bool FeatureWithInteger(const String& media_feature,
                                      const CSSPrimitiveValue* value,
                                      const CSSParserContext& context) {}

static inline bool FeatureWithNumber(const String& media_feature,
                                     const CSSPrimitiveValue* value) {}

static inline bool FeatureWithZeroOrOne(const String& media_feature,
                                        const CSSPrimitiveValue* value) {}

static inline bool FeatureWithAspectRatio(const String& media_feature) {}

bool MediaQueryExp::IsViewportDependent() const {}

bool MediaQueryExp::IsDeviceDependent() const {}

bool MediaQueryExp::IsWidthDependent() const {}

bool MediaQueryExp::IsHeightDependent() const {}

bool MediaQueryExp::IsInlineSizeDependent() const {}

bool MediaQueryExp::IsBlockSizeDependent() const {}

MediaQueryExp::MediaQueryExp(const MediaQueryExp& other)
    :{}

MediaQueryExp::MediaQueryExp(const String& media_feature,
                             const MediaQueryExpValue& value)
    :{}

MediaQueryExp::MediaQueryExp(const String& media_feature,
                             const MediaQueryExpBounds& bounds)
    :{}

MediaQueryExp MediaQueryExp::Create(const String& media_feature,
                                    CSSParserTokenRange& range,
                                    const CSSParserTokenOffsets& offsets,
                                    const CSSParserContext& context) {}

std::optional<MediaQueryExpValue> MediaQueryExpValue::Consume(
    const String& media_feature,
    CSSParserTokenRange& range,
    const CSSParserTokenOffsets& offsets,
    const CSSParserContext& context) {}

namespace {

const char* MediaQueryOperatorToString(MediaQueryOperator op) {}

}  // namespace

MediaQueryExp MediaQueryExp::Create(const String& media_feature,
                                    const MediaQueryExpBounds& bounds) {}

MediaQueryExp::~MediaQueryExp() = default;

void MediaQueryExp::Trace(Visitor* visitor) const {}

bool MediaQueryExp::operator==(const MediaQueryExp& other) const {}

String MediaQueryExp::Serialize() const {}

unsigned MediaQueryExp::GetUnitFlags() const {}

String MediaQueryExpValue::CssText() const {}

unsigned MediaQueryExpValue::GetUnitFlags() const {}

String MediaQueryExpNode::Serialize() const {}

const MediaQueryExpNode* MediaQueryExpNode::Not(
    const MediaQueryExpNode* operand) {}

const MediaQueryExpNode* MediaQueryExpNode::Nested(
    const MediaQueryExpNode* operand) {}

const MediaQueryExpNode* MediaQueryExpNode::Function(
    const MediaQueryExpNode* operand,
    const AtomicString& name) {}

const MediaQueryExpNode* MediaQueryExpNode::And(
    const MediaQueryExpNode* left,
    const MediaQueryExpNode* right) {}

const MediaQueryExpNode* MediaQueryExpNode::Or(const MediaQueryExpNode* left,
                                               const MediaQueryExpNode* right) {}

bool MediaQueryFeatureExpNode::IsViewportDependent() const {}

bool MediaQueryFeatureExpNode::IsDeviceDependent() const {}

unsigned MediaQueryFeatureExpNode::GetUnitFlags() const {}

bool MediaQueryFeatureExpNode::IsWidthDependent() const {}

bool MediaQueryFeatureExpNode::IsHeightDependent() const {}

bool MediaQueryFeatureExpNode::IsInlineSizeDependent() const {}

bool MediaQueryFeatureExpNode::IsBlockSizeDependent() const {}

void MediaQueryFeatureExpNode::SerializeTo(StringBuilder& builder) const {}

void MediaQueryFeatureExpNode::CollectExpressions(
    HeapVector<MediaQueryExp>& result) const {}

MediaQueryExpNode::FeatureFlags MediaQueryFeatureExpNode::CollectFeatureFlags()
    const {}

void MediaQueryFeatureExpNode::Trace(Visitor* visitor) const {}

void MediaQueryUnaryExpNode::Trace(Visitor* visitor) const {}

void MediaQueryUnaryExpNode::CollectExpressions(
    HeapVector<MediaQueryExp>& result) const {}

MediaQueryExpNode::FeatureFlags MediaQueryUnaryExpNode::CollectFeatureFlags()
    const {}

void MediaQueryNestedExpNode::SerializeTo(StringBuilder& builder) const {}

void MediaQueryFunctionExpNode::SerializeTo(StringBuilder& builder) const {}

MediaQueryExpNode::FeatureFlags MediaQueryFunctionExpNode::CollectFeatureFlags()
    const {}

void MediaQueryNotExpNode::SerializeTo(StringBuilder& builder) const {}

void MediaQueryCompoundExpNode::Trace(Visitor* visitor) const {}

void MediaQueryCompoundExpNode::CollectExpressions(
    HeapVector<MediaQueryExp>& result) const {}

MediaQueryExpNode::FeatureFlags MediaQueryCompoundExpNode::CollectFeatureFlags()
    const {}

void MediaQueryAndExpNode::SerializeTo(StringBuilder& builder) const {}

void MediaQueryOrExpNode::SerializeTo(StringBuilder& builder) const {}

void MediaQueryUnknownExpNode::SerializeTo(StringBuilder& builder) const {}

void MediaQueryUnknownExpNode::CollectExpressions(
    HeapVector<MediaQueryExp>&) const {}

MediaQueryExpNode::FeatureFlags MediaQueryUnknownExpNode::CollectFeatureFlags()
    const {}

}  // namespace blink