mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Refactor Gradient
In a similar way to Position, now specified and computed gradients share a common Gradient type defined in style::values::generics::image. This allows us to reuse most code for many style traits like ToCss, HasViewportPercentage and ToComputedValue. The test changes are the fallout of the disappearance of AngleOrCorner::None, which align our code to the spec for serialisation, where components that can be omitted should be omitted.
This commit is contained in:
parent
f2aaba685b
commit
abef5da9d8
10 changed files with 742 additions and 888 deletions
|
@ -12,8 +12,7 @@ use super::{Number, ToComputedValue, Context};
|
|||
use values::{Auto, CSSFloat, Either, ExtremumLength, None_, Normal, specified};
|
||||
use values::specified::length::{AbsoluteLength, FontBaseSize, FontRelativeLength, ViewportPercentageLength};
|
||||
|
||||
pub use super::image::{EndingShape as GradientShape, Gradient, GradientKind, Image};
|
||||
pub use super::image::{LengthOrKeyword, LengthOrPercentageOrKeyword};
|
||||
pub use super::image::Image;
|
||||
pub use values::specified::{Angle, BorderStyle, Time, UrlOrNone};
|
||||
|
||||
impl ToComputedValue for specified::NoCalcLength {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue