mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-01 14:42:05 +00:00
The main motivation here is that the CSS Parser needs to know about PageSelectorList so that we can parse one in `CSSPageRule::set_selector_text()`. Including all of `CSSPageRule.h` there would pull in a lot of other headers that aren't needed.
38 lines
818 B
C++
38 lines
818 B
C++
/*
|
|
* Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/FlyString.h>
|
|
#include <AK/Optional.h>
|
|
#include <AK/Vector.h>
|
|
|
|
namespace Web::CSS {
|
|
|
|
enum class PagePseudoClass : u8 {
|
|
Left,
|
|
Right,
|
|
First,
|
|
Blank,
|
|
};
|
|
Optional<PagePseudoClass> page_pseudo_class_from_string(StringView);
|
|
StringView to_string(PagePseudoClass);
|
|
|
|
class PageSelector {
|
|
public:
|
|
PageSelector(Optional<FlyString> name, Vector<PagePseudoClass>);
|
|
|
|
Optional<FlyString> name() const { return m_name; }
|
|
Vector<PagePseudoClass> const& pseudo_classes() const { return m_pseudo_classes; }
|
|
String serialize() const;
|
|
|
|
private:
|
|
Optional<FlyString> m_name;
|
|
Vector<PagePseudoClass> m_pseudo_classes;
|
|
};
|
|
using PageSelectorList = Vector<PageSelector>;
|
|
|
|
}
|