mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Put UnscannedTextFragmentInfo in a Box
This reduces the size of the SpecificFragmentInfo enum from 48 to 24.
This commit is contained in:
parent
14e945f09a
commit
31261f045e
5 changed files with 14 additions and 13 deletions
|
@ -167,7 +167,7 @@ pub enum SpecificFragmentInfo {
|
|||
TableWrapper,
|
||||
Multicol,
|
||||
MulticolColumn,
|
||||
UnscannedText(UnscannedTextFragmentInfo),
|
||||
UnscannedText(Box<UnscannedTextFragmentInfo>),
|
||||
}
|
||||
|
||||
impl SpecificFragmentInfo {
|
||||
|
@ -896,8 +896,8 @@ impl Fragment {
|
|||
let mut unscanned_ellipsis_fragments = LinkedList::new();
|
||||
unscanned_ellipsis_fragments.push_back(self.transform(
|
||||
self.border_box.size,
|
||||
SpecificFragmentInfo::UnscannedText(UnscannedTextFragmentInfo::new("…".to_owned(),
|
||||
None))));
|
||||
SpecificFragmentInfo::UnscannedText(
|
||||
box UnscannedTextFragmentInfo::new("…".to_owned(), None))));
|
||||
let ellipsis_fragments = TextRunScanner::new().scan_for_runs(&mut layout_context.font_context(),
|
||||
unscanned_ellipsis_fragments);
|
||||
debug_assert!(ellipsis_fragments.len() == 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue