mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
gfx: Implement letter-spacing
per CSS 2.1 § 16.4.
The ligature disabling code has been manually verified, but I was unable to reftest it. (The only way I could think of would be to create an Ahem-like font with a ligature table, but that would be an awful lot of work.) Near as I can tell, the method used to apply the spacing (manually inserting extra advance post-shaping) matches Gecko.
This commit is contained in:
parent
758d79fff4
commit
07bc97e3e2
11 changed files with 246 additions and 47 deletions
|
@ -193,3 +193,4 @@ fragment=top != ../html/acid2.html acid2_ref.html
|
|||
== text_transform_capitalize_a.html text_transform_capitalize_ref.html
|
||||
== outlines_simple_a.html outlines_simple_ref.html
|
||||
== outlines_wrap_a.html outlines_wrap_ref.html
|
||||
== letter_spacing_a.html letter_spacing_ref.html
|
||||
|
|
17
tests/ref/letter_spacing_a.html
Normal file
17
tests/ref/letter_spacing_a.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<html>
|
||||
<head>
|
||||
<!-- Tests that `letter-spacing` works. -->
|
||||
<link rel="stylesheet" type="text/css" href="css/ahem.css">
|
||||
<style>
|
||||
* {
|
||||
letter-spacing: 100px;
|
||||
color: blue;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
<body>XXX</body>
|
||||
</head>
|
||||
|
||||
|
26
tests/ref/letter_spacing_ref.html
Normal file
26
tests/ref/letter_spacing_ref.html
Normal file
|
@ -0,0 +1,26 @@
|
|||
<html>
|
||||
<head>
|
||||
<!-- Tests that `letter-spacing` works. -->
|
||||
<style>
|
||||
section, nav, main {
|
||||
background-color: blue;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
section {
|
||||
left: 0;
|
||||
}
|
||||
nav {
|
||||
left: 200px;
|
||||
}
|
||||
main {
|
||||
left: 400px;
|
||||
}
|
||||
</style>
|
||||
<body><section></section><nav></nav><main></main></body>
|
||||
</head>
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue