style: Add popover attribute and part of basic popover functionality

Starts to add part of the basic functionality for popover. Including
[1] :open & :closed CSS pseudo class
[2] showPopover(), hidePopover() and togglePopover() interfaces. Much of the
functionality is still to-do.
[3] PopoverData interface

Differential Revision: https://phabricator.services.mozilla.com/D171719
This commit is contained in:
Ziran Sun 2023-03-10 10:52:20 +00:00 committed by Martin Robinson
parent 3ded7ff273
commit 29a9f0da46
3 changed files with 7 additions and 0 deletions

View file

@ -141,6 +141,9 @@ impl NonTSPseudoClass {
/// Returns whether the pseudo-class is enabled in content sheets.
#[inline]
fn is_enabled_in_content(&self) -> bool {
if matches!(*self, Self::Open | Self::Closed) {
return static_prefs::pref!("dom.element.popover.enabled");
}
!self.has_any_flag(NonTSPseudoClassFlag::PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME)
}