mirror of
https://github.com/servo/servo.git
synced 2025-08-12 17:05:33 +01:00
Let resolve_color()
take its parameter by reference (#35247)
Bumps Stylo to https://github.com/servo/stylo/pull/116 This way the callers don't have to clone it if they don't have ownership or want to use the value later. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
7edbafb91b
commit
3122de08f3
9 changed files with 34 additions and 42 deletions
|
@ -346,11 +346,11 @@ fn conic_gradient_items_to_color_stops(
|
|||
.filter_map(|item| {
|
||||
match item {
|
||||
GradientItem::SimpleColorStop(color) => Some(ColorStop {
|
||||
color: super::rgba(style.resolve_color(color.clone())),
|
||||
color: super::rgba(style.resolve_color(color)),
|
||||
position: None,
|
||||
}),
|
||||
GradientItem::ComplexColorStop { color, position } => Some(ColorStop {
|
||||
color: super::rgba(style.resolve_color(color.clone())),
|
||||
color: super::rgba(style.resolve_color(color)),
|
||||
position: match position {
|
||||
AngleOrPercentage::Percentage(percentage) => Some(percentage.0),
|
||||
AngleOrPercentage::Angle(angle) => Some(angle.degrees() / 360.),
|
||||
|
@ -384,11 +384,11 @@ fn gradient_items_to_color_stops(
|
|||
.filter_map(|item| {
|
||||
match item {
|
||||
GradientItem::SimpleColorStop(color) => Some(ColorStop {
|
||||
color: super::rgba(style.resolve_color(color.clone())),
|
||||
color: super::rgba(style.resolve_color(color)),
|
||||
position: None,
|
||||
}),
|
||||
GradientItem::ComplexColorStop { color, position } => Some(ColorStop {
|
||||
color: super::rgba(style.resolve_color(color.clone())),
|
||||
color: super::rgba(style.resolve_color(color)),
|
||||
position: Some(if gradient_line_length.is_zero() {
|
||||
0.
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue