aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/values/computed/svg.rs
diff options
context:
space:
mode:
authorBoris Chiou <boris.chiou@gmail.com>2017-09-13 14:26:51 +0800
committerBoris Chiou <boris.chiou@gmail.com>2017-09-13 18:05:14 +0800
commita949e2a0570e41816cd1a2fa3ed5ebd314212dda (patch)
tree79fa5a3535cceb6bf500d938ca7b45ca6af09fc7 /components/style/values/computed/svg.rs
parentcad3aff508fdf47036237ead519791f180e1ea3d (diff)
downloadservo-a949e2a0570e41816cd1a2fa3ed5ebd314212dda.tar.gz
servo-a949e2a0570e41816cd1a2fa3ed5ebd314212dda.zip
Introduce CSSPixelLength and update NonNegativeLength.
First, we define computed::CSSPixelLength which contains a CSSFloat, a pixel value, and then we replace computed::Length with CSSPixelLength. Therefore, the |ComputedValue| of NoCalcLength, AbsoluteLength, FontRelativeLength, ViewportPercentageLength, CharacterWidth, and PhysicalLength is CSSPixelLength. Besides, we drop NonNegativeAu, and replace computed::NonNegativeLength with NonNegative<computed::Length>. (i.e. NonNegative<CSSPixelLength>)
Diffstat (limited to 'components/style/values/computed/svg.rs')
-rw-r--r--components/style/values/computed/svg.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/style/values/computed/svg.rs b/components/style/values/computed/svg.rs
index b4d66b3cec5..1791c18f69d 100644
--- a/components/style/values/computed/svg.rs
+++ b/components/style/values/computed/svg.rs
@@ -6,7 +6,7 @@
use app_units::Au;
use values::RGBA;
-use values::computed::{ComputedUrl, LengthOrPercentage, NonNegativeAu};
+use values::computed::{ComputedUrl, LengthOrPercentage, NonNegativeLength};
use values::computed::{NonNegativeNumber, NonNegativeLengthOrPercentage, Number};
use values::computed::Opacity;
use values::generics::svg as generic;
@@ -72,8 +72,8 @@ impl Into<NonNegativeSvgLengthOrPercentageOrNumber> for SvgLengthOrPercentageOrN
/// An non-negative wrapper of SVGLength.
pub type SVGWidth = generic::SVGLength<NonNegativeSvgLengthOrPercentageOrNumber>;
-impl From<NonNegativeAu> for SVGWidth {
- fn from(length: NonNegativeAu) -> Self {
+impl From<NonNegativeLength> for SVGWidth {
+ fn from(length: NonNegativeLength) -> Self {
generic::SVGLength::Length(
generic::SvgLengthOrPercentageOrNumber::LengthOrPercentage(length.into()))
}