mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Change device and rule_set references to accessors
This commit is contained in:
parent
0ad0641872
commit
4196156bb9
7 changed files with 37 additions and 22 deletions
|
@ -476,7 +476,7 @@ trait PrivateMatchMethods: TElement {
|
|||
|
||||
// Invoke the cascade algorithm.
|
||||
let values =
|
||||
Arc::new(cascade(&shared_context.stylist.device,
|
||||
Arc::new(cascade(shared_context.stylist.device(),
|
||||
rule_node,
|
||||
&shared_context.guards,
|
||||
style_to_inherit_from,
|
||||
|
@ -603,7 +603,7 @@ trait PrivateMatchMethods: TElement {
|
|||
-> Option<Arc<ComputedValues>> {
|
||||
let rule_node = &primary_style.rules;
|
||||
let without_transition_rules =
|
||||
context.shared.stylist.rule_tree.remove_transition_rule_if_applicable(rule_node);
|
||||
context.shared.stylist.rule_tree().remove_transition_rule_if_applicable(rule_node);
|
||||
if without_transition_rules == *rule_node {
|
||||
// We don't have transition rule in this case, so return None to let the caller
|
||||
// use the original ComputedValues.
|
||||
|
@ -955,7 +955,7 @@ pub trait MatchMethods : TElement {
|
|||
// Handle animations here.
|
||||
if let Some(animation_rule) = animation_rules.0 {
|
||||
let animation_rule_node =
|
||||
context.shared.stylist.rule_tree
|
||||
context.shared.stylist.rule_tree()
|
||||
.update_rule_at_level(CascadeLevel::Animations,
|
||||
Some(&animation_rule),
|
||||
&mut rules,
|
||||
|
@ -967,7 +967,7 @@ pub trait MatchMethods : TElement {
|
|||
|
||||
if let Some(animation_rule) = animation_rules.1 {
|
||||
let animation_rule_node =
|
||||
context.shared.stylist.rule_tree
|
||||
context.shared.stylist.rule_tree()
|
||||
.update_rule_at_level(CascadeLevel::Transitions,
|
||||
Some(&animation_rule),
|
||||
&mut rules,
|
||||
|
@ -1011,7 +1011,7 @@ pub trait MatchMethods : TElement {
|
|||
*relations = matching_context.relations;
|
||||
|
||||
let primary_rule_node =
|
||||
compute_rule_node::<Self>(&stylist.rule_tree,
|
||||
compute_rule_node::<Self>(stylist.rule_tree(),
|
||||
&mut applicable_declarations,
|
||||
&context.shared.guards);
|
||||
|
||||
|
@ -1044,7 +1044,7 @@ pub trait MatchMethods : TElement {
|
|||
// at us later in the closure.
|
||||
let stylist = &context.shared.stylist;
|
||||
let guards = &context.shared.guards;
|
||||
let rule_tree = &stylist.rule_tree;
|
||||
let rule_tree = stylist.rule_tree();
|
||||
let bloom_filter = context.thread_local.bloom_filter.filter();
|
||||
|
||||
let mut matching_context =
|
||||
|
@ -1172,7 +1172,7 @@ pub trait MatchMethods : TElement {
|
|||
let mut replace_rule_node = |level: CascadeLevel,
|
||||
pdb: Option<&Arc<Locked<PropertyDeclarationBlock>>>,
|
||||
path: &mut StrongRuleNode| {
|
||||
let new_node = context.shared.stylist.rule_tree
|
||||
let new_node = context.shared.stylist.rule_tree()
|
||||
.update_rule_at_level(level, pdb, path, &context.shared.guards);
|
||||
if let Some(n) = new_node {
|
||||
*path = n;
|
||||
|
@ -1430,7 +1430,7 @@ pub trait MatchMethods : TElement {
|
|||
let relevant_style = pseudo_style.unwrap_or(primary_style);
|
||||
let rule_node = &relevant_style.rules;
|
||||
let without_animation_rules =
|
||||
shared_context.stylist.rule_tree.remove_animation_rules(rule_node);
|
||||
shared_context.stylist.rule_tree().remove_animation_rules(rule_node);
|
||||
if without_animation_rules == *rule_node {
|
||||
// Note that unwrapping here is fine, because the style is
|
||||
// only incomplete during the styling process.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue