Make LayoutCharacterDataHelpers::data_for_layout be safe

This commit is contained in:
Anthony Ramine 2020-03-31 14:40:47 +02:00
parent 00c5ec202c
commit 409bd3d989
4 changed files with 7 additions and 9 deletions

View file

@ -828,7 +828,7 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> {
.dom_children()
.all(|node| match node.script_type_id() {
NodeTypeId::Element(..) => false,
NodeTypeId::CharacterData(CharacterDataTypeId::Text(TextTypeId::Text)) => unsafe {
NodeTypeId::CharacterData(CharacterDataTypeId::Text(TextTypeId::Text)) => {
node.node.downcast().unwrap().data_for_layout().is_empty()
},
_ => true,