mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Apply background-clip
to background-color
This commit is contained in:
parent
ea4882a1c5
commit
f39c3ff38b
1 changed files with 5 additions and 4 deletions
|
@ -270,10 +270,11 @@ impl<'a> BuilderForBoxFragment<'a> {
|
||||||
let b = self.fragment.style.get_background();
|
let b = self.fragment.style.get_background();
|
||||||
let background_color = self.fragment.style.resolve_color(b.background_color);
|
let background_color = self.fragment.style.resolve_color(b.background_color);
|
||||||
if background_color.alpha > 0 {
|
if background_color.alpha > 0 {
|
||||||
let mut common = builder.common_properties(self.border_rect);
|
// https://drafts.csswg.org/css-backgrounds/#background-color
|
||||||
if let Some(clip_id) = self.border_edge_clip(builder) {
|
// “The background color is clipped according to the background-clip
|
||||||
common.clip_id = clip_id
|
// value associated with the bottom-most background image layer.”
|
||||||
}
|
let layer_index = b.background_image.0.len() - 1;
|
||||||
|
let (_, common) = background::painting_area(self, builder, layer_index);
|
||||||
builder.wr.push_rect(&common, rgba(background_color))
|
builder.wr.push_rect(&common, rgba(background_color))
|
||||||
}
|
}
|
||||||
// Reverse because the property is top layer first, we want to paint bottom layer first.
|
// Reverse because the property is top layer first, we want to paint bottom layer first.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue