diff options
author | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2018-08-29 18:30:11 +0200 |
---|---|---|
committer | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2018-10-08 16:12:01 +0200 |
commit | 2d709a283bb2856e2d47c5163ac6a10cf00e2259 (patch) | |
tree | fe2c0a6be819a28f3a441bc44f6d313ced529e15 /components/layout/construct.rs | |
parent | 006bef5eb5a96744b0dae1e8cc8fec2bbee0edc4 (diff) | |
download | servo-2d709a283bb2856e2d47c5163ac6a10cf00e2259.tar.gz servo-2d709a283bb2856e2d47c5163ac6a10cf00e2259.zip |
layout: instantiate SpecificFragmentInfo from node's media data
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r-- | components/layout/construct.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 36ab116d0ca..bb3c534830f 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -23,11 +23,12 @@ use floats::FloatKind; use flow::{AbsoluteDescendants, Flow, FlowClass, GetBaseFlow, ImmutableFlowUtils}; use flow::{FlowFlags, MutableFlowUtils, MutableOwnedFlowUtils}; use flow_ref::FlowRef; -use fragment::{CanvasFragmentInfo, ImageFragmentInfo, InlineAbsoluteFragmentInfo, SvgFragmentInfo}; -use fragment::{Fragment, GeneratedContentInfo, IframeFragmentInfo, FragmentFlags}; -use fragment::{InlineAbsoluteHypotheticalFragmentInfo, TableColumnFragmentInfo}; -use fragment::{InlineBlockFragmentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo}; -use fragment::WhitespaceStrippingResult; +use fragment::{ + CanvasFragmentInfo, Fragment, FragmentFlags, GeneratedContentInfo, IframeFragmentInfo, + ImageFragmentInfo, InlineAbsoluteFragmentInfo, InlineAbsoluteHypotheticalFragmentInfo, + InlineBlockFragmentInfo, MediaFragmentInfo, SpecificFragmentInfo, SvgFragmentInfo, + TableColumnFragmentInfo, UnscannedTextFragmentInfo, WhitespaceStrippingResult, +}; use inline::{InlineFlow, InlineFragmentNodeInfo, InlineFragmentNodeFlags}; use linked_list::prepend_from; use list_item::{ListItemFlow, ListStyleTypeContent}; @@ -405,6 +406,10 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> &self.layout_context, )); 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)) => { let image_info = Box::new(ImageFragmentInfo::new( @@ -1956,6 +1961,7 @@ where match self.type_id() { Some(LayoutNodeType::Text) | Some(LayoutNodeType::Element(LayoutElementType::HTMLImageElement)) | + Some(LayoutNodeType::Element(LayoutElementType::HTMLMediaElement)) | Some(LayoutNodeType::Element(LayoutElementType::HTMLIFrameElement)) | Some(LayoutNodeType::Element(LayoutElementType::HTMLCanvasElement)) | Some(LayoutNodeType::Element(LayoutElementType::SVGSVGElement)) => true, |