aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/canvas/lib.rs1
-rw-r--r--components/devtools_traits/lib.rs1
-rw-r--r--components/gfx/font.rs3
-rw-r--r--components/gfx/font_context.rs4
-rw-r--r--components/gfx/font_template.rs89
-rw-r--r--components/gfx/platform/freetype/font.rs6
-rw-r--r--components/gfx/platform/macos/font.rs17
-rw-r--r--components/layout/layout_debug.rs2
-rw-r--r--components/msg/lib.rs1
-rw-r--r--components/script/dom/webidls/CSSStyleDeclaration.webidl1
-rw-r--r--components/script/lib.rs4
-rw-r--r--components/script_traits/lib.rs1
-rw-r--r--components/servo/Cargo.lock2
-rw-r--r--components/servo/lib.rs1
-rw-r--r--components/servo/main.rs1
-rw-r--r--components/style/properties/mod.rs.mako3
-rw-r--r--components/util/workqueue.rs2
-rw-r--r--ports/cef/Cargo.lock2
-rw-r--r--ports/cef/browser_host.rs4
-rw-r--r--ports/cef/eutil.rs2
-rw-r--r--ports/cef/macros.rs2
-rw-r--r--ports/cef/string.rs2
-rw-r--r--ports/cef/v8.rs2
-rw-r--r--ports/cef/window.rs2
-rw-r--r--ports/cef/wrappers.rs2
-rw-r--r--ports/glfw/window.rs6
-rw-r--r--ports/glutin/lib.rs1
-rw-r--r--ports/glutin/window.rs4
-rw-r--r--ports/gonk/Cargo.lock2
-rw-r--r--ports/gonk/src/window.rs2
-rw-r--r--python/servo/command_base.py8
-rw-r--r--servobuild.example3
-rw-r--r--tests/html/font_stretch.html24
33 files changed, 138 insertions, 69 deletions
diff --git a/components/canvas/lib.rs b/components/canvas/lib.rs
index 8280c530d8e..4992df4588f 100644
--- a/components/canvas/lib.rs
+++ b/components/canvas/lib.rs
@@ -5,6 +5,7 @@
#![deny(unused_imports)]
#![deny(unused_variables)]
#![allow(missing_copy_implementations)]
+#![allow(unstable)]
extern crate azure;
extern crate geom;
diff --git a/components/devtools_traits/lib.rs b/components/devtools_traits/lib.rs
index 14c6c59b56c..7f3aa43ac4b 100644
--- a/components/devtools_traits/lib.rs
+++ b/components/devtools_traits/lib.rs
@@ -13,6 +13,7 @@
#![allow(non_snake_case)]
#![allow(missing_copy_implementations)]
+#![allow(unstable)]
extern crate "msg" as servo_msg;
extern crate serialize;
diff --git a/components/gfx/font.rs b/components/gfx/font.rs
index cfc79b6248c..324e755f438 100644
--- a/components/gfx/font.rs
+++ b/components/gfx/font.rs
@@ -10,7 +10,7 @@ use std::rc::Rc;
use std::cell::RefCell;
use servo_util::cache::HashCache;
use servo_util::smallvec::{SmallVec, SmallVec8};
-use style::computed_values::{font_variant, font_weight};
+use style::computed_values::{font_stretch, font_variant, font_weight};
use style::style_structs::Font as FontStyle;
use std::sync::Arc;
@@ -37,6 +37,7 @@ pub trait FontHandleMethods {
fn face_name(&self) -> String;
fn is_italic(&self) -> bool;
fn boldness(&self) -> font_weight::T;
+ fn stretchiness(&self) -> font_stretch::T;
fn glyph_index(&self, codepoint: char) -> Option<GlyphId>;
fn glyph_h_advance(&self, GlyphId) -> Option<FractionalPixel>;
diff --git a/components/gfx/font_context.rs b/components/gfx/font_context.rs
index 34e92b21540..e67027cf53c 100644
--- a/components/gfx/font_context.rs
+++ b/components/gfx/font_context.rs
@@ -140,7 +140,9 @@ impl FontContext {
// so they will never be released. Find out a good time to drop them.
let desc = FontTemplateDescriptor::new(style.font_weight,
- style.font_style == font_style::T::italic || style.font_style == font_style::T::oblique);
+ style.font_stretch,
+ style.font_style == font_style::T::italic ||
+ style.font_style == font_style::T::oblique);
let mut fonts = SmallVec8::new();
for family in style.font_family.iter() {
diff --git a/components/gfx/font_template.rs b/components/gfx/font_template.rs
index d90df2b3bdb..fee0bc69642 100644
--- a/components/gfx/font_template.rs
+++ b/components/gfx/font_template.rs
@@ -2,14 +2,14 @@
* 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 style::computed_values::font_weight;
+use font::FontHandleMethods;
use platform::font_context::FontContextHandle;
use platform::font::FontHandle;
use platform::font_template::FontTemplateData;
use std::borrow::ToOwned;
use std::sync::{Arc, Weak};
-use font::FontHandleMethods;
+use style::computed_values::{font_stretch, font_weight};
/// Describes how to select a font from a given family.
/// This is very basic at the moment and needs to be
@@ -18,13 +18,17 @@ use font::FontHandleMethods;
#[derive(Clone, Copy)]
pub struct FontTemplateDescriptor {
pub weight: font_weight::T,
+ pub stretch: font_stretch::T,
pub italic: bool,
}
impl FontTemplateDescriptor {
- pub fn new(weight: font_weight::T, italic: bool) -> FontTemplateDescriptor {
+ #[inline]
+ pub fn new(weight: font_weight::T, stretch: font_stretch::T, italic: bool)
+ -> FontTemplateDescriptor {
FontTemplateDescriptor {
weight: weight,
+ stretch: stretch,
italic: italic,
}
}
@@ -33,7 +37,8 @@ impl FontTemplateDescriptor {
impl PartialEq for FontTemplateDescriptor {
fn eq(&self, other: &FontTemplateDescriptor) -> bool {
self.weight.is_bold() == other.weight.is_bold() &&
- self.italic == other.italic
+ self.stretch == other.stretch &&
+ self.italic == other.italic
}
}
@@ -44,7 +49,8 @@ pub struct FontTemplate {
identifier: String,
descriptor: Option<FontTemplateDescriptor>,
weak_ref: Option<Weak<FontTemplateData>>,
- strong_ref: Option<Arc<FontTemplateData>>, // GWTODO: Add code path to unset the strong_ref for web fonts!
+ // GWTODO: Add code path to unset the strong_ref for web fonts!
+ strong_ref: Option<Arc<FontTemplateData>>,
is_valid: bool,
}
@@ -82,8 +88,10 @@ impl FontTemplate {
}
/// Get the data for creating a font if it matches a given descriptor.
- pub fn get_if_matches(&mut self, fctx: &FontContextHandle,
- requested_desc: &FontTemplateDescriptor) -> Option<Arc<FontTemplateData>> {
+ pub fn get_if_matches(&mut self,
+ fctx: &FontContextHandle,
+ requested_desc: &FontTemplateDescriptor)
+ -> Option<Arc<FontTemplateData>> {
// The font template data can be unloaded when nothing is referencing
// it (via the Weak reference to the Arc above). However, if we have
// already loaded a font, store the style information about it separately,
@@ -97,42 +105,42 @@ impl FontTemplate {
None
}
},
- None => {
- if self.is_valid {
- let data = self.get_data();
- let handle: Result<FontHandle, ()> = FontHandleMethods::new_from_template(fctx, data.clone(), None);
- match handle {
- Ok(handle) => {
- let actual_desc = FontTemplateDescriptor::new(handle.boldness(),
- handle.is_italic());
- let desc_match = actual_desc == *requested_desc;
-
- self.descriptor = Some(actual_desc);
- self.is_valid = true;
- if desc_match {
- Some(data)
- } else {
- None
- }
- }
- Err(()) => {
- self.is_valid = false;
- debug!("Unable to create a font from template {}", self.identifier);
+ None if self.is_valid => {
+ let data = self.get_data();
+ let handle: Result<FontHandle, ()> =
+ FontHandleMethods::new_from_template(fctx, data.clone(), None);
+ match handle {
+ Ok(handle) => {
+ let actual_desc = FontTemplateDescriptor::new(handle.boldness(),
+ handle.stretchiness(),
+ handle.is_italic());
+ let desc_match = actual_desc == *requested_desc;
+
+ self.descriptor = Some(actual_desc);
+ self.is_valid = true;
+ if desc_match {
+ Some(data)
+ } else {
None
}
}
- } else {
- None
+ Err(()) => {
+ self.is_valid = false;
+ debug!("Unable to create a font from template {}", self.identifier);
+ None
+ }
}
}
+ None => None,
}
}
/// Get the data for creating a font.
pub fn get(&mut self) -> Option<Arc<FontTemplateData>> {
- match self.is_valid {
- true => Some(self.get_data()),
- false => None
+ if self.is_valid {
+ Some(self.get_data())
+ } else {
+ None
}
}
@@ -145,14 +153,13 @@ impl FontTemplate {
None => None,
};
- match maybe_data {
- Some(data) => data,
- None => {
- assert!(self.strong_ref.is_none());
- let template_data = Arc::new(FontTemplateData::new(self.identifier.as_slice(), None));
- self.weak_ref = Some(template_data.downgrade());
- template_data
- }
+ if let Some(data) = maybe_data {
+ return data
}
+
+ assert!(self.strong_ref.is_none());
+ let template_data = Arc::new(FontTemplateData::new(self.identifier.as_slice(), None));
+ self.weak_ref = Some(template_data.downgrade());
+ template_data
}
}
diff --git a/components/gfx/platform/freetype/font.rs b/components/gfx/platform/freetype/font.rs
index 2e13a4f39aa..3a5d61ef373 100644
--- a/components/gfx/platform/freetype/font.rs
+++ b/components/gfx/platform/freetype/font.rs
@@ -12,7 +12,7 @@ use servo_util::str::c_str_to_string;
use platform::font_context::FontContextHandle;
use text::glyph::GlyphId;
use text::util::{float_to_fixed, fixed_to_float};
-use style::computed_values::font_weight;
+use style::computed_values::{font_stretch, font_weight};
use platform::font_template::FontTemplateData;
use freetype::freetype::{FT_Get_Char_Index, FT_Get_Postscript_Name};
@@ -161,6 +161,10 @@ impl FontHandleMethods for FontHandle {
}
}
}
+ fn stretchiness(&self) -> font_stretch::T {
+ // TODO(pcwalton): Implement this.
+ font_stretch::T::normal
+ }
fn glyph_index(&self, codepoint: char) -> Option<GlyphId> {
assert!(!self.face.is_null());
diff --git a/components/gfx/platform/macos/font.rs b/components/gfx/platform/macos/font.rs
index db168c657e6..fb7f12782c0 100644
--- a/components/gfx/platform/macos/font.rs
+++ b/components/gfx/platform/macos/font.rs
@@ -15,7 +15,7 @@ use servo_util::geometry::{Au, px_to_pt};
use servo_util::geometry;
use platform::macos::font_context::FontContextHandle;
use text::glyph::GlyphId;
-use style::computed_values::font_weight;
+use style::computed_values::{font_stretch, font_weight};
use platform::font_template::FontTemplateData;
use core_foundation::base::CFIndex;
@@ -111,6 +111,21 @@ impl FontHandleMethods for FontHandle {
return font_weight::T::Weight900;
}
+ fn stretchiness(&self) -> font_stretch::T {
+ let normalized = self.ctfont.all_traits().normalized_width(); // [-1.0, 1.0]
+ match (normalized + 1.0) / 2.0 * 9.0 { // [0.0, 9.0]
+ v if v < 1.0 => font_stretch::T::ultra_condensed,
+ v if v < 2.0 => font_stretch::T::extra_condensed,
+ v if v < 3.0 => font_stretch::T::condensed,
+ v if v < 4.0 => font_stretch::T::semi_condensed,
+ v if v < 5.0 => font_stretch::T::normal,
+ v if v < 6.0 => font_stretch::T::semi_expanded,
+ v if v < 7.0 => font_stretch::T::expanded,
+ v if v < 8.0 => font_stretch::T::extra_expanded,
+ _ => font_stretch::T::ultra_expanded,
+ }
+ }
+
fn glyph_index(&self, codepoint: char) -> Option<GlyphId> {
let characters: [UniChar; 1] = [codepoint as UniChar];
let mut glyphs: [CGGlyph; 1] = [0 as CGGlyph];
diff --git a/components/layout/layout_debug.rs b/components/layout/layout_debug.rs
index 5f0851b1f36..5fc606b8705 100644
--- a/components/layout/layout_debug.rs
+++ b/components/layout/layout_debug.rs
@@ -5,7 +5,7 @@
//! Supports writing a trace file created during each layout scope
//! that can be viewed by an external tool to make layout debugging easier.
-#![macro_escape]
+#![macro_use]
use flow_ref::FlowRef;
use flow;
diff --git a/components/msg/lib.rs b/components/msg/lib.rs
index ba02ce8babd..b22627fb4fd 100644
--- a/components/msg/lib.rs
+++ b/components/msg/lib.rs
@@ -7,6 +7,7 @@
#![deny(unused_imports)]
#![deny(unused_variables)]
#![allow(missing_copy_implementations)]
+#![allow(unstable)]
extern crate azure;
extern crate geom;
diff --git a/components/script/dom/webidls/CSSStyleDeclaration.webidl b/components/script/dom/webidls/CSSStyleDeclaration.webidl
index 88c78b72775..70998624dc4 100644
--- a/components/script/dom/webidls/CSSStyleDeclaration.webidl
+++ b/components/script/dom/webidls/CSSStyleDeclaration.webidl
@@ -128,6 +128,7 @@ partial interface CSSStyleDeclaration {
[TreatNullAs=EmptyString] attribute DOMString font;
[TreatNullAs=EmptyString] attribute DOMString fontFamily;
[TreatNullAs=EmptyString] attribute DOMString fontSize;
+ [TreatNullAs=EmptyString] attribute DOMString fontStretch;
[TreatNullAs=EmptyString] attribute DOMString fontStyle;
[TreatNullAs=EmptyString] attribute DOMString fontVariant;
[TreatNullAs=EmptyString] attribute DOMString fontWeight;
diff --git a/components/script/lib.rs b/components/script/lib.rs
index aab99ec9106..055d658ddee 100644
--- a/components/script/lib.rs
+++ b/components/script/lib.rs
@@ -49,9 +49,9 @@ extern crate string_cache_macros;
pub mod cors;
/// The implementation of the DOM.
-#[macro_escape]
+#[macro_use]
pub mod dom {
- #[macro_escape]
+ #[macro_use]
pub mod macros;
/// The code to expose the DOM to JavaScript through IDL bindings.
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index 0b6bb4a3b36..1568615c619 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -7,6 +7,7 @@
#![deny(unused_imports)]
#![deny(unused_variables)]
#![allow(missing_copy_implementations)]
+#![allow(unstable)]
extern crate devtools_traits;
extern crate geom;
diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock
index bfa744ca8bf..3488655cefa 100644
--- a/components/servo/Cargo.lock
+++ b/components/servo/Cargo.lock
@@ -474,7 +474,7 @@ source = "git+https://github.com/bjz/gl-rs.git#230e6c9ed611cddfcb6682dee9686471d
[[package]]
name = "layers"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-layers#8dece8325eda4a74816832580e62ebd3afc99dfb"
+source = "git+https://github.com/servo/rust-layers#c17875c1951ffe2425733a596c2e6c10d9276720"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
diff --git a/components/servo/lib.rs b/components/servo/lib.rs
index 3cc121da0ff..6f1d22ff0bd 100644
--- a/components/servo/lib.rs
+++ b/components/servo/lib.rs
@@ -7,6 +7,7 @@
#![deny(unused_imports)]
#![deny(unused_variables)]
#![allow(missing_copy_implementations)]
+#![allow(unstable)]
#[macro_use]
extern crate log;
diff --git a/components/servo/main.rs b/components/servo/main.rs
index 98463ee91a6..127143e26e8 100644
--- a/components/servo/main.rs
+++ b/components/servo/main.rs
@@ -4,6 +4,7 @@
#![deny(unused_imports)]
#![deny(unused_variables)]
+#![allow(unstable)]
#[cfg(target_os="android")]
extern crate libc;
diff --git a/components/style/properties/mod.rs.mako b/components/style/properties/mod.rs.mako
index b3283b894d8..a608dbd06e5 100644
--- a/components/style/properties/mod.rs.mako
+++ b/components/style/properties/mod.rs.mako
@@ -1149,6 +1149,9 @@ pub mod longhands {
}
</%self:longhand>
+ ${single_keyword("font-stretch",
+ "normal ultra-condensed extra-condensed condensed semi-condensed semi-expanded expanded extra-expanded ultra-expanded")}
+
// CSS 2.1, Section 16 - Text
${new_style_struct("InheritedText", is_inherited=True)}
diff --git a/components/util/workqueue.rs b/components/util/workqueue.rs
index c83902526fd..5cac6d71d70 100644
--- a/components/util/workqueue.rs
+++ b/components/util/workqueue.rs
@@ -195,7 +195,7 @@ impl<'a, QueueData: 'static, WorkData: Send> WorkerProxy<'a, QueueData, WorkData
/// Retrieves the queue user data.
#[inline]
- pub fn user_data<'a>(&'a self) -> &'a QueueData {
+ pub fn user_data<'b>(&'b self) -> &'b QueueData {
unsafe {
mem::transmute(self.queue_data)
}
diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock
index 8a28e365033..58ea35e0a11 100644
--- a/ports/cef/Cargo.lock
+++ b/ports/cef/Cargo.lock
@@ -442,7 +442,7 @@ source = "git+https://github.com/bjz/gl-rs.git#230e6c9ed611cddfcb6682dee9686471d
[[package]]
name = "layers"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-layers#8dece8325eda4a74816832580e62ebd3afc99dfb"
+source = "git+https://github.com/servo/rust-layers#c17875c1951ffe2425733a596c2e6c10d9276720"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
diff --git a/ports/cef/browser_host.rs b/ports/cef/browser_host.rs
index ed8e8f66ede..7b2d3f2c691 100644
--- a/ports/cef/browser_host.rs
+++ b/ports/cef/browser_host.rs
@@ -6,13 +6,13 @@ use eutil::Downcast;
use interfaces::{CefBrowser, CefBrowserHost, CefClient, cef_browser_host_t, cef_client_t};
use types::{cef_mouse_button_type_t, cef_mouse_event, cef_rect_t, cef_key_event};
use types::cef_key_event_type_t::{KEYEVENT_CHAR, KEYEVENT_KEYDOWN, KEYEVENT_KEYUP, KEYEVENT_RAWKEYDOWN};
-use browser::{mod, ServoCefBrowserExtensions};
+use browser::{self, ServoCefBrowserExtensions};
use compositing::windowing::{WindowEvent, MouseWindowEvent};
use geom::point::TypedPoint2D;
use geom::size::TypedSize2D;
use libc::{c_double, c_int};
-use servo_msg::constellation_msg::{mod, KeyModifiers, KeyState};
+use servo_msg::constellation_msg::{self, KeyModifiers, KeyState};
use std::cell::RefCell;
pub struct ServoCefBrowserHost {
diff --git a/ports/cef/eutil.rs b/ports/cef/eutil.rs
index c46158430ec..9ba9852e051 100644
--- a/ports/cef/eutil.rs
+++ b/ports/cef/eutil.rs
@@ -4,7 +4,7 @@
use types::cef_base_t;
-use libc::{mod, c_int, c_void, size_t};
+use libc::{self, c_int, c_void, size_t};
use std::mem;
use std::slice;
use std::str;
diff --git a/ports/cef/macros.rs b/ports/cef/macros.rs
index dd31afe6573..97a42bcef17 100644
--- a/ports/cef/macros.rs
+++ b/ports/cef/macros.rs
@@ -2,7 +2,7 @@
* 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/. */
-#![macro_escape]
+#![macro_use]
// Provides the implementation of a CEF class. An example follows:
//
diff --git a/ports/cef/string.rs b/ports/cef/string.rs
index 8c59c60f4bf..efc35744434 100644
--- a/ports/cef/string.rs
+++ b/ports/cef/string.rs
@@ -4,7 +4,7 @@
use eutil::slice_to_str;
-use libc::{mod, size_t, c_int, c_ushort, c_void};
+use libc::{self, size_t, c_int, c_ushort, c_void};
use libc::types::os::arch::c95::wchar_t;
use std::char;
use std::cmp::Ordering;
diff --git a/ports/cef/v8.rs b/ports/cef/v8.rs
index 48b139ccda6..b046c7d1231 100644
--- a/ports/cef/v8.rs
+++ b/ports/cef/v8.rs
@@ -6,7 +6,7 @@ use interfaces::{cef_v8accessor_t, cef_v8context_t, cef_v8handler_t, cef_v8stack
use interfaces::{cef_v8value_t};
use types::{cef_string_t, cef_time_t};
-use libc::{mod, c_double, c_int};
+use libc::{self, c_double, c_int};
cef_stub_static_method_impls! {
fn cef_v8context_get_current_context() -> *mut cef_v8context_t
diff --git a/ports/cef/window.rs b/ports/cef/window.rs
index a4e4ebca08f..f557dfaaeef 100644
--- a/ports/cef/window.rs
+++ b/ports/cef/window.rs
@@ -13,7 +13,7 @@ use render_handler::CefRenderHandlerExtensions;
use types::{cef_cursor_handle_t, cef_rect_t};
use wrappers::Utf16Encoder;
-use compositing::compositor_task::{mod, CompositorProxy, CompositorReceiver};
+use compositing::compositor_task::{self, CompositorProxy, CompositorReceiver};
use compositing::windowing::{WindowEvent, WindowMethods};
use geom::scale_factor::ScaleFactor;
use geom::size::TypedSize2D;
diff --git a/ports/cef/wrappers.rs b/ports/cef/wrappers.rs
index caaacaba29a..cf3ebdd4b28 100644
--- a/ports/cef/wrappers.rs
+++ b/ports/cef/wrappers.rs
@@ -30,7 +30,7 @@ use types::{cef_time_t, cef_transition_type_t, cef_urlrequest_status_t};
use types::{cef_v8_accesscontrol_t, cef_v8_propertyattribute_t, cef_value_type_t};
use types::{cef_window_info_t, cef_xml_encoding_type_t, cef_xml_node_type_t};
-use libc::{mod, c_char, c_int, c_ushort, c_void};
+use libc::{self, c_char, c_int, c_ushort, c_void};
use std::collections::HashMap;
use std::mem;
use std::ptr;
diff --git a/ports/glfw/window.rs b/ports/glfw/window.rs
index 258bef206e4..d32c6c42fff 100644
--- a/ports/glfw/window.rs
+++ b/ports/glfw/window.rs
@@ -6,13 +6,13 @@
use NestedEventLoopListener;
-use compositing::compositor_task::{mod, CompositorProxy, CompositorReceiver};
+use compositing::compositor_task::{self, CompositorProxy, CompositorReceiver};
use compositing::windowing::WindowNavigateMsg;
use compositing::windowing::{MouseWindowEvent, WindowEvent, WindowMethods};
use geom::point::{Point2D, TypedPoint2D};
use geom::scale_factor::ScaleFactor;
use geom::size::TypedSize2D;
-use glfw::{mod, Context};
+use glfw::{self, Context};
use gleam::gl;
use layers::geometry::DevicePixel;
use layers::platform::surface::NativeGraphicsMetadata;
@@ -25,7 +25,7 @@ use std::cell::{Cell, RefCell};
use std::comm::Receiver;
use std::num::Float;
use std::rc::Rc;
-use time::{mod, Timespec};
+use time::{self, Timespec};
use util::cursor::Cursor;
use util::geometry::ScreenPx;
diff --git a/ports/glutin/lib.rs b/ports/glutin/lib.rs
index d47a8fb22e5..08c83b61558 100644
--- a/ports/glutin/lib.rs
+++ b/ports/glutin/lib.rs
@@ -6,6 +6,7 @@
#![feature(box_syntax, int_uint)]
#![deny(unused_imports, unused_variables)]
+#![allow(unstable)]
#[cfg(target_os="macos")]
extern crate cgl;
diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs
index 80261c3c33b..747a9195572 100644
--- a/ports/glutin/window.rs
+++ b/ports/glutin/window.rs
@@ -4,7 +4,7 @@
//! A windowing implementation using glutin.
-use compositing::compositor_task::{mod, CompositorProxy, CompositorReceiver};
+use compositing::compositor_task::{self, CompositorProxy, CompositorReceiver};
use compositing::windowing::{WindowEvent, WindowMethods};
use geom::scale_factor::ScaleFactor;
use geom::size::TypedSize2D;
@@ -35,7 +35,7 @@ use std::cell::{Cell, RefCell};
#[cfg(feature = "window")]
use std::num::Float;
#[cfg(feature = "window")]
-use time::{mod, Timespec};
+use time::{self, Timespec};
#[cfg(feature = "window")]
use util::opts;
diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock
index 12d56c86fea..b0c2ca1424a 100644
--- a/ports/gonk/Cargo.lock
+++ b/ports/gonk/Cargo.lock
@@ -361,7 +361,7 @@ source = "git+https://github.com/bjz/gl-rs.git#230e6c9ed611cddfcb6682dee9686471d
[[package]]
name = "layers"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-layers#8dece8325eda4a74816832580e62ebd3afc99dfb"
+source = "git+https://github.com/servo/rust-layers#c17875c1951ffe2425733a596c2e6c10d9276720"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
diff --git a/ports/gonk/src/window.rs b/ports/gonk/src/window.rs
index 361c05c47ef..49b04f919d3 100644
--- a/ports/gonk/src/window.rs
+++ b/ports/gonk/src/window.rs
@@ -4,7 +4,7 @@
//! A windowing implementation using gonk interfaces.
-use compositing::compositor_task::{mod, CompositorProxy, CompositorReceiver};
+use compositing::compositor_task::{self, CompositorProxy, CompositorReceiver};
use compositing::windowing::{WindowEvent, WindowMethods};
use geom::scale_factor::ScaleFactor;
use geom::size::TypedSize2D;
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 32c6b2538c9..3b151affdd0 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -54,9 +54,6 @@ class CommandBase(object):
if not hasattr(self.context, "bootstrapped"):
self.context.bootstrapped = False
- if not hasattr(self.context, "sharedir"):
- self.context.sharedir = path.join(path.expanduser("~/"), ".servo")
-
config_path = path.join(context.topdir, ".servobuild")
if path.exists(config_path):
self.config = toml.loads(open(config_path).read())
@@ -65,6 +62,11 @@ class CommandBase(object):
# Handle missing/default items
self.config.setdefault("tools", {})
+ self.config["tools"].setdefault("cache-dir",
+ path.join(context.topdir, ".servo"))
+ # Allow "~" in cache-dir
+ context.sharedir = path.expanduser(self.config["tools"]["cache-dir"])
+
self.config["tools"].setdefault("system-rust", False)
self.config["tools"].setdefault("system-cargo", False)
self.config["tools"].setdefault("rust-root", "")
diff --git a/servobuild.example b/servobuild.example
index db3aba17f4f..f35fc1b5da8 100644
--- a/servobuild.example
+++ b/servobuild.example
@@ -1,5 +1,8 @@
# Tool options
[tools]
+# Where Rust compiler snapshots and other downloads will be stored. Can be
+# shared by multiple Servo reposities. Defaults to <servo-repo>/.servo
+cache-dir = "~/.servo"
# If system-rust is true, will use rustc/rustdoc from the path, or if
# rust-root is specified, will make sure that rust-root is in the path
# when building. Similarly for Cargo. This takes care of PATH as well as
diff --git a/tests/html/font_stretch.html b/tests/html/font_stretch.html
new file mode 100644
index 00000000000..1d5e1809217
--- /dev/null
+++ b/tests/html/font_stretch.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+body {
+ font-size: 36pt;
+ font-family: "Helvetica Neue";
+ font-weight: bold;
+ font-style: normal;
+}
+#a {
+ font-stretch: normal;
+}
+#b {
+ font-stretch: condensed;
+}
+</style>
+</head>
+<body>
+<div id=a>Felis silvestris catus</div>
+<div id=b>Felis silvestris catus</div>
+</body>
+</html>
+