Skip to content

Commit

Permalink
Print element name when panicking in ThreadSafeLayoutElement::style_data
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed May 18, 2020
1 parent f4c4af2 commit 45f1316
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/layout_thread_2020/dom_wrapper.rs
Expand Up @@ -1307,7 +1307,10 @@ impl<'le> ThreadSafeLayoutElement<'le> for ServoThreadSafeLayoutElement<'le> {
}

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 {
Expand Down

0 comments on commit 45f1316

Please sign in to comment.