layout: Record sizes for iframes that have no pipeline.

This commit is contained in:
Josh Matthews 2019-11-06 15:39:32 -05:00
parent 7474b309b4
commit 38e4ae0833

View file

@ -1800,18 +1800,9 @@ impl Fragment {
Some(browsing_context_id) => browsing_context_id, Some(browsing_context_id) => browsing_context_id,
None => return warn!("No browsing context id for iframe."), None => return warn!("No browsing context id for iframe."),
}; };
let pipeline_id = match fragment_info.pipeline_id {
Some(pipeline_id) => pipeline_id,
None => return warn!("No pipeline id for iframe {}.", browsing_context_id),
};
let base = create_base_display_item(state); let base = create_base_display_item(state);
let bounds = stacking_relative_content_box.to_layout(); let bounds = stacking_relative_content_box.to_layout();
let item = DisplayItem::Iframe(Box::new(IframeDisplayItem {
base,
bounds,
iframe: pipeline_id,
}));
// XXXjdm: This sleight-of-hand to convert LayoutRect -> Size2D<CSSPixel> // XXXjdm: This sleight-of-hand to convert LayoutRect -> Size2D<CSSPixel>
// looks bogus. // looks bogus.
@ -1820,6 +1811,16 @@ impl Fragment {
size: euclid::Size2D::new(bounds.size.width, bounds.size.height), size: euclid::Size2D::new(bounds.size.width, bounds.size.height),
}); });
let pipeline_id = match fragment_info.pipeline_id {
Some(pipeline_id) => pipeline_id,
None => return warn!("No pipeline id for iframe {}.", browsing_context_id),
};
let item = DisplayItem::Iframe(Box::new(IframeDisplayItem {
base,
bounds,
iframe: pipeline_id,
}));
state.add_display_item(item); state.add_display_item(item);
} }
}, },