Rename script_layout_interface to layout_api (#37591)

Now that we are standardizing on the `_traits` crates becoming `_api`
and exposing the API of the crate that they get their name from [^1],
`script_layout_interface` becomes `layout_api` as it exposes the API for
`layout` that is used by `script` This brings the crate in line with the
naming of the other ones in `shared`.

[^1]:
https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Organizing.20*_traits.20crates/with/396893711

Testing: This should not change any behavior and thus is covered by
existing tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-06-20 19:13:05 +02:00 committed by GitHub
parent 85c849d843
commit 69ff4afa58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 102 additions and 113 deletions

View file

@ -24,6 +24,10 @@ use fonts::{FontContext, FontContextWebFontMethods};
use fonts_traits::StylesheetWebFontLoadFinishedCallback;
use fxhash::FxHashMap;
use ipc_channel::ipc::IpcSender;
use layout_api::{
Layout, LayoutConfig, LayoutFactory, NodesFromPointQueryType, OffsetParentResponse, ReflowGoal,
ReflowRequest, ReflowResult, TrustedNodeAddress,
};
use log::{debug, error, warn};
use malloc_size_of::{MallocConditionalSizeOf, MallocSizeOf, MallocSizeOfOps};
use net_traits::image_cache::{ImageCache, UsePlaceholder};
@ -35,10 +39,6 @@ use profile_traits::time::{
use profile_traits::{path, time_profile};
use rayon::ThreadPool;
use script::layout_dom::{ServoLayoutDocument, ServoLayoutElement, ServoLayoutNode};
use script_layout_interface::{
Layout, LayoutConfig, LayoutFactory, NodesFromPointQueryType, OffsetParentResponse, ReflowGoal,
ReflowRequest, ReflowResult, TrustedNodeAddress,
};
use script_traits::{DrawAPaintImageResult, PaintWorkletError, Painter, ScriptThreadMessage};
use servo_arc::Arc as ServoArc;
use servo_config::opts::{self, DebugOptions};
@ -271,10 +271,7 @@ impl Layout for LayoutThread {
}
#[servo_tracing::instrument(skip_all)]
fn query_element_inner_outer_text(
&self,
node: script_layout_interface::TrustedNodeAddress,
) -> String {
fn query_element_inner_outer_text(&self, node: layout_api::TrustedNodeAddress) -> String {
let node = unsafe { ServoLayoutNode::new(&node) };
get_the_text_steps(node)
}