mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
layout: Implement text-indent
per CSS 2.1 § 16.1.
I had to use a somewhat unconventional method of computing text indentation (propagating from blocks down to inlines) because of the way containing blocks are handled in Servo. (As a side note, neither Gecko nor WebKit correctly handles percentages in `text-align`, at least incrementally -- i.e. when the percentages are relative to the viewport and the viewport is resized.)
This commit is contained in:
parent
071d320728
commit
caee309ef4
11 changed files with 173 additions and 28 deletions
46
tests/ref/text_indent_ref.html
Normal file
46
tests/ref/text_indent_ref.html
Normal file
|
@ -0,0 +1,46 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!-- Tests that `text-indent` works, in particular when combined with `text-align`. -->
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="css/ahem.css">
|
||||
<style>
|
||||
section {
|
||||
background: blue;
|
||||
position: absolute;
|
||||
width: 100px;
|
||||
}
|
||||
#a {
|
||||
top: 0;
|
||||
left: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
#b {
|
||||
top: 100px;
|
||||
left: 0;
|
||||
height: 100px;
|
||||
}
|
||||
#c {
|
||||
top: 200px;
|
||||
left: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
#d {
|
||||
top: 300px;
|
||||
left: 0;
|
||||
height: 100px;
|
||||
}
|
||||
#e {
|
||||
top: 0;
|
||||
left: 300px;
|
||||
height: 200px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<section id=a></section>
|
||||
<section id=b></section>
|
||||
<section id=c></section>
|
||||
<section id=d></section>
|
||||
<section id=e></section>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue