diff --git a/Tests/LibWeb/Ref/alt-frame.html b/Tests/LibWeb/Ref/alt-frame.html new file mode 100644 index 00000000000..838ed9670cd --- /dev/null +++ b/Tests/LibWeb/Ref/alt-frame.html @@ -0,0 +1,3 @@ + + +Hello!! diff --git a/Tests/LibWeb/Ref/reference/alt-frame.html b/Tests/LibWeb/Ref/reference/alt-frame.html new file mode 100644 index 00000000000..812f789753c --- /dev/null +++ b/Tests/LibWeb/Ref/reference/alt-frame.html @@ -0,0 +1,9 @@ + + diff --git a/Tests/LibWeb/Ref/reference/images/alt-frame.png b/Tests/LibWeb/Ref/reference/images/alt-frame.png new file mode 100644 index 00000000000..f06dd99aa50 Binary files /dev/null and b/Tests/LibWeb/Ref/reference/images/alt-frame.png differ diff --git a/Userland/Libraries/LibWeb/Painting/Command.h b/Userland/Libraries/LibWeb/Painting/Command.h index 6943aed39b9..58c65005040 100644 --- a/Userland/Libraries/LibWeb/Painting/Command.h +++ b/Userland/Libraries/LibWeb/Painting/Command.h @@ -300,16 +300,6 @@ struct DrawSignedDistanceField { } }; -struct PaintFrame { - Gfx::IntRect rect; - Palette palette; - Gfx::FrameStyle style; - - [[nodiscard]] Gfx::IntRect bounding_rect() const { return rect; } - - void translate_by(Gfx::IntPoint const& offset) { rect.translate_by(offset); } -}; - struct ApplyBackdropFilter { Gfx::IntRect backdrop_region; BorderRadiiData border_radii_data; @@ -428,7 +418,6 @@ using Command = Variant< FillEllipse, DrawLine, DrawSignedDistanceField, - PaintFrame, ApplyBackdropFilter, DrawRect, DrawTriangleWave, diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp b/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp index 8c711b27952..fadb1258efa 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp +++ b/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp @@ -378,12 +378,6 @@ CommandResult CommandExecutorCPU::draw_signed_distance_field(Gfx::IntRect const& return CommandResult::Continue; } -CommandResult CommandExecutorCPU::paint_frame(Gfx::IntRect const& rect, Palette const& palette, Gfx::FrameStyle style) -{ - Gfx::StylePainter::paint_frame(painter(), rect, palette, style); - return CommandResult::Continue; -} - CommandResult CommandExecutorCPU::apply_backdrop_filter(Gfx::IntRect const& backdrop_region, Web::CSS::ResolvedBackdropFilter const& backdrop_filter) { auto& painter = this->painter(); diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.h b/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.h index 333d0a6394d..1115f08c09f 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.h +++ b/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.h @@ -35,7 +35,6 @@ public: CommandResult fill_ellipse(Gfx::IntRect const& rect, Color const& color, Gfx::AntiAliasingPainter::BlendMode blend_mode) override; CommandResult draw_line(Color const&, Gfx::IntPoint const& from, Gfx::IntPoint const& to, int thickness, Gfx::Painter::LineStyle style, Color const& alternate_color) override; CommandResult draw_signed_distance_field(Gfx::IntRect const& rect, Color const&, Gfx::GrayscaleBitmap const& sdf, float smoothing) override; - CommandResult paint_frame(Gfx::IntRect const& rect, Palette const&, Gfx::FrameStyle) override; CommandResult apply_backdrop_filter(Gfx::IntRect const& backdrop_region, Web::CSS::ResolvedBackdropFilter const& backdrop_filter) override; CommandResult draw_rect(Gfx::IntRect const& rect, Color const&, bool rough) override; CommandResult paint_radial_gradient(Gfx::IntRect const& rect, Web::Painting::RadialGradientData const& radial_gradient_data, Gfx::IntPoint const& center, Gfx::IntSize const& size, Vector const& clip_paths = {}) override; diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.cpp b/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.cpp index e21c64df6d4..43b409672b1 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.cpp +++ b/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.cpp @@ -272,12 +272,6 @@ CommandResult CommandExecutorGPU::draw_signed_distance_field(Gfx::IntRect const& return CommandResult::Continue; } -CommandResult CommandExecutorGPU::paint_frame(Gfx::IntRect const&, Palette const&, Gfx::FrameStyle) -{ - // FIXME - return CommandResult::Continue; -} - CommandResult CommandExecutorGPU::apply_backdrop_filter(Gfx::IntRect const&, Web::CSS::ResolvedBackdropFilter const&) { // FIXME diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.h b/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.h index 8a09d52ab08..60689549292 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.h +++ b/Userland/Libraries/LibWeb/Painting/CommandExecutorGPU.h @@ -36,7 +36,6 @@ public: CommandResult fill_ellipse(Gfx::IntRect const& rect, Color const& color, Gfx::AntiAliasingPainter::BlendMode blend_mode) override; CommandResult draw_line(Color const&, Gfx::IntPoint const& from, Gfx::IntPoint const& to, int thickness, Gfx::Painter::LineStyle style, Color const& alternate_color) override; CommandResult draw_signed_distance_field(Gfx::IntRect const& rect, Color const&, Gfx::GrayscaleBitmap const& sdf, float smoothing) override; - CommandResult paint_frame(Gfx::IntRect const& rect, Palette const&, Gfx::FrameStyle) override; CommandResult apply_backdrop_filter(Gfx::IntRect const& backdrop_region, Web::CSS::ResolvedBackdropFilter const& backdrop_filter) override; CommandResult draw_rect(Gfx::IntRect const& rect, Color const&, bool rough) override; CommandResult paint_radial_gradient(Gfx::IntRect const& rect, Web::Painting::RadialGradientData const& radial_gradient_data, Gfx::IntPoint const& center, Gfx::IntSize const& size, Vector const& clip_paths = {}) override; diff --git a/Userland/Libraries/LibWeb/Painting/CommandList.cpp b/Userland/Libraries/LibWeb/Painting/CommandList.cpp index 7bc14df9673..360537f8fcb 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandList.cpp +++ b/Userland/Libraries/LibWeb/Painting/CommandList.cpp @@ -183,9 +183,6 @@ void CommandList::execute(CommandExecutor& executor) return executor.draw_signed_distance_field(command.rect, command.color, command.sdf, command.smoothing); }, - [&](PaintFrame const& command) { - return executor.paint_frame(command.rect, command.palette, command.style); - }, [&](ApplyBackdropFilter const& command) { return executor.apply_backdrop_filter(command.backdrop_region, command.backdrop_filter); }, diff --git a/Userland/Libraries/LibWeb/Painting/CommandList.h b/Userland/Libraries/LibWeb/Painting/CommandList.h index d06569eaf6c..9f08ad5d35a 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandList.h +++ b/Userland/Libraries/LibWeb/Painting/CommandList.h @@ -77,7 +77,6 @@ public: virtual CommandResult fill_ellipse(Gfx::IntRect const&, Color const&, Gfx::AntiAliasingPainter::BlendMode blend_mode) = 0; virtual CommandResult draw_line(Color const& color, Gfx::IntPoint const& from, Gfx::IntPoint const& to, int thickness, Gfx::Painter::LineStyle, Color const& alternate_color) = 0; virtual CommandResult draw_signed_distance_field(Gfx::IntRect const& rect, Color const&, Gfx::GrayscaleBitmap const&, float smoothing) = 0; - virtual CommandResult paint_frame(Gfx::IntRect const& rect, Palette const&, Gfx::FrameStyle) = 0; virtual CommandResult apply_backdrop_filter(Gfx::IntRect const& backdrop_region, Web::CSS::ResolvedBackdropFilter const& backdrop_filter) = 0; virtual CommandResult draw_rect(Gfx::IntRect const& rect, Color const&, bool rough) = 0; virtual CommandResult draw_triangle_wave(Gfx::IntPoint const& p1, Gfx::IntPoint const& p2, Color const& color, int amplitude, int thickness) = 0; diff --git a/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp b/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp index 1fd5ac5d1a3..d905646d89a 100644 --- a/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp @@ -66,7 +66,7 @@ void ImagePaintable::paint(PaintContext& context, PaintPhase phase) const auto image_rect = context.rounded_device_rect(absolute_rect()); if (m_renders_as_alt_text) { auto enclosing_rect = context.enclosing_device_rect(absolute_rect()).to_type(); - context.recording_painter().paint_frame(enclosing_rect, context.palette(), Gfx::FrameStyle::SunkenContainer); + context.recording_painter().draw_rect(enclosing_rect, Gfx::Color::Black, 1); context.recording_painter().draw_text(enclosing_rect, m_alt_text, Platform::FontPlugin::the().default_font(), Gfx::TextAlignment::Center, computed_values().color(), Gfx::TextElision::Right); } else if (auto bitmap = m_image_provider.current_image_bitmap(image_rect.size().to_type())) { ScopedCornerRadiusClip corner_clip { context, image_rect, normalized_border_radii_data(ShrinkRadiiForBorders::Yes) }; diff --git a/Userland/Libraries/LibWeb/Painting/RecordingPainter.cpp b/Userland/Libraries/LibWeb/Painting/RecordingPainter.cpp index 4cf9f738832..e0c4c0b7743 100644 --- a/Userland/Libraries/LibWeb/Painting/RecordingPainter.cpp +++ b/Userland/Libraries/LibWeb/Painting/RecordingPainter.cpp @@ -290,11 +290,6 @@ void RecordingPainter::pop_stacking_context() append(PopStackingContext {}); } -void RecordingPainter::paint_frame(Gfx::IntRect rect, Palette palette, Gfx::FrameStyle style) -{ - append(PaintFrame { state().translation.map(rect), palette, style }); -} - void RecordingPainter::apply_backdrop_filter(Gfx::IntRect const& backdrop_region, BorderRadiiData const& border_radii_data, CSS::ResolvedBackdropFilter const& backdrop_filter) { append(ApplyBackdropFilter { diff --git a/Userland/Libraries/LibWeb/Painting/RecordingPainter.h b/Userland/Libraries/LibWeb/Painting/RecordingPainter.h index 16d743a6d32..5119d78b3bf 100644 --- a/Userland/Libraries/LibWeb/Painting/RecordingPainter.h +++ b/Userland/Libraries/LibWeb/Painting/RecordingPainter.h @@ -129,8 +129,6 @@ public: void sample_under_corners(u32 id, CornerRadii corner_radii, Gfx::IntRect border_rect, CornerClip corner_clip); void blit_corner_clipping(u32 id, Gfx::IntRect border_rect); - void paint_frame(Gfx::IntRect rect, Palette palette, Gfx::FrameStyle style); - void apply_backdrop_filter(Gfx::IntRect const& backdrop_region, BorderRadiiData const& border_radii_data, CSS::ResolvedBackdropFilter const& backdrop_filter); void paint_outer_box_shadow_params(PaintOuterBoxShadowParams params);