Auto merge of #10255 - mbrubeck:box-unscanned, r=pcwalton

Reduce size of layout::fragment::Fragment struct

This reduces the size of the SpecificFragmentInfo enum from 48 to 24.

r? @pcwalton

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10255)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-03-30 07:49:25 +05:30
commit 44b2ba2547
11 changed files with 76 additions and 16 deletions

View file

@ -145,7 +145,7 @@ pub enum SpecificFragmentInfo {
/// content resolution phase (e.g. an ordered list item marker).
GeneratedContent(Box<GeneratedContentInfo>),
Iframe(Box<IframeFragmentInfo>),
Iframe(IframeFragmentInfo),
Image(Box<ImageFragmentInfo>),
Canvas(Box<CanvasFragmentInfo>),
@ -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);