Move non-gfx things out of gfx_traits and create a base crate (#32296)

For a long time, `gfx_traits` has held a lot of things unrelated to graphics
and also unrelated to the `gfx` crate (which is mostly about fonts).
This is a cleanup which does a few things:

1. Move non `gfx` crate things out of `gfx_traits`. This is important in
   order to prevent dependency cycles with a different integration between
   layout, script, and fonts.
2. Rename the `msg` crate to `base`. It didn't really contain anything
   to do with messages and instead mostly holds ids, which are used
   across many different crates in Servo. This new crate will hold the
   *rare* data types that are widely used.

Details:

 - All BackgroundHangMonitor-related things from base to a new
   `background_hang_monitor_api` crate.
 - Moved `TraversalDirection` to `script_traits`
 - Moved `Epoch`-related things from `gfx_traits` to `base`.
 - Moved `PrintTree` to base. This should be widely useful in Servo.
 - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it
   to `WebRenderFontApi`.
This commit is contained in:
Martin Robinson 2024-05-17 14:28:58 +02:00 committed by GitHub
parent 1017533297
commit 3398fc017b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
163 changed files with 709 additions and 632 deletions

92
Cargo.lock generated
View file

@ -293,19 +293,35 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
name = "background_hang_monitor"
version = "0.0.1"
dependencies = [
"background_hang_monitor_api",
"backtrace",
"base",
"crossbeam-channel",
"ipc-channel",
"lazy_static",
"libc",
"log",
"mach2",
"msg",
"nix 0.27.1",
"serde_json",
"unwind-sys",
]
[[package]]
name = "background_hang_monitor_api"
version = "0.0.1"
dependencies = [
"base",
"ipc-channel",
"lazy_static",
"malloc_size_of",
"malloc_size_of_derive",
"parking_lot",
"serde",
"size_of_test",
"webrender_api",
]
[[package]]
name = "backtrace"
version = "0.3.71"
@ -321,6 +337,20 @@ dependencies = [
"rustc-demangle",
]
[[package]]
name = "base"
version = "0.0.1"
dependencies = [
"ipc-channel",
"lazy_static",
"malloc_size_of",
"malloc_size_of_derive",
"parking_lot",
"serde",
"size_of_test",
"webrender_api",
]
[[package]]
name = "base64"
version = "0.21.7"
@ -821,6 +851,7 @@ dependencies = [
name = "compositing"
version = "0.0.1"
dependencies = [
"base",
"canvas",
"compositing_traits",
"crossbeam-channel",
@ -835,7 +866,6 @@ dependencies = [
"keyboard-types",
"libc",
"log",
"msg",
"net_traits",
"pixels",
"profile_traits",
@ -856,6 +886,7 @@ dependencies = [
name = "compositing_traits"
version = "0.0.1"
dependencies = [
"base",
"canvas",
"crossbeam-channel",
"embedder_traits",
@ -864,7 +895,6 @@ dependencies = [
"ipc-channel",
"keyboard-types",
"log",
"msg",
"net_traits",
"script_traits",
"servo_url",
@ -886,7 +916,9 @@ name = "constellation"
version = "0.0.1"
dependencies = [
"background_hang_monitor",
"background_hang_monitor_api",
"backtrace",
"base",
"bluetooth_traits",
"canvas_traits",
"compositing_traits",
@ -903,7 +935,6 @@ dependencies = [
"log",
"media",
"metrics",
"msg",
"net",
"net_traits",
"parking_lot",
@ -1252,6 +1283,7 @@ dependencies = [
name = "devtools"
version = "0.0.1"
dependencies = [
"base",
"chrono",
"crossbeam-channel",
"devtools_traits",
@ -1260,7 +1292,6 @@ dependencies = [
"http",
"ipc-channel",
"log",
"msg",
"serde",
"serde_json",
"servo_config",
@ -1273,12 +1304,12 @@ dependencies = [
name = "devtools_traits"
version = "0.0.1"
dependencies = [
"base",
"bitflags 2.5.0",
"http",
"ipc-channel",
"malloc_size_of",
"malloc_size_of_derive",
"msg",
"serde",
"servo_url",
"time 0.1.45",
@ -1481,13 +1512,13 @@ dependencies = [
name = "embedder_traits"
version = "0.0.1"
dependencies = [
"base",
"cfg-if",
"crossbeam-channel",
"ipc-channel",
"keyboard-types",
"lazy_static",
"log",
"msg",
"num-derive",
"num-traits",
"serde",
@ -2020,6 +2051,7 @@ dependencies = [
"unicode-properties",
"unicode-script",
"webrender_api",
"webrender_traits",
"xi-unicode",
"xml-rs",
"yeslogic-fontconfig-sys",
@ -3191,6 +3223,7 @@ version = "0.0.1"
dependencies = [
"app_units",
"atomic_refcell",
"base",
"bitflags 2.5.0",
"canvas_traits",
"embedder_traits",
@ -3203,7 +3236,7 @@ dependencies = [
"lazy_static",
"log",
"malloc_size_of",
"msg",
"malloc_size_of_derive",
"net_traits",
"parking_lot",
"profile_traits",
@ -3234,6 +3267,7 @@ version = "0.0.1"
dependencies = [
"app_units",
"atomic_refcell",
"base",
"bitflags 2.5.0",
"canvas_traits",
"cssparser",
@ -3248,7 +3282,6 @@ dependencies = [
"ipc-channel",
"lazy_static",
"log",
"msg",
"net_traits",
"parking_lot",
"quickcheck",
@ -3276,6 +3309,7 @@ name = "layout_thread_2013"
version = "0.0.1"
dependencies = [
"app_units",
"base",
"crossbeam-channel",
"embedder_traits",
"euclid",
@ -3290,7 +3324,6 @@ dependencies = [
"log",
"malloc_size_of",
"metrics",
"msg",
"net_traits",
"parking_lot",
"profile_traits",
@ -3316,6 +3349,7 @@ name = "layout_thread_2020"
version = "0.0.1"
dependencies = [
"app_units",
"base",
"crossbeam-channel",
"embedder_traits",
"euclid",
@ -3329,7 +3363,6 @@ dependencies = [
"log",
"malloc_size_of",
"metrics",
"msg",
"net_traits",
"parking_lot",
"profile_traits",
@ -3461,6 +3494,7 @@ name = "libservo"
version = "0.0.1"
dependencies = [
"background_hang_monitor",
"base",
"bluetooth",
"bluetooth_traits",
"canvas",
@ -3486,7 +3520,6 @@ dependencies = [
"log",
"media",
"mozangle",
"msg",
"net",
"net_traits",
"profile",
@ -3747,12 +3780,12 @@ dependencies = [
name = "metrics"
version = "0.0.1"
dependencies = [
"base",
"gfx_traits",
"ipc-channel",
"log",
"malloc_size_of",
"malloc_size_of_derive",
"msg",
"profile_traits",
"script_traits",
"servo_config",
@ -3763,10 +3796,10 @@ dependencies = [
name = "metrics_tests"
version = "0.0.1"
dependencies = [
"base",
"gfx_traits",
"ipc-channel",
"metrics",
"msg",
"profile_traits",
"servo_url",
"time 0.1.45",
@ -3879,20 +3912,6 @@ dependencies = [
"walkdir",
]
[[package]]
name = "msg"
version = "0.0.1"
dependencies = [
"ipc-channel",
"lazy_static",
"malloc_size_of",
"malloc_size_of_derive",
"parking_lot",
"serde",
"size_of_test",
"webrender_api",
]
[[package]]
name = "muldiv"
version = "1.0.1"
@ -3956,6 +3975,7 @@ version = "0.0.1"
dependencies = [
"async-recursion",
"async-tungstenite",
"base",
"base64",
"brotli",
"bytes",
@ -3982,7 +4002,6 @@ dependencies = [
"malloc_size_of_derive",
"mime",
"mime_guess",
"msg",
"net_traits",
"percent-encoding",
"pixels",
@ -4013,6 +4032,7 @@ dependencies = [
name = "net_traits"
version = "0.0.1"
dependencies = [
"base",
"content-security-policy",
"cookie 0.12.0",
"embedder_traits",
@ -4027,7 +4047,6 @@ dependencies = [
"malloc_size_of",
"malloc_size_of_derive",
"mime",
"msg",
"num-traits",
"percent-encoding",
"pixels",
@ -5015,7 +5034,9 @@ dependencies = [
"app_units",
"arrayvec",
"atomic_refcell",
"background_hang_monitor_api",
"backtrace",
"base",
"base64",
"bitflags 2.5.0",
"bluetooth_traits",
@ -5059,7 +5080,6 @@ dependencies = [
"mime_guess",
"mozangle",
"mozjs",
"msg",
"net_traits",
"num-traits",
"num_cpus",
@ -5113,6 +5133,7 @@ version = "0.0.1"
dependencies = [
"app_units",
"atomic_refcell",
"base",
"canvas_traits",
"crossbeam-channel",
"euclid",
@ -5124,12 +5145,12 @@ dependencies = [
"malloc_size_of",
"malloc_size_of_derive",
"metrics",
"msg",
"net_traits",
"profile_traits",
"range",
"script_traits",
"selectors",
"serde",
"servo_arc",
"servo_atoms",
"servo_url",
@ -5152,6 +5173,8 @@ dependencies = [
name = "script_traits"
version = "0.0.1"
dependencies = [
"background_hang_monitor_api",
"base",
"bitflags 2.5.0",
"bluetooth_traits",
"canvas_traits",
@ -5170,7 +5193,6 @@ dependencies = [
"malloc_size_of",
"malloc_size_of_derive",
"media",
"msg",
"net_traits",
"pixels",
"profile_traits",
@ -7048,6 +7070,7 @@ dependencies = [
name = "webdriver_server"
version = "0.0.1"
dependencies = [
"base",
"base64",
"compositing_traits",
"cookie 0.12.0",
@ -7058,7 +7081,6 @@ dependencies = [
"ipc-channel",
"keyboard-types",
"log",
"msg",
"net_traits",
"pixels",
"script_traits",
@ -7076,11 +7098,11 @@ name = "webgpu"
version = "0.0.1"
dependencies = [
"arrayvec",
"base",
"euclid",
"ipc-channel",
"log",
"malloc_size_of",
"msg",
"serde",
"servo_config",
"smallvec",

View file

@ -15,7 +15,9 @@ app_units = "0.7"
arrayvec = "0.7"
async-tungstenite = { version = "0.23", features = ["tokio-rustls-webpki-roots"] }
atomic_refcell = "0.1.13"
background_hang_monitor_api = { path = "components/shared/background_hang_monitor" }
backtrace = "0.3"
base = { path = "components/shared/base" }
base64 = "0.21.7"
bitflags = "2.5"
bluetooth_traits = { path = "components/shared/bluetooth" }
@ -68,7 +70,6 @@ malloc_size_of_derive = "0.1"
mime = "0.3.13"
mime_guess = "2.0.3"
mozangle = "0.5.1"
msg = { path = "components/shared/msg" }
net_traits = { path = "components/shared/net" }
num-traits = "0.2"
num_cpus = "1.1.0"

View file

@ -13,12 +13,13 @@ test = false
doctest = false
[dependencies]
background_hang_monitor_api = { workspace = true }
backtrace = { workspace = true }
base = { workspace = true }
crossbeam-channel = { workspace = true }
ipc-channel = { workspace = true }
libc = { workspace = true }
log = { workspace = true }
msg = { workspace = true }
serde_json = { workspace = true }
[dev-dependencies]

View file

@ -8,15 +8,15 @@ use std::sync::{Arc, Weak};
use std::thread;
use std::time::{Duration, Instant};
use crossbeam_channel::{after, never, select, unbounded, Receiver, Sender};
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use log::warn;
use msg::constellation_msg::{
use background_hang_monitor_api::{
BackgroundHangMonitor, BackgroundHangMonitorClone, BackgroundHangMonitorControlMsg,
BackgroundHangMonitorExitSignal, BackgroundHangMonitorRegister, HangAlert, HangAnnotation,
HangMonitorAlert, MonitoredComponentId,
};
use crossbeam_channel::{after, never, select, unbounded, Receiver, Sender};
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use log::warn;
use crate::sampler::{NativeStack, Sampler};

View file

@ -4,7 +4,7 @@
use std::ptr;
use msg::constellation_msg::{HangProfile, HangProfileSymbol};
use background_hang_monitor_api::{HangProfile, HangProfileSymbol};
const MAX_NATIVE_FRAMES: usize = 1024;

View file

@ -10,12 +10,12 @@ use std::thread;
use std::time::Duration;
use background_hang_monitor::HangMonitorRegister;
use ipc_channel::ipc;
use msg::constellation_msg::{
use background_hang_monitor_api::{
BackgroundHangMonitorControlMsg, BackgroundHangMonitorExitSignal, HangAlert, HangAnnotation,
HangMonitorAlert, MonitoredComponentId, MonitoredComponentType, ScriptHangAnnotation,
TEST_PIPELINE_ID,
};
use base::id::TEST_PIPELINE_ID;
use ipc_channel::ipc;
lazy_static::lazy_static! {
static ref SERIAL: Mutex<()> = Mutex::new(());

View file

@ -16,6 +16,7 @@ default = []
multiview = []
[dependencies]
base = { workspace = true }
canvas = { path = "../canvas" }
compositing_traits = { workspace = true }
crossbeam-channel = { workspace = true }
@ -30,7 +31,6 @@ ipc-channel = { workspace = true }
keyboard-types = { workspace = true }
libc = { workspace = true }
log = { workspace = true }
msg = { workspace = true }
net_traits = { workspace = true }
pixels = { path = "../pixels" }
profile_traits = { workspace = true }

View file

@ -11,6 +11,8 @@ use std::iter::once;
use std::rc::Rc;
use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
use base::id::{PipelineId, TopLevelBrowsingContextId, WebViewId};
use base::{Epoch, WebRenderEpochToU16};
use canvas::canvas_paint_thread::ImageUpdate;
use compositing_traits::{
CanvasToCompositorMsg, CompositionPipeline, CompositorMsg, CompositorReceiver,
@ -21,12 +23,10 @@ use embedder_traits::Cursor;
use euclid::{Point2D, Rect, Scale, Transform3D, Vector2D};
use fnv::{FnvHashMap, FnvHashSet};
use gfx::rendering_context::RenderingContext;
use gfx_traits::{Epoch, WebRenderEpochToU16};
use image::{DynamicImage, ImageFormat};
use ipc_channel::ipc;
use libc::c_void;
use log::{debug, error, info, trace, warn};
use msg::constellation_msg::{PipelineId, TopLevelBrowsingContextId, WebViewId};
use net_traits::image::base::Image;
use net_traits::image_cache::CorsStatus;
use pixels::PixelFormat;

View file

@ -4,7 +4,7 @@
use std::collections::HashMap;
use msg::constellation_msg::{PipelineId, WebViewId};
use base::id::{PipelineId, WebViewId};
use webrender_api::units::DeviceRect;
#[derive(Debug, Default)]
@ -113,7 +113,7 @@ impl<WebView> WebViewManager<WebView> {
mod test {
use std::num::NonZeroU32;
use msg::constellation_msg::{
use base::id::{
BrowsingContextId, BrowsingContextIndex, PipelineNamespace, PipelineNamespaceId,
TopLevelBrowsingContextId,
};

View file

@ -7,14 +7,15 @@
use std::fmt::{Debug, Error, Formatter};
use std::time::Duration;
use base::id::{PipelineId, TopLevelBrowsingContextId};
use embedder_traits::{EmbedderProxy, EventLoopWaker};
use euclid::Scale;
use gfx::rendering_context::RenderingContext;
use keyboard_types::KeyboardEvent;
use libc::c_void;
use msg::constellation_msg::{PipelineId, TopLevelBrowsingContextId, TraversalDirection};
use script_traits::{
GamepadEvent, MediaSessionActionType, MouseButton, TouchEventType, TouchId, WheelDelta,
GamepadEvent, MediaSessionActionType, MouseButton, TouchEventType, TouchId, TraversalDirection,
WheelDelta,
};
use servo_geometry::DeviceIndependentPixel;
use servo_url::ServoUrl;

View file

@ -15,8 +15,10 @@ default = []
multiview = []
[dependencies]
background_hang_monitor_api = { workspace = true }
background_hang_monitor = { path = "../background_hang_monitor" }
backtrace = { workspace = true }
base = { workspace = true }
bluetooth_traits = { workspace = true }
canvas_traits = { workspace = true }
compositing_traits = { workspace = true }
@ -32,7 +34,6 @@ keyboard-types = { workspace = true }
log = { workspace = true }
media = { path = "../media" }
metrics = { path = "../metrics" }
msg = { workspace = true }
net = { path = "../net" }
net_traits = { workspace = true }
parking_lot = { workspace = true }

View file

@ -4,11 +4,9 @@
use std::collections::{HashMap, HashSet};
use base::id::{BrowsingContextGroupId, BrowsingContextId, PipelineId, TopLevelBrowsingContextId};
use euclid::Size2D;
use log::warn;
use msg::constellation_msg::{
BrowsingContextGroupId, BrowsingContextId, PipelineId, TopLevelBrowsingContextId,
};
use style_traits::CSSPixel;
use crate::pipeline::Pipeline;

View file

@ -94,6 +94,15 @@ use std::sync::{Arc, Mutex};
use std::{process, thread};
use background_hang_monitor::HangMonitorRegister;
use background_hang_monitor_api::{
BackgroundHangMonitorControlMsg, BackgroundHangMonitorRegister, HangMonitorAlert,
};
use base::id::{
BroadcastChannelRouterId, BrowsingContextGroupId, BrowsingContextId, HistoryStateId,
MessagePortId, MessagePortRouterId, PipelineId, PipelineNamespace, PipelineNamespaceId,
PipelineNamespaceRequest, TopLevelBrowsingContextId, WebViewId,
};
use base::Epoch;
use bluetooth_traits::BluetoothRequest;
use canvas_traits::canvas::{CanvasId, CanvasMsg};
use canvas_traits::webgl::WebGLThreads;
@ -113,7 +122,6 @@ use embedder_traits::{
use euclid::default::Size2D as UntypedSize2D;
use euclid::Size2D;
use gfx::font_cache_thread::FontCacheThread;
use gfx_traits::Epoch;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use ipc_channel::Error as IpcError;
@ -121,12 +129,6 @@ use keyboard_types::webdriver::Event as WebDriverInputEvent;
use keyboard_types::KeyboardEvent;
use log::{debug, error, info, trace, warn};
use media::{GLPlayerThreads, WindowGLContext};
use msg::constellation_msg::{
BackgroundHangMonitorControlMsg, BackgroundHangMonitorRegister, BroadcastChannelRouterId,
BrowsingContextGroupId, BrowsingContextId, HangMonitorAlert, HistoryStateId, MessagePortId,
MessagePortRouterId, PipelineId, PipelineNamespace, PipelineNamespaceId,
PipelineNamespaceRequest, TopLevelBrowsingContextId, TraversalDirection, WebViewId,
};
use net_traits::pub_domains::reg_host;
use net_traits::request::{Referrer, RequestBuilder};
use net_traits::storage_thread::{StorageThreadMsg, StorageType};
@ -142,8 +144,8 @@ use script_traits::{
LoadData, LoadOrigin, LogEntry, MediaSessionActionType, MessagePortMsg, MouseEventType,
PortMessageTask, SWManagerMsg, SWManagerSenders, ScriptMsg as FromScriptMsg,
ScriptToConstellationChan, ServiceWorkerManagerFactory, ServiceWorkerMsg,
StructuredSerializedData, TimerSchedulerMsg, UpdatePipelineIdReason, WebDriverCommandMsg,
WindowSizeData, WindowSizeType,
StructuredSerializedData, TimerSchedulerMsg, TraversalDirection, UpdatePipelineIdReason,
WebDriverCommandMsg, WindowSizeData, WindowSizeType,
};
use serde::{Deserialize, Serialize};
use servo_config::{opts, pref};

View file

@ -7,10 +7,10 @@ use std::sync::Arc;
use std::thread;
use backtrace::Backtrace;
use base::id::TopLevelBrowsingContextId;
use compositing_traits::ConstellationMsg as FromCompositorMsg;
use crossbeam_channel::Sender;
use log::{Level, LevelFilter, Log, Metadata, Record};
use msg::constellation_msg::TopLevelBrowsingContextId;
use parking_lot::ReentrantMutex;
use script_traits::{LogEntry, ScriptMsg as FromScriptMsg, ScriptToConstellationChan};

View file

@ -6,12 +6,12 @@
//! Any redirects that are encountered are followed. Whenever a non-redirect
//! response is received, it is forwarded to the appropriate script thread.
use base::id::PipelineId;
use crossbeam_channel::Sender;
use http::HeaderMap;
use ipc_channel::ipc;
use ipc_channel::router::ROUTER;
use log::warn;
use msg::constellation_msg::PipelineId;
use net::http_loader::{set_default_accept, set_default_accept_language};
use net_traits::request::{Destination, Referrer, RequestBuilder};
use net_traits::response::ResponseInit;

View file

@ -8,6 +8,14 @@ use std::rc::Rc;
use std::sync::Arc;
use background_hang_monitor::HangMonitorRegister;
use background_hang_monitor_api::{
BackgroundHangMonitorControlMsg, BackgroundHangMonitorRegister, HangMonitorAlert,
};
use base::id::{
BrowsingContextId, HistoryStateId, PipelineId, PipelineNamespace, PipelineNamespaceId,
PipelineNamespaceRequest, TopLevelBrowsingContextId,
};
use base::Epoch;
use bluetooth_traits::BluetoothRequest;
use canvas_traits::webgl::WebGLPipeline;
use compositing_traits::{CompositionPipeline, CompositorMsg, CompositorProxy};
@ -15,17 +23,11 @@ use crossbeam_channel::{unbounded, Sender};
use devtools_traits::{DevtoolsControlMsg, ScriptToDevtoolsControlMsg};
use embedder_traits::EventLoopWaker;
use gfx::font_cache_thread::FontCacheThread;
use gfx_traits::Epoch;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use ipc_channel::Error;
use log::{debug, error, warn};
use media::WindowGLContext;
use msg::constellation_msg::{
BackgroundHangMonitorControlMsg, BackgroundHangMonitorRegister, BrowsingContextId,
HangMonitorAlert, HistoryStateId, PipelineId, PipelineNamespace, PipelineNamespaceId,
PipelineNamespaceRequest, TopLevelBrowsingContextId,
};
use net::image_cache::ImageCacheImpl;
use net_traits::image_cache::ImageCache;
use net_traits::ResourceThreads;

View file

@ -5,11 +5,9 @@
use std::cmp::PartialEq;
use std::fmt;
use base::id::{BrowsingContextId, HistoryStateId, PipelineId, TopLevelBrowsingContextId};
use euclid::Size2D;
use log::debug;
use msg::constellation_msg::{
BrowsingContextId, HistoryStateId, PipelineId, TopLevelBrowsingContextId,
};
use script_traits::LoadData;
use servo_url::ServoUrl;
use style_traits::CSSPixel;

View file

@ -4,7 +4,7 @@
use std::collections::HashMap;
use msg::constellation_msg::TopLevelBrowsingContextId;
use base::id::TopLevelBrowsingContextId;
#[derive(Debug)]
pub struct WebViewManager<WebView> {
@ -99,7 +99,7 @@ impl<WebView> WebViewManager<WebView> {
mod test {
use std::num::NonZeroU32;
use msg::constellation_msg::{
use base::id::{
BrowsingContextId, BrowsingContextIndex, PipelineNamespace, PipelineNamespaceId,
TopLevelBrowsingContextId, WebViewId,
};

View file

@ -14,6 +14,7 @@ path = "lib.rs"
chrono = "0.4"
[dependencies]
base = { workspace = true }
chrono = "0.4"
crossbeam-channel = { workspace = true }
devtools_traits = { workspace = true }
@ -22,7 +23,6 @@ headers = { workspace = true }
http = { workspace = true }
ipc-channel = { workspace = true }
log = { workspace = true }
msg = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
servo_config = { path = "../config" }

View file

@ -10,10 +10,10 @@ use std::cell::{Cell, RefCell};
use std::collections::HashMap;
use std::net::TcpStream;
use base::id::{BrowsingContextId, PipelineId};
use devtools_traits::DevtoolScriptControlMsg::{self, WantsLiveNotifications};
use devtools_traits::{DevtoolsPageInfo, NavigationState};
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use serde::Serialize;
use serde_json::{Map, Value};

View file

@ -11,6 +11,7 @@ use std::collections::HashMap;
use std::net::TcpStream;
use std::time::{SystemTime, UNIX_EPOCH};
use base::id::TEST_PIPELINE_ID;
use devtools_traits::EvaluateJSReply::{
ActorValue, BooleanValue, NullValue, NumberValue, StringValue, VoidValue,
};
@ -20,7 +21,6 @@ use devtools_traits::{
};
use ipc_channel::ipc::{self, IpcSender};
use log::debug;
use msg::constellation_msg::TEST_PIPELINE_ID;
use serde::Serialize;
use serde_json::{self, Map, Number, Value};
use uuid::Uuid;

View file

@ -5,9 +5,9 @@
use std::mem;
use std::net::TcpStream;
use base::id::PipelineId;
use devtools_traits::DevtoolScriptControlMsg;
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::PipelineId;
use serde_json::{Map, Value};
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};

View file

@ -7,12 +7,12 @@
use std::cell::RefCell;
use std::net::TcpStream;
use base::id::PipelineId;
use devtools_traits::DevtoolScriptControlMsg::{
GetChildren, GetDocumentElement, GetLayout, GetRootNode, ModifyAttribute,
};
use devtools_traits::{ComputedNodeLayout, DevtoolScriptControlMsg, NodeInfo};
use ipc_channel::ipc::{self, IpcSender};
use msg::constellation_msg::PipelineId;
use serde::Serialize;
use serde_json::{self, Map, Value};

View file

@ -9,10 +9,10 @@ use std::sync::{Arc, Mutex};
use std::thread;
use std::time::Duration;
use base::id::PipelineId;
use devtools_traits::DevtoolScriptControlMsg::{DropTimelineMarkers, SetTimelineMarkers};
use devtools_traits::{DevtoolScriptControlMsg, PreciseTime, TimelineMarker, TimelineMarkerType};
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use msg::constellation_msg::PipelineId;
use serde::{Serialize, Serializer};
use serde_json::{Map, Value};

View file

@ -6,10 +6,10 @@ use std::cell::RefCell;
use std::collections::HashMap;
use std::net::TcpStream;
use base::id::TEST_PIPELINE_ID;
use devtools_traits::DevtoolScriptControlMsg::WantsLiveNotifications;
use devtools_traits::{DevtoolScriptControlMsg, WorkerId};
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::TEST_PIPELINE_ID;
use serde::Serialize;
use serde_json::{Map, Value};
use servo_url::ServoUrl;

View file

@ -20,6 +20,7 @@ use std::net::{Shutdown, TcpListener, TcpStream};
use std::sync::{Arc, Mutex};
use std::thread;
use base::id::{BrowsingContextId, PipelineId};
use crossbeam_channel::{unbounded, Receiver, Sender};
use devtools_traits::{
ChromeToDevtoolsControlMsg, ConsoleMessage, DevtoolScriptControlMsg, DevtoolsControlMsg,
@ -29,7 +30,6 @@ use devtools_traits::{
use embedder_traits::{EmbedderMsg, EmbedderProxy, PromptDefinition, PromptOrigin, PromptResult};
use ipc_channel::ipc::{self, IpcSender};
use log::{debug, warn};
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use serde::Serialize;
use servo_rand::RngCore;

View file

@ -44,6 +44,7 @@ unicode-bidi = { workspace = true, features = ["with_serde"] }
unicode-properties = { workspace = true }
unicode-script = { workspace = true }
webrender_api = { workspace = true }
webrender_traits = { workspace = true }
xi-unicode = { workspace = true }
[target.'cfg(target_os = "macos")'.dependencies]

View file

@ -10,7 +10,6 @@ use std::{f32, fmt, mem, thread};
use app_units::Au;
use atomic_refcell::AtomicRefCell;
use gfx_traits::WebrenderApi;
use ipc_channel::ipc::{self, IpcBytesSender, IpcReceiver, IpcSender};
use log::{debug, trace};
use malloc_size_of_derive::MallocSizeOf;
@ -30,6 +29,7 @@ use style::values::computed::font::{FixedPoint, FontStyleFixedPoint};
use style::values::computed::{FontStretch, FontWeight};
use style::values::specified::FontStretch as SpecifiedFontStretch;
use webrender_api::{FontInstanceFlags, FontInstanceKey, FontKey};
use webrender_traits::WebRenderFontApi;
use crate::font::{FontDescriptor, FontFamilyDescriptor, FontFamilyName, FontSearchScope};
use crate::font_context::FontSource;
@ -160,7 +160,7 @@ struct FontCache {
local_families: HashMap<LowercaseString, FontTemplates>,
web_families: HashMap<LowercaseString, FontTemplates>,
core_resource_thread: CoreResourceThread,
webrender_api: Box<dyn WebrenderApi>,
webrender_api: Box<dyn WebRenderFontApi>,
webrender_fonts: HashMap<FontIdentifier, FontKey>,
font_instances: HashMap<(FontKey, Au), FontInstanceKey>,
}
@ -577,7 +577,7 @@ impl From<&FontFaceRuleData> for CSSFontFaceDescriptors {
impl FontCacheThread {
pub fn new(
core_resource_thread: CoreResourceThread,
webrender_api: Box<dyn WebrenderApi + Send>,
webrender_api: Box<dyn WebRenderFontApi + Send>,
) -> FontCacheThread {
let (chan, port) = ipc::channel().unwrap();

View file

@ -15,6 +15,7 @@ doctest = false
[dependencies]
app_units = { workspace = true }
atomic_refcell = { workspace = true }
base = { workspace = true }
bitflags = { workspace = true }
canvas_traits = { workspace = true }
embedder_traits = { workspace = true }
@ -27,7 +28,7 @@ ipc-channel = { workspace = true }
lazy_static = { workspace = true }
log = { workspace = true }
malloc_size_of = { workspace = true }
msg = { workspace = true }
malloc_size_of_derive = { workspace = true }
net_traits = { workspace = true }
parking_lot = { workspace = true }
profile_traits = { workspace = true }

View file

@ -30,9 +30,9 @@ use std::fmt;
use std::sync::Arc;
use app_units::{Au, MAX_AU};
use base::print_tree::PrintTree;
use bitflags::bitflags;
use euclid::default::{Point2D, Rect, SideOffsets2D, Size2D};
use gfx_traits::print_tree::PrintTree;
use log::{debug, trace};
use serde::{Serialize, Serializer};
use servo_geometry::MaxRect;

View file

@ -9,10 +9,10 @@ use std::hash::BuildHasherDefault;
use std::sync::{Arc, Mutex};
use std::thread;
use base::id::PipelineId;
use fnv::FnvHasher;
use gfx::font_cache_thread::FontCacheThread;
use gfx::font_context::FontContext;
use msg::constellation_msg::PipelineId;
use net_traits::image_cache::{
ImageCache, ImageCacheResult, ImageOrMetadataAvailable, UsePlaceholder,
};

View file

@ -13,6 +13,7 @@ use std::sync::Arc;
use std::{f32, mem};
use app_units::{Au, AU_PER_PX};
use base::id::{BrowsingContextId, PipelineId};
use bitflags::bitflags;
use canvas_traits::canvas::{CanvasMsg, FromLayoutMsg};
use embedder_traits::Cursor;
@ -21,12 +22,11 @@ use euclid::{rect, SideOffsets2D};
use fnv::FnvHashMap;
use gfx::text::glyph::ByteIndex;
use gfx::text::TextRun;
use gfx_traits::{combine_id_with_fragment_type, FragmentType, StackingContextId};
use ipc_channel::ipc;
use log::{debug, warn};
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use net_traits::image_cache::UsePlaceholder;
use range::Range;
use script_layout_interface::{combine_id_with_fragment_type, FragmentType};
use script_traits::compositor::ScrollSensitivity;
use servo_config::opts;
use servo_geometry::{self, MaxRect};
@ -53,6 +53,7 @@ use webrender_api::{
NinePatchBorderSource, NormalBorder, PropertyBinding, StickyOffsetBounds,
};
use super::StackingContextId;
use crate::block::BlockFlow;
use crate::context::LayoutContext;
use crate::display_list::background::{self, get_cyclic};

View file

@ -16,11 +16,10 @@ use std::cmp::Ordering;
use std::collections::HashMap;
use std::{f32, fmt};
use base::id::PipelineId;
use base::print_tree::PrintTree;
use embedder_traits::Cursor;
use euclid::{SideOffsets2D, Vector2D};
use gfx_traits::print_tree::PrintTree;
use gfx_traits::{self, StackingContextId};
use msg::constellation_msg::PipelineId;
use net_traits::image::base::Image;
use script_traits::compositor::{ScrollSensitivity, ScrollTreeNodeId};
use serde::Serialize;
@ -35,6 +34,8 @@ use webrender_api::{
SpatialId, StickyOffsetBounds, TransformStyle,
};
use super::StackingContextId;
/// The factor that we multiply the blur radius by in order to inflate the boundaries of display
/// items that involve a blur. This ensures that the display item boundaries include all the ink.
pub static BLUR_INFLATION_FACTOR: i32 = 3;

View file

@ -2,6 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use malloc_size_of_derive::MallocSizeOf;
use serde::{Deserialize, Serialize};
pub use self::builder::{
BorderPaintingMode, DisplayListBuildState, IndexableText, StackingContextCollectionFlags,
StackingContextCollectionState,
@ -15,3 +18,24 @@ pub(crate) mod conversions;
mod gradient;
pub mod items;
mod webrender_helpers;
/// A unique ID for every stacking context.
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize)]
pub struct StackingContextId(
/// The identifier for this StackingContext, derived from the Flow's memory address
/// and fragment type. As a space optimization, these are combined into a single word.
pub u64,
);
impl StackingContextId {
/// Returns the stacking context ID for the outer document/layout root.
#[inline]
pub fn root() -> StackingContextId {
StackingContextId(0)
}
pub fn next(&self) -> StackingContextId {
let StackingContextId(id) = *self;
StackingContextId(id + 1)
}
}

View file

@ -7,9 +7,9 @@
// This might be achieved by sharing types between WR and Servo display lists, or
// completely converting layout to directly generate WebRender display lists, for example.
use gfx_traits::WebRenderEpochToU16;
use base::id::PipelineId;
use base::WebRenderEpochToU16;
use log::trace;
use msg::constellation_msg::PipelineId;
use script_traits::compositor::{
CompositorDisplayListInfo, ScrollSensitivity, ScrollTreeNodeId, ScrollableNodeInfo,
};

View file

@ -31,10 +31,9 @@ use std::sync::atomic::Ordering;
use std::sync::Arc;
use app_units::Au;
use base::print_tree::PrintTree;
use bitflags::bitflags;
use euclid::default::{Point2D, Rect, Size2D, Vector2D};
use gfx_traits::print_tree::PrintTree;
use gfx_traits::StackingContextId;
use log::debug;
use serde::ser::{SerializeStruct, Serializer};
use serde::Serialize;
@ -54,7 +53,9 @@ use webrender_api::units::LayoutTransform;
use crate::block::{BlockFlow, FormattingContextType};
use crate::context::LayoutContext;
use crate::display_list::items::ClippingAndScrolling;
use crate::display_list::{DisplayListBuildState, StackingContextCollectionState};
use crate::display_list::{
DisplayListBuildState, StackingContextCollectionState, StackingContextId,
};
use crate::flex::FlexFlow;
use crate::floats::{Floats, SpeculatedFloatPlacement};
use crate::flow_list::{FlowList, FlowListIterator, MutFlowListIterator};

View file

@ -11,16 +11,15 @@ use std::sync::{Arc, Mutex};
use std::{f32, fmt};
use app_units::Au;
use base::id::{BrowsingContextId, PipelineId};
use bitflags::bitflags;
use canvas_traits::canvas::{CanvasId, CanvasMsg};
use euclid::default::{Point2D, Rect, Size2D, Vector2D};
use gfx::text::glyph::ByteIndex;
use gfx::text::text_run::{TextRun, TextRunSlice};
use gfx_traits::StackingContextId;
use html5ever::{local_name, namespace_url, ns};
use ipc_channel::ipc::IpcSender;
use log::debug;
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use net_traits::image::base::{Image, ImageMetadata};
use net_traits::image_cache::{ImageOrMetadataAvailable, UsePlaceholder};
use range::*;
@ -59,7 +58,7 @@ use webrender_api::{self, ImageKey};
use crate::context::LayoutContext;
use crate::display_list::items::{ClipScrollNodeIndex, OpaqueNode, BLUR_INFLATION_FACTOR};
use crate::display_list::ToLayout;
use crate::display_list::{StackingContextId, ToLayout};
use crate::floats::ClearType;
use crate::flow::{GetBaseFlow, ImmutableFlowUtils};
use crate::flow_ref::FlowRef;

View file

@ -8,10 +8,10 @@ use std::sync::Arc;
use std::{fmt, i32, isize, mem};
use app_units::{Au, MIN_AU};
use base::print_tree::PrintTree;
use bitflags::bitflags;
use euclid::default::{Point2D, Rect, Size2D};
use gfx::font::FontMetrics;
use gfx_traits::print_tree::PrintTree;
use log::debug;
use range::{int_range_index, Range, RangeIndex};
use script_layout_interface::wrapper_traits::PseudoElementType;

View file

@ -9,8 +9,8 @@ use std::fmt;
use std::sync::Arc;
use app_units::Au;
use base::print_tree::PrintTree;
use euclid::default::{Point2D, Vector2D};
use gfx_traits::print_tree::PrintTree;
use log::{debug, trace};
use style::logical_geometry::LogicalSize;
use style::properties::ComputedValues;

View file

@ -7,8 +7,8 @@
use std::{cmp, fmt};
use app_units::Au;
use base::print_tree::PrintTree;
use euclid::default::Point2D;
use gfx_traits::print_tree::PrintTree;
use log::{debug, trace};
use serde::Serialize;
use style::computed_values::{border_collapse, border_spacing, table_layout};

View file

@ -7,8 +7,8 @@
use std::fmt;
use app_units::Au;
use base::print_tree::PrintTree;
use euclid::default::Point2D;
use gfx_traits::print_tree::PrintTree;
use log::{debug, trace};
use style::logical_geometry::LogicalSize;
use style::properties::ComputedValues;

View file

@ -7,8 +7,8 @@
use std::fmt;
use app_units::Au;
use base::print_tree::PrintTree;
use euclid::default::{Point2D, Rect, SideOffsets2D, Size2D};
use gfx_traits::print_tree::PrintTree;
use log::{debug, trace};
use script_layout_interface::wrapper_traits::ThreadSafeLayoutNode;
use serde::Serialize;

View file

@ -9,8 +9,8 @@ use std::fmt;
use std::iter::{Enumerate, Peekable};
use app_units::Au;
use base::print_tree::PrintTree;
use euclid::default::Point2D;
use gfx_traits::print_tree::PrintTree;
use log::{debug, warn};
use serde::{Serialize, Serializer};
use style::computed_values::border_collapse::T as BorderCollapse;

View file

@ -8,8 +8,8 @@ use std::fmt;
use std::iter::{Iterator, Peekable};
use app_units::Au;
use base::print_tree::PrintTree;
use euclid::default::Point2D;
use gfx_traits::print_tree::PrintTree;
use log::{debug, trace};
use serde::{Serialize, Serializer};
use style::computed_values::{border_collapse, border_spacing};

View file

@ -16,8 +16,8 @@ use std::fmt;
use std::ops::Add;
use app_units::Au;
use base::print_tree::PrintTree;
use euclid::default::Point2D;
use gfx_traits::print_tree::PrintTree;
use log::{debug, trace};
use serde::Serialize;
use style::computed_values::{position, table_layout};

View file

@ -15,6 +15,7 @@ doctest = false
[dependencies]
app_units = { workspace = true }
atomic_refcell = { workspace = true }
base = { workspace = true }
canvas_traits = { workspace = true }
bitflags = { workspace = true }
cssparser = { workspace = true }
@ -27,7 +28,6 @@ gfx_traits = { workspace = true }
html5ever = { workspace = true }
ipc-channel = { workspace = true }
log = { workspace = true }
msg = { workspace = true }
net_traits = { workspace = true }
parking_lot = { workspace = true }
range = { path = "../range" }

View file

@ -4,10 +4,10 @@
use std::sync::{Arc, Mutex};
use base::id::PipelineId;
use fnv::FnvHashMap;
use gfx::font_cache_thread::FontCacheThread;
use gfx::font_context::FontContext;
use msg::constellation_msg::PipelineId;
use net_traits::image_cache::{
ImageCache, ImageCacheResult, ImageOrMetadataAvailable, UsePlaceholder,
};

View file

@ -5,12 +5,12 @@
use std::cell::{OnceCell, RefCell};
use std::sync::Arc;
use base::id::BrowsingContextId;
use base::WebRenderEpochToU16;
use embedder_traits::Cursor;
use euclid::{Point2D, SideOffsets2D, Size2D};
use fnv::FnvHashMap;
use gfx::text::glyph::GlyphStore;
use gfx_traits::WebRenderEpochToU16;
use msg::constellation_msg::BrowsingContextId;
use net_traits::image_cache::UsePlaceholder;
use script_traits::compositor::{CompositorDisplayListInfo, ScrollSensitivity, ScrollTreeNodeId};
use servo_geometry::MaxRect;

View file

@ -5,9 +5,9 @@
use std::cell::RefCell;
use std::mem;
use base::print_tree::PrintTree;
use euclid::default::Rect;
use euclid::SideOffsets2D;
use gfx_traits::print_tree::PrintTree;
use log::warn;
use script_traits::compositor::{ScrollSensitivity, ScrollTreeNodeId, ScrollableNodeInfo};
use servo_arc::Arc as ServoArc;

View file

@ -6,8 +6,8 @@ use std::marker::PhantomData;
use std::sync::{Arc, Mutex};
use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
use base::id::{BrowsingContextId, PipelineId};
use html5ever::{local_name, namespace_url, ns};
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use net_traits::image::base::Image as NetImage;
use script_layout_interface::wrapper_traits::{
LayoutDataTrait, LayoutNode, ThreadSafeLayoutElement, ThreadSafeLayoutNode,

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use bitflags::bitflags;
use gfx_traits::{combine_id_with_fragment_type, FragmentType};
use script_layout_interface::{combine_id_with_fragment_type, FragmentType};
use serde::Serialize;
use style::dom::OpaqueNode;
use style::selector_parser::PseudoElement;

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use app_units::Au;
use gfx_traits::print_tree::PrintTree;
use base::print_tree::PrintTree;
use serde::Serialize;
use servo_arc::Arc as ServoArc;
use style::computed_values::overflow_x::T as ComputedOverflow;

View file

@ -5,10 +5,10 @@
use std::sync::Arc;
use app_units::Au;
use base::id::{BrowsingContextId, PipelineId};
use base::print_tree::PrintTree;
use gfx::font::FontMetrics;
use gfx::text::glyph::GlyphStore;
use gfx_traits::print_tree::PrintTree;
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use serde::Serialize;
use servo_arc::Arc as ServoArc;
use style::properties::ComputedValues;

View file

@ -3,9 +3,9 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use app_units::Au;
use base::print_tree::PrintTree;
use euclid::default::{Point2D, Rect, Size2D};
use fxhash::FxHashSet;
use gfx_traits::print_tree::PrintTree;
use script_traits::compositor::ScrollSensitivity;
use serde::Serialize;
use style::animation::AnimationSetKey;

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use gfx_traits::print_tree::PrintTree;
use base::print_tree::PrintTree;
use serde::Serialize;
use servo_arc::Arc as ServoArc;
use style::logical_geometry::WritingMode;

View file

@ -6,10 +6,10 @@ use std::fmt;
use std::sync::{Arc, Mutex};
use app_units::Au;
use base::id::{BrowsingContextId, PipelineId};
use canvas_traits::canvas::{CanvasId, CanvasMsg, FromLayoutMsg};
use data_url::DataUrl;
use ipc_channel::ipc::{self, IpcSender};
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use net_traits::image::base::Image;
use net_traits::image_cache::{ImageOrMetadataAvailable, UsePlaceholder};
use serde::Serialize;

View file

@ -12,6 +12,7 @@ path = "lib.rs"
[dependencies]
app_units = { workspace = true }
base = { workspace = true }
crossbeam-channel = { workspace = true }
embedder_traits = { workspace = true }
euclid = { workspace = true }
@ -26,7 +27,6 @@ lazy_static = { workspace = true }
log = { workspace = true }
malloc_size_of = { workspace = true }
metrics = { path = "../metrics" }
msg = { workspace = true }
net_traits = { workspace = true }
parking_lot = { workspace = true }
profile_traits = { workspace = true }

View file

@ -17,6 +17,8 @@ use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Mutex};
use app_units::Au;
use base::id::{BrowsingContextId, PipelineId};
use base::Epoch;
use embedder_traits::resources::{self, Resource};
use euclid::default::{Point2D as UntypedPoint2D, Rect as UntypedRect, Size2D as UntypedSize2D};
use euclid::{Point2D, Rect, Scale, Size2D};
@ -25,7 +27,6 @@ use fxhash::{FxHashMap, FxHashSet};
use gfx::font;
use gfx::font_cache_thread::FontCacheThread;
use gfx::font_context::FontContext;
use gfx_traits::{node_id_from_scroll_id, Epoch};
use histogram::Histogram;
use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER;
@ -52,7 +53,6 @@ use lazy_static::lazy_static;
use log::{debug, error, trace, warn};
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use metrics::{PaintTimeMetrics, ProfilerMetadataFactory};
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use net_traits::image_cache::{ImageCache, UsePlaceholder};
use parking_lot::RwLock;
use profile_traits::mem::{Report, ReportKind};
@ -63,8 +63,8 @@ use profile_traits::time::{
use script::layout_dom::{ServoLayoutDocument, ServoLayoutElement, ServoLayoutNode};
use script_layout_interface::wrapper_traits::LayoutNode;
use script_layout_interface::{
Layout, LayoutConfig, LayoutFactory, NodesFromPointQueryType, OffsetParentResponse, Reflow,
ReflowComplete, ReflowGoal, ScriptReflow, TrustedNodeAddress,
node_id_from_scroll_id, Layout, LayoutConfig, LayoutFactory, NodesFromPointQueryType,
OffsetParentResponse, Reflow, ReflowComplete, ReflowGoal, ScriptReflow, TrustedNodeAddress,
};
use script_traits::{
ConstellationControlMsg, DrawAPaintImageResult, IFrameSizeMsg, LayoutControlMsg,

View file

@ -12,6 +12,7 @@ path = "lib.rs"
[dependencies]
app_units = { workspace = true }
base = { workspace = true }
crossbeam-channel = { workspace = true }
embedder_traits = { workspace = true }
euclid = { workspace = true }
@ -25,7 +26,6 @@ lazy_static = { workspace = true }
log = { workspace = true }
malloc_size_of = { workspace = true }
metrics = { path = "../metrics" }
msg = { workspace = true }
net_traits = { workspace = true }
parking_lot = { workspace = true }
profile_traits = { workspace = true }

View file

@ -16,6 +16,8 @@ use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Mutex};
use app_units::Au;
use base::id::{BrowsingContextId, PipelineId};
use base::Epoch;
use embedder_traits::resources::{self, Resource};
use euclid::default::{Point2D as UntypedPoint2D, Rect as UntypedRect, Size2D as UntypedSize2D};
use euclid::{Point2D, Scale, Size2D, Vector2D};
@ -23,7 +25,6 @@ use fnv::FnvHashMap;
use fxhash::FxHashMap;
use gfx::font_cache_thread::FontCacheThread;
use gfx::font_context::FontContext;
use gfx_traits::{node_id_from_scroll_id, Epoch};
use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER;
use layout::context::LayoutContext;
@ -39,7 +40,6 @@ use lazy_static::lazy_static;
use log::{debug, error, warn};
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use metrics::{PaintTimeMetrics, ProfilerMetadataFactory};
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use net_traits::image_cache::{ImageCache, UsePlaceholder};
use parking_lot::RwLock;
use profile_traits::mem::{Report, ReportKind};
@ -49,8 +49,8 @@ use profile_traits::time::{
};
use script::layout_dom::{ServoLayoutDocument, ServoLayoutElement, ServoLayoutNode};
use script_layout_interface::{
Layout, LayoutConfig, LayoutFactory, NodesFromPointQueryType, OffsetParentResponse,
ReflowComplete, ReflowGoal, ScriptReflow, TrustedNodeAddress,
node_id_from_scroll_id, Layout, LayoutConfig, LayoutFactory, NodesFromPointQueryType,
OffsetParentResponse, ReflowComplete, ReflowGoal, ScriptReflow, TrustedNodeAddress,
};
use script_traits::{
ConstellationControlMsg, DrawAPaintImageResult, IFrameSizeMsg, LayoutControlMsg,

View file

@ -11,12 +11,12 @@ name = "metrics"
path = "lib.rs"
[dependencies]
base = { workspace = true }
gfx_traits = { workspace = true }
ipc-channel = { workspace = true }
log = { workspace = true }
malloc_size_of = { workspace = true }
malloc_size_of_derive = { workspace = true }
msg = { workspace = true }
profile_traits = { workspace = true }
script_traits = { workspace = true }
servo_config = { path = "../config" }

View file

@ -7,11 +7,11 @@ use std::cmp::Ordering;
use std::collections::HashMap;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use gfx_traits::Epoch;
use base::id::PipelineId;
use base::Epoch;
use ipc_channel::ipc::IpcSender;
use log::warn;
use malloc_size_of_derive::MallocSizeOf;
use msg::constellation_msg::PipelineId;
use profile_traits::time::{send_profile_data, ProfilerCategory, ProfilerChan, TimerMetadata};
use script_traits::{ConstellationControlMsg, LayoutMsg, ProgressiveWebMetricType};
use servo_config::opts;

View file

@ -16,6 +16,7 @@ doctest = false
[dependencies]
async-recursion = "0.3.2"
async-tungstenite = { workspace = true }
base = { workspace = true }
base64 = { workspace = true }
brotli = "3"
bytes = "1"
@ -42,7 +43,6 @@ malloc_size_of = { workspace = true }
malloc_size_of_derive = { workspace = true }
mime = { workspace = true }
mime_guess = { workspace = true }
msg = { workspace = true }
net_traits = { workspace = true }
percent-encoding = { workspace = true }
pixels = { path = "../pixels" }

View file

@ -9,6 +9,7 @@ use std::sync::{Arc as StdArc, Condvar, Mutex, RwLock};
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use async_recursion::async_recursion;
use base::id::{HistoryStateId, PipelineId};
use crossbeam_channel::Sender;
use devtools_traits::{
ChromeToDevtoolsControlMsg, DevtoolsControlMsg, HttpRequest as DevtoolsHttpRequest,
@ -32,7 +33,6 @@ use hyper_serde::Serde;
use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER;
use log::{debug, error, info, log_enabled, warn};
use msg::constellation_msg::{HistoryStateId, PipelineId};
use net_traits::pub_domains::reg_suffix;
use net_traits::quality::{quality_to_value, Quality, QualityItem};
use net_traits::request::Origin::Origin as SpecificOrigin;

View file

@ -11,6 +11,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Mutex, Weak};
use std::time::{Duration, SystemTime};
use base::id::TEST_PIPELINE_ID;
use crossbeam_channel::{unbounded, Sender};
use devtools_traits::{HttpRequest as DevtoolsHttpRequest, HttpResponse as DevtoolsHttpResponse};
use headers::{
@ -22,7 +23,6 @@ use http::header::{self, HeaderMap, HeaderName, HeaderValue};
use http::{Method, StatusCode};
use hyper::{Body, Request as HyperRequest, Response as HyperResponse};
use mime::{self, Mime};
use msg::constellation_msg::TEST_PIPELINE_ID;
use net::fetch::cors_cache::CorsCache;
use net::fetch::methods::{self, CancellationListener, FetchContext};
use net::filemanager_thread::FileManager;

View file

@ -2,9 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use base::id::TEST_PIPELINE_ID;
use http::header::{HeaderValue, EXPIRES};
use http::StatusCode;
use msg::constellation_msg::TEST_PIPELINE_ID;
use net::http_cache::HttpCache;
use net_traits::request::{Origin, Referrer, Request};
use net_traits::response::{HttpsState, Response, ResponseBody};

View file

@ -11,6 +11,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex, RwLock};
use std::time::Duration;
use base::id::TEST_PIPELINE_ID;
use cookie_rs::Cookie as CookiePair;
use crossbeam_channel::{unbounded, Receiver};
use devtools_traits::{
@ -29,7 +30,6 @@ use http::{Method, StatusCode};
use hyper::{Body, Request as HyperRequest, Response as HyperResponse};
use ipc_channel::ipc;
use ipc_channel::router::ROUTER;
use msg::constellation_msg::TEST_PIPELINE_ID;
use net::cookie::Cookie;
use net::cookie_storage::CookieStorage;
use net::http_loader::determine_requests_referrer;

View file

@ -31,7 +31,9 @@ accountable-refcell = { workspace = true, optional = true }
app_units = { workspace = true }
arrayvec = { workspace = true }
atomic_refcell = { workspace = true }
background_hang_monitor_api = { workspace = true }
backtrace = { workspace = true }
base = { workspace = true }
base64 = { workspace = true }
bitflags = { workspace = true }
bluetooth_traits = { workspace = true }
@ -74,7 +76,6 @@ media = { path = "../media" }
metrics = { path = "../metrics" }
mime = { workspace = true }
mime_guess = { workspace = true }
msg = { workspace = true }
net_traits = { workspace = true }
num_cpus = { workspace = true }
num-traits = { workspace = true }

View file

@ -6,10 +6,10 @@
use std::cell::Cell;
use base::id::PipelineId;
use cssparser::ToCss;
use fxhash::{FxHashMap, FxHashSet};
use libc::c_void;
use msg::constellation_msg::PipelineId;
use script_traits::{AnimationState as AnimationsPresentState, ScriptMsg, UntrustedNodeAddress};
use serde::{Deserialize, Serialize};
use style::animation::{

View file

@ -5,6 +5,7 @@
use std::rc::Rc;
use std::str;
use base::id::PipelineId;
use devtools_traits::{
AutoMargins, ComputedNodeLayout, EvaluateJSReply, Modification, NodeInfo, TimelineMarker,
TimelineMarkerType,
@ -12,7 +13,6 @@ use devtools_traits::{
use ipc_channel::ipc::IpcSender;
use js::jsval::UndefinedValue;
use js::rust::ToString;
use msg::constellation_msg::PipelineId;
use uuid::Uuid;
use crate::dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods;

View file

@ -4,9 +4,9 @@
use std::rc::Rc;
use base::id::PipelineId;
use dom_struct::dom_struct;
use js::rust::HandleObject;
use msg::constellation_msg::PipelineId;
use servo_media::audio::context::{LatencyCategory, ProcessingState, RealTimeAudioContextOptions};
use crate::dom::baseaudiocontext::{BaseAudioContext, BaseAudioContextOptions};

View file

@ -8,10 +8,10 @@ use std::collections::{HashMap, VecDeque};
use std::rc::Rc;
use std::sync::{Arc, Mutex};
use base::id::PipelineId;
use dom_struct::dom_struct;
use js::rust::CustomAutoRooterGuard;
use js::typedarray::ArrayBuffer;
use msg::constellation_msg::PipelineId;
use servo_media::audio::context::{
AudioContext, AudioContextOptions, OfflineAudioContextOptions, ProcessingState,
RealTimeAudioContextOptions,

View file

@ -8,6 +8,7 @@ use std::collections::HashMap;
use std::os::raw;
use std::ptr;
use base::id::{BlobId, MessagePortId};
use js::glue::{
CopyJSStructuredCloneData, DeleteJSAutoStructuredCloneBuffer, GetLengthOfJSStructuredCloneData,
NewJSAutoStructuredCloneBuffer, WriteBytesToJSStructuredCloneData,
@ -22,7 +23,6 @@ use js::jsapi::{
use js::jsval::UndefinedValue;
use js::rust::wrappers::{JS_ReadStructuredClone, JS_WriteStructuredClone};
use js::rust::{CustomAutoRooterGuard, HandleValue, MutableHandleValue};
use msg::constellation_msg::{BlobId, MessagePortId};
use script_traits::serializable::BlobImpl;
use script_traits::transferable::MessagePortImpl;
use script_traits::StructuredSerializedData;

View file

@ -7,11 +7,11 @@ use std::num::NonZeroU32;
use std::ptr::NonNull;
use std::rc::Rc;
use base::id::{BlobId, BlobIndex, PipelineNamespaceId};
use dom_struct::dom_struct;
use encoding_rs::UTF_8;
use js::jsapi::JSObject;
use js::rust::HandleObject;
use msg::constellation_msg::{BlobId, BlobIndex, PipelineNamespaceId};
use net_traits::filemanager_thread::RelativePos;
use script_traits::serializable::BlobImpl;
use uuid::Uuid;

View file

@ -7,6 +7,7 @@ use std::sync::atomic::AtomicBool;
use std::sync::Arc;
use std::thread::{self, JoinHandle};
use base::id::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId};
use crossbeam_channel::{unbounded, Receiver, Sender};
use devtools_traits::DevtoolScriptControlMsg;
use dom_struct::dom_struct;
@ -15,7 +16,6 @@ use ipc_channel::router::ROUTER;
use js::jsapi::{Heap, JSContext, JSObject, JS_AddInterruptCallback};
use js::jsval::UndefinedValue;
use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleValue};
use msg::constellation_msg::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId};
use net_traits::image_cache::ImageCache;
use net_traits::request::{
CredentialsMode, Destination, ParserMetadata, Referrer, RequestBuilder, RequestMode,

View file

@ -2,11 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use base::id::PipelineId;
use dom_struct::dom_struct;
use js::jsapi::{Heap, JSObject};
use js::jsval::{JSVal, UndefinedValue};
use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleValue};
use msg::constellation_msg::PipelineId;
use script_traits::{ScriptMsg, StructuredSerializedData};
use servo_url::ServoUrl;

View file

@ -13,6 +13,7 @@ use std::rc::Rc;
use std::slice::from_ref;
use std::time::{Duration, Instant};
use base::id::BrowsingContextId;
use canvas_traits::webgl::{self, WebGLContextId, WebGLMsg};
use content_security_policy::{self as csp, CspList};
use cookie::Cookie;
@ -33,7 +34,6 @@ use metrics::{
ProgressiveWebMetric,
};
use mime::{self, Mime};
use msg::constellation_msg::BrowsingContextId;
use net_traits::pub_domains::is_pub_domain;
use net_traits::request::RequestBuilder;
use net_traits::response::HttpsState;

View file

@ -15,6 +15,7 @@ use std::{fmt, mem};
use cssparser::match_ignore_ascii_case;
use devtools_traits::AttrInfo;
use dom_struct::dom_struct;
use embedder_traits::InputMethodType;
use euclid::default::{Rect, Size2D};
use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode};
use html5ever::serialize::{SerializeOpts, TraversalScope};
@ -25,7 +26,6 @@ use html5ever::{
use js::jsapi::Heap;
use js::jsval::JSVal;
use js::rust::HandleObject;
use msg::constellation_msg::InputMethodType;
use net_traits::request::CorsSettings;
use net_traits::ReferrerPolicy;
use script_layout_interface::ReflowGoal;

View file

@ -14,6 +14,10 @@ use std::thread::JoinHandle;
use std::time::Instant;
use std::{mem, ptr};
use base::id::{
BlobId, BroadcastChannelRouterId, MessagePortId, MessagePortRouterId, PipelineId,
ServiceWorkerId, ServiceWorkerRegistrationId,
};
use content_security_policy::CspList;
use crossbeam_channel::Sender;
use devtools_traits::{PageError, ScriptToDevtoolsControlMsg};
@ -34,10 +38,6 @@ use js::rust::{
MutableHandleValue, ParentRuntime, Runtime,
};
use js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL};
use msg::constellation_msg::{
BlobId, BroadcastChannelRouterId, MessagePortId, MessagePortRouterId, PipelineId,
ServiceWorkerId, ServiceWorkerRegistrationId,
};
use net_traits::blob_url_store::{get_blob_origin, BlobBuf};
use net_traits::filemanager_thread::{
FileManagerResult, FileManagerThreadMsg, ReadFileProgress, RelativePos,

View file

@ -5,15 +5,15 @@
use std::cell::Cell;
use std::cmp::Ordering;
use base::id::HistoryStateId;
use dom_struct::dom_struct;
use js::jsapi::Heap;
use js::jsval::{JSVal, NullValue, UndefinedValue};
use js::rust::HandleValue;
use msg::constellation_msg::{HistoryStateId, TraversalDirection};
use net_traits::{CoreResourceMsg, IpcSend};
use profile_traits::ipc;
use profile_traits::ipc::channel;
use script_traits::{ScriptMsg, StructuredSerializedData};
use script_traits::{ScriptMsg, StructuredSerializedData, TraversalDirection};
use servo_url::ServoUrl;
use crate::dom::bindings::codegen::Bindings::HistoryBinding::HistoryMethods;

View file

@ -4,11 +4,11 @@
use std::cell::Cell;
use base::id::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId};
use bitflags::bitflags;
use dom_struct::dom_struct;
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use msg::constellation_msg::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId};
use profile_traits::ipc as ProfiledIpc;
use script_layout_interface::ReflowGoal;
use script_traits::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed};

View file

@ -9,6 +9,7 @@ use std::sync::{Arc, Mutex};
use std::{char, i32, mem};
use app_units::{Au, AU_PER_PX};
use base::id::PipelineId;
use cssparser::{Parser, ParserInput};
use dom_struct::dom_struct;
use euclid::Point2D;
@ -19,7 +20,6 @@ use ipc_channel::router::ROUTER;
use js::jsapi::JSAutoRealm;
use js::rust::HandleObject;
use mime::{self, Mime};
use msg::constellation_msg::PipelineId;
use net_traits::image::base::{Image, ImageMetadata};
use net_traits::image_cache::{
CorsStatus, ImageCache, ImageCacheResult, ImageOrMetadataAvailable, ImageResponse,

View file

@ -11,7 +11,7 @@ use std::{f64, ptr};
use chrono::naive::{NaiveDate, NaiveDateTime};
use chrono::{DateTime, Datelike, Weekday};
use dom_struct::dom_struct;
use embedder_traits::FilterPattern;
use embedder_traits::{FilterPattern, InputMethodType};
use encoding_rs::Encoding;
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::jsapi::{
@ -21,7 +21,6 @@ use js::jsapi::{
use js::jsval::UndefinedValue;
use js::rust::jsapi_wrapped::{ExecuteRegExpNoStatics, ObjectIsRegExp};
use js::rust::{HandleObject, MutableHandleObject};
use msg::constellation_msg::InputMethodType;
use net_traits::blob_url_store::get_blob_origin;
use net_traits::filemanager_thread::FileManagerThreadMsg;
use net_traits::{CoreResourceMsg, IpcSend};

View file

@ -12,6 +12,7 @@ use std::ptr;
use std::rc::Rc;
use std::sync::{Arc, Mutex};
use base::id::PipelineId;
use content_security_policy as csp;
use dom_struct::dom_struct;
use encoding_rs::Encoding;
@ -24,7 +25,6 @@ use js::rust::{
transform_str_to_source_text, CompileOptionsWrapper, FinishOffThreadStencil, HandleObject,
Stencil,
};
use msg::constellation_msg::PipelineId;
use net_traits::request::{
CorsSettings, CredentialsMode, Destination, ParserMetadata, RequestBuilder,
};

View file

@ -8,10 +8,10 @@ use std::convert::TryInto;
use std::num::NonZeroU32;
use std::rc::Rc;
use base::id::{MessagePortId, MessagePortIndex, PipelineNamespaceId};
use dom_struct::dom_struct;
use js::jsapi::{Heap, JSObject, MutableHandleObject};
use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleValue};
use msg::constellation_msg::{MessagePortId, MessagePortIndex, PipelineNamespaceId};
use script_traits::PortMessageTask;
use crate::dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull;

View file

@ -13,6 +13,7 @@ use std::sync::Arc as StdArc;
use std::{cmp, iter};
use app_units::Au;
use base::id::{BrowsingContextId, PipelineId};
use bitflags::bitflags;
use devtools_traits::NodeInfo;
use dom_struct::dom_struct;
@ -22,7 +23,6 @@ use js::jsapi::JSObject;
use js::rust::HandleObject;
use libc::{self, c_void, uintptr_t};
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use net_traits::image::base::{Image, ImageMetadata};
use script_layout_interface::{
GenericLayoutData, HTMLCanvasData, HTMLMediaData, LayoutElementType, LayoutNodeType, QueryMsg,

View file

@ -7,9 +7,9 @@ use std::rc::Rc;
use std::sync::{mpsc, Arc, Mutex};
use std::thread::Builder;
use base::id::PipelineId;
use dom_struct::dom_struct;
use js::rust::HandleObject;
use msg::constellation_msg::PipelineId;
use servo_media::audio::context::OfflineAudioContextOptions as ServoMediaOfflineAudioContextOptions;
use crate::dom::audiobuffer::{AudioBuffer, MAX_SAMPLE_RATE, MIN_SAMPLE_RATE};

View file

@ -10,6 +10,7 @@ use std::sync::{Arc, Mutex};
use std::thread;
use std::time::Duration;
use base::id::PipelineId;
use crossbeam_channel::{unbounded, Sender};
use dom_struct::dom_struct;
use euclid::{Scale, Size2D};
@ -20,7 +21,6 @@ use js::jsapi::{
use js::jsval::{JSVal, ObjectValue, UndefinedValue};
use js::rust::wrappers::{Call, Construct1};
use js::rust::{HandleValue, Runtime};
use msg::constellation_msg::PipelineId;
use net_traits::image_cache::ImageCache;
use pixels::PixelFormat;
use profile_traits::ipc;

View file

@ -4,10 +4,10 @@
use std::cell::Cell;
use base::id::ServiceWorkerId;
use dom_struct::dom_struct;
use js::jsapi::{Heap, JSObject};
use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleValue};
use msg::constellation_msg::ServiceWorkerId;
use script_traits::{DOMMessage, ScriptMsg};
use servo_url::ServoUrl;

View file

@ -7,6 +7,7 @@ use std::sync::Arc;
use std::thread::{self, JoinHandle};
use std::time::{Duration, Instant};
use base::id::PipelineId;
use crossbeam_channel::{after, unbounded, Receiver, Sender};
use devtools_traits::DevtoolScriptControlMsg;
use dom_struct::dom_struct;
@ -14,7 +15,6 @@ use ipc_channel::ipc::{IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use js::jsapi::{JSContext, JS_AddInterruptCallback};
use js::jsval::UndefinedValue;
use msg::constellation_msg::PipelineId;
use net_traits::request::{CredentialsMode, Destination, ParserMetadata, Referrer, RequestBuilder};
use net_traits::{CustomResponseMediator, IpcSend};
use parking_lot::Mutex;

View file

@ -4,9 +4,9 @@
use std::cell::Cell;
use base::id::ServiceWorkerRegistrationId;
use devtools_traits::WorkerId;
use dom_struct::dom_struct;
use msg::constellation_msg::ServiceWorkerRegistrationId;
use script_traits::{ScopeThings, WorkerScriptLoadOrigin};
use servo_url::ServoUrl;
use uuid::Uuid;

View file

@ -6,6 +6,7 @@ use std::borrow::Cow;
use std::cell::Cell;
use std::mem;
use base::id::PipelineId;
use base64::engine::general_purpose;
use base64::Engine as _;
use content_security_policy::{self as csp, CspList};
@ -20,7 +21,6 @@ use html5ever::tree_builder::{ElementFlags, NextParserState, NodeOrText, QuirksM
use html5ever::{local_name, namespace_url, ns, Attribute, ExpandedName, LocalName, QualName};
use hyper_serde::Serde;
use mime::{self, Mime};
use msg::constellation_msg::PipelineId;
use net_traits::{
FetchMetadata, FetchResponseListener, Metadata, NetworkError, ResourceFetchTiming,
ResourceTimingType,

View file

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use base::id::PipelineId;
use html5ever::buffer_queue::BufferQueue;
use html5ever::tokenizer::states::RawKind;
use html5ever::tokenizer::{
@ -9,7 +10,6 @@ use html5ever::tokenizer::{
};
use html5ever::{local_name, Attribute, LocalName};
use js::jsapi::JSTracer;
use msg::constellation_msg::PipelineId;
use net_traits::request::{CorsSettings, CredentialsMode, ParserMetadata, Referrer};
use net_traits::{CoreResourceMsg, FetchChannels, IpcSend, ReferrerPolicy, ResourceThreads};
use servo_url::{ImmutableOrigin, ServoUrl};

View file

@ -4,10 +4,10 @@
use std::collections::HashMap;
use base::id::PipelineId;
use crossbeam_channel::Sender;
use dom_struct::dom_struct;
use js::rust::Runtime;
use msg::constellation_msg::PipelineId;
use servo_url::ServoUrl;
use crate::dom::bindings::cell::DomRefCell;

View file

@ -16,6 +16,7 @@ use std::{cmp, env, mem};
use app_units::Au;
use backtrace::Backtrace;
use base::id::{BrowsingContextId, PipelineId};
use base64::Engine;
use bluetooth_traits::BluetoothRequest;
use canvas_traits::webgl::WebGLChan;
@ -26,7 +27,6 @@ use dom_struct::dom_struct;
use embedder_traits::{EmbedderMsg, PromptDefinition, PromptOrigin, PromptResult};
use euclid::default::{Point2D as UntypedPoint2D, Rect as UntypedRect};
use euclid::{Point2D, Rect, Scale, Size2D, Vector2D};
use gfx_traits::combine_id_with_fragment_type;
use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER;
use js::conversions::ToJSValConvertible;
@ -38,7 +38,6 @@ use js::rust::{
};
use malloc_size_of::MallocSizeOf;
use media::WindowGLContext;
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use net_traits::image_cache::{
ImageCache, ImageResponder, ImageResponse, PendingImageId, PendingImageResponse,
};
@ -50,7 +49,8 @@ use profile_traits::ipc as ProfiledIpc;
use profile_traits::mem::ProfilerChan as MemProfilerChan;
use profile_traits::time::ProfilerChan as TimeProfilerChan;
use script_layout_interface::{
Layout, PendingImageState, QueryMsg, Reflow, ReflowGoal, ScriptReflow, TrustedNodeAddress,
combine_id_with_fragment_type, FragmentType, Layout, PendingImageState, QueryMsg, Reflow,
ReflowGoal, ScriptReflow, TrustedNodeAddress,
};
use script_traits::webdriver_msg::{WebDriverJSError, WebDriverJSResult};
use script_traits::{
@ -2110,10 +2110,7 @@ impl Window {
.borrow_mut()
.insert(node.to_opaque(), Vector2D::new(x_ as f32, y_ as f32));
let scroll_id = ExternalScrollId(
combine_id_with_fragment_type(
node.to_opaque().id(),
gfx_traits::FragmentType::FragmentBody,
),
combine_id_with_fragment_type(node.to_opaque().id(), FragmentType::FragmentBody),
self.pipeline_id().into(),
);

View file

@ -5,6 +5,7 @@
use std::cell::Cell;
use std::ptr;
use base::id::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId};
use dom_struct::dom_struct;
use embedder_traits::EmbedderMsg;
use html5ever::local_name;
@ -27,7 +28,6 @@ use js::jsval::{JSVal, NullValue, PrivateValue, UndefinedValue};
use js::rust::wrappers::{JS_TransplantObject, NewWindowProxy, SetWindowProxy};
use js::rust::{get_object_class, Handle, MutableHandle};
use js::JSCLASS_IS_GLOBAL;
use msg::constellation_msg::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId};
use net_traits::request::Referrer;
use script_traits::{
AuxiliaryBrowsingContextLoadInfo, HistoryEntryReplacement, LoadData, LoadOrigin, NewLayoutInfo,

View file

@ -7,6 +7,7 @@ use std::rc::Rc;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use base::id::{PipelineId, PipelineNamespace};
use crossbeam_channel::Receiver;
use devtools_traits::{DevtoolScriptControlMsg, WorkerId};
use dom_struct::dom_struct;
@ -14,7 +15,6 @@ use ipc_channel::ipc::IpcSender;
use js::jsval::UndefinedValue;
use js::panic::maybe_resume_unwind;
use js::rust::{HandleValue, ParentRuntime};
use msg::constellation_msg::{PipelineId, PipelineNamespace};
use net_traits::request::{
CredentialsMode, Destination, ParserMetadata, RequestBuilder as NetRequestInit,
};

View file

@ -18,11 +18,11 @@ use std::sync::atomic::{AtomicIsize, Ordering};
use std::sync::Arc;
use std::thread;
use base::id::PipelineId;
use crossbeam_channel::{unbounded, Receiver, Sender};
use dom_struct::dom_struct;
use js::jsapi::{GCReason, JSGCParamKey, JSTracer, JS_GetGCParameter, JS_GC};
use malloc_size_of::malloc_size_of_is_0;
use msg::constellation_msg::PipelineId;
use net_traits::request::{Destination, RequestBuilder, RequestMode};
use net_traits::IpcSend;
use servo_url::{ImmutableOrigin, ServoUrl};

View file

@ -5,13 +5,13 @@
use std::borrow::Cow;
use std::sync::Arc;
use base::id::PipelineId;
use crossbeam_channel::Sender;
use devtools_traits::ScriptToDevtoolsControlMsg;
use dom_struct::dom_struct;
use ipc_channel::ipc::IpcSender;
use js::jsval::UndefinedValue;
use js::rust::Runtime;
use msg::constellation_msg::PipelineId;
use net_traits::image_cache::ImageCache;
use net_traits::ResourceThreads;
use parking_lot::Mutex;

View file

@ -5,10 +5,10 @@
use std::cell::Cell;
use std::rc::Rc;
use base::id::PipelineId;
use dom_struct::dom_struct;
use ipc_channel::ipc::{self as ipc_crate, IpcReceiver};
use ipc_channel::router::ROUTER;
use msg::constellation_msg::PipelineId;
use profile_traits::ipc;
use servo_config::pref;
use webxr_api::{Error as XRError, Frame, Session, SessionInit, SessionMode};

Some files were not shown because too many files have changed in this diff Show more