mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #7013 - servo:user-stylesheets, r=mbrubeck
Make the Ahem font available to test-css and test-wpt tests. Add support for user stylesheets, and provide one to tests with an `@font-face` rule for it. Fix #6195. Many previously-failing tests now pass, and a few previously-passing now fail. Among the latter, `font-family-013.htm` and `fonts-013.htm` are testing that the Ahem font is not used for characters it doesn’t have a glyph for. They were passing because Ahem was not available at all, and now fail because we don’t implement font fallback correctly. The others also use Ahem, but I don’t understand yet what’s going on exactly. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7013) <!-- Reviewable:end -->
This commit is contained in:
commit
08987e3eda
505 changed files with 173 additions and 1536 deletions
|
@ -297,6 +297,14 @@ impl<'a> DerefMut for RWGuard<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn add_font_face_rules(stylesheet: &Stylesheet, device: &Device, font_cache_task: &FontCacheTask) {
|
||||
for font_face in stylesheet.effective_rules(&device).font_face() {
|
||||
for source in font_face.sources.iter() {
|
||||
font_cache_task.add_web_font(font_face.family.clone(), source.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl LayoutTask {
|
||||
/// Creates a new `LayoutTask` structure.
|
||||
fn new(id: PipelineId,
|
||||
|
@ -336,6 +344,11 @@ impl LayoutTask {
|
|||
let image_cache_receiver =
|
||||
ROUTER.route_ipc_receiver_to_new_mpsc_receiver(ipc_image_cache_receiver);
|
||||
|
||||
let stylist = box Stylist::new(device);
|
||||
for user_or_user_agent_stylesheet in stylist.stylesheets() {
|
||||
add_font_face_rules(user_or_user_agent_stylesheet, &stylist.device, &font_cache_task);
|
||||
}
|
||||
|
||||
LayoutTask {
|
||||
id: id,
|
||||
url: url,
|
||||
|
@ -362,7 +375,7 @@ impl LayoutTask {
|
|||
constellation_chan: constellation_chan,
|
||||
screen_size: screen_size,
|
||||
stacking_context: None,
|
||||
stylist: box Stylist::new(device),
|
||||
stylist: stylist,
|
||||
parallel_traversal: parallel_traversal,
|
||||
dirty: Rect::zero(),
|
||||
generation: 0,
|
||||
|
@ -735,11 +748,7 @@ impl LayoutTask {
|
|||
let mut rw_data = self.lock_rw_data(possibly_locked_rw_data);
|
||||
|
||||
if mq.evaluate(&rw_data.stylist.device) {
|
||||
for font_face in sheet.effective_rules(&rw_data.stylist.device).font_face() {
|
||||
for source in font_face.sources.iter() {
|
||||
self.font_cache_task.add_web_font(font_face.family.clone(), source.clone());
|
||||
}
|
||||
}
|
||||
add_font_face_rules(&sheet, &rw_data.stylist.device, &self.font_cache_task);
|
||||
rw_data.stylist.add_stylesheet(sheet);
|
||||
}
|
||||
|
||||
|
|
9
components/servo/Cargo.lock
generated
9
components/servo/Cargo.lock
generated
|
@ -462,6 +462,14 @@ dependencies = [
|
|||
"winapi 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "getopts"
|
||||
version = "0.2.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gfx"
|
||||
version = "0.0.1"
|
||||
|
@ -1521,6 +1529,7 @@ dependencies = [
|
|||
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"getopts 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
|
||||
"js 0.1.0 (git+https://github.com/servo/rust-mozjs)",
|
||||
|
|
|
@ -12,6 +12,7 @@ use selectors::Element;
|
|||
use std::process;
|
||||
use smallvec::VecLike;
|
||||
use util::resource_files::read_resource_file;
|
||||
use util::opts;
|
||||
|
||||
use legacy::PresentationalHintSynthesis;
|
||||
use media_queries::Device;
|
||||
|
@ -76,9 +77,18 @@ impl Stylist {
|
|||
}
|
||||
}
|
||||
}
|
||||
for &(ref contents, ref url) in &opts::get().user_stylesheets {
|
||||
stylist.add_stylesheet(Stylesheet::from_bytes(
|
||||
&contents, url.clone(), None, None, Origin::User));
|
||||
}
|
||||
stylist
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn stylesheets(&self) -> &[Stylesheet] {
|
||||
&self.stylesheets
|
||||
}
|
||||
|
||||
pub fn constrain_viewport(&self) -> Option<ViewportConstraints> {
|
||||
let cascaded_rule = self.stylesheets.iter()
|
||||
.flat_map(|s| s.effective_rules(&self.device).viewport())
|
||||
|
|
|
@ -53,3 +53,4 @@ serde = "0.4"
|
|||
serde_macros = "0.4"
|
||||
string_cache = "0.1"
|
||||
lazy_static = "0.1"
|
||||
getopts = "0.2.11"
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#![feature(optin_builtin_traits)]
|
||||
#![feature(path_ext)]
|
||||
#![feature(plugin)]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(slice_splits)]
|
||||
#![feature(step_by)]
|
||||
#![feature(step_trait)]
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
use geometry::ScreenPx;
|
||||
|
||||
use euclid::size::{Size2D, TypedSize2D};
|
||||
use getopts;
|
||||
use getopts::Options;
|
||||
use num_cpus;
|
||||
use std::collections::HashSet;
|
||||
use std::cmp;
|
||||
use std::env;
|
||||
use std::io::{self, Write};
|
||||
use std::fs::PathExt;
|
||||
use std::io::{self, Read, Write};
|
||||
use std::fs::{File, PathExt};
|
||||
use std::path::Path;
|
||||
use std::process;
|
||||
use std::sync::atomic::{AtomicBool, Ordering, ATOMIC_BOOL_INIT};
|
||||
|
@ -66,6 +66,8 @@ pub struct Opts {
|
|||
/// won't be loaded
|
||||
pub userscripts: Option<String>,
|
||||
|
||||
pub user_stylesheets: Vec<(Vec<u8>, Url)>,
|
||||
|
||||
pub output_file: Option<String>,
|
||||
|
||||
/// Replace unpaires surrogates in DOM strings with U+FFFD.
|
||||
|
@ -172,9 +174,9 @@ pub struct Opts {
|
|||
pub exit_after_load: bool,
|
||||
}
|
||||
|
||||
fn print_usage(app: &str, opts: &[getopts::OptGroup]) {
|
||||
fn print_usage(app: &str, opts: &Options) {
|
||||
let message = format!("Usage: {} [ options ... ] [URL]\n\twhere options include", app);
|
||||
println!("{}", getopts::usage(&message, opts));
|
||||
println!("{}", opts.usage(&message));
|
||||
}
|
||||
|
||||
pub fn print_debug_usage(app: &str) -> ! {
|
||||
|
@ -241,6 +243,7 @@ pub fn default_opts() -> Opts {
|
|||
nonincremental_layout: false,
|
||||
nossl: false,
|
||||
userscripts: None,
|
||||
user_stylesheets: Vec::new(),
|
||||
output_file: None,
|
||||
replace_surrogates: false,
|
||||
gc_profile: false,
|
||||
|
@ -278,37 +281,38 @@ pub fn default_opts() -> Opts {
|
|||
pub fn from_cmdline_args(args: &[String]) {
|
||||
let (app_name, args) = args.split_first().unwrap();
|
||||
|
||||
let opts = vec!(
|
||||
getopts::optflag("c", "cpu", "CPU painting (default)"),
|
||||
getopts::optflag("g", "gpu", "GPU painting"),
|
||||
getopts::optopt("o", "output", "Output file", "output.png"),
|
||||
getopts::optopt("s", "size", "Size of tiles", "512"),
|
||||
getopts::optopt("", "device-pixel-ratio", "Device pixels per px", ""),
|
||||
getopts::optflag("e", "experimental", "Enable experimental web features"),
|
||||
getopts::optopt("t", "threads", "Number of paint threads", "1"),
|
||||
getopts::optflagopt("p", "profile", "Profiler flag and output interval", "10"),
|
||||
getopts::optflagopt("m", "memory-profile", "Memory profiler flag and output interval", "10"),
|
||||
getopts::optflag("x", "exit", "Exit after load flag"),
|
||||
getopts::optopt("y", "layout-threads", "Number of threads to use for layout", "1"),
|
||||
getopts::optflag("i", "nonincremental-layout", "Enable to turn off incremental layout."),
|
||||
getopts::optflag("", "no-ssl", "Disables ssl certificate verification."),
|
||||
getopts::optflagopt("", "userscripts",
|
||||
"Uses userscripts in resources/user-agent-js, or a specified full path",""),
|
||||
getopts::optflag("z", "headless", "Headless mode"),
|
||||
getopts::optflag("f", "hard-fail", "Exit on task failure instead of displaying about:failure"),
|
||||
getopts::optflagopt("", "devtools", "Start remote devtools server on port", "6000"),
|
||||
getopts::optflagopt("", "webdriver", "Start remote WebDriver server on port", "7000"),
|
||||
getopts::optopt("", "resolution", "Set window resolution.", "800x600"),
|
||||
getopts::optopt("u", "user-agent", "Set custom user agent string", "NCSA Mosaic/1.0 (X11;SunOS 4.1.4 sun4m)"),
|
||||
getopts::optflag("M", "multiprocess", "Run in multiprocess mode"),
|
||||
getopts::optopt("Z", "debug",
|
||||
"A comma-separated string of debug options. Pass help to show available options.", ""),
|
||||
getopts::optflag("h", "help", "Print this message"),
|
||||
getopts::optopt("", "resources-path", "Path to find static resources", "/home/servo/resources"),
|
||||
getopts::optflag("", "sniff-mime-types" , "Enable MIME sniffing"),
|
||||
);
|
||||
let mut opts = Options::new();
|
||||
opts.optflag("c", "cpu", "CPU painting (default)");
|
||||
opts.optflag("g", "gpu", "GPU painting");
|
||||
opts.optopt("o", "output", "Output file", "output.png");
|
||||
opts.optopt("s", "size", "Size of tiles", "512");
|
||||
opts.optopt("", "device-pixel-ratio", "Device pixels per px", "");
|
||||
opts.optflag("e", "experimental", "Enable experimental web features");
|
||||
opts.optopt("t", "threads", "Number of paint threads", "1");
|
||||
opts.optflagopt("p", "profile", "Profiler flag and output interval", "10");
|
||||
opts.optflagopt("m", "memory-profile", "Memory profiler flag and output interval", "10");
|
||||
opts.optflag("x", "exit", "Exit after load flag");
|
||||
opts.optopt("y", "layout-threads", "Number of threads to use for layout", "1");
|
||||
opts.optflag("i", "nonincremental-layout", "Enable to turn off incremental layout.");
|
||||
opts.optflag("", "no-ssl", "Disables ssl certificate verification.");
|
||||
opts.optflagopt("", "userscripts",
|
||||
"Uses userscripts in resources/user-agent-js, or a specified full path","");
|
||||
opts.optmulti("", "user-stylesheet",
|
||||
"A user stylesheet to be added to every document", "file.css");
|
||||
opts.optflag("z", "headless", "Headless mode");
|
||||
opts.optflag("f", "hard-fail", "Exit on task failure instead of displaying about:failure");
|
||||
opts.optflagopt("", "devtools", "Start remote devtools server on port", "6000");
|
||||
opts.optflagopt("", "webdriver", "Start remote WebDriver server on port", "7000");
|
||||
opts.optopt("", "resolution", "Set window resolution.", "800x600");
|
||||
opts.optopt("u", "user-agent", "Set custom user agent string", "NCSA Mosaic/1.0 (X11;SunOS 4.1.4 sun4m)");
|
||||
opts.optflag("M", "multiprocess", "Run in multiprocess mode");
|
||||
opts.optopt("Z", "debug",
|
||||
"A comma-separated string of debug options. Pass help to show available options.", "");
|
||||
opts.optflag("h", "help", "Print this message");
|
||||
opts.optopt("", "resources-path", "Path to find static resources", "/home/servo/resources");
|
||||
opts.optflag("", "sniff-mime-types" , "Enable MIME sniffing");
|
||||
|
||||
let opt_match = match getopts::getopts(args, &opts) {
|
||||
let opt_match = match opts.parse(args) {
|
||||
Ok(m) => m,
|
||||
Err(f) => args_fail(&f.to_string()),
|
||||
};
|
||||
|
@ -330,12 +334,12 @@ pub fn from_cmdline_args(args: &[String]) {
|
|||
print_debug_usage(app_name)
|
||||
}
|
||||
|
||||
let cwd = env::current_dir().unwrap();
|
||||
let url = if opt_match.free.is_empty() {
|
||||
print_usage(app_name, &opts);
|
||||
args_fail("servo asks that you provide a URL")
|
||||
} else {
|
||||
let ref url = opt_match.free[0];
|
||||
let cwd = env::current_dir().unwrap();
|
||||
match Url::parse(url) {
|
||||
Ok(url) => url,
|
||||
Err(url::ParseError::RelativeUrlWithoutBase) => {
|
||||
|
@ -407,6 +411,17 @@ pub fn from_cmdline_args(args: &[String]) {
|
|||
}
|
||||
};
|
||||
|
||||
let user_stylesheets = opt_match.opt_strs("user-stylesheet").iter().map(|filename| {
|
||||
let path = cwd.join(filename);
|
||||
let url = Url::from_file_path(&path).unwrap();
|
||||
let mut contents = Vec::new();
|
||||
File::open(path)
|
||||
.unwrap_or_else(|err| args_fail(&format!("Couldn’t open {}: {}", filename, err)))
|
||||
.read_to_end(&mut contents)
|
||||
.unwrap_or_else(|err| args_fail(&format!("Couldn’t read {}: {}", filename, err)));
|
||||
(contents, url)
|
||||
}).collect();
|
||||
|
||||
let opts = Opts {
|
||||
url: Some(url),
|
||||
paint_threads: paint_threads,
|
||||
|
@ -420,6 +435,7 @@ pub fn from_cmdline_args(args: &[String]) {
|
|||
nonincremental_layout: nonincremental_layout,
|
||||
nossl: nossl,
|
||||
userscripts: opt_match.opt_default("userscripts", ""),
|
||||
user_stylesheets: user_stylesheets,
|
||||
output_file: opt_match.opt_str("o"),
|
||||
replace_surrogates: debug_options.contains(&"replace-surrogates"),
|
||||
gc_profile: debug_options.contains(&"gc-profile"),
|
||||
|
|
4
resources/ahem.css
Normal file
4
resources/ahem.css
Normal file
|
@ -0,0 +1,4 @@
|
|||
@font-face {
|
||||
font-family: Ahem;
|
||||
src: url(ahem/AHEM____.TTF);
|
||||
}
|
1
resources/ahem/Ahem.ps
Normal file
1
resources/ahem/Ahem.ps
Normal file
File diff suppressed because one or more lines are too long
BIN
resources/ahem/Ahem.sit
Normal file
BIN
resources/ahem/Ahem.sit
Normal file
Binary file not shown.
1
resources/ahem/COPIED-FROM
Normal file
1
resources/ahem/COPIED-FROM
Normal file
|
@ -0,0 +1 @@
|
|||
The files in this directory are copied from http://www.w3.org/Style/CSS/Test/Fonts/Ahem/
|
|
@ -2,10 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(fonts/ahem/ahem.ttf);
|
||||
}
|
||||
body {
|
||||
font-family: 'ahem';
|
||||
margin: 0;
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(../fonts/ahem/ahem.ttf);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'ahem';
|
||||
font-size: 100px;
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url('fonts/ahem/ahem.ttf');
|
||||
}
|
||||
body {
|
||||
font-family: 'ahem';
|
||||
font-size: 100px;
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url('fonts/ahem/ahem.ttf');
|
||||
}
|
||||
body {
|
||||
font-family: 'ahem';
|
||||
font-size: 100px;
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(fonts/ahem/ahem.ttf);
|
||||
}
|
||||
.fr {
|
||||
float: right;
|
||||
}
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(fonts/ahem/ahem.ttf);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(fonts/ahem/ahem.ttf);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'ahem';
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(fonts/ahem/ahem.ttf);
|
||||
}
|
||||
body {
|
||||
font-family: 'ahem';
|
||||
font-size: 400px;
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(fonts/ahem/ahem.ttf);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(fonts/ahem/ahem.ttf);
|
||||
}
|
||||
body {
|
||||
font-family: 'ahem';
|
||||
font-size: 100px;
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(fonts/ahem/ahem.ttf);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'ahem';
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(fonts/ahem/ahem.ttf);
|
||||
}
|
||||
.large-border {
|
||||
border-left: 100px solid red;
|
||||
border-right: 100px solid blue;
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(fonts/ahem/ahem.ttf);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(fonts/ahem/ahem.ttf);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
|
|
@ -3,11 +3,6 @@
|
|||
<head>
|
||||
<!-- Tests that font fallback occurs on a per-glyph basis. -->
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(fonts/ahem/ahem.ttf);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Ahem, sans-serif;
|
||||
font-size: 24px;
|
||||
|
|
|
@ -3,11 +3,6 @@
|
|||
<head>
|
||||
<!-- Tests that font fallback occurs on a per-glyph basis. -->
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(fonts/ahem/ahem.ttf);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Ahem, sans-serif;
|
||||
font-size: 24px;
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: url(fonts/ahem/ahem.ttf);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'ahem';
|
||||
|
|
2
tests/reftest.rs
vendored
2
tests/reftest.rs
vendored
|
@ -19,6 +19,7 @@
|
|||
extern crate png;
|
||||
extern crate test;
|
||||
extern crate url;
|
||||
extern crate util;
|
||||
|
||||
use std::env;
|
||||
use std::ffi::OsStr;
|
||||
|
@ -257,6 +258,7 @@ fn capture(reftest: &Reftest, side: usize) -> (u32, u32, Vec<u8>) {
|
|||
.stdout(Stdio::null())
|
||||
.stderr(Stdio::null())
|
||||
.args(&reftest.servo_args[..])
|
||||
.arg("--user-stylesheet").arg(util::resource_files::resources_dir_path().join("ahem.css"))
|
||||
// Allows pixel perfect rendering of Ahem font and the HTML canvas for reftests.
|
||||
.arg("-Z")
|
||||
.arg("disable-text-aa,disable-canvas-aa")
|
||||
|
|
|
@ -142,7 +142,7 @@ Reftest results can be analyzed from a raw log file. To generate this run
|
|||
with the `--log-raw` option e.g.
|
||||
|
||||
./mach test-css --log-raw css.log
|
||||
|
||||
|
||||
This file can then be fed into the
|
||||
[reftest analyzer](http://hoppipolla.co.uk/410/reftest-analyser-structured.xhtml)
|
||||
which will show all failing tests (not just those with unexpected results).
|
||||
|
|
|
@ -26,7 +26,8 @@ def check_args(**kwargs):
|
|||
|
||||
def browser_kwargs(**kwargs):
|
||||
return {"binary": kwargs["binary"],
|
||||
"debug_info": kwargs["debug_info"]}
|
||||
"debug_info": kwargs["debug_info"],
|
||||
"user_stylesheets": kwargs.get("user_stylesheets")}
|
||||
|
||||
|
||||
def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
|
||||
|
@ -44,11 +45,13 @@ def env_options():
|
|||
|
||||
|
||||
class ServoBrowser(NullBrowser):
|
||||
def __init__(self, logger, binary, debug_info=None):
|
||||
def __init__(self, logger, binary, debug_info=None, user_stylesheets=None):
|
||||
NullBrowser.__init__(self, logger)
|
||||
self.binary = binary
|
||||
self.debug_info = debug_info
|
||||
self.user_stylesheets = user_stylesheets or []
|
||||
|
||||
def executor_browser(self):
|
||||
return ExecutorBrowser, {"binary": self.binary,
|
||||
"debug_info": self.debug_info}
|
||||
"debug_info": self.debug_info,
|
||||
"user_stylesheets": self.user_stylesheets}
|
||||
|
|
|
@ -62,9 +62,10 @@ class ServoTestharnessExecutor(ProcessTestExecutor):
|
|||
self.result_data = None
|
||||
self.result_flag = threading.Event()
|
||||
|
||||
debug_args, command = browser_command(self.binary,
|
||||
["--cpu", "--hard-fail", "-u", "Servo/wptrunner", "-z", self.test_url(test)],
|
||||
self.debug_info)
|
||||
args = ["--cpu", "--hard-fail", "-u", "Servo/wptrunner", "-z", self.test_url(test)]
|
||||
for stylesheet in self.browser.user_stylesheets:
|
||||
args += ["--user-stylesheet", stylesheet]
|
||||
debug_args, command = browser_command(self.binary, args, self.debug_info)
|
||||
|
||||
self.command = command
|
||||
|
||||
|
@ -192,6 +193,8 @@ class ServoRefTestExecutor(ProcessTestExecutor):
|
|||
self.command = [self.binary, "--cpu", "--hard-fail", "--exit",
|
||||
"-u", "Servo/wptrunner", "-Z", "disable-text-aa",
|
||||
"--output=%s" % output_path, full_url]
|
||||
for stylesheet in self.browser.user_stylesheets:
|
||||
self.command += ["--user-stylesheet", stylesheet]
|
||||
|
||||
env = os.environ.copy()
|
||||
env["HOST_FILE"] = self.hosts_path
|
||||
|
|
|
@ -159,6 +159,11 @@ def create_parser(product_choices=None):
|
|||
b2g_group.add_argument("--b2g-no-backup", action="store_true", default=False,
|
||||
help="Don't backup device before testrun with --product=b2g")
|
||||
|
||||
servo_group = parser.add_argument_group("Servo-specific")
|
||||
servo_group.add_argument("--user-stylesheet",
|
||||
default=[], action="append", dest="user_stylesheets",
|
||||
help="Inject a user CSS stylesheet into every test.")
|
||||
|
||||
parser.add_argument("test_list", nargs="*",
|
||||
help="List of URLs for tests to run, or paths including tests to run. "
|
||||
"(equivalent to --include)")
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vlr-121.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vlr-153.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vlr-169.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vlr-185.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vlr-201.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vlr-217.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vrl-014.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vrl-038.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vrl-050.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vrl-062.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vrl-074.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vrl-086.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vrl-120.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vrl-152.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vrl-168.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vrl-184.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vrl-200.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[abs-pos-non-replaced-vrl-216.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[absolute-non-replaced-height-002.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[absolute-non-replaced-height-007.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[absolute-non-replaced-max-height-002.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[absolute-non-replaced-width-001.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[absolute-non-replaced-width-003.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[absolute-non-replaced-width-004.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[absolute-non-replaced-width-006.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[absolute-non-replaced-width-008.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[absolute-non-replaced-width-010.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[absolute-non-replaced-width-011.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[absolute-non-replaced-width-013.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[absolute-non-replaced-width-014.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[absolute-non-replaced-width-016.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[anonymous-boxes-inheritance-001.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-049.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-052.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-053.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-054.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-070.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-073.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-074.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-075.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-090.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-093.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-094.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-095.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-110.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-113.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-114.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[background-color-115.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-010.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-011.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-012.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-014.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-015.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-016.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-017.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-018.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-023.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-024.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-025.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-026.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-027.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-028.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-029.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-030.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
|
@ -1,3 +0,0 @@
|
|||
[bidi-box-model-032.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue