/* * Copyright (c) 2022-2023, MacDue * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::CSS { // FIXME: Named PositionValue to avoid conflicts with enums, but this represents a struct PositionValue { enum class HorizontalPreset { Left, Center, Right }; enum class VerticalPreset { Top, Center, Bottom }; enum class HorizontalEdge { Left, Right }; enum class VerticalEdge { Top, Bottom }; static PositionValue center() { return PositionValue { HorizontalPreset::Center, VerticalPreset::Center }; } Variant horizontal_position { HorizontalPreset::Left }; Variant vertical_position { VerticalPreset::Top }; HorizontalEdge x_relative_to { HorizontalEdge::Left }; VerticalEdge y_relative_to { VerticalEdge::Top }; CSSPixelPoint resolved(Layout::Node const& node, CSSPixelRect const& rect) const; ErrorOr serialize(StringBuilder&) const; bool operator==(PositionValue const&) const = default; }; }