mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
style: Change nscolor to StyleComplexColor in nsCSSShadowItem.
Bug: 1467621 Reviewed-by: xidorn MozReview-Commit-ID: moE2CI7fT8
This commit is contained in:
parent
9c243a115e
commit
a055e8af89
5 changed files with 27 additions and 42 deletions
|
@ -186,7 +186,7 @@ impl ComputeSquaredDistance for Color {
|
|||
(Foreground, Foreground) => SquaredDistance::from_sqrt(0.),
|
||||
(Numeric(c1), Numeric(c2)) => c1.compute_squared_distance(&c2)?,
|
||||
(Foreground, Numeric(color)) | (Numeric(color), Foreground) => {
|
||||
// `computed_squared_distance` is symmetic.
|
||||
// `computed_squared_distance` is symmetric.
|
||||
color.compute_squared_distance(&RGBA::transparent())?
|
||||
+ SquaredDistance::from_sqrt(1.)
|
||||
}
|
||||
|
@ -207,7 +207,6 @@ impl ComputeSquaredDistance for Color {
|
|||
impl ToAnimatedZero for Color {
|
||||
#[inline]
|
||||
fn to_animated_zero(&self) -> Result<Self, ()> {
|
||||
// FIXME(nox): This does not look correct to me.
|
||||
Err(())
|
||||
Ok(RGBA::transparent().into())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#[cfg(not(feature = "gecko"))]
|
||||
use values::Impossible;
|
||||
use values::animated::color::RGBA;
|
||||
use values::animated::color::Color;
|
||||
use values::computed::{Angle, Number};
|
||||
use values::computed::length::Length;
|
||||
#[cfg(feature = "gecko")]
|
||||
|
@ -17,7 +17,7 @@ use values::generics::effects::Filter as GenericFilter;
|
|||
use values::generics::effects::SimpleShadow as GenericSimpleShadow;
|
||||
|
||||
/// An animated value for a single `box-shadow`.
|
||||
pub type BoxShadow = GenericBoxShadow<Option<RGBA>, Length, Length, Length>;
|
||||
pub type BoxShadow = GenericBoxShadow<Color, Length, Length, Length>;
|
||||
|
||||
/// An animated value for a single `filter`.
|
||||
#[cfg(feature = "gecko")]
|
||||
|
@ -28,7 +28,7 @@ pub type Filter = GenericFilter<Angle, Number, Length, SimpleShadow, ComputedUrl
|
|||
pub type Filter = GenericFilter<Angle, Number, Length, Impossible, Impossible>;
|
||||
|
||||
/// An animated value for the `drop-shadow()` filter.
|
||||
pub type SimpleShadow = GenericSimpleShadow<Option<RGBA>, Length, Length>;
|
||||
pub type SimpleShadow = GenericSimpleShadow<Color, Length, Length>;
|
||||
|
||||
impl ComputeSquaredDistance for BoxShadow {
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue