Implement getComputedStyle

This commit is contained in:
David Zbarsky 2015-07-27 23:05:18 -04:00
parent 416931f4be
commit e484d6b5e3
24 changed files with 886 additions and 152 deletions

View file

@ -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;