From 2f21070701c9f7b795040cede4449f943034f59f Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Thu, 5 Oct 2017 09:43:57 +0800 Subject: [PATCH] style: Remove Stylist::might_have_state_dependency. We always know for sure whether we have a dependency on particular event state bits, so just use has_state_dependency. --- components/style/stylist.rs | 6 ------ ports/geckolib/glue.rs | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/components/style/stylist.rs b/components/style/stylist.rs index 2657e1dffdb..ed8f83c1f7a 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -625,12 +625,6 @@ impl Stylist { } } - /// Returns whether the given ElementState bit might be relied upon by a - /// selector of some rule in the stylist. - pub fn might_have_state_dependency(&self, state: ElementState) -> bool { - self.has_state_dependency(state) - } - /// Returns whether the given ElementState bit is relied upon by a selector /// of some rule in the stylist. pub fn has_state_dependency(&self, state: ElementState) -> bool { diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 98b7cde6866..45eb85d839e 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -4090,13 +4090,13 @@ pub extern "C" fn Servo_StyleSet_HasStateDependency( let state = ElementState::from_bits_truncate(state); let data = PerDocumentStyleData::from_ffi(raw_data).borrow(); - let mut has_dep = data.stylist.might_have_state_dependency(state); + let mut has_dep = data.stylist.has_state_dependency(state); if !has_dep { // TODO(emilio): Consider optimizing this storing attribute // dependencies from UA sheets separately, so we could optimize // the above lookup if cut_off_inheritance is true. element.each_xbl_stylist(|stylist| { - has_dep = has_dep || stylist.might_have_state_dependency(state); + has_dep = has_dep || stylist.has_state_dependency(state); }); }