diff --git a/components/layout/construct.rs b/components/layout/construct.rs index f108876d53c..38c2c9f4f1e 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -705,11 +705,16 @@ 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() || - node.type_id() == Some(LayoutNodeType::Element(LayoutElementType::HTMLMediaElement)) - { + let is_media_element_with_widget = node.type_id() == + Some(LayoutNodeType::Element(LayoutElementType::HTMLMediaElement)) && + node.as_element().unwrap().is_shadow_host(); + if !node.is_replaced_content() || is_media_element_with_widget { for kid in node.children() { if kid.get_pseudo_element_type() != PseudoElementType::Normal { + if node.is_replaced_content() { + // Replaced elements don't have pseudo-elements per spec. + continue; + } self.process(&kid); } diff --git a/components/layout_thread/dom_wrapper.rs b/components/layout_thread/dom_wrapper.rs index 35463f69715..5d815517532 100644 --- a/components/layout_thread/dom_wrapper.rs +++ b/components/layout_thread/dom_wrapper.rs @@ -1397,6 +1397,10 @@ impl<'le> ThreadSafeLayoutElement for ServoThreadSafeLayoutElement<'le> { .expect("Unstyled layout node?") .borrow() } + + fn is_shadow_host(&self) -> bool { + self.element.shadow_root().is_some() + } } /// This implementation of `::selectors::Element` is used for implementing lazy diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 50c0f8d4f4d..fea12fc6905 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -4581,6 +4581,7 @@ impl DocumentMethods for Document { self.exit_fullscreen() } + // check-tidy: no specs after this line // Servo only API to get an instance of the controls of a specific // media element matching the given id. fn ServoGetMediaControls(&self, id: DOMString) -> Fallible> { diff --git a/components/script/dom/shadowroot.rs b/components/script/dom/shadowroot.rs index 47deb9067e6..91218cd5a1f 100644 --- a/components/script/dom/shadowroot.rs +++ b/components/script/dom/shadowroot.rs @@ -46,8 +46,6 @@ pub struct ShadowRoot { author_styles: DomRefCell>, stylesheet_list: MutNullableDom, window: Dom, - /// Whether this ShadowRoot hosts a User Agent widget. - is_widget: IsUserAgentWidget, } impl ShadowRoot { @@ -72,7 +70,6 @@ impl ShadowRoot { author_styles: DomRefCell::new(AuthorStyles::new()), stylesheet_list: MutNullableDom::new(None), window: Dom::from_ref(document.window()), - is_widget, } } @@ -170,10 +167,6 @@ impl ShadowRoot { root, ); } - - pub fn is_user_agent_widget(&self) -> bool { - self.is_widget == IsUserAgentWidget::Yes - } } impl ShadowRootMethods for ShadowRoot { diff --git a/components/script_layout_interface/wrapper_traits.rs b/components/script_layout_interface/wrapper_traits.rs index ae559474d06..8ce22e9e202 100644 --- a/components/script_layout_interface/wrapper_traits.rs +++ b/components/script_layout_interface/wrapper_traits.rs @@ -490,4 +490,6 @@ pub trait ThreadSafeLayoutElement: .clone(), } } + + fn is_shadow_host(&self) -> bool; } diff --git a/ports/glutin/resources.rs b/ports/glutin/resources.rs index d668f0ac247..0dff0dce2bf 100644 --- a/ports/glutin/resources.rs +++ b/ports/glutin/resources.rs @@ -28,7 +28,7 @@ fn filename(file: Resource) -> &'static str { Resource::ServoCSS => "servo.css", Resource::PresentationalHintsCSS => "presentational-hints.css", Resource::QuirksModeCSS => "quirks-mode.css", - Resource::RippyPNG => "rippy.png", + Resource::RippyPNG => "rippy.png", Resource::MediaControlsCSS => "media_controls.css", Resource::MediaControlsJS => "media_controls.js", }