mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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.
This commit is contained in:
parent
21926e0008
commit
2f21070701
2 changed files with 2 additions and 8 deletions
|
@ -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
|
/// Returns whether the given ElementState bit is relied upon by a selector
|
||||||
/// of some rule in the stylist.
|
/// of some rule in the stylist.
|
||||||
pub fn has_state_dependency(&self, state: ElementState) -> bool {
|
pub fn has_state_dependency(&self, state: ElementState) -> bool {
|
||||||
|
|
|
@ -4090,13 +4090,13 @@ pub extern "C" fn Servo_StyleSet_HasStateDependency(
|
||||||
let state = ElementState::from_bits_truncate(state);
|
let state = ElementState::from_bits_truncate(state);
|
||||||
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
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 {
|
if !has_dep {
|
||||||
// TODO(emilio): Consider optimizing this storing attribute
|
// TODO(emilio): Consider optimizing this storing attribute
|
||||||
// dependencies from UA sheets separately, so we could optimize
|
// dependencies from UA sheets separately, so we could optimize
|
||||||
// the above lookup if cut_off_inheritance is true.
|
// the above lookup if cut_off_inheritance is true.
|
||||||
element.each_xbl_stylist(|stylist| {
|
element.each_xbl_stylist(|stylist| {
|
||||||
has_dep = has_dep || stylist.might_have_state_dependency(state);
|
has_dep = has_dep || stylist.has_state_dependency(state);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue