mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
html: Properly count <image>/<source> insertion/removal steps as the relevant mutations (#39452)
Follow the HTML specification and take into account that the HTML `<image>/<source>` element inserting/removal steps should only be counted as relevant mutations for `<image>` element if the parent of the inclusive ancestor that was inserted/removed is the parent `<picture>` element. See <https://html.spec.whatwg.org/multipage/#relevant-mutations>. Testing: Improvements in the following tests - html/semantics/embedded-content/the-img-element/relevant-mutations.html Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
This commit is contained in:
parent
c63311af02
commit
99fbd36b5d
6 changed files with 75 additions and 71 deletions
|
@ -586,20 +586,15 @@ impl VirtualMethods for ShadowRoot {
|
|||
|
||||
shadow_root.set_flag(NodeFlags::IS_CONNECTED, context.tree_connected);
|
||||
|
||||
let context = BindContext::new(shadow_root);
|
||||
|
||||
// avoid iterate over the shadow root itself
|
||||
for node in shadow_root.traverse_preorder(ShadowIncluding::Yes).skip(1) {
|
||||
node.set_flag(NodeFlags::IS_CONNECTED, context.tree_connected);
|
||||
|
||||
// Out-of-document elements never have the descendants flag set
|
||||
debug_assert!(!node.get_flag(NodeFlags::HAS_DIRTY_DESCENDANTS));
|
||||
vtable_for(&node).bind_to_tree(
|
||||
&BindContext {
|
||||
tree_connected: context.tree_connected,
|
||||
tree_is_in_a_document_tree: false,
|
||||
tree_is_in_a_shadow_tree: true,
|
||||
},
|
||||
can_gc,
|
||||
);
|
||||
vtable_for(&node).bind_to_tree(&context, can_gc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue