зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #17991 - style: Avoid branching on the origin for each selector when inserting in the cascade data (from emilio:dumb-branches); r=heycam
This is on top of #17990, and it's intended to help with bug 1386045. Source-Repo: https://github.com/servo/servo Source-Revision: 806540cabdbca1799dd14bb1c67bd0c86b21f6a7 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 618224ec519ee0cb985d6e345c0ea1dedad3f5e8
This commit is contained in:
Родитель
e8713ffdd1
Коммит
288d392ecd
|
@ -458,6 +458,10 @@ impl Stylist {
|
||||||
self.effective_media_query_results.saw_effective(stylesheet);
|
self.effective_media_query_results.saw_effective(stylesheet);
|
||||||
|
|
||||||
let origin = stylesheet.origin(guard);
|
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) {
|
for rule in stylesheet.effective_rules(&self.device, guard) {
|
||||||
match *rule {
|
match *rule {
|
||||||
CssRule::Style(ref locked) => {
|
CssRule::Style(ref locked) => {
|
||||||
|
@ -469,8 +473,7 @@ impl Stylist {
|
||||||
let hashes =
|
let hashes =
|
||||||
AncestorHashes::new(&selector, self.quirks_mode);
|
AncestorHashes::new(&selector, self.quirks_mode);
|
||||||
|
|
||||||
self.cascade_data
|
origin_cascade_data
|
||||||
.borrow_mut_for_origin(&origin)
|
|
||||||
.borrow_mut_for_pseudo_or_insert(selector.pseudo_element())
|
.borrow_mut_for_pseudo_or_insert(selector.pseudo_element())
|
||||||
.insert(
|
.insert(
|
||||||
Rule::new(selector.clone(),
|
Rule::new(selector.clone(),
|
||||||
|
|
Загрузка…
Ссылка в новой задаче