Remove special-casing anonymous box in PseudoElement::exposed_in_non_ua_sheets. r?heycam
draft
Remove special-casing anonymous box in PseudoElement::exposed_in_non_ua_sheets. r?heycam
MozReview-Commit-ID: 8gS4PGm6Xyf
--- a/servo/components/style/gecko/pseudo_element.rs
+++ b/servo/components/style/gecko/pseudo_element.rs
@@ -86,20 +86,16 @@ impl PseudoElement {
/// Whether this pseudo-element is lazily-cascaded.
#[inline]
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
}
--- a/servo/components/style/gecko/pseudo_element_definition.mako.rs
+++ b/servo/components/style/gecko/pseudo_element_definition.mako.rs
@@ -60,23 +60,22 @@ impl PseudoElement {
${" | ".join(map(lambda name: "PseudoElement::{}".format(name), EAGER_PSEUDOS))})
}
/// Gets the flags associated to this pseudo-element, or 0 if it's an
/// anonymous box.
pub fn flags(&self) -> u32 {
match *self {
% for pseudo in PSEUDOS:
- PseudoElement::${pseudo.capitalized()} => {
- % if pseudo.is_anon_box():
- 0
- % else:
- structs::SERVO_CSS_PSEUDO_ELEMENT_FLAGS_${pseudo.original_ident}
- % endif
- }
+ PseudoElement::${pseudo.capitalized()} =>
+ % if pseudo.is_anon_box():
+ structs::CSS_PSEUDO_ELEMENT_UA_SHEET_ONLY,
+ % else:
+ structs::SERVO_CSS_PSEUDO_ELEMENT_FLAGS_${pseudo.original_ident},
+ % endif
% endfor
}
}
/// Construct a pseudo-element from a `CSSPseudoElementType`.
#[inline]
pub fn from_pseudo_type(type_: CSSPseudoElementType) -> Option<Self> {
match type_ {