layout: Float table wrappers directly instead of generating a block

wrapper around them.

Fixes Wikipedia tables leaking out.

Along the way, I refactored tables' width calculation significantly.
This was necessary in order to properly handle floated tables, as some
of the logic had to be ported over from block flows.
This commit is contained in:
Patrick Walton 2014-09-19 22:46:41 -07:00
parent e9a7b44f68
commit 62bb9093d7
9 changed files with 270 additions and 217 deletions

View file

@ -144,3 +144,4 @@ flaky_gpu,flaky_linux == acid2_noscroll.html acid2_ref_broken.html
== whitespace_nowrap_a.html whitespace_nowrap_ref.html
== block_formatting_context_relative_a.html block_formatting_context_ref.html
== block_formatting_context_translation_a.html block_formatting_context_translation_ref.html
== floated_table_with_margin_a.html floated_table_with_margin_ref.html

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<title>Rust - Wikipedia, the free encyclopedia</title>
<style>
body {
margin: 0;
}
</style>
</head>
<body>
<table style="float: right; margin: 0px 0px 0em 1em; width: 100px; background: red;">
<tr><td>foo</td></tr>
<tr><td>foo</td></tr>
<tr><td>foo</td></tr>
<tr><td>foo</td></tr>
<tr><td>foo</td></tr>
</table>
</body>
</html>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<title>Rust - Wikipedia, the free encyclopedia</title>
<style>
body {
margin: 0;
}
</style>
</head>
<body>
<div style="float: right"><table style="margin: 0px 0px 0em 1em; width: 100px; background: red;">
<tr><td>foo</td></tr>
<tr><td>foo</td></tr>
<tr><td>foo</td></tr>
<tr><td>foo</td></tr>
<tr><td>foo</td></tr>
</table></div>
</body>
</html>