From ebdc6f69b112154d2f9d888535a797a1df7647bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 10 Mar 2017 03:30:07 +0100 Subject: [PATCH] gfx: Show the text in the display item when debugging. --- components/gfx/display_list/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index ac2ad50e1a2..04fcf7b367c 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -1222,7 +1222,11 @@ impl fmt::Debug for DisplayItem { solid_color.color.g, solid_color.color.b, solid_color.color.a), - DisplayItem::Text(_) => "Text".to_owned(), + DisplayItem::Text(ref text) => { + format!("Text ({:?})", + &text.text_run.text[ + text.range.begin().0 as usize..(text.range.begin().0 + text.range.length().0) as usize]) + } DisplayItem::Image(_) => "Image".to_owned(), DisplayItem::WebGL(_) => "WebGL".to_owned(), DisplayItem::Border(_) => "Border".to_owned(),