diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2018-01-24 14:31:07 +0530 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2018-01-24 14:31:07 +0530 |
commit | fc97f0b4640c0aa8ae7368a02ba5ce2b455261e7 (patch) | |
tree | b8e1e36d09dabca12ac4d3bf8ccccf1febcccf14 /components/layout/fragment.rs | |
parent | f3c81fcda8a16e9f3d7a30a9f67b0a03d618e630 (diff) | |
download | servo-fc97f0b4640c0aa8ae7368a02ba5ce2b455261e7.tar.gz servo-fc97f0b4640c0aa8ae7368a02ba5ce2b455261e7.zip |
do not preserve suppress flag on second half of split
Diffstat (limited to 'components/layout/fragment.rs')
-rw-r--r-- | components/layout/fragment.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index d11ed64a4be..4de15fdbb32 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -717,13 +717,15 @@ impl Fragment { } /// Transforms this fragment using the given `SplitInfo`, preserving all the other data. - pub fn transform_with_split_info(&self, split: &SplitInfo, text_run: Arc<TextRun>) - -> Fragment { + /// + /// If this is the first half of a split, `first` is true + pub fn transform_with_split_info(&self, split: &SplitInfo, text_run: Arc<TextRun>, + first: bool) -> Fragment { let size = LogicalSize::new(self.style.writing_mode, split.inline_size, self.border_box.size.block); // Preserve the insertion point if it is in this fragment's range or it is at line end. - let (flags, insertion_point) = match self.specific { + let (mut flags, insertion_point) = match self.specific { SpecificFragmentInfo::ScannedText(ref info) => { match info.insertion_point { Some(index) if split.range.contains(index) => (info.flags, info.insertion_point), @@ -734,6 +736,11 @@ impl Fragment { }, _ => (ScannedTextFlags::empty(), None) }; + + if !first { + flags.set(ScannedTextFlags::SUPPRESS_LINE_BREAK_BEFORE, false); + } + let info = Box::new(ScannedTextFragmentInfo::new( text_run, split.range, |