mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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:
commit
44b2ba2547
11 changed files with 76 additions and 16 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue