Various fixes

Fix the behavior of block-direction margins of replaced element both
as block level or inline level, and no longer query fragment info when
building display list for canvas.
This commit is contained in:
Pu Xingyu 2016-12-11 04:22:49 +08:00
parent b1b17f1869
commit b0de105bb0
3 changed files with 54 additions and 52 deletions

View file

@ -1990,10 +1990,10 @@ impl Fragment {
SpecificFragmentInfo::Canvas(_) | SpecificFragmentInfo::Iframe(_) |
SpecificFragmentInfo::Image(_) | SpecificFragmentInfo::Svg(_) |
SpecificFragmentInfo::Generic | SpecificFragmentInfo::GeneratedContent(_) => {
let ascent = self.border_box.size.block + self.margin.block_start;
let ascent = self.border_box.size.block + self.margin.block_end;
InlineMetrics {
space_above_baseline: ascent,
space_below_baseline: self.margin.block_end,
space_above_baseline: ascent + self.margin.block_start,
space_below_baseline: Au(0),
ascent: ascent,
}
}