Fix servo build.

This commit is contained in:
Emilio Cobos Álvarez 2018-04-25 18:50:48 +02:00
parent 16ca8de6df
commit 54b444992d
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
13 changed files with 148 additions and 143 deletions

View file

@ -15,6 +15,7 @@ use gecko_bindings::sugar::refptr::RefPtr;
#[cfg(feature = "gecko")]
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use std::fmt::{self, Write};
#[cfg(feature = "gecko")]
use std::hash::{Hash, Hasher};
#[cfg(feature = "servo")]
use std::slice;
@ -122,16 +123,6 @@ impl FontWeight {
}
}
impl Hash for FontWeight {
fn hash<H>(&self, state: &mut H)
where
H: Hasher,
{
// We hash the floating point number with four decimal places.
state.write_u32((self.0 * 10000.).trunc() as u32)
}
}
impl FontSize {
/// The actual computed font size.
pub fn size(self) -> Au {
@ -841,6 +832,7 @@ impl ToComputedValue for specified::MozScriptLevel {
/// A wrapper over an `Angle`, that handles clamping to the appropriate range
/// for `font-style` animation.
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
pub struct FontStyleAngle(pub Angle);
impl ToAnimatedValue for FontStyleAngle {
@ -878,7 +870,7 @@ impl FontStyle {
///
/// https://drafts.csswg.org/css-fonts-4/#valdef-font-style-oblique-angle
#[inline]
fn default_angle() -> FontStyleAngle {
pub fn default_angle() -> FontStyleAngle {
FontStyleAngle(Angle::Deg(specified::DEFAULT_FONT_STYLE_OBLIQUE_ANGLE_DEGREES))
}