/* * Copyright (c) 2018-2020, Andreas Kling * Copyright (c) 2021, Tobias Christiansen * Copyright (c) 2021-2023, Sam Atkins * Copyright (c) 2022-2023, MacDue * * SPDX-License-Identifier: BSD-2-Clause */ #include "PositionStyleValue.h" namespace Web::CSS { ErrorOr PositionStyleValue::to_string() const { auto to_string = [](PositionEdge edge) { switch (edge) { case PositionEdge::Left: return "left"; case PositionEdge::Right: return "right"; case PositionEdge::Top: return "top"; case PositionEdge::Bottom: return "bottom"; } VERIFY_NOT_REACHED(); }; return String::formatted("{} {} {} {}", to_string(m_properties.edge_x), TRY(m_properties.offset_x.to_string()), to_string(m_properties.edge_y), TRY(m_properties.offset_y.to_string())); } }