mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Only allow UA widgets as children of media elements
Do not allow pseudo-elements for replaced elements
This commit is contained in:
parent
618f528344
commit
e344203c11
6 changed files with 16 additions and 11 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue