The Servo Browser Engine
Find a file
Sam Gibson 732ae5714f Fix the parsing of the chromium HSTS preload list
Urg! The Chromium HSTS preload JSON file contains single line comments. Previously these were filtered out with a very simple regex that just looked for '//' and removed the line. Now the file has added a couple fields that have URLs in them that were erroneously removed and caused the JSON parsing to fail. This commit slightly complicates the regex to fix this specific problem.

If this happens again, it's likely worth it to figure out how to use a real parser to remove the comments.

servo/servo#8760
2015-12-02 15:36:38 +11:00
components Auto merge of #8714 - frewsxcv:body-fgcolor, r=Ms2ger 2015-12-01 21:40:58 +05:30
etc Also run checks for test-css MANIFEST.json 2015-11-21 10:33:39 +11:00
ports Add debug option to disable vsync for profiling. 2015-12-01 09:52:13 +10:00
python Fix the parsing of the chromium HSTS preload list 2015-12-02 15:36:38 +11:00
resources Fix the parsing of the chromium HSTS preload list 2015-12-02 15:36:38 +11:00
support Silence the "Nothing to be done for 'all'." message 2015-11-13 20:51:26 +01:00
tests Auto merge of #8714 - frewsxcv:body-fgcolor, r=Ms2ger 2015-12-01 21:40:58 +05:30
.gitattributes Appease Github's Linguist 2015-06-11 00:16:42 -04:00
.gitignore Revert "Revert "Auto merge of #7103 - frewsxcv:python-venv, r=metajack" for breaking web-platform-tests." 2015-09-02 09:34:01 -04:00
.travis.yml Add to manifest checks to .travis.yml 2015-11-21 15:45:49 +11:00
cargo-nightly-build Run all unit tests with just one Cargo command. 2015-10-01 17:59:18 +02:00
CONTRIBUTING.md Add servo-starters to CONTRIBUTING 2015-11-07 13:11:42 -07:00
HACKING_QUICKSTART.md Typo fix 2015-11-06 15:52:58 +02:00
Info.plist Build an app bundle on OS X 2012-04-23 17:43:45 -07:00
LICENSE Add license 2013-04-03 18:37:29 -07:00
mach Minor style tweak 2015-09-14 20:55:23 +01:00
ORGANIZATION.md Add more information to ORGANIZATION.md 2015-10-16 15:02:50 -04:00
README.md Clarify servo as parallel browser engine 2015-11-21 23:17:20 +05:30
rust-snapshot-hash Upgrade to rustc 1.6.0-nightly (1805bba39 2015-11-26) 2015-11-27 14:33:29 +01:00
servobuild.example Add CCACHE infra and turn it on in travis 2015-11-05 14:47:23 -06:00

The Servo Parallel Browser Engine Project

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

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

Visit the Servo Project page for news and guides.

Prerequisites

On OS X (homebrew):

brew install automake pkg-config python cmake
pip install virtualenv

On OS X (MacPorts):

sudo port install python27 py27-virtualenv cmake

On Debian-based Linuxes:

sudo apt-get install curl freeglut3-dev \
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \
    gperf g++ cmake python-virtualenv python-pip \
    libssl-dev libbz2-dev libosmesa6-dev libxmu6 libxmu-dev libglu1-mesa-dev

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

On Fedora:

sudo dnf install curl freeglut-devel libtool gcc-c++ libXi-devel \
    freetype-devel mesa-libGL-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 Arch Linux:

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

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

Cross-compilation for Android:

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

Using Virtualbox:

If you're running servo on a guest machine, make sure 3D Acceleration is switched off (#5643)

The Rust compiler

Servo's build system automatically downloads a snapshot 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 the snapshot revision of Rust which we use, see rust-snapshot-hash.

Building

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 https://github.com/servo/servo
cd servo
./mach build --dev
./mach run tests/html/about-mozilla.html

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 https://github.com/servo/servo
cd servo
ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android
cd ports/android
ANDROID_SDK=/path/to/sdk make install

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

Running

Use ./mach run [url] to run 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

Keyboard Shortcuts

  • Ctrl-- zooms out
  • Ctrl-= zooms in
  • Backspace goes backwards in the history
  • Shift-Backspace goes forwards in the history
  • Esc exits servo

Developing

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

The generated documentation can be found on http://doc.servo.org/servo/index.html