mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Minor improvements to layout_debug and associated code
This commit is contained in:
parent
c33a517387
commit
5e76c93cc7
2 changed files with 19 additions and 50 deletions
|
@ -8,8 +8,7 @@
|
|||
use crate::flow::{BoxTreeRoot, FragmentTreeRoot};
|
||||
use serde_json::{to_string, to_value, Value};
|
||||
use std::cell::RefCell;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::fs;
|
||||
#[cfg(debug_assertions)]
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::Arc;
|
||||
|
@ -141,6 +140,9 @@ pub fn end_trace(generation: u32) {
|
|||
fragment_tree: to_value(&thread_state.fragment_tree).unwrap_or(Value::Null),
|
||||
};
|
||||
let result = to_string(&root_scope).unwrap();
|
||||
let mut file = File::create(format!("layout_trace-{}.json", generation)).unwrap();
|
||||
file.write_all(result.as_bytes()).unwrap();
|
||||
fs::write(
|
||||
format!("layout_trace-{}.json", generation),
|
||||
result.as_bytes(),
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue