Bug 230555. Support white-space:pre-line (add tests). r+sr=dbaron

This commit is contained in:
Robert O'Callahan 2008-08-12 21:49:03 +12:00
Родитель 1320053484
Коммит a768ce438f
11 изменённых файлов: 187 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html>
<body style="width:6em; text-align:justify; border:1px solid black; overflow:hidden;">
<p>I am the very model of a modern major-general.
<p style="width:100em;">I am the very model of a modern major-general.
<p style="width:100em;">I &nbsp;am the<br>very model of a modern major-general.
<p style="text-align:left;">I &nbsp;am the<br>very model of a modern major-general.
<p>I am the<br>very model of a modern major-general.
</body>
</html>

Просмотреть файл

@ -0,0 +1,18 @@
<!DOCTYPE HTML>
<html>
<body style="width:6em; text-align:justify; border:1px solid black;">
<!-- Test which white-space values are allowed to take justification -->
<p style="white-space:normal;">I am the
very model of a modern major-general.
<p style="white-space:nowrap;">I am the
very model of a modern major-general.
<p style="white-space:pre;">I am the
very model of a modern major-general.
<p style="white-space:pre-wrap;">I am the
very model of a modern major-general.
<p style="white-space:pre-line;">I am the
very model of a modern major-general.
</body>
</html>

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
span { display:inline-block; width:100px; height:10px; background:yellow; }
</style>
</head>
<body>
<span></span><span style="background:none;"></span><span></span><br>
<span></span>
</body>
</html>

Просмотреть файл

@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
span { display:inline-block; width:100px; height:10px; background:yellow; }
</style>
</head>
<!-- Test that justify actually works. 3 spans won't fit on a line so there will be
two spans plus 100px of justification space on the first line. -->
<body style="text-align:justify; width:300px;">
<span></span> <span></span>
<span></span>
</body>
</html>

Просмотреть файл

@ -0,0 +1,13 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
span { display:inline-block; width:100px; height:10px; background:yellow; }
</style>
</head>
<!-- Test that text-align is taken from the containing block only -->
<body style="text-align:justify; width:300px;">
<span></span><span style="display:inline; text-align:left; background:none"> <span></span>
<span></span>
</body>
</html>

Просмотреть файл

@ -0,0 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
span { background:yellow; }
.float { float:left; background:orange; }
.outer { overflow:auto; margin:1em; }
</style>
</head>
<body>
<div class="outer">My name is<br><br><br>Fred.</div>
<div class="outer"><span>My name is<br><br><br>Fred.</span></div>
<div class="outer"><div class="float">My name is<br><br><br>Fred.</div></div>
<div class="outer"><div class="float"><span class="preline">My name is<br><br><br>Fred.</span></div></div>
<div class="outer"><div style="width:0;"><div class="float">My name is<br><br><br>Fred.</div></div></div>
<div class="outer"><div style="width:0;"><div class="float"><span>My name is<br><br><br>Fred.</span></div></div></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
.preline { white-space:pre-line; }
span { background:yellow; }
.float { float:left; background:orange; }
.outer { overflow:auto; margin:1em; }
</style>
</head>
<body>
<!-- Note, in the following tests there are trailing spaces after "is" and on the second
blank line. -->
<div class="outer"><div class="preline">My name is
Fred.</div></div>
<div class="outer"><span class="preline">My name is
Fred.</span></div>
<div class="outer"><div class="preline float">My name is
Fred.</div></div>
<div class="outer"><div class="float"><span class="preline">My name is
Fred.</span></div></div>
<div class="outer"><div style="width:0;"><div class="preline float">My name is
Fred.</div></div></div>
<div class="outer"><div style="width:0;"><div class="float"><span class="preline">My name is
Fred.</span></div></div></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,10 @@
<!DOCTYPE HTML>
<html>
<body>
Hello
<div style="height:100px;"></div>
<br>
<div style="height:100px;"></div>
Kitty
</body>
</html>

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html>
<body>
<!-- Check that a pre-line newline inhibits margin collapsing -->
<div style="margin-bottom:100px;">Hello</div>
<span style="white-space:pre-line;">
</span>
<div style="margin-top:100px;">Kitty</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,8 @@
<!DOCTYPE HTML>
<html>
<body>
<div><span style="font-size:200%; white-space:pre">
</span>
Hello</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
div::first-letter { font-size:200%; }
</style>
</head>
<body style="white-space:pre-line;">
<div>
Hello</div>
</body>
</html>