1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:47:34 +00:00

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. :^)
This commit is contained in:
Sam Atkins 2022-02-07 17:19:33 +00:00 committed by Andreas Kling
parent 8aaab19e6b
commit 48c6cf92e3
4 changed files with 6 additions and 0 deletions

View file

@ -1141,6 +1141,7 @@
"initial": "auto",
"valid-identifiers": [
"auto",
"all",
"none"
]
},

View file

@ -415,6 +415,8 @@ Optional<CSS::PointerEvents> 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:

View file

@ -264,6 +264,7 @@ enum class WhiteSpace {
enum class PointerEvents {
Auto,
All,
None
};

View file

@ -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;