From 48c6cf92e310005161e455e6e689e3610375f01d Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Mon, 7 Feb 2022 17:19:33 +0000 Subject: [PATCH] LibWeb: Add `pointer-events: all` This is basically the same as `auto` in the spec, so let's just treat them as identical for now. Gets rid of some Discord CSS parser spam. :^) --- Userland/Libraries/LibWeb/CSS/Properties.json | 1 + Userland/Libraries/LibWeb/CSS/StyleProperties.cpp | 2 ++ Userland/Libraries/LibWeb/CSS/StyleValue.h | 1 + Userland/Libraries/LibWeb/Page/EventHandler.cpp | 2 ++ 4 files changed, 6 insertions(+) diff --git a/Userland/Libraries/LibWeb/CSS/Properties.json b/Userland/Libraries/LibWeb/CSS/Properties.json index 629f71faa2..5a056133fe 100644 --- a/Userland/Libraries/LibWeb/CSS/Properties.json +++ b/Userland/Libraries/LibWeb/CSS/Properties.json @@ -1141,6 +1141,7 @@ "initial": "auto", "valid-identifiers": [ "auto", + "all", "none" ] }, diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp index f16ad5c25d..5a998edce0 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp @@ -415,6 +415,8 @@ Optional StyleProperties::pointer_events() const switch (value.value()->to_identifier()) { case CSS::ValueID::Auto: return CSS::PointerEvents::Auto; + case CSS::ValueID::All: + return CSS::PointerEvents::All; case CSS::ValueID::None: return CSS::PointerEvents::None; default: diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h index 35f3954b22..4999886f53 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h @@ -264,6 +264,7 @@ enum class WhiteSpace { enum class PointerEvents { Auto, + All, None }; diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp index 2facde87d2..e45ab08d9a 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp @@ -200,6 +200,7 @@ bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned butt return false; auto pointer_events = result.layout_node->computed_values().pointer_events(); + // FIXME: Handle other values for pointer-events. if (pointer_events == CSS::PointerEvents::None) return false; @@ -335,6 +336,7 @@ bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned butt } auto pointer_events = result.layout_node->computed_values().pointer_events(); + // FIXME: Handle other values for pointer-events. if (pointer_events == CSS::PointerEvents::None) return false;