Latest commit af243d5 Mar 28, 2017 @bors-servo bors-servo committed on GitHub Auto merge of #16155 - chenpighead:gecko-glue-for-font-language-overr…
…ide, r=emilio

stylo: Implement gecko glue for font-language-override.

To be aligned with the implementation from Gecko side, we parse
font-language-override as Normal keyword or String. Then, we compute
and store it as a u32. So, as to the stylo glue, we can just pass the
u32 to Gecko.

The extra crate, byteorder, is used to simplify the computing and

Since we now implement font-language-override for Gecko, we can remove
the additional branches for font-language-override in font shorthand.

ref: Gecko [Bug 1347821](

<!-- Please describe your changes on the following line: -->

<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
This change is [<img src="" height="34" align="absmiddle" alt="Reviewable"/>](
<!-- Reviewable:end -->
Failed to load latest commit information.
components Auto merge of #16155 - chenpighead:gecko-glue-for-font-language-overr… Mar 28, 2017
docs Fix fmt::Display vs fmt::Debug URL Feb 11, 2017
etc Layout viewer now uses local copy of jquery. Mar 16, 2017
ports Auto merge of #16144 - emilio:number-calc, r=heycam Mar 27, 2017
python Allow using servo as dependency, by fixing Cargo.toml of servo-test-t… Mar 27, 2017
resources Add pref to ignore popup in testing Feb 13, 2017
support Remove usage of unstable libc crate. Feb 19, 2017
tests Add full parsing/serialization for mask-repeat and background-repeat Mar 27, 2017
.gitattributes Appease Github's Linguist Jun 11, 2015
.gitignore Remove legacy items from .gitignore Dec 12, 2016
.hgignore Add .hgignore file Feb 4, 2017
.mailmap Fix Clark Gaebel's entry in the mailmap Dec 25, 2016
.travis.yml Remove unused packages from travis.yml Feb 6, 2017 Start collecting documentation, and add an in-tree glossary. Encourag… Apr 18, 2016
Cargo.lock Auto merge of #16155 - chenpighead:gecko-glue-for-font-language-overr… Mar 28, 2017
Cargo.toml Enable codegen-units=4 in debug mode Jan 12, 2017
Info.plist Package: Restore `run-servo` script on MacOS Jan 6, 2017
LICENSE Add license Apr 4, 2013 Request users to allow edits from maintainers in PRs Mar 23, 2017 Auto merge of #15871 - pcpeters:trial, r=jdm Mar 24, 2017
appveyor.yml Switch to commit-specific nightlies Feb 15, 2017
cargo-commit-hash Update to cargo 0.17.0-nightly (385e243 2017-01-27) Jan 27, 2017
dependencyci.yml Skip dependencyci checks for the charade module, which is out of our … Nov 3, 2016
mach Fix test-wpt and test-css for Windows. Nov 16, 2016
mach.bat Fix hardcoded path to link.exe Feb 3, 2017
rust-commit-hash Update rustc to 1.17.0-nightly (7dd4e2db7 2017-03-26) Mar 26, 2017
rust-stable-version Upgrade to Rust 1.15.1 for build-geckolib Feb 13, 2017
rustfmt.toml Add rustfmt.toml. Jan 3, 2017
servo-tidy.toml Update audio-video-metadata crate to last version Mar 8, 2017
servobuild.example Disable LLVM assertions by default, on supported platforms. Feb 16, 2017

The Servo Parallel Browser Engine Project

Linux Build Status Windows Build Status Changelog #228

Servo is a prototype web browser engine written in the Rust language. It is currently developed on 64bit OS X, 64bit Linux, and Android.

Servo welcomes contribution from everyone. See and for help getting started.

Visit the Servo Project page for news and guides.

Setting up your environment

Please select your operating system:


On OS X (homebrew)

brew install automake pkg-config python cmake yasm
pip install virtualenv

On OS X (MacPorts)

sudo port install python27 py27-virtualenv cmake yasm

On OS X >= 10.11 (El Capitan), you also have to install OpenSSL

brew install openssl

export OPENSSL_INCLUDE_DIR="$(brew --prefix openssl)/include"
export OPENSSL_LIB_DIR="$(brew --prefix openssl)/lib"

./mach build ...

If you've already partially compiled servo but forgot to do this step, run ./mach clean, set the shell variables, and recompile.

On Debian-based Linuxes

sudo apt install git curl freeglut3-dev autoconf \
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \
    gperf g++ build-essential cmake virtualenv python-pip \
    libssl1.0-dev libbz2-dev libosmesa6-dev libxmu6 libxmu-dev \
    libglu1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libdbus-1-dev

If you using a version prior to Ubuntu 17.04 or Debian Sid, replace libssl1.0-dev with libssl-dev.

If you are on Ubuntu 14.04 and encountered errors on installing these dependencies involving libcheese, see #6158 for a workaround.

If virtualenv does not exist, try python-virtualenv.

On Fedora

sudo dnf install curl freeglut-devel libtool gcc-c++ libXi-devel \
    freetype-devel mesa-libGL-devel mesa-libEGL-devel glib2-devel libX11-devel libXrandr-devel gperf \
    fontconfig-devel cabextract ttmkfdir python python-virtualenv python-pip expat-devel \
    rpm-build openssl-devel cmake bzip2-devel libXcursor-devel libXmu-devel mesa-libOSMesa-devel \

On openSUSE Linux

sudo zypper install libX11-devel libexpat-devel libbz2-devel Mesa-libEGL-devel Mesa-libGL-devel cabextract cmake \
    dbus-1-devel fontconfig-devel freetype-devel gcc-c++ git glib2-devel gperf \
    harfbuzz-devel libOSMesa-devel libXcursor-devel libXi-devel libXmu-devel libXrandr-devel libopenssl-devel \
    python-pip python-virtualenv rpm-build glu-devel

On Arch Linux

sudo pacman -S --needed base-devel git python2 python2-virtualenv python2-pip mesa cmake bzip2 libxmu glu pkg-config

On Gentoo Linux

sudo emerge net-misc/curl media-libs/freeglut \
    media-libs/freetype media-libs/mesa dev-util/gperf \
    dev-python/virtualenv dev-python/pip dev-libs/openssl \
    x11-libs/libXmu media-libs/glu x11-base/xorg-server

On Windows (MSVC & MinGW)

  1. Install Python for Windows ( The windows x86-64 MSI installer is fine. You should change the installation to install the "Add python.exe to Path" feature.

  2. Install virtualenv.

In a normal Windows Shell (cmd.exe or "Command Prompt" from the start menu), do:

pip install virtualenv

If this does not work, you may need to reboot for the changed PATH settings (by the python installer) to take effect.

  1. (MSVC only) Install Git for Windows ( DO allow it to add git.exe to the PATH (default settings for the installer are fine).

  2. (MSVC only) Install Visual Studio 2015 Community Edition ( You MUST add "Visual C++" to the list of installed components. It is not on by default.

  3. (MinGW only) Install MSYS2 ( After you have done so, open an MSYS shell window and update the core libraries and install new packages. The extra step at the end is to downgrade GCC to 5.4, as the GCC6 versions in mingw currently fail to compile some of our dependencies. We are upgrading to a gcc-free build on Windows as soon as possible:

pacman -Su
pacman -Sy git mingw-w64-x86_64-toolchain mingw-w64-x86_64-icu \
   mingw-w64-x86_64-nspr mingw-w64-x86_64-ca-certificates \
   mingw-w64-x86_64-expat mingw-w64-x86_64-cmake tar diffutils patch \
   patchutils make python2-setuptools
export GCC_URL=
export GCC_EXT=5.4.0-1-any.pkg.tar.xz
pacman -U --noconfirm $GCC_URL-$GCC_EXT $GCC_URL-ada-$GCC_EXT \
   $GCC_URL-fortran-$GCC_EXT $GCC_URL-libgfortran-$GCC_EXT $GCC_URL-libs-$GCC_EXT \

Add the following line to the end of .profile in your home directory:

export PATH=/c/Python27:/c/Python27/Scripts:$PATH

Now, open a MINGW64 (not MSYS!) shell window, and you should be able to build servo as usual!

Cross-compilation for Android

Pre-installed Android tools are needed. See wiki for details

The Rust compiler

Servo's build system automatically downloads a Rust compiler to build itself. This is normally a specific revision of Rust upstream, but sometimes has a backported patch or two. If you'd like to know which nightly build of Rust we use, see rust-commit-hash.


Servo is built with Cargo, the Rust package manager. We also use Mozilla's Mach tools to orchestrate the build and other tasks.

Normal build

To build Servo in development mode. This is useful for development, but the resulting binary is very slow.

git clone
cd servo
./mach build --dev
./mach run tests/html/about-mozilla.html

Or on Windows MSVC, in a normal Command Prompt (cmd.exe):

git clone
cd servo
mach.bat build --dev

For benchmarking, performance testing, or real-world use, add the --release flag to create an optimized build:

./mach build --release
./mach run --release tests/html/about-mozilla.html

Building for Android target

git clone
cd servo

export ANDROID_SDK="/path/to/sdk"
export ANDROID_NDK="/path/to/ndk"
export ANDROID_TOOLCHAIN="/path/to/toolchain"
export PATH="$PATH:/path/to/toolchain/bin"

./mach build --release --android
./mach package --release --android

Rather than setting the ANDROID_* environment variables every time, you can also create a .servobuild file and then edit it to contain the correct paths to the Android SDK/NDK tools:

cp servobuild.example .servobuild
# edit .servobuild


Use ./mach run [url] to run Servo. Like so,

./mach run

Also, don't miss the info on the browserhtml page on how to run the Browser.html full tech demo (it provides a more browser-like experience than just browsing a single URL with servo).

Commandline Arguments

  • -p INTERVAL turns on the profiler and dumps info to the console every INTERVAL seconds
  • -s SIZE sets the tile size for painting; defaults to 512
  • -z disables all graphical output; useful for running JS / layout tests
  • -Z help displays useful output to debug servo

Keyboard Shortcuts

  • Ctrl+- zooms out
  • Ctrl+= zooms in
  • Alt+left arrow goes backwards in the history
  • Alt+right arrow goes forwards in the history
  • Esc exits servo


There are lots of mach commands you can use. You can list them with ./mach --help.

The generated documentation can be found on