mirror of
https://github.com/servo/servo.git
synced 2025-06-10 09:33:13 +00:00
layout: Shrink fragments down from 448 bytes down to 128 bytes.
16% performance improvement in layout (!)
This commit is contained in:
parent
2df236376a
commit
de5e2fd5e2
8 changed files with 128 additions and 88 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue