mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
LibWeb: Implement popover methods
Implements basics of showPopover, hidePopover and togglePopover.
This commit is contained in:
committed by
Tim Ledbetter
parent
b17bbe6d1f
commit
eb1c60f37b
@@ -738,6 +738,16 @@ static inline bool matches_pseudo_class(CSS::Selector::SimpleSelector::PseudoCla
|
||||
// FIXME: fullscreen elements are also modal.
|
||||
return false;
|
||||
}
|
||||
case CSS::PseudoClass::PopoverOpen: {
|
||||
// https://html.spec.whatwg.org/#selector-popover-open
|
||||
// The :popover-open pseudo-class is defined to match any HTML element whose popover attribute is not in the no popover state and whose popover visibility state is showing.
|
||||
if (is<HTML::HTMLElement>(element) && element.has_attribute(HTML::AttributeNames::popover)) {
|
||||
auto& html_element = static_cast<HTML::HTMLElement const&>(element);
|
||||
return html_element.popover_visibility_state() == HTML::HTMLElement::PopoverVisibilityState::Showing;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user