mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
layout: Limit visibility of some types and removed unused enum variants / data (#38428)
Testing: This change mainly removes dead code, so no tests necessary. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
e78d8818a0
commit
a7b232ef4c
7 changed files with 16 additions and 24 deletions
|
@ -56,13 +56,11 @@ pub enum ResolvedImage<'a> {
|
||||||
pub enum ResolveImageError {
|
pub enum ResolveImageError {
|
||||||
LoadError,
|
LoadError,
|
||||||
ImagePending,
|
ImagePending,
|
||||||
ImageRequested,
|
|
||||||
OnlyMetadata,
|
OnlyMetadata,
|
||||||
InvalidUrl,
|
InvalidUrl,
|
||||||
MissingNode,
|
MissingNode,
|
||||||
ImageMissingFromImageSet,
|
ImageMissingFromImageSet,
|
||||||
FailedToResolveImageFromImageSet,
|
NotImplementedYet,
|
||||||
NotImplementedYet(&'static str),
|
|
||||||
None,
|
None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,10 +240,8 @@ impl ImageResolver {
|
||||||
match image {
|
match image {
|
||||||
// TODO: Add support for PaintWorklet and CrossFade rendering.
|
// TODO: Add support for PaintWorklet and CrossFade rendering.
|
||||||
Image::None => Result::Err(ResolveImageError::None),
|
Image::None => Result::Err(ResolveImageError::None),
|
||||||
Image::CrossFade(_) => Result::Err(ResolveImageError::NotImplementedYet("CrossFade")),
|
Image::CrossFade(_) => Result::Err(ResolveImageError::NotImplementedYet),
|
||||||
Image::PaintWorklet(_) => {
|
Image::PaintWorklet(_) => Result::Err(ResolveImageError::NotImplementedYet),
|
||||||
Result::Err(ResolveImageError::NotImplementedYet("PaintWorklet"))
|
|
||||||
},
|
|
||||||
Image::Gradient(gradient) => Ok(ResolvedImage::Gradient(gradient)),
|
Image::Gradient(gradient) => Ok(ResolvedImage::Gradient(gradient)),
|
||||||
Image::Url(image_url) => {
|
Image::Url(image_url) => {
|
||||||
// FIXME: images won’t always have in intrinsic width or
|
// FIXME: images won’t always have in intrinsic width or
|
||||||
|
|
|
@ -49,7 +49,7 @@ use wr::units::LayoutVector2D;
|
||||||
|
|
||||||
use crate::cell::ArcRefCell;
|
use crate::cell::ArcRefCell;
|
||||||
use crate::context::{ImageResolver, ResolvedImage};
|
use crate::context::{ImageResolver, ResolvedImage};
|
||||||
pub use crate::display_list::conversions::ToWebRender;
|
pub(crate) use crate::display_list::conversions::ToWebRender;
|
||||||
use crate::display_list::stacking_context::StackingContextSection;
|
use crate::display_list::stacking_context::StackingContextSection;
|
||||||
use crate::fragment_tree::{
|
use crate::fragment_tree::{
|
||||||
BackgroundMode, BoxFragment, Fragment, FragmentFlags, FragmentTree, SpecificLayoutInfo, Tag,
|
BackgroundMode, BoxFragment, Fragment, FragmentFlags, FragmentTree, SpecificLayoutInfo, Tag,
|
||||||
|
@ -68,7 +68,7 @@ mod gradient;
|
||||||
mod stacking_context;
|
mod stacking_context;
|
||||||
|
|
||||||
use background::BackgroundPainter;
|
use background::BackgroundPainter;
|
||||||
pub use stacking_context::*;
|
pub(crate) use stacking_context::*;
|
||||||
|
|
||||||
// webrender's `ItemTag` is private.
|
// webrender's `ItemTag` is private.
|
||||||
type ItemTag = (u64, u16);
|
type ItemTag = (u64, u16);
|
||||||
|
|
|
@ -410,7 +410,6 @@ pub enum DebugPrintField {
|
||||||
Contents,
|
Contents,
|
||||||
RealStackingContextsAndPositionedStackingContainers,
|
RealStackingContextsAndPositionedStackingContainers,
|
||||||
FloatStackingContainers,
|
FloatStackingContainers,
|
||||||
AtomicInlineStackingContainers,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StackingContext {
|
impl StackingContext {
|
||||||
|
@ -581,7 +580,7 @@ impl StackingContext {
|
||||||
pub(crate) fn build_canvas_background_display_list(
|
pub(crate) fn build_canvas_background_display_list(
|
||||||
&self,
|
&self,
|
||||||
builder: &mut DisplayListBuilder,
|
builder: &mut DisplayListBuilder,
|
||||||
fragment_tree: &crate::FragmentTree,
|
fragment_tree: &crate::fragment_tree::FragmentTree,
|
||||||
) {
|
) {
|
||||||
let Some(root_fragment) = fragment_tree.root_fragments.iter().find(|fragment| {
|
let Some(root_fragment) = fragment_tree.root_fragments.iter().find(|fragment| {
|
||||||
fragment
|
fragment
|
||||||
|
@ -796,9 +795,6 @@ impl StackingContext {
|
||||||
DebugPrintField::FloatStackingContainers => {
|
DebugPrintField::FloatStackingContainers => {
|
||||||
self.float_stacking_containers[*index].debug_print_with_tree(tree);
|
self.float_stacking_containers[*index].debug_print_with_tree(tree);
|
||||||
},
|
},
|
||||||
DebugPrintField::AtomicInlineStackingContainers => {
|
|
||||||
// do nothing; we print these in DebugPrintField::Contents
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
match self.context_type {
|
match self.context_type {
|
||||||
|
|
|
@ -52,7 +52,7 @@ pub mod inline;
|
||||||
mod root;
|
mod root;
|
||||||
|
|
||||||
pub(crate) use construct::BlockContainerBuilder;
|
pub(crate) use construct::BlockContainerBuilder;
|
||||||
pub use root::BoxTree;
|
pub(crate) use root::BoxTree;
|
||||||
|
|
||||||
#[derive(Debug, MallocSizeOf)]
|
#[derive(Debug, MallocSizeOf)]
|
||||||
pub(crate) struct BlockFormattingContext {
|
pub(crate) struct BlockFormattingContext {
|
||||||
|
|
|
@ -15,6 +15,6 @@ pub(crate) use base_fragment::*;
|
||||||
pub(crate) use box_fragment::*;
|
pub(crate) use box_fragment::*;
|
||||||
pub(crate) use containing_block::*;
|
pub(crate) use containing_block::*;
|
||||||
pub(crate) use fragment::*;
|
pub(crate) use fragment::*;
|
||||||
pub use fragment_tree::*;
|
pub(crate) use fragment_tree::*;
|
||||||
pub(crate) use hoisted_shared_fragment::*;
|
pub(crate) use hoisted_shared_fragment::*;
|
||||||
pub(crate) use positioning_fragment::*;
|
pub(crate) use positioning_fragment::*;
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
//! painted.
|
//! painted.
|
||||||
|
|
||||||
mod cell;
|
mod cell;
|
||||||
pub mod context;
|
mod context;
|
||||||
pub mod display_list;
|
mod display_list;
|
||||||
pub mod dom;
|
mod dom;
|
||||||
mod dom_traversal;
|
mod dom_traversal;
|
||||||
mod flexbox;
|
mod flexbox;
|
||||||
pub mod flow;
|
pub mod flow;
|
||||||
|
@ -24,18 +24,18 @@ mod taffy;
|
||||||
mod construct_modern;
|
mod construct_modern;
|
||||||
mod lists;
|
mod lists;
|
||||||
mod positioned;
|
mod positioned;
|
||||||
pub mod query;
|
mod query;
|
||||||
mod quotes;
|
mod quotes;
|
||||||
mod replaced;
|
mod replaced;
|
||||||
mod sizing;
|
mod sizing;
|
||||||
mod style_ext;
|
mod style_ext;
|
||||||
pub mod table;
|
pub mod table;
|
||||||
pub mod traversal;
|
mod traversal;
|
||||||
|
|
||||||
use app_units::Au;
|
use app_units::Au;
|
||||||
pub use cell::ArcRefCell;
|
pub use cell::ArcRefCell;
|
||||||
pub use flow::BoxTree;
|
pub(crate) use flow::BoxTree;
|
||||||
pub use fragment_tree::FragmentTree;
|
pub(crate) use fragment_tree::FragmentTree;
|
||||||
pub use layout_impl::LayoutFactoryImpl;
|
pub use layout_impl::LayoutFactoryImpl;
|
||||||
use malloc_size_of_derive::MallocSizeOf;
|
use malloc_size_of_derive::MallocSizeOf;
|
||||||
use servo_arc::Arc as ServoArc;
|
use servo_arc::Arc as ServoArc;
|
||||||
|
|
|
@ -6,4 +6,4 @@
|
||||||
|
|
||||||
mod convert;
|
mod convert;
|
||||||
mod wrapper;
|
mod wrapper;
|
||||||
pub use wrapper::TaffyStyloStyle;
|
pub(crate) use wrapper::TaffyStyloStyle;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue