1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 18:28:10 +00:00
serenity/Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.h
Sam Atkins 82d12b170a LibWeb: Merge CSS Parser's QualifiedStyleRule and AtStyleRule
AtStyleRule being a subclass of QualifiedStyleRule was causing
problems when trying to distinguish between them. Combining them
and then distinguishing between them with a Type enum makes that
check simpler, and is in line with how similar checks are done
elsewhere in the parser.
2021-07-11 23:19:56 +02:00

35 lines
668 B
C++

/*
* Copyright (c) 2020-2021, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/CSS/Parser/StyleDeclarationRule.h>
#include <LibWeb/CSS/Parser/StyleRule.h>
namespace Web::CSS {
class DeclarationOrAtRule {
friend class Parser;
public:
explicit DeclarationOrAtRule(RefPtr<StyleRule> at);
explicit DeclarationOrAtRule(StyleDeclarationRule declaration);
~DeclarationOrAtRule();
enum class DeclarationType {
At,
Declaration,
};
String to_string() const;
private:
DeclarationType m_type;
RefPtr<StyleRule> m_at;
StyleDeclarationRule m_declaration;
};
}