summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Militzer <emil.militzer@posteo.de>2023-04-26 20:28:01 +0200
committerAndreas Kling <kling@serenityos.org>2023-05-02 20:27:28 +0200
commit81c11bc6f25267feb8476ca3e482c9d34a7b6b3a (patch)
tree03df4d6997700f4e2405961a61660c5fc645bd97
parentb74940ffb72435ca2ae93258d4016c59fcecaf58 (diff)
downloadserenity-81c11bc6f25267feb8476ca3e482c9d34a7b6b3a.zip
LibWeb: Expose list_item value in CSS display
-rw-r--r--Userland/Libraries/LibWeb/CSS/Display.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Display.h b/Userland/Libraries/LibWeb/CSS/Display.h
index 5d041b6285..ff65f75778 100644
--- a/Userland/Libraries/LibWeb/CSS/Display.h
+++ b/Userland/Libraries/LibWeb/CSS/Display.h
@@ -70,6 +70,11 @@ public:
None,
};
+ enum class ListItem {
+ No,
+ Yes,
+ };
+
enum class Type {
OutsideAndInside,
Internal,
@@ -107,7 +112,14 @@ public:
bool is_block_outside() const { return is_outside_and_inside() && outside() == Outside::Block; }
bool is_inline_outside() const { return is_outside_and_inside() && outside() == Outside::Inline; }
bool is_inline_block() const { return is_inline_outside() && is_flow_root_inside(); }
- bool is_list_item() const { return is_outside_and_inside() && m_value.outside_inside.list_item == ListItem::Yes; }
+
+ ListItem list_item() const
+ {
+ VERIFY(is_outside_and_inside());
+ return m_value.outside_inside.list_item;
+ }
+
+ bool is_list_item() const { return is_outside_and_inside() && list_item() == ListItem::Yes; }
Inside inside() const
{
@@ -142,11 +154,6 @@ public:
InlineTable,
};
- enum class ListItem {
- No,
- Yes,
- };
-
static Display from_short(Short short_)
{
switch (short_) {