From a15a44cfc8ce58651b93cce2c8b8d1b46ac7065b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 25 Mar 2023 12:06:35 +0100 Subject: [PATCH] LibWeb: Don't use image source URL as backup `alt` attribute This was a non-standard behavior of ours that broke layout on many pages where an image failed to load for some reason. --- Userland/Libraries/LibWeb/Layout/ImageBox.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/ImageBox.cpp b/Userland/Libraries/LibWeb/Layout/ImageBox.cpp index f763e738db..95fee4bcbf 100644 --- a/Userland/Libraries/LibWeb/Layout/ImageBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/ImageBox.cpp @@ -63,8 +63,6 @@ void ImageBox::prepare_for_replaced_layout() auto& image_element = verify_cast(dom_node()); auto& font = Platform::FontPlugin::the().default_font(); auto alt = image_element.alt(); - if (alt.is_empty()) - alt = image_element.src(); CSSPixels alt_text_width = 0; if (!m_cached_alt_text_width.has_value())