Add a new descendants api as well as deeper element queries to ElementHandle

This commit is contained in:
Simon Hausmann 2024-06-18 10:45:06 +02:00 committed by Simon Hausmann
parent 19116252f4
commit b67fcce4a3
3 changed files with 335 additions and 12 deletions

View file

@ -181,7 +181,13 @@ pub async fn run_passes(
doc.visit_all_used_components(|component| {
deduplicate_property_read::deduplicate_property_read(component);
optimize_useless_rectangles::optimize_useless_rectangles(component);
// Don't perform the empty rectangle removal when debug info is requested, because the resulting
// item tree ends up with a hierarchy where certain items have children that aren't child elements
// but siblings or sibling children. We need a new data structure to perform a correct element tree
// traversal.
if !type_loader.compiler_config.debug_info {
optimize_useless_rectangles::optimize_useless_rectangles(component);
}
move_declarations::move_declarations(component);
});