mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Fix Stylist::lazily_compute_pseudo_element_style to return None when it should.
We have a fast path to return None if we have no rules for the pseudo-element at all, but we should also return None if we have no _matching_ rules for it for the given originating element. This is relied on by consumers like Servo_ResolvePseudoStyle, which needs to be able to detect the "no styles for this pseudo-element for this originating element case", to support probing for whether work for a specific pseudo-element should be done at all.
This commit is contained in:
parent
2c445169ad
commit
c9fd747e69
1 changed files with 4 additions and 0 deletions
|
@ -534,6 +534,10 @@ impl Stylist {
|
|||
&mut declarations,
|
||||
&mut set_selector_flags);
|
||||
|
||||
if declarations.is_empty() {
|
||||
return None
|
||||
}
|
||||
|
||||
let rule_node =
|
||||
self.rule_tree.insert_ordered_rules(
|
||||
declarations.into_iter().map(|a| (a.source, a.level)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue