layout: Implement floated list items.

This patch also makes Servo not crash when
`generated_containing_block_rect()` is called on a list item (as, for
example, GitHub does), and for good measure I added the fix to other
flows as well.
This commit is contained in:
Patrick Walton 2014-12-22 11:40:20 -08:00
parent c8e68fa45c
commit d891c677aa
9 changed files with 110 additions and 12 deletions

View file

@ -233,3 +233,4 @@ fragment=top != ../html/acid2.html acid2_ref.html
== filter_sepia_a.html filter_sepia_ref.html
== mix_blend_mode_a.html mix_blend_mode_ref.html
!= text_overflow_a.html text_overflow_ref.html
== floated_list_item_a.html floated_list_item_ref.html

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<!-- Tests that list items can be floated. -->
<style>
ul div {
display: list-item;
float: left;
list-style: none;
margin: 0;
}
ul {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<ul>
<div>Foo</div>
<div>Bar</div>
<div>Baz</div>
</ul>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<!-- Tests that list items can be floated. -->
<style>
ul div {
float: left;
margin: 0;
}
ul {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<ul>
<div>Foo</div>
<div>Bar</div>
<div>Baz</div>
</ul>
</body>
</html>