mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Rename get_visited_style to just visited_style.
This commit is contained in:
parent
d2dab24748
commit
ab8dcf0a18
5 changed files with 14 additions and 14 deletions
|
@ -206,7 +206,7 @@ impl CascadeInputs {
|
|||
pub fn new_from_style(style: &ComputedValues) -> Self {
|
||||
CascadeInputs {
|
||||
rules: style.rules.clone(),
|
||||
visited_rules: style.get_visited_style().and_then(|v| v.rules.clone()),
|
||||
visited_rules: style.visited_style().and_then(|v| v.rules.clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ trait PrivateMatchMethods: TElement {
|
|||
let inputs =
|
||||
CascadeInputs {
|
||||
rules: Some(without_transition_rules),
|
||||
visited_rules: primary_style.get_visited_style().and_then(|s| s.rules.clone()),
|
||||
visited_rules: primary_style.visited_rules().cloned()
|
||||
};
|
||||
|
||||
// Actually `PseudoElementResolution` doesn't really matter.
|
||||
|
|
|
@ -2100,16 +2100,16 @@ impl ComputedValues {
|
|||
self.visited_style.is_some()
|
||||
}
|
||||
|
||||
/// Gets a reference to the visited style, if any.
|
||||
pub fn get_visited_style(&self) -> Option<<&ComputedValues> {
|
||||
self.visited_style.as_ref().map(|x| &**x)
|
||||
}
|
||||
|
||||
/// Gets a reference to the rule node. Panic if no rule node exists.
|
||||
pub fn rules(&self) -> &StrongRuleNode {
|
||||
self.rules.as_ref().unwrap()
|
||||
}
|
||||
|
||||
/// Returns the visited style, if any.
|
||||
pub fn visited_style(&self) -> Option<<&ComputedValues> {
|
||||
self.visited_style.as_ref().map(|s| &**s)
|
||||
}
|
||||
|
||||
/// Returns the visited rules, if applicable.
|
||||
pub fn visited_rules(&self) -> Option<<&StrongRuleNode> {
|
||||
self.visited_style.as_ref().and_then(|s| s.rules.as_ref())
|
||||
|
|
|
@ -293,7 +293,7 @@ where
|
|||
pseudo: Option<&PseudoElement>,
|
||||
) -> ResolvedStyle {
|
||||
let mut style_if_visited = None;
|
||||
if parent_style.map_or(false, |s| s.get_visited_style().is_some()) ||
|
||||
if parent_style.map_or(false, |s| s.visited_style().is_some()) ||
|
||||
inputs.visited_rules.is_some() {
|
||||
style_if_visited = Some(self.cascade_style(
|
||||
inputs.visited_rules.as_ref().or(inputs.rules.as_ref()),
|
||||
|
@ -384,7 +384,7 @@ where
|
|||
};
|
||||
|
||||
let mut visited_rules = None;
|
||||
if originating_element_style.style().get_visited_style().is_some() {
|
||||
if originating_element_style.style().visited_style().is_some() {
|
||||
visited_rules = self.match_pseudo(
|
||||
originating_element_style.style(),
|
||||
pseudo,
|
||||
|
@ -567,7 +567,7 @@ where
|
|||
// visitedness of the relevant link should influence style.
|
||||
if pseudo.is_some() || !self.element.is_link() {
|
||||
parent_style = parent_style.map(|s| {
|
||||
s.get_visited_style().unwrap_or(s)
|
||||
s.visited_style().unwrap_or(s)
|
||||
});
|
||||
}
|
||||
cascade_flags.insert(VISITED_DEPENDENT_ONLY);
|
||||
|
|
|
@ -893,7 +893,7 @@ impl Stylist {
|
|||
) -> Arc<ComputedValues> {
|
||||
// We need to compute visited values if we have visited rules or if our
|
||||
// parent has visited values.
|
||||
let visited_values = if inputs.visited_rules.is_some() || parent_style.get_visited_style().is_some() {
|
||||
let visited_values = if inputs.visited_rules.is_some() || parent_style.visited_style().is_some() {
|
||||
// Slightly annoying: we know that inputs has either rules or
|
||||
// visited rules, but we can't do inputs.rules() up front because
|
||||
// maybe it just has visited rules, so can't unwrap_or.
|
||||
|
@ -913,11 +913,11 @@ impl Stylist {
|
|||
// We want to use the visited bits (if any) from our parent
|
||||
// style as our parent.
|
||||
inherited_style =
|
||||
parent_style.get_visited_style().unwrap_or(parent_style);
|
||||
parent_style.visited_style().unwrap_or(parent_style);
|
||||
inherited_style_ignoring_first_line =
|
||||
parent_style_ignoring_first_line.get_visited_style().unwrap_or(parent_style_ignoring_first_line);
|
||||
parent_style_ignoring_first_line.visited_style().unwrap_or(parent_style_ignoring_first_line);
|
||||
layout_parent_style_for_visited =
|
||||
layout_parent_style.get_visited_style().unwrap_or(layout_parent_style);
|
||||
layout_parent_style.visited_style().unwrap_or(layout_parent_style);
|
||||
}
|
||||
|
||||
Some(properties::cascade(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue