mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Check the child is unstyled without creating element data in preprocess_children.
If we check it and skip the child after ensure_element_data() call, the child will have an empty element data, so we will succeed element_data.is_some() check unexpectedly.
This commit is contained in:
parent
028c0e4a43
commit
5a8e2562d5
1 changed files with 4 additions and 4 deletions
|
@ -862,14 +862,14 @@ where
|
||||||
None => continue,
|
None => continue,
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut child_data =
|
|
||||||
unsafe { D::ensure_element_data(&child).borrow_mut() };
|
|
||||||
|
|
||||||
// If the child is unstyled, we don't need to set up any restyling.
|
// If the child is unstyled, we don't need to set up any restyling.
|
||||||
if !child_data.has_styles() {
|
if child.borrow_data().map_or(true, |d| !d.has_styles()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut child_data =
|
||||||
|
unsafe { D::ensure_element_data(&child).borrow_mut() };
|
||||||
|
|
||||||
trace!(" > {:?} -> {:?} + {:?}, pseudo: {:?}",
|
trace!(" > {:?} -> {:?} + {:?}, pseudo: {:?}",
|
||||||
child,
|
child,
|
||||||
child_data.restyle.hint,
|
child_data.restyle.hint,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue