Correct negative margins in centered table cells

Fixes @AelitaBot queue viewer page
This commit is contained in:
Michael Howell 2016-07-06 10:02:33 -07:00
parent 4aaae7a4e6
commit c11f85947e
4 changed files with 46 additions and 0 deletions

View file

@ -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;