Remove special-casing anonymous box in PseudoElement::exposed_in_non_ua_sheets. r?heycam draft
authorXidorn Quan <me@upsuper.org>
Mon, 10 Jul 2017 20:02:45 +1000
changeset 606466 f982ef87e7b7091d2b1ad2de90a4d9b790c06583
parent 606465 8a621554e75b0615f741c22c1b937a8c4a94a361
child 606467 a4bfda6861dd85f64f056d47e48a4d2eef82ee8a
push id67706
push userxquan@mozilla.com
push dateMon, 10 Jul 2017 23:54:14 +0000
reviewersheycam
milestone56.0a1
Remove special-casing anonymous box in PseudoElement::exposed_in_non_ua_sheets. r?heycam MozReview-Commit-ID: 8gS4PGm6Xyf
servo/components/style/gecko/pseudo_element.rs
servo/components/style/gecko/pseudo_element_definition.mako.rs
--- 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_ {