Explorar el Código

LibWeb: Stop rendering the src (URL) as image alt attribute fallback

If an image element has no alt attribute, other browsers don't fall back
to using the src attribute like we did.

This gave us a janky look while loading pages that other browsers don't
have, and it's not like seeing a partial URL is really helpful to the
user anyway.
Andreas Kling hace 1 año
padre
commit
473f3a0931
Se han modificado 1 ficheros con 0 adiciones y 2 borrados
  1. 0 2
      Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp

+ 0 - 2
Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp

@@ -58,8 +58,6 @@ void ImagePaintable::paint(PaintContext& context, PaintPhase phase) const
             context.recording_painter().set_font(Platform::FontPlugin::the().default_font());
             context.recording_painter().paint_frame(enclosing_rect, context.palette(), Gfx::FrameStyle::SunkenContainer);
             auto alt = image_element.get_attribute_value(HTML::AttributeNames::alt);
-            if (alt.is_empty())
-                alt = image_element.get_attribute_value(HTML::AttributeNames::src);
             context.recording_painter().draw_text(enclosing_rect, alt, Gfx::TextAlignment::Center, computed_values().color(), Gfx::TextElision::Right);
         } else if (auto bitmap = layout_box().image_provider().current_image_bitmap(image_rect.size().to_type<int>())) {
             ScopedCornerRadiusClip corner_clip { context, image_rect, normalized_border_radii_data(ShrinkRadiiForBorders::Yes) };