mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Make text-shadow and box-shadow use SimpleShadow
This commit is contained in:
parent
65ff4a399c
commit
201d7e79e7
14 changed files with 414 additions and 434 deletions
|
@ -9,7 +9,6 @@ use context::QuirksMode;
|
|||
use euclid::Size2D;
|
||||
use font_metrics::FontMetricsProvider;
|
||||
use media_queries::Device;
|
||||
use num_traits::Zero;
|
||||
#[cfg(feature = "gecko")]
|
||||
use properties;
|
||||
use properties::{ComputedValues, StyleBuilder};
|
||||
|
@ -28,7 +27,7 @@ pub use self::background::BackgroundSize;
|
|||
pub use self::border::{BorderImageSlice, BorderImageWidth, BorderImageSideWidth};
|
||||
pub use self::border::{BorderRadius, BorderCornerRadius};
|
||||
pub use self::color::{Color, RGBAColor};
|
||||
pub use self::effects::Filter;
|
||||
pub use self::effects::{BoxShadow, Filter, SimpleShadow};
|
||||
pub use self::flex::FlexBasis;
|
||||
pub use self::image::{Gradient, GradientItem, ImageLayer, LineDirection, Image, ImageRect};
|
||||
#[cfg(feature = "gecko")]
|
||||
|
@ -412,38 +411,6 @@ impl ComputedValueAsSpecified for specified::AlignJustifyContent {}
|
|||
impl ComputedValueAsSpecified for specified::AlignJustifySelf {}
|
||||
impl ComputedValueAsSpecified for specified::BorderStyle {}
|
||||
|
||||
#[derive(Debug, PartialEq, Clone, Copy)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[allow(missing_docs)]
|
||||
pub struct Shadow {
|
||||
pub offset_x: Au,
|
||||
pub offset_y: Au,
|
||||
pub blur_radius: Au,
|
||||
pub spread_radius: Au,
|
||||
pub color: Color,
|
||||
pub inset: bool,
|
||||
}
|
||||
|
||||
impl ToCss for Shadow {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
if self.inset {
|
||||
dest.write_str("inset ")?;
|
||||
}
|
||||
self.offset_x.to_css(dest)?;
|
||||
dest.write_str(" ")?;
|
||||
self.offset_y.to_css(dest)?;
|
||||
dest.write_str(" ")?;
|
||||
self.blur_radius.to_css(dest)?;
|
||||
dest.write_str(" ")?;
|
||||
if self.spread_radius != Au::zero() {
|
||||
self.spread_radius.to_css(dest)?;
|
||||
dest.write_str(" ")?;
|
||||
}
|
||||
self.color.to_css(dest)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// A `<number>` value.
|
||||
pub type Number = CSSFloat;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue