mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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 background_color = self.fragment.style.resolve_color(b.background_color);
|
||||
if background_color.alpha > 0 {
|
||||
let mut common = builder.common_properties(self.border_rect);
|
||||
if let Some(clip_id) = self.border_edge_clip(builder) {
|
||||
common.clip_id = clip_id
|
||||
}
|
||||
// https://drafts.csswg.org/css-backgrounds/#background-color
|
||||
// “The background color is clipped according to the background-clip
|
||||
// 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))
|
||||
}
|
||||
// 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