mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
layout: Lay out Shadow DOM elements (#34701)
When an element is a shadow root, lay out the shadow root elements instead of the non-shadow children. This fixes some tests and introduces some failures, due to bugs in the Shadow DOM implementation. In general, this is very low impact as the Shadow DOM is still disabled by default. At least this gets elements rendering when the preference is turned on though. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
b7460bcb84
commit
50c9c72778
31 changed files with 32 additions and 67 deletions
|
@ -558,19 +558,24 @@ impl Element {
|
|||
};
|
||||
shadow_root.bind_to_tree(&bind_context);
|
||||
|
||||
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
|
||||
let node = self.upcast::<Node>();
|
||||
node.dirty(NodeDamage::OtherNodeDamage);
|
||||
node.rev_version();
|
||||
|
||||
Ok(shadow_root)
|
||||
}
|
||||
|
||||
pub fn detach_shadow(&self) {
|
||||
if let Some(ref shadow_root) = self.shadow_root() {
|
||||
self.upcast::<Node>().note_dirty_descendants();
|
||||
shadow_root.detach();
|
||||
self.ensure_rare_data().shadow_root = None;
|
||||
} else {
|
||||
debug_assert!(false, "Trying to detach a non-attached shadow root");
|
||||
}
|
||||
let Some(ref shadow_root) = self.shadow_root() else {
|
||||
unreachable!("Trying to detach a non-attached shadow root");
|
||||
};
|
||||
|
||||
let node = self.upcast::<Node>();
|
||||
node.note_dirty_descendants();
|
||||
node.rev_version();
|
||||
|
||||
shadow_root.detach();
|
||||
self.ensure_rare_data().shadow_root = None;
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#translation-mode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue