diff options
Diffstat (limited to 'components/gfx/display_list/mod.rs')
-rw-r--r-- | components/gfx/display_list/mod.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index c4c73e50dc7..fff0d658aec 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -17,7 +17,7 @@ use app_units::Au; use euclid::{Transform3D, Point2D, Vector2D, Rect, Size2D, TypedRect, SideOffsets2D}; use euclid::num::{One, Zero}; -use gfx_traits::StackingContextId; +use gfx_traits::{self, StackingContextId}; use gfx_traits::print_tree::PrintTree; use ipc_channel::ipc::IpcSharedMemory; use msg::constellation_msg::PipelineId; @@ -146,6 +146,25 @@ impl DisplayList { } } +impl gfx_traits::DisplayList for DisplayList { + /// Analyze the display list to figure out if this may be the first + /// contentful paint (i.e. the display list contains items of type text, + /// image, non-white canvas or SVG). Used by metrics. + fn is_contentful(&self) -> bool { + for item in &self.list { + match item { + &DisplayItem::Text(_) | + &DisplayItem::Image(_) => { + return true + } + _ => (), + } + } + + false + } +} + /// Display list sections that make up a stacking context. Each section here refers /// to the steps in CSS 2.1 Appendix E. /// |