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:
Martin Robinson 2025-01-28 12:15:36 +01:00 committed by GitHub
parent 78b90030bd
commit a1cf0cbf86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 330 additions and 334 deletions

View file

@ -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;