layout: Shrink fragments down from 448 bytes down to 128 bytes.

16% performance improvement in layout (!)
This commit is contained in:
Patrick Walton 2014-10-21 23:08:02 -07:00
parent 2df236376a
commit de5e2fd5e2
8 changed files with 128 additions and 88 deletions

View file

@ -238,12 +238,12 @@ impl<'a> FlowConstructor<'a> {
Some(url) => {
// FIXME(pcwalton): The fact that image fragments store the cache within them makes
// little sense to me.
ImageFragment(ImageFragmentInfo::new(node,
url,
self.layout_context
.shared
.image_cache
.clone()))
ImageFragment(box ImageFragmentInfo::new(node,
url,
self.layout_context
.shared
.image_cache
.clone()))
}
}
}
@ -258,7 +258,7 @@ impl<'a> FlowConstructor<'a> {
-> SpecificFragmentInfo {
match node.type_id() {
Some(ElementNodeTypeId(HTMLIFrameElementTypeId)) => {
IframeFragment(IframeFragmentInfo::new(node))
IframeFragment(box IframeFragmentInfo::new(node))
}
Some(ElementNodeTypeId(HTMLImageElementTypeId)) => {
self.build_fragment_info_for_image(node, node.image_url())