Skip to content

Commit 6ab98e1

Browse files
committed
Handle masking properties
1 parent 53113fb commit 6ab98e1

File tree

4 files changed

+174
-102
lines changed

4 files changed

+174
-102
lines changed

src/properties/background.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ impl ToCss for BackgroundSize {
9393
}
9494
}
9595

96+
impl IsCompatible for BackgroundSize {
97+
fn is_compatible(&self, browsers: Browsers) -> bool {
98+
match self {
99+
BackgroundSize::Explicit { width, height } => {
100+
width.is_compatible(browsers) && height.is_compatible(browsers)
101+
}
102+
BackgroundSize::Cover | BackgroundSize::Contain => true,
103+
}
104+
}
105+
}
106+
96107
enum_property! {
97108
/// A [`<repeat-style>`](https://www.w3.org/TR/css-backgrounds-3/#typedef-repeat-style) value,
98109
/// used within the `background-repeat` property to represent how a background image is repeated
@@ -173,6 +184,12 @@ impl ToCss for BackgroundRepeat {
173184
}
174185
}
175186

187+
impl IsCompatible for BackgroundRepeat {
188+
fn is_compatible(&self, _browsers: Browsers) -> bool {
189+
true
190+
}
191+
}
192+
176193
enum_property! {
177194
/// A value for the [background-attachment](https://www.w3.org/TR/css-backgrounds-3/#background-attachment) property.
178195
pub enum BackgroundAttachment {

0 commit comments

Comments
 (0)