Print element name when panicking in ThreadSafeLayoutElement::style_data

This commit is contained in:
Anthony Ramine 2020-05-15 12:12:54 +02:00
parent f4c4af2bd4
commit 45f1316c62

View file

@ -1307,7 +1307,10 @@ impl<'le> ThreadSafeLayoutElement<'le> for ServoThreadSafeLayoutElement<'le> {
} }
fn style_data(&self) -> AtomicRef<ElementData> { fn style_data(&self) -> AtomicRef<ElementData> {
self.element.borrow_data().expect("Unstyled layout node?") match self.element.borrow_data() {
Some(data) => data,
None => panic!("could not find styles for <{}>", self.element.local_name()),
}
} }
fn is_shadow_host(&self) -> bool { fn is_shadow_host(&self) -> bool {