mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
libservo: Stop using script_traits
in the embedding layer (#35185)
Many types used directly in the `libservo` API are in the `script_traits` crate, which was created to break circular dependencies. Move all API exposed types to `embedder_traits` which now contains types exposed via the `libservo` embedding API. Also expose these at the root of the `libservo` `servo` crate so that the API won't break when they move around in the future. The idea with `embedder_traits` in the future is that it contains types that are available throughout servo because they are used in the embedding API and thus should have minimal dependencies on other Servo crates (a bit like `base`). Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
78b90030bd
commit
a1cf0cbf86
39 changed files with 330 additions and 334 deletions
|
@ -22,7 +22,10 @@ use cookie::Cookie;
|
|||
use cssparser::match_ignore_ascii_case;
|
||||
use devtools_traits::ScriptToDevtoolsControlMsg;
|
||||
use dom_struct::dom_struct;
|
||||
use embedder_traits::EmbedderMsg;
|
||||
use embedder_traits::{
|
||||
ClipboardEventType, EmbedderMsg, MouseButton, MouseEventType, TouchEventType, TouchId,
|
||||
WheelDelta,
|
||||
};
|
||||
use encoding_rs::{Encoding, UTF_8};
|
||||
use euclid::default::{Point2D, Rect, Size2D};
|
||||
use html5ever::{local_name, namespace_url, ns, LocalName, Namespace, QualName};
|
||||
|
@ -48,9 +51,8 @@ use profile_traits::ipc as profile_ipc;
|
|||
use profile_traits::time::{TimerMetadata, TimerMetadataFrameType, TimerMetadataReflowType};
|
||||
use script_layout_interface::{PendingRestyle, TrustedNodeAddress};
|
||||
use script_traits::{
|
||||
AnimationState, AnimationTickType, ClipboardEventType, CompositorEvent, DocumentActivity,
|
||||
MouseButton, MouseEventType, ScriptMsg, TouchEventType, TouchId, UntrustedNodeAddress,
|
||||
WheelDelta,
|
||||
AnimationState, AnimationTickType, CompositorEvent, DocumentActivity, ScriptMsg,
|
||||
UntrustedNodeAddress,
|
||||
};
|
||||
use servo_arc::Arc;
|
||||
use servo_atoms::Atom;
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
use std::cell::Cell;
|
||||
|
||||
use dom_struct::dom_struct;
|
||||
use embedder_traits::{GamepadSupportedHapticEffects, GamepadUpdateType};
|
||||
use js::typedarray::{Float64, Float64Array};
|
||||
use script_traits::{GamepadSupportedHapticEffects, GamepadUpdateType};
|
||||
|
||||
use super::bindings::buffer_source::HeapBufferSource;
|
||||
use crate::dom::bindings::codegen::Bindings::GamepadBinding::{GamepadHand, GamepadMethods};
|
||||
|
|
|
@ -6,11 +6,10 @@ use std::cell::Cell;
|
|||
use std::rc::Rc;
|
||||
|
||||
use dom_struct::dom_struct;
|
||||
use embedder_traits::{DualRumbleEffectParams, EmbedderMsg};
|
||||
use embedder_traits::{DualRumbleEffectParams, EmbedderMsg, GamepadSupportedHapticEffects};
|
||||
use ipc_channel::ipc;
|
||||
use ipc_channel::router::ROUTER;
|
||||
use js::rust::MutableHandleValue;
|
||||
use script_traits::GamepadSupportedHapticEffects;
|
||||
|
||||
use crate::dom::bindings::cell::DomRefCell;
|
||||
use crate::dom::bindings::codegen::Bindings::GamepadHapticActuatorBinding::{
|
||||
|
|
|
@ -22,7 +22,9 @@ use content_security_policy::{CheckResult, CspList, PolicyDisposition};
|
|||
use crossbeam_channel::Sender;
|
||||
use devtools_traits::{PageError, ScriptToDevtoolsControlMsg};
|
||||
use dom_struct::dom_struct;
|
||||
use embedder_traits::EmbedderMsg;
|
||||
use embedder_traits::{
|
||||
EmbedderMsg, GamepadEvent, GamepadSupportedHapticEffects, GamepadUpdateType,
|
||||
};
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use js::glue::{IsWrapper, UnwrapObjectDynamic};
|
||||
|
@ -56,8 +58,7 @@ use profile_traits::{ipc as profile_ipc, mem as profile_mem, time as profile_tim
|
|||
use script_traits::serializable::{BlobData, BlobImpl, FileBlob};
|
||||
use script_traits::transferable::MessagePortImpl;
|
||||
use script_traits::{
|
||||
BroadcastMsg, GamepadEvent, GamepadSupportedHapticEffects, GamepadUpdateType, MessagePortMsg,
|
||||
PortMessageTask, ScriptMsg, ScriptToConstellationChan,
|
||||
BroadcastMsg, MessagePortMsg, PortMessageTask, ScriptMsg, ScriptToConstellationChan,
|
||||
};
|
||||
use servo_url::{ImmutableOrigin, MutableOrigin, ServoUrl};
|
||||
use timers::{TimerEventId, TimerEventRequest, TimerSource};
|
||||
|
|
|
@ -7,13 +7,14 @@ use std::cmp::Ordering;
|
|||
|
||||
use base::id::HistoryStateId;
|
||||
use dom_struct::dom_struct;
|
||||
use embedder_traits::TraversalDirection;
|
||||
use js::jsapi::Heap;
|
||||
use js::jsval::{JSVal, NullValue, UndefinedValue};
|
||||
use js::rust::{HandleValue, MutableHandleValue};
|
||||
use net_traits::{CoreResourceMsg, IpcSend};
|
||||
use profile_traits::ipc;
|
||||
use profile_traits::ipc::channel;
|
||||
use script_traits::{ScriptMsg, StructuredSerializedData, TraversalDirection};
|
||||
use script_traits::{ScriptMsg, StructuredSerializedData};
|
||||
use servo_url::ServoUrl;
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::HistoryBinding::HistoryMethods;
|
||||
|
|
|
@ -5,8 +5,10 @@
|
|||
use std::rc::Rc;
|
||||
|
||||
use dom_struct::dom_struct;
|
||||
use embedder_traits::{MediaMetadata as EmbedderMediaMetadata, MediaSessionEvent};
|
||||
use script_traits::{MediaSessionActionType, ScriptMsg};
|
||||
use embedder_traits::{
|
||||
MediaMetadata as EmbedderMediaMetadata, MediaSessionActionType, MediaSessionEvent,
|
||||
};
|
||||
use script_traits::ScriptMsg;
|
||||
|
||||
use super::bindings::trace::HashMapTracedValues;
|
||||
use crate::conversions::Convert;
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom_struct::dom_struct;
|
||||
use embedder_traits::GamepadSupportedHapticEffects;
|
||||
use js::conversions::ToJSValConvertible;
|
||||
use js::jsapi::Heap;
|
||||
use js::jsval::{JSVal, UndefinedValue};
|
||||
use js::rust::MutableHandleValue;
|
||||
use script_traits::GamepadSupportedHapticEffects;
|
||||
use webxr_api::{Handedness, InputFrame, InputId, InputSource, TargetRayMode};
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::XRInputSourceBinding::{
|
||||
|
|
|
@ -25,7 +25,7 @@ use crossbeam_channel::{unbounded, Sender};
|
|||
use cssparser::{Parser, ParserInput, SourceLocation};
|
||||
use devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMarker, TimelineMarkerType};
|
||||
use dom_struct::dom_struct;
|
||||
use embedder_traits::{EmbedderMsg, PromptDefinition, PromptOrigin, PromptResult};
|
||||
use embedder_traits::{EmbedderMsg, PromptDefinition, PromptOrigin, PromptResult, Theme};
|
||||
use euclid::default::{Point2D as UntypedPoint2D, Rect as UntypedRect};
|
||||
use euclid::{Point2D, Rect, Scale, Size2D, Vector2D};
|
||||
use fonts::FontContext;
|
||||
|
@ -59,8 +59,8 @@ use script_layout_interface::{
|
|||
use script_traits::webdriver_msg::{WebDriverJSError, WebDriverJSResult};
|
||||
use script_traits::{
|
||||
ConstellationControlMsg, DocumentState, LoadData, LoadOrigin, NavigationHistoryBehavior,
|
||||
ScriptMsg, ScriptToConstellationChan, ScrollState, StructuredSerializedData, Theme,
|
||||
WindowSizeData, WindowSizeType,
|
||||
ScriptMsg, ScriptToConstellationChan, ScrollState, StructuredSerializedData, WindowSizeData,
|
||||
WindowSizeType,
|
||||
};
|
||||
use selectors::attr::CaseSensitivity;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue