mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Bug 1364412: Expose pseudo-element flags, and properly reject pseudos in non-UA sheets. r=bholley
MozReview-Commit-ID: KYC1ywfI7Lg Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
5820e3ecac
commit
1e0edf4909
7 changed files with 742 additions and 332 deletions
|
@ -9,7 +9,7 @@
|
|||
//! need to update the checked-in files for Servo.
|
||||
|
||||
use cssparser::ToCss;
|
||||
use gecko_bindings::structs::CSSPseudoElementType;
|
||||
use gecko_bindings::structs::{self, CSSPseudoElementType};
|
||||
use selector_parser::PseudoElementCascadeType;
|
||||
use std::fmt;
|
||||
use string_cache::Atom;
|
||||
|
@ -61,6 +61,26 @@ impl PseudoElement {
|
|||
pub fn is_lazy(&self) -> bool {
|
||||
!self.is_eager() && !self.is_precomputed()
|
||||
}
|
||||
|
||||
/// Whether this pseudo-element is web-exposed.
|
||||
pub fn exposed_in_non_ua_sheets(&self) -> bool {
|
||||
if self.is_anon_box() {
|
||||
return false;
|
||||
}
|
||||
|
||||
(self.flags() & structs::CSS_PSEUDO_ELEMENT_UA_SHEET_ONLY) == 0
|
||||
}
|
||||
|
||||
/// Whether this pseudo-element supports user action selectors.
|
||||
pub fn supports_user_action_state(&self) -> bool {
|
||||
(self.flags() & structs::CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE) != 0
|
||||
}
|
||||
|
||||
/// Whether this pseudo-element is precomputed.
|
||||
#[inline]
|
||||
pub fn is_precomputed(&self) -> bool {
|
||||
self.is_anon_box()
|
||||
}
|
||||
}
|
||||
|
||||
impl ToCss for PseudoElement {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue