mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
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:
parent
85c849d843
commit
69ff4afa58
41 changed files with 102 additions and 113 deletions
|
@ -35,6 +35,7 @@ icu_locid = { workspace = true }
|
|||
icu_segmenter = { workspace = true }
|
||||
ipc-channel = { workspace = true }
|
||||
itertools = { workspace = true }
|
||||
layout_api = { workspace = true }
|
||||
log = { workspace = true }
|
||||
malloc_size_of = { workspace = true }
|
||||
malloc_size_of_derive = { workspace = true }
|
||||
|
@ -45,7 +46,6 @@ profile_traits = { workspace = true }
|
|||
range = { path = "../range" }
|
||||
rayon = { workspace = true }
|
||||
script = { path = "../script" }
|
||||
script_layout_interface = { workspace = true }
|
||||
script_traits = { workspace = true }
|
||||
selectors = { workspace = true }
|
||||
servo_arc = { workspace = true }
|
||||
|
|
|
@ -9,15 +9,15 @@ use euclid::Size2D;
|
|||
use fnv::FnvHashMap;
|
||||
use fonts::FontContext;
|
||||
use fxhash::FxHashMap;
|
||||
use layout_api::{
|
||||
IFrameSizes, ImageAnimationState, PendingImage, PendingImageState, PendingRasterizationImage,
|
||||
};
|
||||
use net_traits::image_cache::{
|
||||
Image as CachedImage, ImageCache, ImageCacheResult, ImageOrMetadataAvailable, PendingImageId,
|
||||
UsePlaceholder,
|
||||
};
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
use pixels::RasterImage;
|
||||
use script_layout_interface::{
|
||||
IFrameSizes, ImageAnimationState, PendingImage, PendingImageState, PendingRasterizationImage,
|
||||
};
|
||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||
use style::context::SharedStyleContext;
|
||||
use style::dom::OpaqueNode;
|
||||
|
|
|
@ -8,15 +8,15 @@ use std::marker::PhantomData;
|
|||
use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
|
||||
use base::id::{BrowsingContextId, PipelineId};
|
||||
use html5ever::{local_name, ns};
|
||||
use layout_api::wrapper_traits::{
|
||||
LayoutDataTrait, LayoutNode, ThreadSafeLayoutElement, ThreadSafeLayoutNode,
|
||||
};
|
||||
use layout_api::{
|
||||
GenericLayoutDataTrait, LayoutElementType, LayoutNodeType as ScriptLayoutNodeType,
|
||||
};
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use net_traits::image_cache::Image;
|
||||
use script::layout_dom::ServoLayoutNode;
|
||||
use script_layout_interface::wrapper_traits::{
|
||||
LayoutDataTrait, LayoutNode, ThreadSafeLayoutElement, ThreadSafeLayoutNode,
|
||||
};
|
||||
use script_layout_interface::{
|
||||
GenericLayoutDataTrait, LayoutElementType, LayoutNodeType as ScriptLayoutNodeType,
|
||||
};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::context::SharedStyleContext;
|
||||
use style::properties::ComputedValues;
|
||||
|
|
|
@ -7,12 +7,10 @@ use std::iter::FusedIterator;
|
|||
|
||||
use fonts::ByteIndex;
|
||||
use html5ever::{LocalName, local_name};
|
||||
use layout_api::wrapper_traits::{LayoutNode, ThreadSafeLayoutElement, ThreadSafeLayoutNode};
|
||||
use layout_api::{LayoutElementType, LayoutNodeType};
|
||||
use range::Range;
|
||||
use script::layout_dom::ServoLayoutNode;
|
||||
use script_layout_interface::wrapper_traits::{
|
||||
LayoutNode, ThreadSafeLayoutElement, ThreadSafeLayoutNode,
|
||||
};
|
||||
use script_layout_interface::{LayoutElementType, LayoutNodeType};
|
||||
use selectors::Element as SelectorsElement;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::dom::{NodeInfo, TElement, TNode, TShadowRoot};
|
||||
|
|
|
@ -6,9 +6,9 @@ use std::vec::IntoIter;
|
|||
|
||||
use app_units::Au;
|
||||
use fonts::FontMetrics;
|
||||
use layout_api::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode};
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use script::layout_dom::ServoLayoutNode;
|
||||
use script_layout_interface::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::properties::ComputedValues;
|
||||
|
||||
|
|
|
@ -83,6 +83,7 @@ use bitflags::bitflags;
|
|||
use construct::InlineFormattingContextBuilder;
|
||||
use fonts::{ByteIndex, FontMetrics, GlyphStore};
|
||||
use inline_box::{InlineBox, InlineBoxContainerState, InlineBoxIdentifier, InlineBoxes};
|
||||
use layout_api::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode};
|
||||
use line::{
|
||||
AbsolutelyPositionedLineItem, AtomicLineItem, FloatLineItem, LineItem, LineItemLayout,
|
||||
TextRunLineItem,
|
||||
|
@ -91,7 +92,6 @@ use line_breaker::LineBreaker;
|
|||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use range::Range;
|
||||
use script::layout_dom::ServoLayoutNode;
|
||||
use script_layout_interface::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode};
|
||||
use servo_arc::Arc;
|
||||
use style::Zero;
|
||||
use style::computed_values::text_wrap_mode::T as TextWrapMode;
|
||||
|
|
|
@ -7,12 +7,10 @@ use atomic_refcell::AtomicRef;
|
|||
use compositing_traits::display_list::AxesScrollSensitivity;
|
||||
use euclid::Rect;
|
||||
use euclid::default::Size2D as UntypedSize2D;
|
||||
use layout_api::wrapper_traits::{LayoutNode, ThreadSafeLayoutElement, ThreadSafeLayoutNode};
|
||||
use layout_api::{LayoutElementType, LayoutNodeType};
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use script::layout_dom::ServoLayoutNode;
|
||||
use script_layout_interface::wrapper_traits::{
|
||||
LayoutNode, ThreadSafeLayoutElement, ThreadSafeLayoutNode,
|
||||
};
|
||||
use script_layout_interface::{LayoutElementType, LayoutNodeType};
|
||||
use servo_arc::Arc;
|
||||
use style::dom::{NodeInfo, TNode};
|
||||
use style::properties::ComputedValues;
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use bitflags::bitflags;
|
||||
use layout_api::combine_id_with_fragment_type;
|
||||
use malloc_size_of::malloc_size_of_is_0;
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use script_layout_interface::combine_id_with_fragment_type;
|
||||
use style::dom::OpaqueNode;
|
||||
use style::selector_parser::PseudoElement;
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -9,11 +9,9 @@ use app_units::Au;
|
|||
use euclid::default::{Point2D, Rect};
|
||||
use euclid::{SideOffsets2D, Size2D};
|
||||
use itertools::Itertools;
|
||||
use layout_api::wrapper_traits::{LayoutNode, ThreadSafeLayoutElement, ThreadSafeLayoutNode};
|
||||
use layout_api::{LayoutElementType, LayoutNodeType, OffsetParentResponse};
|
||||
use script::layout_dom::ServoLayoutNode;
|
||||
use script_layout_interface::wrapper_traits::{
|
||||
LayoutNode, ThreadSafeLayoutElement, ThreadSafeLayoutNode,
|
||||
};
|
||||
use script_layout_interface::{LayoutElementType, LayoutNodeType, OffsetParentResponse};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use servo_url::ServoUrl;
|
||||
use style::computed_values::display::T as Display;
|
||||
|
|
|
@ -9,10 +9,10 @@ use base::id::{BrowsingContextId, PipelineId};
|
|||
use data_url::DataUrl;
|
||||
use embedder_traits::ViewportDetails;
|
||||
use euclid::{Scale, Size2D};
|
||||
use layout_api::IFrameSize;
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use net_traits::image_cache::{Image, ImageOrMetadataAvailable, UsePlaceholder};
|
||||
use script::layout_dom::ServoLayoutNode;
|
||||
use script_layout_interface::IFrameSize;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::Zero;
|
||||
use style::computed_values::object_fit::T as ObjectFit;
|
||||
|
|
|
@ -7,8 +7,8 @@ use std::convert::{TryFrom, TryInto};
|
|||
use std::iter::repeat;
|
||||
|
||||
use atomic_refcell::AtomicRef;
|
||||
use layout_api::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode};
|
||||
use log::warn;
|
||||
use script_layout_interface::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode};
|
||||
use servo_arc::Arc;
|
||||
use style::properties::ComputedValues;
|
||||
use style::properties::style_structs::Font;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* 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 layout_api::wrapper_traits::LayoutNode;
|
||||
use script::layout_dom::ServoLayoutNode;
|
||||
use script_layout_interface::wrapper_traits::LayoutNode;
|
||||
use style::context::{SharedStyleContext, StyleContext};
|
||||
use style::data::ElementData;
|
||||
use style::dom::{NodeInfo, TElement, TNode};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue