mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +01:00
layout: instantiate SpecificFragmentInfo from node's media data
This commit is contained in:
parent
006bef5eb5
commit
2d709a283b
1 changed files with 11 additions and 5 deletions
|
@ -23,11 +23,12 @@ use floats::FloatKind;
|
||||||
use flow::{AbsoluteDescendants, Flow, FlowClass, GetBaseFlow, ImmutableFlowUtils};
|
use flow::{AbsoluteDescendants, Flow, FlowClass, GetBaseFlow, ImmutableFlowUtils};
|
||||||
use flow::{FlowFlags, MutableFlowUtils, MutableOwnedFlowUtils};
|
use flow::{FlowFlags, MutableFlowUtils, MutableOwnedFlowUtils};
|
||||||
use flow_ref::FlowRef;
|
use flow_ref::FlowRef;
|
||||||
use fragment::{CanvasFragmentInfo, ImageFragmentInfo, InlineAbsoluteFragmentInfo, SvgFragmentInfo};
|
use fragment::{
|
||||||
use fragment::{Fragment, GeneratedContentInfo, IframeFragmentInfo, FragmentFlags};
|
CanvasFragmentInfo, Fragment, FragmentFlags, GeneratedContentInfo, IframeFragmentInfo,
|
||||||
use fragment::{InlineAbsoluteHypotheticalFragmentInfo, TableColumnFragmentInfo};
|
ImageFragmentInfo, InlineAbsoluteFragmentInfo, InlineAbsoluteHypotheticalFragmentInfo,
|
||||||
use fragment::{InlineBlockFragmentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo};
|
InlineBlockFragmentInfo, MediaFragmentInfo, SpecificFragmentInfo, SvgFragmentInfo,
|
||||||
use fragment::WhitespaceStrippingResult;
|
TableColumnFragmentInfo, UnscannedTextFragmentInfo, WhitespaceStrippingResult,
|
||||||
|
};
|
||||||
use inline::{InlineFlow, InlineFragmentNodeInfo, InlineFragmentNodeFlags};
|
use inline::{InlineFlow, InlineFragmentNodeInfo, InlineFragmentNodeFlags};
|
||||||
use linked_list::prepend_from;
|
use linked_list::prepend_from;
|
||||||
use list_item::{ListItemFlow, ListStyleTypeContent};
|
use list_item::{ListItemFlow, ListStyleTypeContent};
|
||||||
|
@ -405,6 +406,10 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
||||||
&self.layout_context,
|
&self.layout_context,
|
||||||
));
|
));
|
||||||
SpecificFragmentInfo::Image(image_info)
|
SpecificFragmentInfo::Image(image_info)
|
||||||
|
}
|
||||||
|
Some(LayoutNodeType::Element(LayoutElementType::HTMLMediaElement)) => {
|
||||||
|
let data = node.media_data().unwrap();
|
||||||
|
SpecificFragmentInfo::Media(Box::new(MediaFragmentInfo::new(data)))
|
||||||
},
|
},
|
||||||
Some(LayoutNodeType::Element(LayoutElementType::HTMLObjectElement)) => {
|
Some(LayoutNodeType::Element(LayoutElementType::HTMLObjectElement)) => {
|
||||||
let image_info = Box::new(ImageFragmentInfo::new(
|
let image_info = Box::new(ImageFragmentInfo::new(
|
||||||
|
@ -1956,6 +1961,7 @@ where
|
||||||
match self.type_id() {
|
match self.type_id() {
|
||||||
Some(LayoutNodeType::Text) |
|
Some(LayoutNodeType::Text) |
|
||||||
Some(LayoutNodeType::Element(LayoutElementType::HTMLImageElement)) |
|
Some(LayoutNodeType::Element(LayoutElementType::HTMLImageElement)) |
|
||||||
|
Some(LayoutNodeType::Element(LayoutElementType::HTMLMediaElement)) |
|
||||||
Some(LayoutNodeType::Element(LayoutElementType::HTMLIFrameElement)) |
|
Some(LayoutNodeType::Element(LayoutElementType::HTMLIFrameElement)) |
|
||||||
Some(LayoutNodeType::Element(LayoutElementType::HTMLCanvasElement)) |
|
Some(LayoutNodeType::Element(LayoutElementType::HTMLCanvasElement)) |
|
||||||
Some(LayoutNodeType::Element(LayoutElementType::SVGSVGElement)) => true,
|
Some(LayoutNodeType::Element(LayoutElementType::SVGSVGElement)) => true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue