mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
tests: Use Ahem font provided by WPT harness.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
e9f364ef51
commit
90e3ff521b
14 changed files with 14 additions and 78 deletions
|
@ -225,7 +225,7 @@ fn test_fetch_blob() {
|
|||
|
||||
#[test]
|
||||
fn test_file() {
|
||||
let path = Path::new("../../resources/ahem.css")
|
||||
let path = Path::new("../../components/net/tests/test.css")
|
||||
.canonicalize()
|
||||
.unwrap();
|
||||
let url = ServoUrl::from_file_path(path.clone()).unwrap();
|
||||
|
|
3
components/net/tests/test.css
Normal file
3
components/net/tests/test.css
Normal file
|
@ -0,0 +1,3 @@
|
|||
html {
|
||||
color: red;
|
||||
}
|
|
@ -73,7 +73,7 @@ def run_tests(default_binary_path: str, **kwargs):
|
|||
# chunks and leads to more consistent timing on GitHub Actions.
|
||||
set_if_none(kwargs, "chunk_type", "id_hash")
|
||||
|
||||
kwargs["user_stylesheets"].append(os.path.join(SERVO_ROOT, "resources", "ahem.css"))
|
||||
kwargs["user_stylesheets"].append(os.path.join(SERVO_ROOT, "tests", "wpt", "tests", "fonts", "ahem.css"))
|
||||
|
||||
set_if_none(kwargs, "binary", default_binary_path)
|
||||
set_if_none(kwargs, "webdriver_binary", default_binary_path)
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
@font-face {
|
||||
font-family: Ahem;
|
||||
src: url(ahem/AHEM____.TTF);
|
||||
}
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
The files in this directory are copied from http://www.w3.org/Style/CSS/Test/Fonts/Ahem/
|
|
@ -1,36 +0,0 @@
|
|||
The Ahem font in this directory belongs to the public domain. In
|
||||
jurisdictions that do not recognize public domain ownership of these
|
||||
files, the following Creative Commons Zero declaration applies:
|
||||
|
||||
<http://labs.creativecommons.org/licenses/zero-waive/1.0/us/legalcode>
|
||||
|
||||
which is quoted below:
|
||||
|
||||
The person who has associated a work with this document (the "Work")
|
||||
affirms that he or she (the "Affirmer") is the/an author or owner of
|
||||
the Work. The Work may be any work of authorship, including a
|
||||
database.
|
||||
|
||||
The Affirmer hereby fully, permanently and irrevocably waives and
|
||||
relinquishes all of her or his copyright and related or neighboring
|
||||
legal rights in the Work available under any federal or state law,
|
||||
treaty or contract, including but not limited to moral rights,
|
||||
publicity and privacy rights, rights protecting against unfair
|
||||
competition and any rights protecting the extraction, dissemination
|
||||
and reuse of data, whether such rights are present or future, vested
|
||||
or contingent (the "Waiver"). The Affirmer makes the Waiver for the
|
||||
benefit of the public at large and to the detriment of the Affirmer's
|
||||
heirs or successors.
|
||||
|
||||
The Affirmer understands and intends that the Waiver has the effect
|
||||
of eliminating and entirely removing from the Affirmer's control all
|
||||
the copyright and related or neighboring legal rights previously held
|
||||
by the Affirmer in the Work, to that extent making the Work freely
|
||||
available to the public for any and all uses and purposes without
|
||||
restriction of any kind, including commercial use and uses in media
|
||||
and formats or by methods that have not yet been invented or
|
||||
conceived. Should the Waiver for any reason be judged legally
|
||||
ineffective in any jurisdiction, the Affirmer hereby grants a free,
|
||||
full, permanent, irrevocable, nonexclusive and worldwide license for
|
||||
all her or his copyright and related or neighboring legal rights in
|
||||
the Work.
|
|
@ -1,30 +0,0 @@
|
|||
The Ahem font was developed by Todd Fahrner to help test writers
|
||||
develop predictable tests. The font's em square is exactly square.
|
||||
Its ascent and descent is exactly the size of the em square. This
|
||||
means that the font's extent is exactly the same as its line-height,
|
||||
meaning that it can be exactly aligned with padding, borders, margins,
|
||||
and so forth.
|
||||
|
||||
The font's alphabetic baseline is 0.2em above its bottom, and 0.8em
|
||||
below its top. The font has an x-height of 0.8em.
|
||||
|
||||
The font has four glyphs:
|
||||
|
||||
'X' U+0058 A square exactly 1em in height and width.
|
||||
|
||||
'p' U+0070 A rectangle exactly 0.2em high, 1em wide, and aligned so
|
||||
that its top is flush with the baseline.
|
||||
|
||||
'É' U+00C9 A rectangle exactly 0.8em high, 1em wide, and aligned so
|
||||
that its bottom is flush with the baseline.
|
||||
|
||||
' ' U+0020 A transparent space exactly 1em high and wide.
|
||||
|
||||
Most other US-ASCII characters in the font have the same glyph as X.
|
||||
|
||||
The Ahem font belongs to the public domain as described in COPYING.
|
||||
|
||||
Acknowledgements: The font was originally created by Todd Fahrner in
|
||||
the late 90s, and was updated by Paul Nelson in the mid 2000s. The
|
||||
changes were the introduction of x-height information to the OS/2
|
||||
table and the addition of the space and non-breaking space glyphs.
|
|
@ -28,4 +28,3 @@
|
|||
|
||||
[.test 16: space-around]
|
||||
expected: FAIL
|
||||
|
4
tests/wpt/mozilla/meta/MANIFEST.json
vendored
4
tests/wpt/mozilla/meta/MANIFEST.json
vendored
|
@ -8601,7 +8601,7 @@
|
|||
],
|
||||
"css": {
|
||||
"ahem.css": [
|
||||
"51eede74aaa0b43f2c9235019bc73a508b1f14e4",
|
||||
"a7db592e0df53e0b70f66ca7b31a7734db18887e",
|
||||
[]
|
||||
]
|
||||
},
|
||||
|
@ -10647,7 +10647,7 @@
|
|||
[]
|
||||
],
|
||||
"no_mime_type.py": [
|
||||
"860005a42c237735287031133786352d7c732402",
|
||||
"980eeee18f993f20a9df033f337a52ec93155ec4",
|
||||
[]
|
||||
],
|
||||
"origin_helpers.js": [
|
||||
|
|
6
tests/wpt/mozilla/tests/css/css/ahem.css
vendored
6
tests/wpt/mozilla/tests/css/css/ahem.css
vendored
|
@ -1,3 +1,9 @@
|
|||
@font-face {
|
||||
font-family: 'ahem';
|
||||
src: local('Ahem'),
|
||||
url('/fonts/Ahem.ttf');
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'ahem';
|
||||
font-size: 100px;
|
||||
|
|
|
@ -7,5 +7,5 @@ def main(request, response):
|
|||
headers = []
|
||||
if b'Content-Type' in request.GET:
|
||||
headers += [(b'Content-Type', request.GET[b'Content-Type'])]
|
||||
with open('./resources/ahem/AHEM____.TTF', 'rb') as f:
|
||||
with open('./tests/wpt/tests/fonts/Ahem.ttf', 'rb') as f:
|
||||
return 200, headers, f.read()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue