layout_api/container_timing_record.rs
1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5use euclid::Box2D;
6use malloc_size_of_derive::MallocSizeOf;
7use serde::{Deserialize, Serialize};
8use servo_base::id::ContainerTimingID;
9use style::dom::OpaqueNode;
10use webrender_api::units::LayoutPixel;
11
12#[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
13pub struct ContainerTimingRecord {
14 /// A unique identifier for this particular update.
15 pub id: ContainerTimingID,
16 /// The painted area within the container, in CSS pixels.
17 pub size: f32,
18 /// The viewport-clipped, union'd painted rect, in CSS pixels.
19 pub intersection_rect: Box2D<f32, LayoutPixel>,
20 /// The container root element, for `PerformanceContainerTiming::rootElement`. This
21 /// is also a stable identity for the container across updates.
22 pub root_element: OpaqueNode,
23 /// The descendant whose paint triggered this update.
24 pub last_painted_element: Option<OpaqueNode>,
25}