diff --git a/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp b/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp index c093aac8a90..df73bc93737 100644 --- a/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp @@ -149,7 +149,8 @@ void ImageStyleValue::paint(PaintContext& context, DevicePixelRect const& dest_r { if (auto const* b = bitmap(m_current_frame_index, dest_rect.size().to_type()); b != nullptr) { auto scaling_mode = to_gfx_scaling_mode(image_rendering, b->rect(), dest_rect.to_type()); - context.display_list_recorder().draw_scaled_immutable_bitmap(dest_rect.to_type(), *b, b->rect(), scaling_mode); + auto dest_int_rect = dest_rect.to_type(); + context.display_list_recorder().draw_scaled_immutable_bitmap(dest_int_rect, dest_int_rect, *b, scaling_mode); } } diff --git a/Libraries/LibWeb/Painting/Command.h b/Libraries/LibWeb/Painting/Command.h index 32ec22471ff..637ad1e82d5 100644 --- a/Libraries/LibWeb/Painting/Command.h +++ b/Libraries/LibWeb/Painting/Command.h @@ -72,12 +72,16 @@ struct DrawPaintingSurface { struct DrawScaledImmutableBitmap { Gfx::IntRect dst_rect; + Gfx::IntRect clip_rect; NonnullRefPtr bitmap; - Gfx::IntRect src_rect; Gfx::ScalingMode scaling_mode; - [[nodiscard]] Gfx::IntRect bounding_rect() const { return dst_rect; } - void translate_by(Gfx::IntPoint const& offset) { dst_rect.translate_by(offset); } + [[nodiscard]] Gfx::IntRect bounding_rect() const { return clip_rect; } + void translate_by(Gfx::IntPoint const& offset) + { + dst_rect.translate_by(offset); + clip_rect.translate_by(offset); + } }; struct DrawRepeatedImmutableBitmap { diff --git a/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp b/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp index d4a5ed1fd46..c6332ebbd01 100644 --- a/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp +++ b/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp @@ -135,11 +135,14 @@ void DisplayListPlayerSkia::draw_painting_surface(DrawPaintingSurface const& com void DisplayListPlayerSkia::draw_scaled_immutable_bitmap(DrawScaledImmutableBitmap const& command) { - auto src_rect = to_skia_rect(command.src_rect); auto dst_rect = to_skia_rect(command.dst_rect); + auto clip_rect = to_skia_rect(command.clip_rect); auto& canvas = surface().canvas(); SkPaint paint; - canvas.drawImageRect(command.bitmap->sk_image(), src_rect, dst_rect, to_skia_sampling_options(command.scaling_mode), &paint, SkCanvas::kStrict_SrcRectConstraint); + canvas.save(); + canvas.clipRect(clip_rect); + canvas.drawImageRect(command.bitmap->sk_image(), dst_rect, to_skia_sampling_options(command.scaling_mode), &paint); + canvas.restore(); } void DisplayListPlayerSkia::draw_repeated_immutable_bitmap(DrawRepeatedImmutableBitmap const& command) diff --git a/Libraries/LibWeb/Painting/DisplayListRecorder.cpp b/Libraries/LibWeb/Painting/DisplayListRecorder.cpp index 0026b12d3aa..f17dedd13da 100644 --- a/Libraries/LibWeb/Painting/DisplayListRecorder.cpp +++ b/Libraries/LibWeb/Painting/DisplayListRecorder.cpp @@ -194,14 +194,14 @@ void DisplayListRecorder::draw_painting_surface(Gfx::IntRect const& dst_rect, No }); } -void DisplayListRecorder::draw_scaled_immutable_bitmap(Gfx::IntRect const& dst_rect, Gfx::ImmutableBitmap const& bitmap, Gfx::IntRect const& src_rect, Gfx::ScalingMode scaling_mode) +void DisplayListRecorder::draw_scaled_immutable_bitmap(Gfx::IntRect const& dst_rect, Gfx::IntRect const& clip_rect, Gfx::ImmutableBitmap const& bitmap, Gfx::ScalingMode scaling_mode) { if (dst_rect.is_empty()) return; append(DrawScaledImmutableBitmap { .dst_rect = dst_rect, + .clip_rect = clip_rect, .bitmap = bitmap, - .src_rect = src_rect, .scaling_mode = scaling_mode, }); } diff --git a/Libraries/LibWeb/Painting/DisplayListRecorder.h b/Libraries/LibWeb/Painting/DisplayListRecorder.h index 71e145c7bab..e3cbc7fa8a7 100644 --- a/Libraries/LibWeb/Painting/DisplayListRecorder.h +++ b/Libraries/LibWeb/Painting/DisplayListRecorder.h @@ -95,7 +95,7 @@ public: void draw_rect(Gfx::IntRect const& rect, Color color, bool rough = false); void draw_painting_surface(Gfx::IntRect const& dst_rect, NonnullRefPtr, Gfx::IntRect const& src_rect, Gfx::ScalingMode scaling_mode = Gfx::ScalingMode::NearestNeighbor); - void draw_scaled_immutable_bitmap(Gfx::IntRect const& dst_rect, Gfx::ImmutableBitmap const& bitmap, Gfx::IntRect const& src_rect, Gfx::ScalingMode scaling_mode = Gfx::ScalingMode::NearestNeighbor); + void draw_scaled_immutable_bitmap(Gfx::IntRect const& dst_rect, Gfx::IntRect const& clip_rect, Gfx::ImmutableBitmap const& bitmap, Gfx::ScalingMode scaling_mode = Gfx::ScalingMode::NearestNeighbor); void draw_repeated_immutable_bitmap(Gfx::IntRect dst_rect, Gfx::IntRect clip_rect, NonnullRefPtr bitmap, Gfx::ScalingMode scaling_mode, DrawRepeatedImmutableBitmap::Repeat); diff --git a/Libraries/LibWeb/Painting/ImagePaintable.cpp b/Libraries/LibWeb/Painting/ImagePaintable.cpp index b964727352f..a8e5f2dc423 100644 --- a/Libraries/LibWeb/Painting/ImagePaintable.cpp +++ b/Libraries/LibWeb/Painting/ImagePaintable.cpp @@ -79,7 +79,6 @@ void ImagePaintable::paint(PaintContext& context, PaintPhase phase) const auto scale_x = 0.0f; auto scale_y = 0.0f; - Gfx::IntRect bitmap_intersect = bitmap_rect; // https://drafts.csswg.org/css-images/#the-object-fit auto object_fit = m_is_svg_image ? CSS::ObjectFit::Contain : computed_values().object_fit(); @@ -109,11 +108,9 @@ void ImagePaintable::paint(PaintContext& context, PaintPhase phase) const if (bitmap_aspect_ratio >= image_aspect_ratio) { scale_x = (float)image_rect.width() / bitmap_rect.width(); scale_y = scale_x; - bitmap_intersect.set_height(bitmap_rect.width() * image_aspect_ratio); } else { scale_x = (float)image_rect.height() / bitmap_rect.height(); scale_y = scale_x; - bitmap_intersect.set_width(bitmap_rect.height() / image_aspect_ratio); } break; case CSS::ObjectFit::ScaleDown: @@ -121,7 +118,6 @@ void ImagePaintable::paint(PaintContext& context, PaintPhase phase) const case CSS::ObjectFit::None: scale_x = 1; scale_y = 1; - bitmap_intersect.set_size(image_rect.size().to_type()); } auto scaled_bitmap_width = CSSPixels::nearest_value_for(bitmap_rect.width() * scale_x); @@ -130,31 +126,22 @@ void ImagePaintable::paint(PaintContext& context, PaintPhase phase) const auto residual_horizontal = image_rect.width() - scaled_bitmap_width; auto residual_vertical = image_rect.height() - scaled_bitmap_height; - bitmap_intersect.set_x((bitmap_rect.width() - bitmap_intersect.width()) / 2); - bitmap_intersect.set_y((bitmap_rect.height() - bitmap_intersect.height()) / 2); - // https://drafts.csswg.org/css-images/#the-object-position auto const& object_position = computed_values().object_position(); auto offset_x = CSSPixels::from_raw(0); if (object_position.edge_x == CSS::PositionEdge::Left) { offset_x = object_position.offset_x.to_px(layout_node(), residual_horizontal); - bitmap_intersect.set_x(0); } else if (object_position.edge_x == CSS::PositionEdge::Right) { offset_x = residual_horizontal - object_position.offset_x.to_px(layout_node(), residual_horizontal); } - if (image_rect.width() < scaled_bitmap_width) - bitmap_intersect.set_x(-(offset_x / scale_x)); auto offset_y = CSSPixels::from_raw(0); if (object_position.edge_y == CSS::PositionEdge::Top) { offset_y = object_position.offset_y.to_px(layout_node(), residual_vertical); - bitmap_intersect.set_y(0); } else if (object_position.edge_y == CSS::PositionEdge::Bottom) { offset_y = residual_vertical - object_position.offset_y.to_px(layout_node(), residual_vertical); } - if (image_rect.height() < scaled_bitmap_height) - bitmap_intersect.set_y(-(offset_y / scale_y)); Gfx::IntRect draw_rect = { image_int_rect_device_pixels.x() + context.rounded_device_pixels(offset_x).value(), @@ -163,7 +150,7 @@ void ImagePaintable::paint(PaintContext& context, PaintPhase phase) const context.rounded_device_pixels(scaled_bitmap_height).value() }; - context.display_list_recorder().draw_scaled_immutable_bitmap(draw_rect.intersected(image_int_rect_device_pixels), *bitmap, bitmap_rect.intersected(bitmap_intersect), scaling_mode); + context.display_list_recorder().draw_scaled_immutable_bitmap(draw_rect, image_int_rect_device_pixels, *bitmap, scaling_mode); } } } diff --git a/Libraries/LibWeb/Painting/VideoPaintable.cpp b/Libraries/LibWeb/Painting/VideoPaintable.cpp index 4375a36d340..e2f5deb31c1 100644 --- a/Libraries/LibWeb/Painting/VideoPaintable.cpp +++ b/Libraries/LibWeb/Painting/VideoPaintable.cpp @@ -130,7 +130,8 @@ void VideoPaintable::paint(PaintContext& context, PaintPhase phase) const auto paint_frame = [&](auto const& frame) { auto scaling_mode = to_gfx_scaling_mode(computed_values().image_rendering(), frame->rect(), video_rect.to_type()); - context.display_list_recorder().draw_scaled_immutable_bitmap(video_rect.to_type(), Gfx::ImmutableBitmap::create(*frame), frame->rect(), scaling_mode); + auto dst_rect = video_rect.to_type(); + context.display_list_recorder().draw_scaled_immutable_bitmap(dst_rect, dst_rect, Gfx::ImmutableBitmap::create(*frame), scaling_mode); }; auto paint_transparent_black = [&]() { diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-contain-png-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-contain-png-001-ref.html new file mode 100644 index 00000000000..02950be1813 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-contain-png-001-ref.html @@ -0,0 +1,79 @@ + + + + + + CSS Reftest Reference + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ + + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-contain-png-002-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-contain-png-002-ref.html new file mode 100644 index 00000000000..74ef1f91d9a --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-contain-png-002-ref.html @@ -0,0 +1,79 @@ + + + + + + CSS Reftest Reference + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ + + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-cover-png-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-cover-png-001-ref.html new file mode 100644 index 00000000000..08e2a9305ff --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-cover-png-001-ref.html @@ -0,0 +1,79 @@ + + + + + + CSS Reftest Reference + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ + + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-cover-png-002-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-cover-png-002-ref.html new file mode 100644 index 00000000000..51136a0a0d4 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-cover-png-002-ref.html @@ -0,0 +1,79 @@ + + + + + + CSS Reftest Reference + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ + + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-fill-png-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-fill-png-001-ref.html new file mode 100644 index 00000000000..2de8eed741d --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-fill-png-001-ref.html @@ -0,0 +1,79 @@ + + + + + + CSS Reftest Reference + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ + + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-fill-png-002-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-fill-png-002-ref.html new file mode 100644 index 00000000000..1c150c27a9b --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-fill-png-002-ref.html @@ -0,0 +1,79 @@ + + + + + + CSS Reftest Reference + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ + + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-none-png-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-none-png-001-ref.html new file mode 100644 index 00000000000..caed978982a --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-none-png-001-ref.html @@ -0,0 +1,79 @@ + + + + + + CSS Reftest Reference + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ + + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-none-png-002-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-none-png-002-ref.html new file mode 100644 index 00000000000..4143b4702c4 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-none-png-002-ref.html @@ -0,0 +1,79 @@ + + + + + + CSS Reftest Reference + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ + + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-scale-down-png-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-scale-down-png-001-ref.html new file mode 100644 index 00000000000..36c517eeac1 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-scale-down-png-001-ref.html @@ -0,0 +1,80 @@ + + + + + + CSS Reftest Reference + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ + + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-scale-down-png-002-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-scale-down-png-002-ref.html new file mode 100644 index 00000000000..fbf2cebd9ae --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-fit-scale-down-png-002-ref.html @@ -0,0 +1,80 @@ + + + + + + CSS Reftest Reference + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ + + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-position-png-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-position-png-001-ref.html new file mode 100644 index 00000000000..742ad7a1c53 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-position-png-001-ref.html @@ -0,0 +1,44 @@ + + + + + + CSS Reftest Reference + + + + +
+
+
+
+
+
+
+ + + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-position-png-002-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-position-png-002-ref.html new file mode 100644 index 00000000000..460e3f9018d --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/object-position-png-002-ref.html @@ -0,0 +1,44 @@ + + + + + + CSS Reftest Reference + + + + +
+
+
+
+
+
+
+ + + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/support/colors-16x8.png b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/support/colors-16x8.png new file mode 100644 index 00000000000..bd238458713 Binary files /dev/null and b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/support/colors-16x8.png differ diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/support/colors-8x16.png b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/support/colors-8x16.png new file mode 100644 index 00000000000..596fdb389d6 Binary files /dev/null and b/Tests/LibWeb/Ref/expected/wpt-import/css/css-images/support/colors-8x16.png differ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-contain-png-001i.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-contain-png-001i.html new file mode 100644 index 00000000000..26b608ebcdd --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-contain-png-001i.html @@ -0,0 +1,77 @@ + + + + + + CSS Test: 'object-fit: contain' on img element, with a PNG image and with various 'object-position' values + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-contain-png-002i.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-contain-png-002i.html new file mode 100644 index 00000000000..928f0a3e185 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-contain-png-002i.html @@ -0,0 +1,77 @@ + + + + + + CSS Test: 'object-fit: contain' on img element, with a PNG image and with various 'object-position' values + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-cover-png-001i.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-cover-png-001i.html new file mode 100644 index 00000000000..d9837213b03 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-cover-png-001i.html @@ -0,0 +1,77 @@ + + + + + + CSS Test: 'object-fit: cover' on img element, with a PNG image and with various 'object-position' values + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-cover-png-002i.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-cover-png-002i.html new file mode 100644 index 00000000000..72ae4c2690d --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-cover-png-002i.html @@ -0,0 +1,77 @@ + + + + + + CSS Test: 'object-fit: cover' on img element, with a PNG image and with various 'object-position' values + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-fill-png-001i.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-fill-png-001i.html new file mode 100644 index 00000000000..5bc8176056f --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-fill-png-001i.html @@ -0,0 +1,77 @@ + + + + + + CSS Test: 'object-fit: fill' on img element, with a PNG image and with various 'object-position' values + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-fill-png-002i.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-fill-png-002i.html new file mode 100644 index 00000000000..4d74cd1d7ad --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-fill-png-002i.html @@ -0,0 +1,77 @@ + + + + + + CSS Test: 'object-fit: fill' on img element, with a PNG image and with various 'object-position' values + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-none-png-001i.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-none-png-001i.html new file mode 100644 index 00000000000..06f6333f4e5 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-none-png-001i.html @@ -0,0 +1,77 @@ + + + + + + CSS Test: 'object-fit: none' on img element, with a PNG image and with various 'object-position' values + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-none-png-002i.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-none-png-002i.html new file mode 100644 index 00000000000..a1227dd95d3 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-none-png-002i.html @@ -0,0 +1,77 @@ + + + + + + CSS Test: 'object-fit: none' on img element, with a PNG image and with various 'object-position' values + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-scale-down-png-001i.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-scale-down-png-001i.html new file mode 100644 index 00000000000..876e161c231 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-scale-down-png-001i.html @@ -0,0 +1,77 @@ + + + + + + CSS Test: 'object-fit: scale-down' on img element, with a PNG image and with various 'object-position' values + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-scale-down-png-002i.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-scale-down-png-002i.html new file mode 100644 index 00000000000..ac563093b80 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-fit-scale-down-png-002i.html @@ -0,0 +1,77 @@ + + + + + + CSS Test: 'object-fit: scale-down' on img element, with a PNG image and with various 'object-position' values + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-position-png-001i.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-position-png-001i.html new file mode 100644 index 00000000000..8e0dd9be4f4 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-position-png-001i.html @@ -0,0 +1,44 @@ + + + + + + CSS Test: various 'object-position' values on a fixed-size img element, with a PNG image and 'object-fit:contain'. + + + + + + + + + + + + + + + + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-position-png-002i.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-position-png-002i.html new file mode 100644 index 00000000000..78ac5993457 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/object-position-png-002i.html @@ -0,0 +1,44 @@ + + + + + + CSS Test: various 'object-position' values on a fixed-size img element, with a PNG image and 'object-fit:contain'. + + + + + + + + + + + + + + + + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/support/colors-16x8.png b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/support/colors-16x8.png new file mode 100644 index 00000000000..bd238458713 Binary files /dev/null and b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/support/colors-16x8.png differ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/support/colors-8x16.png b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/support/colors-8x16.png new file mode 100644 index 00000000000..596fdb389d6 Binary files /dev/null and b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/support/colors-8x16.png differ diff --git a/Tests/LibWeb/Screenshot/images/object-fit-position.png b/Tests/LibWeb/Screenshot/images/object-fit-position.png index ede3411daed..99caac63595 100644 Binary files a/Tests/LibWeb/Screenshot/images/object-fit-position.png and b/Tests/LibWeb/Screenshot/images/object-fit-position.png differ