mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
style: Avoid branching on the origin for each selector when inserting in the cascade data.
This is on top of #17990, and it's intended to help with bug 1386045.
This commit is contained in:
parent
cc1aab35ea
commit
7ee4b3f881
1 changed files with 5 additions and 2 deletions
|
@ -458,6 +458,10 @@ impl Stylist {
|
|||
self.effective_media_query_results.saw_effective(stylesheet);
|
||||
|
||||
let origin = stylesheet.origin(guard);
|
||||
|
||||
let origin_cascade_data =
|
||||
self.cascade_data.borrow_mut_for_origin(&origin);
|
||||
|
||||
for rule in stylesheet.effective_rules(&self.device, guard) {
|
||||
match *rule {
|
||||
CssRule::Style(ref locked) => {
|
||||
|
@ -469,8 +473,7 @@ impl Stylist {
|
|||
let hashes =
|
||||
AncestorHashes::new(&selector, self.quirks_mode);
|
||||
|
||||
self.cascade_data
|
||||
.borrow_mut_for_origin(&origin)
|
||||
origin_cascade_data
|
||||
.borrow_mut_for_pseudo_or_insert(selector.pseudo_element())
|
||||
.insert(
|
||||
Rule::new(selector.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue