mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Do not optimize out lazy pseudo rules if the main stylist doesn't have rules for it.
This could prevent an XBL binding to use some pseudo-elements fairly randomly. MozReview-Commit-ID: b44DO8qcfD Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
1162aed4e5
commit
d82e6926fc
1 changed files with 0 additions and 14 deletions
|
@ -964,12 +964,6 @@ impl Stylist {
|
|||
)
|
||||
}
|
||||
|
||||
fn has_rules_for_pseudo(&self, pseudo: &PseudoElement) -> bool {
|
||||
self.cascade_data
|
||||
.iter_origins()
|
||||
.any(|(d, _)| d.has_rules_for_pseudo(pseudo))
|
||||
}
|
||||
|
||||
/// Computes the cascade inputs for a lazily-cascaded pseudo-element.
|
||||
///
|
||||
/// See the documentation on lazy pseudo-elements in
|
||||
|
@ -988,10 +982,6 @@ impl Stylist {
|
|||
let pseudo = pseudo.canonical();
|
||||
debug_assert!(pseudo.is_lazy());
|
||||
|
||||
if !self.has_rules_for_pseudo(&pseudo) {
|
||||
return CascadeInputs::default()
|
||||
}
|
||||
|
||||
// Apply the selector flags. We should be in sequential mode
|
||||
// already, so we can directly apply the parent flags.
|
||||
let mut set_selector_flags = |element: &E, flags: ElementSelectorFlags| {
|
||||
|
@ -2195,10 +2185,6 @@ impl CascadeData {
|
|||
}
|
||||
}
|
||||
|
||||
fn has_rules_for_pseudo(&self, pseudo: &PseudoElement) -> bool {
|
||||
self.pseudos_map.get(pseudo).is_some()
|
||||
}
|
||||
|
||||
/// Clears the cascade data, but not the invalidation data.
|
||||
fn clear_cascade_data(&mut self) {
|
||||
self.element_map.clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue