Keep all nodes for a given element (even if it is optimized out)

This commit is contained in:
Olivier Goffart 2024-01-25 11:57:25 +01:00
parent ffaf19812c
commit 09dc25f107
10 changed files with 40 additions and 36 deletions

View file

@ -152,7 +152,7 @@ pub fn with_property_lookup_ctx<R>(
loop {
scope.push(it.clone());
if let Some(c) = it.clone().borrow().children.iter().find(|c| {
c.borrow().node.as_ref().map_or(false, |n| n.text_range().contains(offset))
c.borrow().node.first().map_or(false, |n| n.text_range().contains(offset))
}) {
it = c.clone();
} else {