mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
layout: Add support for object-fit
and object-position
(#33479)
This also makes a couple small improvements: - Rename `IntrinsicSizes` to `NaturalSizes` which reflects more modern spec language. - Move the conversion of Stylo's `ImageRendering` to WebRender's version to a `ToWebRender` trait implementation. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
632d832704
commit
bd632fc814
58 changed files with 169 additions and 563 deletions
|
@ -4,12 +4,15 @@
|
|||
|
||||
use app_units::Au;
|
||||
use style::color::AbsoluteColor;
|
||||
use style::computed_values::image_rendering::T as ComputedImageRendering;
|
||||
use style::computed_values::mix_blend_mode::T as ComputedMixBlendMode;
|
||||
use style::computed_values::text_decoration_style::T as ComputedTextDecorationStyle;
|
||||
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, LineStyle, MixBlendMode, RepeatMode, Shadow, TransformStyle};
|
||||
use webrender_api::{
|
||||
units, FilterOp, ImageRendering, LineStyle, MixBlendMode, RepeatMode, Shadow, TransformStyle,
|
||||
};
|
||||
|
||||
use crate::geom::{PhysicalPoint, PhysicalRect, PhysicalSides, PhysicalSize};
|
||||
|
||||
|
@ -142,3 +145,15 @@ impl ToWebRender for BorderImageRepeatKeyword {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToWebRender for ComputedImageRendering {
|
||||
type Type = ImageRendering;
|
||||
|
||||
fn to_webrender(&self) -> Self::Type {
|
||||
match self {
|
||||
ComputedImageRendering::Auto => ImageRendering::Auto,
|
||||
ComputedImageRendering::CrispEdges => ImageRendering::CrispEdges,
|
||||
ComputedImageRendering::Pixelated => ImageRendering::Pixelated,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue