summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.h
blob: 53ae1c0a4617434e238df48daa60b5e9a4589174 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Copyright (c) 2020-2021, SerenityOS developers
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibWeb/CSS/Parser/AtStyleRule.h>
#include <LibWeb/CSS/Parser/StyleDeclarationRule.h>

namespace Web::CSS {

class DeclarationOrAtRule {
    friend class Parser;

public:
    explicit DeclarationOrAtRule(AtStyleRule at);
    explicit DeclarationOrAtRule(StyleDeclarationRule declaration);
    ~DeclarationOrAtRule();

    enum class DeclarationType {
        At,
        Declaration,
    };

    String to_string() const;

private:
    DeclarationType m_type;
    AtStyleRule m_at;
    StyleDeclarationRule m_declaration;
};

}