aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/geometry.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/util/geometry.rs')
-rw-r--r--components/util/geometry.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/components/util/geometry.rs b/components/util/geometry.rs
index 1ed0565e3b4..8af8dce27ab 100644
--- a/components/util/geometry.rs
+++ b/components/util/geometry.rs
@@ -2,6 +2,8 @@
* 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/. */
+use cssparser::ToCss;
+
use euclid::length::Length;
use euclid::point::Point2D;
use euclid::rect::Rect;
@@ -122,7 +124,14 @@ impl Encodable for Au {
impl fmt::Debug for Au {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}px", self.to_f64_px())
- }}
+ }
+}
+
+impl ToCss for Au {
+ fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
+ write!(dest, "{}px", self.to_f64_px())
+ }
+}
impl Add for Au {
type Output = Au;