mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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
|
@ -10,6 +10,7 @@ use script_layout_interface::wrapper_traits::{ThreadSafeLayoutElement, ThreadSaf
|
|||
use script_layout_interface::{LayoutElementType, LayoutNodeType};
|
||||
use selectors::Element as SelectorsElement;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::dom::{TElement, TShadowRoot};
|
||||
use style::properties::ComputedValues;
|
||||
use style::selector_parser::PseudoElement;
|
||||
use style::values::generics::counters::{Content, ContentItem};
|
||||
|
@ -467,6 +468,10 @@ pub(crate) fn iter_child_nodes<'dom, Node>(parent: Node) -> impl Iterator<Item =
|
|||
where
|
||||
Node: NodeExt<'dom>,
|
||||
{
|
||||
if let Some(shadow) = parent.as_element().and_then(|e| e.shadow_root()) {
|
||||
return iter_child_nodes(shadow.as_node());
|
||||
};
|
||||
|
||||
let mut next = parent.first_child();
|
||||
std::iter::from_fn(move || {
|
||||
next.inspect(|child| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue