mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Fix inset box-shadow to use the padding box (#33433)
As specified in https://drafts.csswg.org/css-backgrounds-3/#shadow-shape Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
6e80a34d09
commit
52f89c95b9
5 changed files with 4 additions and 13 deletions
|
@ -1028,18 +1028,17 @@ impl<'a> BuilderForBoxFragment<'a> {
|
|||
}
|
||||
|
||||
// NB: According to CSS-BACKGROUNDS, box shadows render in *reverse* order (front to back).
|
||||
let border_rect = self.border_rect;
|
||||
let common = builder.common_properties(MaxRect::max_rect(), &self.fragment.style);
|
||||
for box_shadow in box_shadows.iter().rev() {
|
||||
let clip_mode = if box_shadow.inset {
|
||||
BoxShadowClipMode::Inset
|
||||
let (rect, clip_mode) = if box_shadow.inset {
|
||||
(*self.padding_rect(), BoxShadowClipMode::Inset)
|
||||
} else {
|
||||
BoxShadowClipMode::Outset
|
||||
(self.border_rect, BoxShadowClipMode::Outset)
|
||||
};
|
||||
|
||||
builder.wr().push_box_shadow(
|
||||
&common,
|
||||
border_rect,
|
||||
rect,
|
||||
LayoutVector2D::new(
|
||||
box_shadow.base.horizontal.px(),
|
||||
box_shadow.base.vertical.px(),
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
[box-shadow-041.html]
|
||||
expected: FAIL
|
|
@ -1,2 +0,0 @@
|
|||
[box-shadow-042.html]
|
||||
expected: FAIL
|
|
@ -1,2 +0,0 @@
|
|||
[box-shadow-inset-without-border-radius.html]
|
||||
expected: FAIL
|
|
@ -1,2 +0,0 @@
|
|||
[box-shadow-001.html]
|
||||
expected: FAIL
|
Loading…
Add table
Add a link
Reference in a new issue