Hide servo internal shadow roots from the inspector by default (#35958)

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-03-13 14:08:24 +01:00 committed by GitHub
parent 4a9967725f
commit e627ac5cfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 27 additions and 4 deletions

View file

@ -14,6 +14,7 @@ use devtools_traits::{
use ipc_channel::ipc::IpcSender;
use js::jsval::UndefinedValue;
use js::rust::ToString;
use servo_config::pref;
use uuid::Uuid;
use crate::document_collection::DocumentCollection;
@ -162,7 +163,11 @@ pub(crate) fn handle_get_children(
let mut children = vec![];
if let Some(shadow_root) = parent.downcast::<Element>().and_then(Element::shadow_root) {
children.push(shadow_root.upcast::<Node>().summarize());
if !shadow_root.is_user_agent_widget() ||
pref!(inspector_show_servo_internal_shadow_roots)
{
children.push(shadow_root.upcast::<Node>().summarize());
}
}
let children_iter = parent.children().enumerate().filter_map(|(i, child)| {
// Filter whitespace only text nodes that are not inline level