mirror of
https://github.com/servo/servo.git
synced 2025-06-25 09:34:32 +01:00
auto merge of #4114 : glennw/servo/table-layout-fix, r=pcwalton
This commit is contained in:
commit
431644bfc8
4 changed files with 57 additions and 5 deletions
|
@ -265,12 +265,9 @@ impl Flow for TableFlow {
|
||||||
// if there are any, or among all the columns if all are specified.
|
// if there are any, or among all the columns if all are specified.
|
||||||
if total_column_inline_size < content_inline_size &&
|
if total_column_inline_size < content_inline_size &&
|
||||||
num_unspecified_inline_sizes == 0 {
|
num_unspecified_inline_sizes == 0 {
|
||||||
let extra_column_inline_size = content_inline_size;
|
let ratio = content_inline_size.to_subpx() / total_column_inline_size.to_subpx();
|
||||||
(content_inline_size - total_column_inline_size) /
|
|
||||||
(self.column_inline_sizes.len() as i32);
|
|
||||||
for column_inline_size in self.column_inline_sizes.iter_mut() {
|
for column_inline_size in self.column_inline_sizes.iter_mut() {
|
||||||
column_inline_size.minimum_length = column_inline_size.minimum_length +
|
column_inline_size.minimum_length = column_inline_size.minimum_length.scale_by(ratio);
|
||||||
extra_column_inline_size;
|
|
||||||
column_inline_size.percentage = 0.0;
|
column_inline_size.percentage = 0.0;
|
||||||
}
|
}
|
||||||
} else if num_unspecified_inline_sizes != 0 {
|
} else if num_unspecified_inline_sizes != 0 {
|
||||||
|
|
|
@ -185,3 +185,4 @@ fragment=top != ../html/acid2.html acid2_ref.html
|
||||||
!= linear_gradients_corners_a.html linear_gradients_corners_ref.html
|
!= linear_gradients_corners_a.html linear_gradients_corners_ref.html
|
||||||
== linear_gradients_lengths_a.html linear_gradients_lengths_ref.html
|
== linear_gradients_lengths_a.html linear_gradients_lengths_ref.html
|
||||||
== incremental_float_a.html incremental_float_ref.html
|
== incremental_float_a.html incremental_float_ref.html
|
||||||
|
== table_specified_width_a.html table_specified_width_ref.html
|
||||||
|
|
37
tests/ref/table_specified_width_a.html
Normal file
37
tests/ref/table_specified_width_a.html
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
table {
|
||||||
|
table-layout: fixed;
|
||||||
|
width: 400px;
|
||||||
|
border-spacing: 0;
|
||||||
|
}
|
||||||
|
td {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.td1 {
|
||||||
|
background: #ff0000;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
.td2 {
|
||||||
|
background: #00ff00;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table id="mn">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="td1" width="50">
|
||||||
|
</td>
|
||||||
|
<td class="td2" width="150">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
17
tests/ref/table_specified_width_ref.html
Normal file
17
tests/ref/table_specified_width_ref.html
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/ahem.css">
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.red {
|
||||||
|
color: #ff0000;
|
||||||
|
}
|
||||||
|
.green {
|
||||||
|
color: #00ff00;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body><span class="red">X</span><span class="green">XXX</span></body>
|
||||||
|
</html>
|
Loading…
Add table
Add a link
Reference in a new issue