Serenity Operating System
at master 35 lines 583 B view raw
1/* 2 * Copyright (c) 2022, the SerenityOS developers. 3 * 4 * SPDX-License-Identifier: BSD-2-Clause 5 */ 6 7#pragma once 8 9#include <LibWeb/CSS/StyleValue.h> 10 11namespace Web::CSS { 12 13class Clip { 14public: 15 enum class Type { 16 Auto, 17 Rect 18 }; 19 20 Clip(Type type, EdgeRect edge_rect); 21 Clip(EdgeRect edge_rect); 22 23 static Clip make_auto(); 24 25 bool is_auto() const { return m_type == Type::Auto; } 26 bool is_rect() const { return m_type == Type::Rect; } 27 28 EdgeRect to_rect() const { return m_edge_rect; } 29 30private: 31 Type m_type; 32 EdgeRect m_edge_rect; 33}; 34 35}