mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Bug 1374233 - Part 9: Add NonNegativeLengthOrPercentageOrNumber for stroke-{width|dasharry}.
Also add SVGWidth which use NonNegativeSVGLengthOrPercentage as the LengthType for stroke-width. MozReview-Commit-ID: 8gD0fVe2eAe
This commit is contained in:
parent
b37f270c65
commit
bd0a098ef1
9 changed files with 64 additions and 46 deletions
|
@ -569,6 +569,13 @@ impl ToComputedValue for specified::LengthOrPercentageOrNone {
|
|||
/// A wrapper of LengthOrPercentage, whose value must be >= 0.
|
||||
pub type NonNegativeLengthOrPercentage = NonNegative<LengthOrPercentage>;
|
||||
|
||||
impl From<NonNegativeAu> for NonNegativeLengthOrPercentage {
|
||||
#[inline]
|
||||
fn from(length: NonNegativeAu) -> Self {
|
||||
LengthOrPercentage::Length(length.0).into()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<LengthOrPercentage> for NonNegativeLengthOrPercentage {
|
||||
#[inline]
|
||||
fn from(lop: LengthOrPercentage) -> Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue