From 0b68fb3cb537c0eb3e25bee395ff1e40d4e60258 Mon Sep 17 00:00:00 2001 From: Alexandrov Sergey Date: Sun, 7 Aug 2016 23:47:50 +0300 Subject: [PATCH] reset border_padding between, account for border_padding in border_box and reset *_FRAGMENT_OF_ELEMENT flag for splitted fragments --- components/layout/inline.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/components/layout/inline.rs b/components/layout/inline.rs index f734e66eb6a7..0bc24d762768 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -636,7 +636,23 @@ impl LineBreaker { // Push the first fragment onto the line we're working on and start off the next line with // the second fragment. If there's no second fragment, the next line will start off empty. match (inline_start_fragment, inline_end_fragment) { - (Some(inline_start_fragment), Some(inline_end_fragment)) => { + (Some(mut inline_start_fragment), Some(mut inline_end_fragment)) => { + inline_start_fragment.border_padding.inline_end = Au(0); + if let Some(ref mut inline_context) = inline_start_fragment.inline_context { + for node in &mut inline_context.nodes { + node.flags.remove(LAST_FRAGMENT_OF_ELEMENT); + } + } + inline_start_fragment.border_box.size.inline += inline_start_fragment.border_padding.inline_start; + + inline_end_fragment.border_padding.inline_start = Au(0); + if let Some(ref mut inline_context) = inline_end_fragment.inline_context { + for node in &mut inline_context.nodes { + node.flags.remove(FIRST_FRAGMENT_OF_ELEMENT); + } + } + inline_end_fragment.border_box.size.inline += inline_end_fragment.border_padding.inline_end; + self.push_fragment_to_line(layout_context, inline_start_fragment, LineFlushMode::Flush);