From 4f6b86f9f5234096b4f8f336e297c1cf887ab2d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Jim=C3=A9nez=20Moreno?= Date: Fri, 12 Apr 2019 11:15:26 +0200 Subject: [PATCH] Render media controls --- components/layout/construct.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 21e3611f446..f56da289dda 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -705,7 +705,8 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> // List of absolute descendants, in tree order. let mut abs_descendants = AbsoluteDescendants::new(); let mut legalizer = Legalizer::new(); - if !node.is_replaced_content() { + if !node.is_replaced_content() || + node.type_id() == Some(LayoutNodeType::Element(LayoutElementType::HTMLMediaElement)) { for kid in node.children() { if kid.get_pseudo_element_type() != PseudoElementType::Normal { self.process(&kid); @@ -1248,9 +1249,14 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> // Go to a path that concatenates our kids' fragments. self.build_fragments_for_nonreplaced_inline_content(node) } else { - // Otherwise, just nuke our kids' fragments, create our fragment if any, and be done - // with it. - self.build_fragments_for_replaced_inline_content(node) + if node.type_id() == Some(LayoutNodeType::Element(LayoutElementType::HTMLMediaElement)) { + // Do not treat media elements as leafs. + self.build_flow_for_block(node, None) + } else { + // Otherwise, just nuke our kids' fragments, create our fragment if any, and be done + // with it. + self.build_fragments_for_replaced_inline_content(node) + } } }