diff options
author | Martin Robinson <mrobinson@igalia.com> | 2025-04-06 00:13:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-05 22:13:29 +0000 |
commit | 6031a12fd1fa4aee8368e0b3dc0cb792caac56bc (patch) | |
tree | cc91327012041a24bd1b71c7768660a2efbe862f /components/script/dom | |
parent | a67409fb253b3cb6dd1adbaf9d3cad47941f4993 (diff) | |
download | servo-6031a12fd1fa4aee8368e0b3dc0cb792caac56bc.tar.gz servo-6031a12fd1fa4aee8368e0b3dc0cb792caac56bc.zip |
Move `ScriptToConstellationMsg` to `constellation_traits` (#36364)
This is the last big change necessary to create the
`constellation_traits` crate. This moves the data structure for messages
that originate from the `ScriptThread` and are sent to the
`Contellation` to `constellation_traits`, effectively splitting
`script_traits` in half. Before, `script_traits` was responsible for
exposing the API of both the `ScriptThread` and the `Constellation` to
the rest of Servo.
- Data structures that are used by `ScriptToConstellationMsg` are moved
to `constellation_traits`. The dependency graph looks a bit like this:
`script_layout_interface` depends on `script_traits` depends on
`constellation_traits` depends on `embedder_traits`.
- Data structures that are used in the embedding layer
(`UntrustedNodeAddress`, `CompositorHitTestResult`, `TouchEventResult`
and `AnimationState`) are moved to embedder_traits, to avoid a
dependency cycle between `webrender_traits` and
`constellation_traits`.
- Types dealing with MessagePorts and serialization are moved to
`constellation_traits::message_port`.
Testing: This is covered by existing tests as it just moves types
around.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/script/dom')
39 files changed, 71 insertions, 73 deletions
diff --git a/components/script/dom/abstractworker.rs b/components/script/dom/abstractworker.rs index 5f7131eb0a0..8a353531145 100644 --- a/components/script/dom/abstractworker.rs +++ b/components/script/dom/abstractworker.rs @@ -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 script_traits::StructuredSerializedData; +use constellation_traits::StructuredSerializedData; use servo_url::ImmutableOrigin; use crate::dom::bindings::refcounted::Trusted; diff --git a/components/script/dom/bindings/structuredclone.rs b/components/script/dom/bindings/structuredclone.rs index d7ce192652c..572faca1907 100644 --- a/components/script/dom/bindings/structuredclone.rs +++ b/components/script/dom/bindings/structuredclone.rs @@ -10,6 +10,10 @@ use std::os::raw; use std::ptr; use base::id::{BlobId, DomPointId, MessagePortId, PipelineNamespaceId}; +use constellation_traits::{ + BlobImpl, DomPoint, MessagePortImpl, Serializable as SerializableInterface, + StructuredSerializedData, Transferrable as TransferrableInterface, +}; use js::glue::{ CopyJSStructuredCloneData, DeleteJSAutoStructuredCloneBuffer, GetLengthOfJSStructuredCloneData, NewJSAutoStructuredCloneBuffer, WriteBytesToJSStructuredCloneData, @@ -24,12 +28,6 @@ use js::jsval::UndefinedValue; use js::rust::wrappers::{JS_ReadStructuredClone, JS_WriteStructuredClone}; use js::rust::{CustomAutoRooterGuard, HandleValue, MutableHandleValue}; use script_bindings::conversions::IDLInterface; -use script_traits::serializable::{BlobImpl, DomPoint}; -use script_traits::transferable::MessagePortImpl; -use script_traits::{ - Serializable as SerializableInterface, StructuredSerializedData, - Transferrable as TransferrableInterface, -}; use strum::IntoEnumIterator; use crate::dom::bindings::conversions::{ToJSValConvertible, root_from_object}; diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index d23cb62002e..5f9d4052929 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -8,13 +8,13 @@ use std::ptr; use std::rc::Rc; use base::id::{BlobId, BlobIndex, PipelineNamespaceId}; +use constellation_traits::BlobImpl; use dom_struct::dom_struct; use encoding_rs::UTF_8; use js::jsapi::JSObject; use js::rust::HandleObject; use js::typedarray::Uint8; use net_traits::filemanager_thread::RelativePos; -use script_traits::serializable::BlobImpl; use uuid::Uuid; use crate::body::{FetchedData, run_array_buffer_data_algorithm}; diff --git a/components/script/dom/broadcastchannel.rs b/components/script/dom/broadcastchannel.rs index 2d7d6740589..aae748262f2 100644 --- a/components/script/dom/broadcastchannel.rs +++ b/components/script/dom/broadcastchannel.rs @@ -4,9 +4,9 @@ use std::cell::Cell; +use constellation_traits::BroadcastMsg; use dom_struct::dom_struct; use js::rust::{HandleObject, HandleValue}; -use script_traits::BroadcastMsg; use uuid::Uuid; use crate::dom::bindings::codegen::Bindings::BroadcastChannelBinding::BroadcastChannelMethods; diff --git a/components/script/dom/dedicatedworkerglobalscope.rs b/components/script/dom/dedicatedworkerglobalscope.rs index 5bfde8dcfc7..3f6b6ee7d90 100644 --- a/components/script/dom/dedicatedworkerglobalscope.rs +++ b/components/script/dom/dedicatedworkerglobalscope.rs @@ -7,6 +7,7 @@ use std::sync::atomic::AtomicBool; use std::thread::{self, JoinHandle}; use base::id::{BrowsingContextId, PipelineId, WebViewId}; +use constellation_traits::{WorkerGlobalScopeInit, WorkerScriptLoadOrigin}; use crossbeam_channel::{Receiver, Sender, unbounded}; use devtools_traits::DevtoolScriptControlMsg; use dom_struct::dom_struct; @@ -21,7 +22,6 @@ use net_traits::request::{ CredentialsMode, Destination, InsecureRequestsPolicy, ParserMetadata, Referrer, RequestBuilder, RequestMode, }; -use script_traits::{WorkerGlobalScopeInit, WorkerScriptLoadOrigin}; use servo_rand::random; use servo_url::{ImmutableOrigin, ServoUrl}; use style::thread_state::{self, ThreadState}; diff --git a/components/script/dom/dissimilaroriginwindow.rs b/components/script/dom/dissimilaroriginwindow.rs index e5258daf2c1..233b43855c4 100644 --- a/components/script/dom/dissimilaroriginwindow.rs +++ b/components/script/dom/dissimilaroriginwindow.rs @@ -3,11 +3,11 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use base::id::PipelineId; +use constellation_traits::{ScriptToConstellationMessage, StructuredSerializedData}; use dom_struct::dom_struct; use js::jsapi::{Heap, JSObject}; use js::jsval::UndefinedValue; use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleValue, MutableHandleValue}; -use script_traits::{ScriptToConstellationMessage, StructuredSerializedData}; use servo_url::ServoUrl; use crate::dom::bindings::codegen::Bindings::DissimilarOriginWindowBinding; diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 2e1d3859b4b..d76367ca982 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -20,16 +20,16 @@ use base::id::WebViewId; use canvas_traits::canvas::CanvasId; use canvas_traits::webgl::{self, WebGLContextId, WebGLMsg}; use chrono::Local; -use constellation_traits::{AnimationTickType, CompositorHitTestResult}; +use constellation_traits::{AnimationTickType, ScriptToConstellationMessage}; use content_security_policy::{self as csp, CspList, PolicyDisposition}; use cookie::Cookie; use cssparser::match_ignore_ascii_case; use devtools_traits::ScriptToDevtoolsControlMsg; use dom_struct::dom_struct; use embedder_traits::{ - AllowOrDeny, ContextMenuResult, EditingActionEvent, EmbedderMsg, ImeEvent, InputEvent, - LoadStatus, MouseButton, MouseButtonAction, MouseButtonEvent, TouchEvent, TouchEventType, - TouchId, WheelEvent, + AllowOrDeny, AnimationState, CompositorHitTestResult, ContextMenuResult, EditingActionEvent, + EmbedderMsg, ImeEvent, InputEvent, LoadStatus, MouseButton, MouseButtonAction, + MouseButtonEvent, TouchEvent, TouchEventType, TouchId, WheelEvent, }; use encoding_rs::{Encoding, UTF_8}; use euclid::default::{Point2D, Rect, Size2D}; @@ -53,10 +53,7 @@ use profile_traits::ipc as profile_ipc; use profile_traits::time::TimerMetadataFrameType; use script_bindings::interfaces::DocumentHelpers; use script_layout_interface::{PendingRestyle, TrustedNodeAddress}; -use script_traits::{ - AnimationState, ConstellationInputEvent, DocumentActivity, ProgressiveWebMetricType, - ScriptToConstellationMessage, -}; +use script_traits::{ConstellationInputEvent, DocumentActivity, ProgressiveWebMetricType}; use servo_arc::Arc; use servo_config::pref; use servo_media::{ClientContextId, ServoMedia}; diff --git a/components/script/dom/documentorshadowroot.rs b/components/script/dom/documentorshadowroot.rs index 6d59623c966..e3b09924689 100644 --- a/components/script/dom/documentorshadowroot.rs +++ b/components/script/dom/documentorshadowroot.rs @@ -4,7 +4,7 @@ use std::fmt; -use constellation_traits::UntrustedNodeAddress; +use embedder_traits::UntrustedNodeAddress; use euclid::default::Point2D; use script_layout_interface::{NodesFromPointQueryType, QueryMsg}; use servo_arc::Arc; diff --git a/components/script/dom/dompoint.rs b/components/script/dom/dompoint.rs index 84b02e6f4c4..c6323b28cf7 100644 --- a/components/script/dom/dompoint.rs +++ b/components/script/dom/dompoint.rs @@ -5,9 +5,9 @@ use std::collections::HashMap; use base::id::DomPointId; +use constellation_traits::DomPoint; use dom_struct::dom_struct; use js::rust::HandleObject; -use script_traits::serializable::DomPoint; use crate::dom::bindings::codegen::Bindings::DOMPointBinding::{DOMPointInit, DOMPointMethods}; use crate::dom::bindings::codegen::Bindings::DOMPointReadOnlyBinding::DOMPointReadOnlyMethods; diff --git a/components/script/dom/dompointreadonly.rs b/components/script/dom/dompointreadonly.rs index fed82bd9055..0bd6d5742c7 100644 --- a/components/script/dom/dompointreadonly.rs +++ b/components/script/dom/dompointreadonly.rs @@ -7,9 +7,9 @@ use std::collections::HashMap; use std::num::NonZeroU32; use base::id::{DomPointId, DomPointIndex, PipelineNamespaceId}; +use constellation_traits::DomPoint; use dom_struct::dom_struct; use js::rust::HandleObject; -use script_traits::serializable::DomPoint; use crate::dom::bindings::codegen::Bindings::DOMPointBinding::DOMPointInit; use crate::dom::bindings::codegen::Bindings::DOMPointReadOnlyBinding::DOMPointReadOnlyMethods; diff --git a/components/script/dom/file.rs b/components/script/dom/file.rs index 06671794c13..14a0ce68094 100644 --- a/components/script/dom/file.rs +++ b/components/script/dom/file.rs @@ -4,10 +4,10 @@ use std::time::SystemTime; +use constellation_traits::BlobImpl; use dom_struct::dom_struct; use js::rust::HandleObject; use net_traits::filemanager_thread::SelectedFile; -use script_traits::serializable::BlobImpl; use time::{Duration, OffsetDateTime}; use crate::dom::bindings::codegen::Bindings::FileBinding; diff --git a/components/script/dom/formdata.rs b/components/script/dom/formdata.rs index 6c8c7e057a9..1082a202f34 100644 --- a/components/script/dom/formdata.rs +++ b/components/script/dom/formdata.rs @@ -2,10 +2,10 @@ * 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 constellation_traits::BlobImpl; use dom_struct::dom_struct; use html5ever::LocalName; use js::rust::HandleObject; -use script_traits::serializable::BlobImpl; use super::bindings::trace::NoTrace; use crate::dom::bindings::cell::DomRefCell; diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs index 7d3c65dad2f..1ff9a7334be 100644 --- a/components/script/dom/globalscope.rs +++ b/components/script/dom/globalscope.rs @@ -17,6 +17,10 @@ use base::id::{ BlobId, BroadcastChannelRouterId, MessagePortId, MessagePortRouterId, PipelineId, ServiceWorkerId, ServiceWorkerRegistrationId, WebViewId, }; +use constellation_traits::{ + BlobData, BlobImpl, BroadcastMsg, FileBlob, MessagePortImpl, MessagePortMsg, PortMessageTask, + ScriptToConstellationChan, ScriptToConstellationMessage, +}; use content_security_policy::{CheckResult, CspList, PolicyDisposition}; use crossbeam_channel::Sender; use devtools_traits::{PageError, ScriptToDevtoolsControlMsg}; @@ -55,12 +59,6 @@ use net_traits::{ }; use profile_traits::{ipc as profile_ipc, mem as profile_mem, time as profile_time}; use script_bindings::interfaces::GlobalScopeHelpers; -use script_traits::serializable::{BlobData, BlobImpl, FileBlob}; -use script_traits::transferable::MessagePortImpl; -use script_traits::{ - BroadcastMsg, MessagePortMsg, PortMessageTask, ScriptToConstellationChan, - ScriptToConstellationMessage, -}; use servo_url::{ImmutableOrigin, MutableOrigin, ServoUrl}; use timers::{TimerEventId, TimerEventRequest, TimerSource}; use uuid::Uuid; diff --git a/components/script/dom/history.rs b/components/script/dom/history.rs index 316e9c86690..4b51f3e62d2 100644 --- a/components/script/dom/history.rs +++ b/components/script/dom/history.rs @@ -6,7 +6,9 @@ use std::cell::Cell; use std::cmp::Ordering; use base::id::HistoryStateId; -use constellation_traits::TraversalDirection; +use constellation_traits::{ + ScriptToConstellationMessage, StructuredSerializedData, TraversalDirection, +}; use dom_struct::dom_struct; use js::jsapi::Heap; use js::jsval::{JSVal, NullValue, UndefinedValue}; @@ -14,7 +16,6 @@ use js::rust::{HandleValue, MutableHandleValue}; use net_traits::{CoreResourceMsg, IpcSend}; use profile_traits::ipc; use profile_traits::ipc::channel; -use script_traits::{ScriptToConstellationMessage, StructuredSerializedData}; use servo_url::ServoUrl; use crate::dom::bindings::codegen::Bindings::HistoryBinding::HistoryMethods; diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index 547ee9d8ccd..7d459349567 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -7,6 +7,9 @@ use std::collections::HashMap; use std::rc::Rc; use canvas_traits::webgl::{GLContextAttributes, WebGLVersion}; +use constellation_traits::BlobImpl; +#[cfg(feature = "webgpu")] +use constellation_traits::ScriptToConstellationMessage; use dom_struct::dom_struct; use euclid::default::Size2D; use html5ever::{LocalName, Prefix, local_name, namespace_url, ns}; @@ -20,9 +23,6 @@ use ipc_channel::ipc::{self as ipcchan}; use js::error::throw_type_error; use js::rust::{HandleObject, HandleValue}; use script_layout_interface::{HTMLCanvasData, HTMLCanvasDataSource}; -#[cfg(feature = "webgpu")] -use script_traits::ScriptToConstellationMessage; -use script_traits::serializable::BlobImpl; use servo_media::streams::MediaStreamType; use servo_media::streams::registry::MediaStreamId; use style::attr::AttrValue; diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index fd85e3fd1a9..260c6cfb620 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -5,6 +5,7 @@ use std::borrow::ToOwned; use std::cell::Cell; +use constellation_traits::{LoadData, LoadOrigin, NavigationHistoryBehavior}; use dom_struct::dom_struct; use encoding_rs::{Encoding, UTF_8}; use headers::{ContentType, HeaderMapExt}; @@ -14,7 +15,6 @@ use js::rust::HandleObject; use mime::{self, Mime}; use net_traits::http_percent_encode; use net_traits::request::Referrer; -use script_traits::{LoadData, LoadOrigin, NavigationHistoryBehavior}; use servo_rand::random; use style::attr::AttrValue; use style::str::split_html_space_chars; diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 04127ef1b17..cc6c3f047ce 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -6,17 +6,18 @@ use std::cell::Cell; use base::id::{BrowsingContextId, PipelineId, WebViewId}; use bitflags::bitflags; +use constellation_traits::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed}; +use constellation_traits::{ + IFrameLoadInfo, IFrameLoadInfoWithData, JsEvalResult, LoadData, LoadOrigin, + NavigationHistoryBehavior, ScriptToConstellationMessage, +}; use dom_struct::dom_struct; use embedder_traits::ViewportDetails; use html5ever::{LocalName, Prefix, local_name, namespace_url, ns}; use js::rust::HandleObject; use net_traits::ReferrerPolicy; use profile_traits::ipc as ProfiledIpc; -use script_traits::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed}; -use script_traits::{ - IFrameLoadInfo, IFrameLoadInfoWithData, JsEvalResult, LoadData, LoadOrigin, - NavigationHistoryBehavior, NewLayoutInfo, ScriptToConstellationMessage, UpdatePipelineIdReason, -}; +use script_traits::{NewLayoutInfo, UpdatePipelineIdReason}; use servo_url::ServoUrl; use style::attr::{AttrValue, LengthOrPercentageOrAuto}; use stylo_atoms::Atom; diff --git a/components/script/dom/htmlmetaelement.rs b/components/script/dom/htmlmetaelement.rs index 16b6a2463d4..fd95ac1abbf 100644 --- a/components/script/dom/htmlmetaelement.rs +++ b/components/script/dom/htmlmetaelement.rs @@ -6,11 +6,11 @@ use std::str::FromStr; use std::sync::LazyLock; use std::time::Duration; +use constellation_traits::NavigationHistoryBehavior; use dom_struct::dom_struct; use html5ever::{LocalName, Prefix}; use js::rust::HandleObject; use regex::bytes::Regex; -use script_traits::NavigationHistoryBehavior; use servo_url::ServoUrl; use style::str::HTML_SPACE_CHARACTERS; diff --git a/components/script/dom/location.rs b/components/script/dom/location.rs index eabf9c83f81..cbc0566a2e5 100644 --- a/components/script/dom/location.rs +++ b/components/script/dom/location.rs @@ -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 constellation_traits::{LoadData, LoadOrigin, NavigationHistoryBehavior}; use dom_struct::dom_struct; use net_traits::request::Referrer; -use script_traits::{LoadData, LoadOrigin, NavigationHistoryBehavior}; use servo_url::{MutableOrigin, ServoUrl}; use crate::dom::bindings::codegen::Bindings::LocationBinding::LocationMethods; diff --git a/components/script/dom/mediasession.rs b/components/script/dom/mediasession.rs index f54335afb60..2d3b44dec7e 100644 --- a/components/script/dom/mediasession.rs +++ b/components/script/dom/mediasession.rs @@ -4,11 +4,11 @@ use std::rc::Rc; +use constellation_traits::ScriptToConstellationMessage; use dom_struct::dom_struct; use embedder_traits::{ MediaMetadata as EmbedderMediaMetadata, MediaSessionActionType, MediaSessionEvent, }; -use script_traits::ScriptToConstellationMessage; use super::bindings::trace::HashMapTracedValues; use crate::conversions::Convert; diff --git a/components/script/dom/messageport.rs b/components/script/dom/messageport.rs index f10ba10383e..8addfe0731f 100644 --- a/components/script/dom/messageport.rs +++ b/components/script/dom/messageport.rs @@ -8,11 +8,10 @@ use std::num::NonZeroU32; use std::rc::Rc; use base::id::{MessagePortId, MessagePortIndex, PipelineNamespaceId}; +use constellation_traits::{MessagePortImpl, PortMessageTask}; use dom_struct::dom_struct; use js::jsapi::{Heap, JSObject}; use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleValue}; -use script_traits::PortMessageTask; -use script_traits::transferable::MessagePortImpl; use crate::dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; use crate::dom::bindings::codegen::Bindings::MessagePortBinding::{ diff --git a/components/script/dom/mouseevent.rs b/components/script/dom/mouseevent.rs index 5818eb7352f..63752e6eb0a 100644 --- a/components/script/dom/mouseevent.rs +++ b/components/script/dom/mouseevent.rs @@ -5,8 +5,8 @@ use std::cell::Cell; use std::default::Default; -use constellation_traits::CompositorHitTestResult; use dom_struct::dom_struct; +use embedder_traits::CompositorHitTestResult; use euclid::default::Point2D; use js::rust::HandleObject; use servo_config::pref; diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index eff078c49c4..9c069a28c50 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -16,9 +16,9 @@ use std::{cmp, fmt, iter}; use app_units::Au; use base::id::{BrowsingContextId, PipelineId}; use bitflags::bitflags; -use constellation_traits::UntrustedNodeAddress; use devtools_traits::NodeInfo; use dom_struct::dom_struct; +use embedder_traits::UntrustedNodeAddress; use euclid::default::{Rect, Size2D, Vector2D}; use html5ever::serialize::HtmlSerializer; use html5ever::{Namespace, Prefix, QualName, namespace_url, ns, serialize as html_serialize}; diff --git a/components/script/dom/rtcdatachannel.rs b/components/script/dom/rtcdatachannel.rs index d9c5853a6a1..1aad3ef6794 100644 --- a/components/script/dom/rtcdatachannel.rs +++ b/components/script/dom/rtcdatachannel.rs @@ -5,13 +5,13 @@ use std::cell::Cell; use std::ptr; +use constellation_traits::BlobImpl; use dom_struct::dom_struct; use js::conversions::ToJSValConvertible; use js::jsapi::{JSAutoRealm, JSObject}; use js::jsval::UndefinedValue; use js::rust::CustomAutoRooterGuard; use js::typedarray::{ArrayBuffer, ArrayBufferView, CreateWith}; -use script_traits::serializable::BlobImpl; use servo_media::webrtc::{ DataChannelId, DataChannelInit, DataChannelMessage, DataChannelState, WebRtcError, }; diff --git a/components/script/dom/serviceworker.rs b/components/script/dom/serviceworker.rs index 68c995f6ce3..694c54e7455 100644 --- a/components/script/dom/serviceworker.rs +++ b/components/script/dom/serviceworker.rs @@ -5,10 +5,10 @@ use std::cell::Cell; use base::id::ServiceWorkerId; +use constellation_traits::{DOMMessage, ScriptToConstellationMessage}; use dom_struct::dom_struct; use js::jsapi::{Heap, JSObject}; use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleValue}; -use script_traits::{DOMMessage, ScriptToConstellationMessage}; use servo_url::ServoUrl; use crate::dom::abstractworker::SimpleWorkerErrorHandler; diff --git a/components/script/dom/serviceworkercontainer.rs b/components/script/dom/serviceworkercontainer.rs index b532714ec1a..b0781941f51 100644 --- a/components/script/dom/serviceworkercontainer.rs +++ b/components/script/dom/serviceworkercontainer.rs @@ -5,12 +5,12 @@ use std::default::Default; use std::rc::Rc; +use constellation_traits::{ + Job, JobError, JobResult, JobResultValue, JobType, ScriptToConstellationMessage, +}; use dom_struct::dom_struct; use ipc_channel::ipc; use ipc_channel::router::ROUTER; -use script_traits::{ - Job, JobError, JobResult, JobResultValue, JobType, ScriptToConstellationMessage, -}; use crate::dom::bindings::codegen::Bindings::ServiceWorkerContainerBinding::{ RegistrationOptions, ServiceWorkerContainerMethods, diff --git a/components/script/dom/serviceworkerglobalscope.rs b/components/script/dom/serviceworkerglobalscope.rs index a158363f9f2..defed40f0ef 100644 --- a/components/script/dom/serviceworkerglobalscope.rs +++ b/components/script/dom/serviceworkerglobalscope.rs @@ -8,6 +8,9 @@ use std::thread::{self, JoinHandle}; use std::time::{Duration, Instant}; use base::id::PipelineId; +use constellation_traits::{ + ScopeThings, ServiceWorkerMsg, WorkerGlobalScopeInit, WorkerScriptLoadOrigin, +}; use crossbeam_channel::{Receiver, Sender, after, unbounded}; use devtools_traits::DevtoolScriptControlMsg; use dom_struct::dom_struct; @@ -19,7 +22,6 @@ use net_traits::request::{ CredentialsMode, Destination, InsecureRequestsPolicy, ParserMetadata, Referrer, RequestBuilder, }; use net_traits::{CustomResponseMediator, IpcSend}; -use script_traits::{ScopeThings, ServiceWorkerMsg, WorkerGlobalScopeInit, WorkerScriptLoadOrigin}; use servo_config::pref; use servo_rand::random; use servo_url::ServoUrl; diff --git a/components/script/dom/serviceworkerregistration.rs b/components/script/dom/serviceworkerregistration.rs index bbd3840e695..fc29a4b7afe 100644 --- a/components/script/dom/serviceworkerregistration.rs +++ b/components/script/dom/serviceworkerregistration.rs @@ -5,10 +5,10 @@ use std::cell::Cell; use base::id::ServiceWorkerRegistrationId; +use constellation_traits::{ScopeThings, WorkerScriptLoadOrigin}; use devtools_traits::WorkerId; use dom_struct::dom_struct; use net_traits::request::Referrer; -use script_traits::{ScopeThings, WorkerScriptLoadOrigin}; use servo_url::ServoUrl; use uuid::Uuid; diff --git a/components/script/dom/servointernals.rs b/components/script/dom/servointernals.rs index 87c0d246e6f..54516c9a5b0 100644 --- a/components/script/dom/servointernals.rs +++ b/components/script/dom/servointernals.rs @@ -4,12 +4,12 @@ use std::rc::Rc; +use constellation_traits::ScriptToConstellationMessage; use dom_struct::dom_struct; use js::rust::HandleObject; use profile_traits::mem::MemoryReportResult; use script_bindings::interfaces::ServoInternalsHelpers; use script_bindings::script_runtime::JSContext; -use script_traits::ScriptToConstellationMessage; use crate::dom::bindings::codegen::Bindings::ServoInternalsBinding::ServoInternalsMethods; use crate::dom::bindings::error::Error; diff --git a/components/script/dom/storage.rs b/components/script/dom/storage.rs index 03b59fb6c15..054e4ab5ac3 100644 --- a/components/script/dom/storage.rs +++ b/components/script/dom/storage.rs @@ -2,12 +2,12 @@ * 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 constellation_traits::ScriptToConstellationMessage; use dom_struct::dom_struct; use ipc_channel::ipc::IpcSender; use net_traits::IpcSend; use net_traits::storage_thread::{StorageThreadMsg, StorageType}; use profile_traits::ipc; -use script_traits::ScriptToConstellationMessage; use servo_url::ServoUrl; use crate::dom::bindings::codegen::Bindings::StorageBinding::StorageMethods; diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs index e54fea515a6..8c1b9994284 100644 --- a/components/script/dom/testbinding.rs +++ b/components/script/dom/testbinding.rs @@ -9,6 +9,7 @@ use std::ptr::{self, NonNull}; use std::rc::Rc; use std::time::Duration; +use constellation_traits::BlobImpl; use dom_struct::dom_struct; use js::jsapi::{Heap, JS_NewPlainObject, JSObject}; use js::jsval::JSVal; @@ -16,7 +17,6 @@ use js::rust::{CustomAutoRooterGuard, HandleObject, HandleValue, MutableHandleVa use js::typedarray::{self, Uint8ClampedArray}; use script_bindings::interfaces::TestBindingHelpers; use script_bindings::record::Record; -use script_traits::serializable::BlobImpl; use servo_config::prefs; use crate::dom::bindings::buffer_source::create_buffer_source; diff --git a/components/script/dom/webgpu/gpu.rs b/components/script/dom/webgpu/gpu.rs index e07224c8248..f02ae386772 100644 --- a/components/script/dom/webgpu/gpu.rs +++ b/components/script/dom/webgpu/gpu.rs @@ -4,9 +4,9 @@ use std::rc::Rc; +use constellation_traits::ScriptToConstellationMessage; use dom_struct::dom_struct; use js::jsapi::Heap; -use script_traits::ScriptToConstellationMessage; use webgpu_traits::WebGPUAdapterResponse; use wgpu_types::PowerPreference; diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs index 4cfb143a10d..68e59384c60 100644 --- a/components/script/dom/websocket.rs +++ b/components/script/dom/websocket.rs @@ -6,6 +6,7 @@ use std::borrow::ToOwned; use std::cell::Cell; use std::ptr; +use constellation_traits::BlobImpl; use dom_struct::dom_struct; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; @@ -21,7 +22,6 @@ use net_traits::{ CoreResourceMsg, FetchChannels, MessageData, WebSocketDomAction, WebSocketNetworkEvent, }; use profile_traits::ipc as ProfiledIpc; -use script_traits::serializable::BlobImpl; use servo_url::{ImmutableOrigin, ServoUrl}; use crate::dom::bindings::cell::DomRefCell; diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index fc9c4bf88d2..c73caab123f 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -21,7 +21,10 @@ use base64::Engine; #[cfg(feature = "bluetooth")] use bluetooth_traits::BluetoothRequest; use canvas_traits::webgl::WebGLChan; -use constellation_traits::{ScrollState, WindowSizeType}; +use constellation_traits::{ + DocumentState, LoadData, LoadOrigin, NavigationHistoryBehavior, ScriptToConstellationChan, + ScriptToConstellationMessage, ScrollState, StructuredSerializedData, WindowSizeType, +}; use crossbeam_channel::{Sender, unbounded}; use cssparser::{Parser, ParserInput, SourceLocation}; use devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMarker, TimelineMarkerType}; @@ -62,10 +65,7 @@ use script_layout_interface::{ FragmentType, Layout, PendingImageState, QueryMsg, Reflow, ReflowGoal, ReflowRequest, TrustedNodeAddress, combine_id_with_fragment_type, }; -use script_traits::{ - DocumentState, LoadData, LoadOrigin, NavigationHistoryBehavior, ScriptThreadMessage, - ScriptToConstellationChan, ScriptToConstellationMessage, StructuredSerializedData, -}; +use script_traits::ScriptThreadMessage; use selectors::attr::CaseSensitivity; use servo_arc::Arc as ServoArc; use servo_config::{opts, pref}; diff --git a/components/script/dom/windowproxy.rs b/components/script/dom/windowproxy.rs index f4e429ee731..e3fc81bf7ec 100644 --- a/components/script/dom/windowproxy.rs +++ b/components/script/dom/windowproxy.rs @@ -6,6 +6,10 @@ use std::cell::Cell; use std::ptr; use base::id::{BrowsingContextId, PipelineId, WebViewId}; +use constellation_traits::{ + AuxiliaryWebViewCreationRequest, LoadData, LoadOrigin, NavigationHistoryBehavior, + ScriptToConstellationMessage, +}; use dom_struct::dom_struct; use html5ever::local_name; use indexmap::map::IndexMap; @@ -29,10 +33,7 @@ use js::rust::wrappers::{JS_TransplantObject, NewWindowProxy, SetWindowProxy}; use js::rust::{Handle, MutableHandle, MutableHandleValue, get_object_class}; use malloc_size_of::{MallocSizeOf, MallocSizeOfOps}; use net_traits::request::Referrer; -use script_traits::{ - AuxiliaryWebViewCreationRequest, LoadData, LoadOrigin, NavigationHistoryBehavior, - NewLayoutInfo, ScriptToConstellationMessage, -}; +use script_traits::NewLayoutInfo; use serde::{Deserialize, Serialize}; use servo_url::{ImmutableOrigin, ServoUrl}; use style::attr::parse_integer; diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs index 34fc30ce0e5..e07f88f5ec1 100644 --- a/components/script/dom/worker.rs +++ b/components/script/dom/worker.rs @@ -6,6 +6,7 @@ use std::cell::Cell; use std::sync::Arc; use std::sync::atomic::{AtomicBool, Ordering}; +use constellation_traits::{StructuredSerializedData, WorkerScriptLoadOrigin}; use crossbeam_channel::{Sender, unbounded}; use devtools_traits::{DevtoolsPageInfo, ScriptToDevtoolsControlMsg, WorkerId}; use dom_struct::dom_struct; @@ -14,7 +15,6 @@ use js::jsapi::{Heap, JSObject}; use js::jsval::UndefinedValue; use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleObject, HandleValue}; use net_traits::request::Referrer; -use script_traits::{StructuredSerializedData, WorkerScriptLoadOrigin}; use uuid::Uuid; use crate::dom::abstractworker::{SimpleWorkerErrorHandler, WorkerScriptMsg}; diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs index 7009f51e29a..a857b261cd0 100644 --- a/components/script/dom/workerglobalscope.rs +++ b/components/script/dom/workerglobalscope.rs @@ -11,6 +11,7 @@ use std::time::Duration; use base::cross_process_instant::CrossProcessInstant; use base::id::{PipelineId, PipelineNamespace}; +use constellation_traits::WorkerGlobalScopeInit; use crossbeam_channel::Receiver; use devtools_traits::{DevtoolScriptControlMsg, WorkerId}; use dom_struct::dom_struct; @@ -25,7 +26,6 @@ use net_traits::request::{ RequestBuilder as NetRequestInit, }; use profile_traits::mem::ProcessReports; -use script_traits::WorkerGlobalScopeInit; use servo_url::{MutableOrigin, ServoUrl}; use timers::TimerScheduler; use uuid::Uuid; diff --git a/components/script/dom/workletglobalscope.rs b/components/script/dom/workletglobalscope.rs index 23a3f3a6528..0196d6a83ea 100644 --- a/components/script/dom/workletglobalscope.rs +++ b/components/script/dom/workletglobalscope.rs @@ -5,6 +5,7 @@ use std::sync::Arc; use base::id::PipelineId; +use constellation_traits::{ScriptToConstellationChan, ScriptToConstellationMessage}; use crossbeam_channel::Sender; use devtools_traits::ScriptToDevtoolsControlMsg; use dom_struct::dom_struct; @@ -14,7 +15,7 @@ use js::rust::Runtime; use net_traits::ResourceThreads; use net_traits::image_cache::ImageCache; use profile_traits::{mem, time}; -use script_traits::{Painter, ScriptToConstellationChan, ScriptToConstellationMessage}; +use script_traits::Painter; use servo_url::{ImmutableOrigin, MutableOrigin, ServoUrl}; use stylo_atoms::Atom; diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index aa634d61ccc..20e25415f98 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -10,6 +10,7 @@ use std::str::{self, FromStr}; use std::sync::{Arc, Mutex}; use std::time::{Duration, Instant}; +use constellation_traits::BlobImpl; use dom_struct::dom_struct; use encoding_rs::{Encoding, UTF_8}; use headers::{ContentLength, ContentType, HeaderMapExt}; @@ -31,7 +32,6 @@ use net_traits::{ ResourceFetchTiming, ResourceTimingType, trim_http_whitespace, }; use script_traits::DocumentActivity; -use script_traits::serializable::BlobImpl; use servo_url::ServoUrl; use stylo_atoms::Atom; use url::Position; |