mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Move represents_keyword to the css attributes.
Bug: 1457635 Reviewed-by: xidorn MozReview-Commit-ID: 21yuU4h34AQ
This commit is contained in:
parent
a375baf84b
commit
c508d8576d
8 changed files with 24 additions and 69 deletions
|
@ -23,12 +23,13 @@ pub enum BorderImageSideWidth<LengthOrPercentage, Number> {
|
|||
|
||||
/// A generic value for the `border-image-slice` property.
|
||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
|
||||
ToComputedValue)]
|
||||
ToComputedValue, ToCss)]
|
||||
pub struct BorderImageSlice<NumberOrPercentage> {
|
||||
/// The offsets.
|
||||
#[css(field_bound)]
|
||||
pub offsets: Rect<NumberOrPercentage>,
|
||||
/// Whether to fill the middle part.
|
||||
#[value_info(represents_keyword)]
|
||||
#[css(represents_keyword)]
|
||||
pub fill: bool,
|
||||
}
|
||||
|
||||
|
@ -86,22 +87,6 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<N> ToCss for BorderImageSlice<N>
|
||||
where
|
||||
N: PartialEq + ToCss,
|
||||
{
|
||||
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
|
||||
where
|
||||
W: Write,
|
||||
{
|
||||
self.offsets.to_css(dest)?;
|
||||
if self.fill {
|
||||
dest.write_str(" fill")?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl<L> BorderRadius<L> {
|
||||
/// Returns a new `BorderRadius<L>`.
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue