mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-31 14:48:17 +00:00
LibWeb/DOM: Don't crash getting custom properties from invalid pseudos
This commit is contained in:
parent
9079be850b
commit
97ad1ea7e0
Notes:
github-actions[bot]
2025-07-09 15:46:13 +00:00
Author: https://github.com/AtkinsSJ
Commit: 97ad1ea7e0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5226
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 4 additions and 1 deletions
|
@ -3026,10 +3026,13 @@ void Element::set_custom_properties(Optional<CSS::PseudoElement> pseudo_element,
|
|||
|
||||
HashMap<FlyString, CSS::StyleProperty> const& Element::custom_properties(Optional<CSS::PseudoElement> pseudo_element) const
|
||||
{
|
||||
static HashMap<FlyString, CSS::StyleProperty> s_empty_custom_properties;
|
||||
|
||||
if (!pseudo_element.has_value())
|
||||
return m_custom_properties;
|
||||
|
||||
VERIFY(CSS::Selector::PseudoElementSelector::is_known_pseudo_element_type(pseudo_element.value()));
|
||||
if (!CSS::Selector::PseudoElementSelector::is_known_pseudo_element_type(pseudo_element.value()))
|
||||
return s_empty_custom_properties;
|
||||
|
||||
return ensure_pseudo_element(pseudo_element.value()).custom_properties();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue