Explorar o código

LibWeb: Render HTMLVideoElement controls when scripting is disabled

The spec recommends exposing the user agent interface when scripting is
disabled on the media element.
Timothy Flynn %!s(int64=2) %!d(string=hai) anos
pai
achega
6131e621d6
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Userland/Libraries/LibWeb/Painting/VideoPaintable.cpp

+ 1 - 1
Userland/Libraries/LibWeb/Painting/VideoPaintable.cpp

@@ -74,7 +74,7 @@ void VideoPaintable::paint(PaintContext& context, PaintPhase phase) const
     if (layout_mouse_position.has_value() && document().hovered_node() == &video_element)
     if (layout_mouse_position.has_value() && document().hovered_node() == &video_element)
         mouse_position = context.rounded_device_point(*layout_mouse_position);
         mouse_position = context.rounded_device_point(*layout_mouse_position);
 
 
-    auto paint_user_agent_controls = video_element.has_attribute(HTML::AttributeNames::controls);
+    auto paint_user_agent_controls = video_element.has_attribute(HTML::AttributeNames::controls) || video_element.is_scripting_disabled();
 
 
     if (auto const& bitmap = layout_box().dom_node().current_frame()) {
     if (auto const& bitmap = layout_box().dom_node().current_frame()) {
         context.painter().draw_scaled_bitmap(video_rect.to_type<int>(), *bitmap, bitmap->rect(), 1.0f, to_gfx_scaling_mode(computed_values().image_rendering()));
         context.painter().draw_scaled_bitmap(video_rect.to_type<int>(), *bitmap, bitmap->rect(), 1.0f, to_gfx_scaling_mode(computed_values().image_rendering()));