mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Refactor BorderRadius and move it to the border modules
BorderRadius now parses itself reusing Rect<T>.
This commit is contained in:
parent
4144dc74db
commit
af3ede418b
20 changed files with 269 additions and 286 deletions
|
@ -17,7 +17,6 @@ use std::f32::consts::PI;
|
|||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use super::{CSSFloat, CSSInteger, RGBA};
|
||||
use super::generics::BorderRadiusSize as GenericBorderRadiusSize;
|
||||
use super::generics::grid::{TrackBreadth as GenericTrackBreadth, TrackSize as GenericTrackSize};
|
||||
use super::generics::grid::TrackList as GenericTrackList;
|
||||
use super::specified;
|
||||
|
@ -26,6 +25,7 @@ pub use app_units::Au;
|
|||
pub use cssparser::Color as CSSColor;
|
||||
pub use self::background::BackgroundSize;
|
||||
pub use self::border::{BorderImageSlice, BorderImageWidth, BorderImageWidthSide};
|
||||
pub use self::border::{BorderRadius, BorderRadiusSize};
|
||||
pub use self::image::{Gradient, GradientItem, ImageLayer, LineDirection, Image, ImageRect};
|
||||
pub use self::rect::LengthOrNumberRect;
|
||||
pub use super::{Auto, Either, None_};
|
||||
|
@ -462,20 +462,6 @@ impl ComputedValueAsSpecified for specified::AlignJustifyContent {}
|
|||
impl ComputedValueAsSpecified for specified::AlignJustifySelf {}
|
||||
impl ComputedValueAsSpecified for specified::BorderStyle {}
|
||||
|
||||
/// The computed value of `BorderRadiusSize`
|
||||
pub type BorderRadiusSize = GenericBorderRadiusSize<LengthOrPercentage>;
|
||||
|
||||
impl BorderRadiusSize {
|
||||
/// Create a null value.
|
||||
#[inline]
|
||||
pub fn zero() -> BorderRadiusSize {
|
||||
let zero = LengthOrPercentage::zero();
|
||||
GenericBorderRadiusSize(Size2D::new(zero.clone(), zero))
|
||||
}
|
||||
}
|
||||
|
||||
impl Copy for BorderRadiusSize {}
|
||||
|
||||
#[derive(Debug, PartialEq, Clone, Copy)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[allow(missing_docs)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue