Update rustfmt to the 2024 style edition (#35764)

* Use 2024 style edition

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Reformat all code

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-03-03 12:26:53 +01:00 committed by GitHub
parent 6300e820b4
commit 3d320fa96a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
603 changed files with 1739 additions and 1648 deletions

View file

@ -8,14 +8,14 @@ use style::computed_values::background_attachment::SingleComputedValue as Backgr
use style::computed_values::background_clip::single_value::T as Clip;
use style::computed_values::background_origin::single_value::T as Origin;
use style::properties::ComputedValues;
use style::values::computed::background::BackgroundSize as Size;
use style::values::computed::LengthPercentage;
use style::values::computed::background::BackgroundSize as Size;
use style::values::specified::background::{
BackgroundRepeat as RepeatXY, BackgroundRepeatKeyword as Repeat,
};
use webrender_api::{self as wr, units};
use wr::units::LayoutSize;
use wr::ClipChainId;
use wr::units::LayoutSize;
use crate::replaced::NaturalSizes;

View file

@ -8,11 +8,11 @@ use style::values::computed::length_percentage::NonNegativeLengthPercentage;
use style::values::computed::position::Position;
use style::values::generics::basic_shape::{GenericShapeRadius, ShapeBox, ShapeGeometryBox};
use style::values::generics::position::GenericPositionOrAuto;
use webrender_api::units::{LayoutRect, LayoutSideOffsets, LayoutSize};
use webrender_api::ClipChainId;
use webrender_api::units::{LayoutRect, LayoutSideOffsets, LayoutSize};
use webrender_traits::display_list::ScrollTreeNodeId;
use super::{compute_margin_box_radius, normalize_radii, BuilderForBoxFragment, DisplayList};
use super::{BuilderForBoxFragment, DisplayList, compute_margin_box_radius, normalize_radii};
pub(super) fn build_clip_path_clip_chain_if_necessary(
clip_path: ClipPath,

View file

@ -11,7 +11,7 @@ use style::computed_values::transform_style::T as ComputedTransformStyle;
use style::values::computed::Filter as ComputedFilter;
use style::values::specified::border::BorderImageRepeatKeyword;
use webrender_api::{
units, FilterOp, ImageRendering, LineStyle, MixBlendMode, RepeatMode, Shadow, TransformStyle,
FilterOp, ImageRendering, LineStyle, MixBlendMode, RepeatMode, Shadow, TransformStyle, units,
};
use crate::geom::{PhysicalPoint, PhysicalRect, PhysicalSides, PhysicalSize};

View file

@ -4,6 +4,7 @@
use app_units::Au;
use euclid::Size2D;
use style::Zero;
use style::color::mix::ColorInterpolationMethod;
use style::properties::ComputedValues;
use style::values::computed::image::{EndingShape, Gradient, LineDirection};
@ -11,11 +12,10 @@ use style::values::computed::{Angle, AngleOrPercentage, Color, LengthPercentage,
use style::values::generics::image::{
Circle, ColorStop, Ellipse, GradientFlags, GradientItem, ShapeExtent,
};
use style::Zero;
use webrender_api::units::LayoutPixel;
use webrender_api::{
self as wr, units, ConicGradient as WebRenderConicGradient,
Gradient as WebRenderLinearGradient, RadialGradient as WebRenderRadialGradient,
self as wr, ConicGradient as WebRenderConicGradient, Gradient as WebRenderLinearGradient,
RadialGradient as WebRenderRadialGradient, units,
};
use wr::ColorF;

View file

@ -13,27 +13,27 @@ use fonts::GlyphStore;
use gradient::WebRenderGradient;
use net_traits::image_cache::UsePlaceholder;
use servo_geometry::MaxRect;
use style::Zero;
use style::color::{AbsoluteColor, ColorSpace};
use style::computed_values::border_image_outset::T as BorderImageOutset;
use style::computed_values::text_decoration_style::T as ComputedTextDecorationStyle;
use style::dom::OpaqueNode;
use style::properties::ComputedValues;
use style::properties::longhands::visibility::computed_value::T as Visibility;
use style::properties::style_structs::Border;
use style::properties::ComputedValues;
use style::values::computed::image::Image;
use style::values::computed::{
BorderImageSideWidth, BorderImageWidth, BorderStyle, LengthPercentage,
NonNegativeLengthOrNumber, NumberOrPercentage, OutlineStyle,
};
use style::values::generics::rect::Rect;
use style::values::generics::NonNegative;
use style::values::generics::rect::Rect;
use style::values::specified::text::TextDecorationLine;
use style::values::specified::ui::CursorKind;
use style::Zero;
use webrender_api::units::{DevicePixel, LayoutPixel, LayoutRect, LayoutSize};
use webrender_api::{
self as wr, units, BorderDetails, BoxShadowClipMode, ClipChainId, CommonItemProperties,
ImageRendering, NinePatchBorder, NinePatchBorderSource,
self as wr, BorderDetails, BoxShadowClipMode, ClipChainId, CommonItemProperties,
ImageRendering, NinePatchBorder, NinePatchBorderSource, units,
};
use webrender_traits::display_list::{
AxesScrollSensitivity, CompositorDisplayListInfo, ScrollTreeNodeId,
@ -1074,7 +1074,7 @@ impl<'a> BuilderForBoxFragment<'a> {
}
},
Image::CrossFade(_) | Image::ImageSet(_) | Image::None | Image::PaintWorklet(_) => {
return false
return false;
},
};

View file

@ -8,11 +8,12 @@ use std::mem;
use app_units::Au;
use base::print_tree::PrintTree;
use euclid::default::{Point2D, Rect, Size2D};
use euclid::SideOffsets2D;
use euclid::default::{Point2D, Rect, Size2D};
use log::warn;
use servo_arc::Arc as ServoArc;
use servo_config::opts::DebugOptions;
use style::Zero;
use style::computed_values::float::T as ComputedFloat;
use style::computed_values::mix_blend_mode::T as ComputedMixBlendMode;
use style::computed_values::overflow_x::T as ComputedOverflow;
@ -23,17 +24,16 @@ use style::values::computed::{ClipRectOrAuto, Length};
use style::values::generics::box_::Perspective;
use style::values::generics::transform;
use style::values::specified::box_::DisplayOutside;
use style::Zero;
use webrender_api::units::{LayoutPoint, LayoutRect, LayoutTransform, LayoutVector2D};
use webrender_api::{self as wr, BorderRadius};
use webrender_traits::display_list::{AxesScrollSensitivity, ScrollTreeNodeId, ScrollableNodeInfo};
use wr::units::{LayoutPixel, LayoutSize};
use wr::{ClipChainId, SpatialTreeItemKey, StickyOffsetBounds};
use super::clip_path::build_clip_path_clip_chain_if_necessary;
use super::DisplayList;
use super::clip_path::build_clip_path_clip_chain_if_necessary;
use crate::display_list::conversions::{FilterToWebRender, ToWebRender};
use crate::display_list::{offset_radii, BuilderForBoxFragment, DisplayListBuilder};
use crate::display_list::{BuilderForBoxFragment, DisplayListBuilder, offset_radii};
use crate::fragment_tree::{
BoxFragment, ContainingBlockManager, Fragment, FragmentFlags, FragmentTree,
PositioningFragment, SpecificLayoutInfo,
@ -486,28 +486,31 @@ impl StackingContext {
self.real_stacking_contexts_and_positioned_stacking_containers
.sort_by_key(|a| a.z_index());
debug_assert!(self
.real_stacking_contexts_and_positioned_stacking_containers
.iter()
.all(|c| matches!(
c.context_type,
StackingContextType::RealStackingContext |
StackingContextType::PositionedStackingContainer
)));
debug_assert!(self
.float_stacking_containers
.iter()
.all(
|c| c.context_type == StackingContextType::FloatStackingContainer &&
c.z_index() == 0
));
debug_assert!(self
.atomic_inline_stacking_containers
.iter()
.all(
|c| c.context_type == StackingContextType::AtomicInlineStackingContainer &&
c.z_index() == 0
));
debug_assert!(
self.real_stacking_contexts_and_positioned_stacking_containers
.iter()
.all(|c| matches!(
c.context_type,
StackingContextType::RealStackingContext |
StackingContextType::PositionedStackingContainer
))
);
debug_assert!(
self.float_stacking_containers
.iter()
.all(
|c| c.context_type == StackingContextType::FloatStackingContainer &&
c.z_index() == 0
)
);
debug_assert!(
self.atomic_inline_stacking_containers
.iter()
.all(
|c| c.context_type == StackingContextType::AtomicInlineStackingContainer &&
c.z_index() == 0
)
);
}
fn push_webrender_stacking_context_if_necessary(
@ -1056,9 +1059,10 @@ impl BoxFragment {
// but all fragments that establish reference frames also establish
// containing blocks for absolute and fixed descendants, so those
// properties will be replaced before recursing into children.
assert!(self
.style
.establishes_containing_block_for_all_descendants(self.base.flags));
assert!(
self.style
.establishes_containing_block_for_all_descendants(self.base.flags)
);
let adjusted_containing_block = ContainingBlock::new(
containing_block
.rect