aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/construct.rs
diff options
context:
space:
mode:
authorFernando Jiménez Moreno <ferjmoreno@gmail.com>2019-05-13 17:29:23 +0200
committerFernando Jiménez Moreno <ferjmoreno@gmail.com>2019-07-22 17:40:15 +0200
commite344203c116ba49713c91138174230bf530f0224 (patch)
tree5edbe429942b560eac647e7b89bb9d517b1d5c76 /components/layout/construct.rs
parent618f528344642d682c5ed2f35bfede1b179e0459 (diff)
downloadservo-e344203c116ba49713c91138174230bf530f0224.tar.gz
servo-e344203c116ba49713c91138174230bf530f0224.zip
Only allow UA widgets as children of media elements
Do not allow pseudo-elements for replaced elements
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r--components/layout/construct.rs11
1 files changed, 8 insertions, 3 deletions
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);
}