mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
layout: Implement word-spacing
per CSS 2.1 § 16.4.
This assumes that there are no ligatures that span across multiple words. Since we have a per-word shape cache, this is a safe assumption as of now. I have left comments to ensure that, if and when this is revisted, we make sure to handle it properly.
This commit is contained in:
parent
ea39b878ac
commit
106fdb1d32
7 changed files with 94 additions and 7 deletions
|
@ -198,3 +198,4 @@ fragment=top != ../html/acid2.html acid2_ref.html
|
|||
!= border_black_ridge.html border_black_solid.html
|
||||
!= border_black_ridge.html border_black_groove.html
|
||||
== text_indent_a.html text_indent_ref.html
|
||||
== word_spacing_a.html word_spacing_ref.html
|
||||
|
|
16
tests/ref/word_spacing_a.html
Normal file
16
tests/ref/word_spacing_a.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<html>
|
||||
<head>
|
||||
<!-- Tests that `word-spacing` works. -->
|
||||
<link rel="stylesheet" type="text/css" href="css/ahem.css">
|
||||
<style>
|
||||
* {
|
||||
word-spacing: 100px;
|
||||
color: chartreuse;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
<body>X XX</body>
|
||||
</head>
|
||||
|
26
tests/ref/word_spacing_ref.html
Normal file
26
tests/ref/word_spacing_ref.html
Normal file
|
@ -0,0 +1,26 @@
|
|||
<html>
|
||||
<head>
|
||||
<!-- Tests that `word-spacing` works. -->
|
||||
<style>
|
||||
section, nav, main {
|
||||
background-color: chartreuse;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
section {
|
||||
left: 0;
|
||||
}
|
||||
nav {
|
||||
left: 300px;
|
||||
}
|
||||
main {
|
||||
left: 400px;
|
||||
}
|
||||
</style>
|
||||
<body><section></section><nav></nav><main></main></body>
|
||||
</head>
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue