mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-05 01:10:24 +00:00
LibWeb/Animations: Make KeyframeEffect work with AbstractElements
This commit is contained in:
committed by
Andreas Kling
parent
05e449d32a
commit
ba86b81c1a
Notes:
github-actions[bot]
2025-12-03 12:31:27 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/ba86b81c1a2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6998
@@ -799,6 +799,19 @@ WebIDL::ExceptionOr<void> KeyframeEffect::set_pseudo_element(Optional<String> va
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Optional<DOM::AbstractElement> KeyframeEffect::target_abstract_element() const
|
||||||
|
{
|
||||||
|
if (m_target_element)
|
||||||
|
return DOM::AbstractElement { *m_target_element, pseudo_element_type() };
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
void KeyframeEffect::set_target(DOM::AbstractElement abstract_element)
|
||||||
|
{
|
||||||
|
set_target(&abstract_element.element());
|
||||||
|
m_target_pseudo_selector = abstract_element.pseudo_element().map([](auto it) { return CSS::Selector::PseudoElementSelector { it }; });
|
||||||
|
}
|
||||||
|
|
||||||
Optional<CSS::PseudoElement> KeyframeEffect::pseudo_element_type() const
|
Optional<CSS::PseudoElement> KeyframeEffect::pseudo_element_type() const
|
||||||
{
|
{
|
||||||
if (!m_target_pseudo_selector.has_value())
|
if (!m_target_pseudo_selector.has_value())
|
||||||
|
|||||||
@@ -93,6 +93,9 @@ public:
|
|||||||
Optional<String> pseudo_element() const;
|
Optional<String> pseudo_element() const;
|
||||||
WebIDL::ExceptionOr<void> set_pseudo_element(Optional<String>);
|
WebIDL::ExceptionOr<void> set_pseudo_element(Optional<String>);
|
||||||
|
|
||||||
|
Optional<DOM::AbstractElement> target_abstract_element() const;
|
||||||
|
void set_target(DOM::AbstractElement);
|
||||||
|
|
||||||
Optional<CSS::PseudoElement> pseudo_element_type() const;
|
Optional<CSS::PseudoElement> pseudo_element_type() const;
|
||||||
void set_pseudo_element(Optional<CSS::Selector::PseudoElementSelector> pseudo_element) { m_target_pseudo_selector = pseudo_element; }
|
void set_pseudo_element(Optional<CSS::Selector::PseudoElementSelector> pseudo_element) { m_target_pseudo_selector = pseudo_element; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user