mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 14:45:29 +00:00
4b84fe41d5
Outer table frames act as CSS2.1 table wrapper boxes. We used to lay them out without taking their margins into the account, which meant that their width was always equal to the available width. This breaks horizontal positioning of absolutely positioned kids of a table frame. The main purpose of this patch is to apply the margins of tables to their outer frame, instead of the inner frame. This means that the inner table frame will always have a zero margin, which means that a lot of the stuff which used to rely on the fact that table margins are applied to the inner frame need to change. In particular, in order to get the computed margins of a table, we used to query the inner table frame, and this patch corrects that. Also, when shrink wrapping tables, we used to not take the margins of the inner table frame into account, which is fixed by this patch too. nsBlockReflowState:: ComputeReplacedBlockOffsetsForFloats also needed to be changed to read the margin values from the outer frame too. Also, as part of this patch, we start to respect the CSS2.1 margin model for captions on all sides. This means that in particular, the top/bottom margins on the top-outside and bottom-outside captions will not be collapsed with the top/bottom margins of the table, and that the margins of the caption element contribute to the width and height of the outer table frame. The 427129-table-caption reftest has been modified to match this new behavior. Another side effect of this bug is fixing bug 87277, and the reftests for that bug are marked as passing in this patch.
18 lines
468 B
HTML
18 lines
468 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Testcase for table + caption vertical margins (bug 478614)</title>
|
|
<style type="text/css">
|
|
body {margin-top: 0} /* Don't let collapsing of the body's top margin interfere with positioning */
|
|
caption {margin-top: 50px; margin-bottom: 100px; caption-side:bottom-outside}
|
|
table {margin-bottom: 50px; width:100px}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<table><caption>caption</caption>
|
|
<tr><td>td</td></tr>
|
|
</table>
|
|
<div>block</div>
|
|
</body>
|
|
</html>
|