chromium/third_party/blink/renderer/core/style/computed_style_constants.h

/*
 * Copyright (C) 2000 Lars Knoll ([email protected])
 *           (C) 2000 Antti Koivisto ([email protected])
 *           (C) 2000 Dirk Mueller ([email protected])
 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
 * reserved.
 * Copyright (C) 2006 Graham Dennis ([email protected])
 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
 * (http://www.torchmobile.com/)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 *
 */

#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_STYLE_COMPUTED_STYLE_CONSTANTS_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_STYLE_COMPUTED_STYLE_CONSTANTS_H_

#include <cstddef>
#include <cstdint>
#include "base/check_op.h"
#include "third_party/blink/renderer/core/style/computed_style_base_constants.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"

namespace blink {

template <typename Enum>
inline bool EnumHasFlags(Enum v, Enum mask) {}

// Some enums are automatically generated in ComputedStyleBaseConstants

// TODO(sashab): Change these enums to enum classes with an unsigned underlying
// type. Enum classes provide better type safety, and forcing an unsigned
// underlying type prevents msvc from interpreting enums as negative numbers.
// See: crbug.com/628043

// Sides used when drawing borders and outlines. The values should run clockwise
// from top.
enum class BoxSide : unsigned {};

// Static pseudo styles. Dynamic ones are produced on the fly.
enum PseudoId : uint8_t {};

inline bool IsHighlightPseudoElement(PseudoId pseudo_id) {}

inline bool UsesHighlightPseudoInheritance(PseudoId pseudo_id) {}

inline bool IsTransitionPseudoElement(PseudoId pseudo_id) {}

inline bool PseudoElementHasArguments(PseudoId pseudo_id) {}

enum class OutlineIsAuto : bool {};

// Random visual rendering model attributes. Not inherited.

enum class EVerticalAlign : unsigned {};

enum class EFillAttachment : unsigned {};

// `EFillBox` is used for {-webkit-}background-clip, {-webkit-}mask-clip, and
// {-webkit-}mask-origin. Not all properties support all of these values.
//
// Background-clip (https://drafts.csswg.org/css-backgrounds/#background-clip)
// supports <visual-box> (border-box, padding-box, content-box), as well as the
// non-standard `text` value.
//
// Mask-clip (https://drafts.fxtf.org/css-masking/#the-mask-clip) supports
// <coord-box> (border-box, padding-box, content-box, fill-box, stroke-box,
// view-box), `no-clip`, as well as the non-standard `text` value.
//
// Mask-origin (https://drafts.fxtf.org/css-masking/#the-mask-origin) supports
// <coord-box> (border-box, padding-box, content-box, fill-box, stroke-box,
// view-box).
enum class EFillBox : unsigned {};

inline EFillBox EnclosingFillBox(EFillBox box_a, EFillBox box_b) {}

enum class EFillRepeat : unsigned {};

enum class EFillMaskMode : unsigned {};

enum class EFillLayerType : unsigned {};

// CSS3 Background Values
enum class EFillSizeType : unsigned {};

// CSS3 Background Position
enum class BackgroundEdgeOrigin : unsigned {};

// CSS3 Image Values
enum class QuoteType : unsigned {};

enum class EAnimPlayState : unsigned {};

enum class OffsetRotationType : unsigned {};

static const size_t kGridAutoFlowBits =;
enum InternalGridAutoFlowAlgorithm {};

enum InternalGridAutoFlowDirection {};

enum GridAutoFlow {};

static const size_t kContainmentBits =;
enum Containment {};
inline Containment operator|(Containment a, Containment b) {}
inline Containment& operator|=(Containment& a, Containment b) {}

static const size_t kContainerTypeBits =;
enum EContainerType {};
inline EContainerType operator|(EContainerType a, EContainerType b) {}
inline EContainerType& operator|=(EContainerType& a, EContainerType b) {}

static const size_t kTextUnderlinePositionBits =;
enum class TextUnderlinePosition : unsigned {};
inline TextUnderlinePosition operator|(TextUnderlinePosition a,
                                       TextUnderlinePosition b) {}
inline TextUnderlinePosition& operator|=(TextUnderlinePosition& a,
                                         TextUnderlinePosition b) {}

enum class ItemPosition : unsigned {};

enum class OverflowAlignment : unsigned {};

enum class ItemPositionType : unsigned {};

enum class ContentPosition : unsigned {};

enum class ContentDistributionType : unsigned {};

// Reasonable maximum to prevent insane font sizes from causing crashes on some
// platforms (such as Windows).
static const float kMaximumAllowedFontSize =;

enum class CSSBoxType : unsigned {};

enum class TextEmphasisPosition : unsigned {};

inline bool IsOver(TextEmphasisPosition position) {}

inline bool IsRight(TextEmphasisPosition position) {}

inline bool IsLeft(TextEmphasisPosition position) {}

enum class LineLogicalSide {};

constexpr size_t kScrollbarGutterBits =;
enum ScrollbarGutter {};
inline ScrollbarGutter operator|(ScrollbarGutter a, ScrollbarGutter b) {}
inline ScrollbarGutter& operator|=(ScrollbarGutter& a, ScrollbarGutter b) {}

enum class EBaselineShiftType : unsigned {};

enum EPaintOrderType : uint8_t {};

enum EPaintOrder {};

constexpr size_t kViewportUnitFlagBits =;
enum class ViewportUnitFlag {};

enum class TimelineAxis {};
enum class TimelineScroller {};

enum class CoordBox {};

// https://drafts.fxtf.org/css-masking/#typedef-geometry-box
enum class GeometryBox {};

// https://drafts.fxtf.org/css-masking/#typedef-compositing-operator
enum class CompositingOperator : unsigned {};

// https://drafts.csswg.org/css-anchor-position-1/#typedef-position-try-fallbacks-try-tactic
enum class TryTactic : uint8_t {};

// TODO(crbug.com/332933527): Support anchors-valid.
static const size_t kPositionVisibilityBits =;
enum class PositionVisibility : uint8_t {};
inline PositionVisibility operator|(PositionVisibility a,
                                    PositionVisibility b) {}
inline PositionVisibility& operator|=(PositionVisibility& a,
                                      PositionVisibility b) {}

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_STYLE_COMPUTED_STYLE_CONSTANTS_H_