diff options
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index babfffe9046..28b40109778 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -2607,6 +2607,12 @@ impl Document { "Complete before DOMContentLoaded?" ); + // We only want a tracing event for DOMContentLoaded for actual pages and iframes, + // not when a script is just parsing a fragment. + if self.has_browsing_context() { + #[cfg(feature = "tracing")] + tracing::info!(name: "DOMContentLoaded", servo_profiling = true, url = self.url().to_string()); + } update_with_current_instant(&self.dom_content_loaded_event_start); // Step 4.1. @@ -2781,6 +2787,10 @@ impl Document { return; } if self.tti_window.borrow().needs_check() { + // TODO(delan): include this in Perfetto traces. May require support for backdating + // events, unless we include all candidates and filter them in perf-analysis-tools. + // Not a high priority, since TTI is now considered to be an outdated metric: + // <https://developer.chrome.com/docs/lighthouse/performance/interactive/> self.get_interactive_metrics().maybe_set_tti( self, InteractiveFlag::TimeToInteractive(self.tti_window.borrow().get_start()), |