LibWeb: Include leading colons in KeyframeEffect::pseudo_element()

This commit is contained in:
Matthew Olsson 2024-05-27 06:44:46 -07:00 committed by Andreas Kling
parent 854d02fe10
commit 7bd62809a9
2 changed files with 8 additions and 1 deletions

View file

@ -736,6 +736,13 @@ void KeyframeEffect::set_target(DOM::Element* target)
m_target_element = target;
}
Optional<String> KeyframeEffect::pseudo_element() const
{
if (!m_target_pseudo_selector.has_value())
return {};
return MUST(String::formatted("::{}", m_target_pseudo_selector->name()));
}
// https://www.w3.org/TR/web-animations-1/#dom-keyframeeffect-pseudoelement
WebIDL::ExceptionOr<void> KeyframeEffect::set_pseudo_element(Optional<String> pseudo_element)
{

View file

@ -88,7 +88,7 @@ public:
void set_target(DOM::Element* target);
// JS bindings
Optional<StringView> pseudo_element() const { return m_target_pseudo_selector->name(); }
Optional<String> pseudo_element() const;
WebIDL::ExceptionOr<void> set_pseudo_element(Optional<String>);
Optional<CSS::Selector::PseudoElement::Type> pseudo_element_type() const;