aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2016-07-06 10:02:33 -0700
committerMichael Howell <michael@notriddle.com>2016-07-06 10:02:33 -0700
commitc11f85947e6406d053f02de6129ab7ecfbe7145c (patch)
tree6c986fdc5d5833b08bd7c9d9c3724d2605b2aa82 /components
parent4aaae7a4e69fd0dfb10b562d6a78ddfe3972d8f1 (diff)
downloadservo-c11f85947e6406d053f02de6129ab7ecfbe7145c.tar.gz
servo-c11f85947e6406d053f02de6129ab7ecfbe7145c.zip
Correct negative margins in centered table cells
Fixes @AelitaBot queue viewer page
Diffstat (limited to 'components')
-rw-r--r--components/layout/table_cell.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs
index 58bb96cfbf6..1e36adc65af 100644
--- a/components/layout/table_cell.rs
+++ b/components/layout/table_cell.rs
@@ -80,8 +80,12 @@ impl TableCellFlow {
if !flow::base(self).restyle_damage.contains(REFLOW) {
return;
}
+ // Note to the reader: this code has been tested with negative margins.
+ // We end up with a "end" that's before the "start," but the math still works out.
let first_start = flow::base(self).children.front().map(|kid| {
+ let kid_base = flow::base(kid);
flow::base(kid).position.start.b
+ - kid_base.collapsible_margins.block_start_margin_for_noncollapsible_context()
});
if let Some(mut first_start) = first_start {
let mut last_end = first_start;