Do not replace an ellipsis when reflowing a line

The ellipsis should be replaced, if needed, when the text itself is reflowed.
This commit is contained in:
Michael Howell 2017-01-11 23:29:56 +00:00
parent 783829eccc
commit 8a90cda09f
2 changed files with 21 additions and 5 deletions

View file

@ -15,6 +15,7 @@ use flow::{CONTAINS_TEXT_OR_REPLACED_FRAGMENTS, EarlyAbsolutePositionInfo, Mutab
use flow::OpaqueFlow;
use flow_ref::FlowRef;
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, Overflow};
use fragment::IS_ELLIPSIS;
use fragment::SpecificFragmentInfo;
use gfx::display_list::OpaqueNode;
use gfx::font::FontMetrics;
@ -331,6 +332,16 @@ impl LineBreaker {
None => break,
Some(fragment) => fragment,
};
// If ellipsis are still needed, then they were already needed for the previous fragment.
if fragment.flags.contains(IS_ELLIPSIS) {
continue
}
// If ellipsis are still needed, then they were already needed for the previous fragment.
if fragment.flags.contains(IS_ELLIPSIS) {
continue
}
// Try to append the fragment.
self.reflow_fragment(fragment, flow, layout_context);