mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
layout: Use BoxFragment
border widths for display list generation (#31292)
Instead of using the border widths from the style, use the ones recorded by the `BoxFragment`. This is necessary because inline layout can override these border widths during fragmentation. For instance, when a box is split across two lines only one fragment should have an inline start border.
This commit is contained in:
parent
eb6c22fff1
commit
f6b81a97f3
75 changed files with 8 additions and 155 deletions
|
@ -685,11 +685,15 @@ impl<'a> BuilderForBoxFragment<'a> {
|
|||
|
||||
fn build_border(&mut self, builder: &mut DisplayListBuilder) {
|
||||
let border = self.fragment.style.get_border();
|
||||
let border_widths = self
|
||||
.fragment
|
||||
.border
|
||||
.to_physical(self.fragment.style.writing_mode);
|
||||
let widths = SideOffsets2D::new(
|
||||
border.border_top_width.to_f32_px(),
|
||||
border.border_right_width.to_f32_px(),
|
||||
border.border_bottom_width.to_f32_px(),
|
||||
border.border_left_width.to_f32_px(),
|
||||
border_widths.top.px(),
|
||||
border_widths.right.px(),
|
||||
border_widths.bottom.px(),
|
||||
border_widths.left.px(),
|
||||
);
|
||||
if widths == SideOffsets2D::zero() {
|
||||
return;
|
||||
|
|
|
@ -302,11 +302,6 @@ impl InlineBoxLineItem {
|
|||
border.inline_start = Length::zero();
|
||||
margin.inline_start = Length::zero();
|
||||
}
|
||||
if !self.is_last_fragment_of_ib_split {
|
||||
padding.inline_end = Length::zero();
|
||||
border.inline_end = Length::zero();
|
||||
margin.inline_end = Length::zero();
|
||||
}
|
||||
let pbm_sums = &(&padding + &border) + &margin;
|
||||
state.inline_position += pbm_sums.inline_start;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue