mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -611,7 +611,7 @@ impl Fragment {
|
|||
absolute_bounds: Rect<Au>,
|
||||
) {
|
||||
let background = style.get_background();
|
||||
let background_color = style.resolve_color(background.background_color.clone());
|
||||
let background_color = style.resolve_color(&background.background_color);
|
||||
// XXXManishearth the below method should ideally use an iterator over
|
||||
// backgrounds
|
||||
self.build_display_list_for_background_if_applicable_with_background(
|
||||
|
@ -1015,9 +1015,7 @@ impl Fragment {
|
|||
webrender_api::BoxShadowDisplayItem {
|
||||
common: items::empty_common_item_properties(),
|
||||
box_bounds: absolute_bounds.to_layout(),
|
||||
color: style
|
||||
.resolve_color(box_shadow.base.color.clone())
|
||||
.to_layout(),
|
||||
color: style.resolve_color(&box_shadow.base.color).to_layout(),
|
||||
offset: LayoutVector2D::new(
|
||||
box_shadow.base.horizontal.px(),
|
||||
box_shadow.base.vertical.px(),
|
||||
|
@ -1120,19 +1118,19 @@ impl Fragment {
|
|||
}
|
||||
let details = BorderDetails::Normal(NormalBorder {
|
||||
left: BorderSide {
|
||||
color: style.resolve_color(colors.left).to_layout(),
|
||||
color: style.resolve_color(&colors.left).to_layout(),
|
||||
style: border_style.left.to_layout(),
|
||||
},
|
||||
right: BorderSide {
|
||||
color: style.resolve_color(colors.right).to_layout(),
|
||||
color: style.resolve_color(&colors.right).to_layout(),
|
||||
style: border_style.right.to_layout(),
|
||||
},
|
||||
top: BorderSide {
|
||||
color: style.resolve_color(colors.top).to_layout(),
|
||||
color: style.resolve_color(&colors.top).to_layout(),
|
||||
style: border_style.top.to_layout(),
|
||||
},
|
||||
bottom: BorderSide {
|
||||
color: style.resolve_color(colors.bottom).to_layout(),
|
||||
color: style.resolve_color(&colors.bottom).to_layout(),
|
||||
style: border_style.bottom.to_layout(),
|
||||
},
|
||||
radius: border_radius,
|
||||
|
@ -1302,7 +1300,7 @@ impl Fragment {
|
|||
|
||||
// Append the outline to the display list.
|
||||
let color = style
|
||||
.resolve_color(style.get_outline().outline_color.clone())
|
||||
.resolve_color(&style.get_outline().outline_color)
|
||||
.to_layout();
|
||||
let base = state.create_base_display_item(
|
||||
clip,
|
||||
|
@ -1343,8 +1341,7 @@ impl Fragment {
|
|||
// TODO: Allow non-text fragments to be selected too.
|
||||
if scanned_text_fragment_info.selected() {
|
||||
let style = self.selected_style();
|
||||
let background_color =
|
||||
style.resolve_color(style.get_background().background_color.clone());
|
||||
let background_color = style.resolve_color(&style.get_background().background_color);
|
||||
let base = state.create_base_display_item(
|
||||
stacking_relative_border_box,
|
||||
self.node,
|
||||
|
@ -1929,7 +1926,7 @@ impl Fragment {
|
|||
base: base.clone(),
|
||||
shadow: webrender_api::Shadow {
|
||||
offset: LayoutVector2D::new(shadow.horizontal.px(), shadow.vertical.px()),
|
||||
color: self.style.resolve_color(shadow.color.clone()).to_layout(),
|
||||
color: self.style.resolve_color(&shadow.color).to_layout(),
|
||||
blur_radius: shadow.blur.px(),
|
||||
},
|
||||
},
|
||||
|
|
|
@ -195,7 +195,7 @@ fn convert_gradient_stops(
|
|||
assert!(offset.is_finite());
|
||||
stops.push(GradientStop {
|
||||
offset,
|
||||
color: style.resolve_color(stop.color.clone()).to_layout(),
|
||||
color: style.resolve_color(stop.color).to_layout(),
|
||||
})
|
||||
}
|
||||
stops
|
||||
|
|
|
@ -1340,7 +1340,7 @@ impl TableCellStyleInfo<'_> {
|
|||
|
||||
let build_dl = |sty: &ComputedValues, state: &mut &mut DisplayListBuildState| {
|
||||
let background = sty.get_background();
|
||||
let background_color = sty.resolve_color(background.background_color.clone());
|
||||
let background_color = sty.resolve_color(&background.background_color);
|
||||
cell_flow.build_display_list_for_background_if_applicable_with_background(
|
||||
state,
|
||||
background,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue