summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-03-21 15:42:57 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-21 15:42:57 +0100
commitdf8ef03957d5a9918562af3c039b83433aff7db3 (patch)
tree8ca91a6eadbec318ff91184e3551aeeea17a632a /Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
parent01662b232029e2909bd27b78da2abd10f65f8242 (diff)
downloadserenity-df8ef03957d5a9918562af3c039b83433aff7db3.zip
LibWeb: Pick up the CSS "visibility" property an honor it when painting
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/StyleProperties.cpp')
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleProperties.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
index 3ed1a06945..aaf84c44a6 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
+++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
@@ -698,6 +698,23 @@ Optional<CSS::Cursor> StyleProperties::cursor() const
}
}
+Optional<CSS::Visibility> StyleProperties::visibility() const
+{
+ auto value = property(CSS::PropertyID::Visibility);
+ if (!value.has_value() || !value.value()->is_identifier())
+ return {};
+ switch (value.value()->to_identifier()) {
+ case CSS::ValueID::Visible:
+ return CSS::Visibility::Visible;
+ case CSS::ValueID::Hidden:
+ return CSS::Visibility::Hidden;
+ case CSS::ValueID::Collapse:
+ return CSS::Visibility::Collapse;
+ default:
+ return {};
+ }
+}
+
CSS::Display StyleProperties::display() const
{
auto value = property(CSS::PropertyID::Display);