mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Use generics for the border-image-width property
This commit is contained in:
parent
7a214831f0
commit
c8eb277ca5
8 changed files with 115 additions and 189 deletions
24
components/style/values/computed/border.rs
Normal file
24
components/style/values/computed/border.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
//! Computed types for CSS values related to borders.
|
||||
|
||||
use values::computed::Number;
|
||||
use values::computed::length::LengthOrPercentage;
|
||||
use values::generics::border::BorderImageWidthSide as GenericBorderImageWidthSide;
|
||||
use values::generics::rect::Rect;
|
||||
|
||||
/// A computed value for the `border-image-width` property.
|
||||
pub type BorderImageWidth = Rect<BorderImageWidthSide>;
|
||||
|
||||
/// A computed value for a single side of a `border-image-width` property.
|
||||
pub type BorderImageWidthSide = GenericBorderImageWidthSide<LengthOrPercentage, Number>;
|
||||
|
||||
impl BorderImageWidthSide {
|
||||
/// Returns `1`.
|
||||
#[inline]
|
||||
pub fn one() -> Self {
|
||||
GenericBorderImageWidthSide::Number(1.)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue