From b73525ba0e698a59b2342a4449aa1e8dce3b315d Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sat, 28 Jun 2025 04:59:19 +0200 Subject: [PATCH] LibWeb+WebContent: Delete unused "has focus" flag from paint config --- Libraries/LibWeb/DOM/Document.cpp | 1 - Libraries/LibWeb/DOM/Document.h | 1 - Libraries/LibWeb/HTML/TraversableNavigable.cpp | 1 - Libraries/LibWeb/Page/Page.h | 1 - .../LibWeb/Painting/NavigableContainerViewportPaintable.cpp | 1 - Libraries/LibWeb/Painting/PaintContext.h | 5 ----- Services/WebContent/PageClient.cpp | 1 - 7 files changed, 11 deletions(-) diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index 508a441552d..50216f963f5 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -6494,7 +6494,6 @@ RefPtr Document::record_display_list(PaintConfig config) context.set_device_viewport_rect(viewport_rect); context.set_should_show_line_box_borders(config.should_show_line_box_borders); context.set_should_paint_overlay(config.paint_overlay); - context.set_has_focus(config.has_focus); update_paint_and_hit_testing_properties_if_needed(); diff --git a/Libraries/LibWeb/DOM/Document.h b/Libraries/LibWeb/DOM/Document.h index b9564831282..23b895e13fc 100644 --- a/Libraries/LibWeb/DOM/Document.h +++ b/Libraries/LibWeb/DOM/Document.h @@ -835,7 +835,6 @@ public: struct PaintConfig { bool paint_overlay { false }; bool should_show_line_box_borders { false }; - bool has_focus { false }; Optional canvas_fill_rect {}; bool operator==(PaintConfig const& other) const = default; diff --git a/Libraries/LibWeb/HTML/TraversableNavigable.cpp b/Libraries/LibWeb/HTML/TraversableNavigable.cpp index de16009b744..a92ab950986 100644 --- a/Libraries/LibWeb/HTML/TraversableNavigable.cpp +++ b/Libraries/LibWeb/HTML/TraversableNavigable.cpp @@ -1444,7 +1444,6 @@ RefPtr TraversableNavigable::record_display_list(DevicePi DOM::Document::PaintConfig paint_config; paint_config.paint_overlay = paint_options.paint_overlay == PaintOptions::PaintOverlay::Yes; paint_config.should_show_line_box_borders = paint_options.should_show_line_box_borders; - paint_config.has_focus = paint_options.has_focus; paint_config.canvas_fill_rect = Gfx::IntRect { {}, content_rect.size() }; return document->record_display_list(paint_config); } diff --git a/Libraries/LibWeb/Page/Page.h b/Libraries/LibWeb/Page/Page.h index d917587861a..6dca520c58d 100644 --- a/Libraries/LibWeb/Page/Page.h +++ b/Libraries/LibWeb/Page/Page.h @@ -309,7 +309,6 @@ struct PaintOptions { PaintOverlay paint_overlay { PaintOverlay::Yes }; bool should_show_line_box_borders { false }; - bool has_focus { false }; }; enum class DisplayListPlayerType { diff --git a/Libraries/LibWeb/Painting/NavigableContainerViewportPaintable.cpp b/Libraries/LibWeb/Painting/NavigableContainerViewportPaintable.cpp index bd0c675f66c..155d8145ee3 100644 --- a/Libraries/LibWeb/Painting/NavigableContainerViewportPaintable.cpp +++ b/Libraries/LibWeb/Painting/NavigableContainerViewportPaintable.cpp @@ -58,7 +58,6 @@ void NavigableContainerViewportPaintable::paint(PaintContext& context, PaintPhas DOM::Document::PaintConfig paint_config; paint_config.paint_overlay = context.should_paint_overlay(); paint_config.should_show_line_box_borders = context.should_show_line_box_borders(); - paint_config.has_focus = context.has_focus(); auto display_list = const_cast(hosted_document)->record_display_list(paint_config); auto scroll_state_snapshot = hosted_document->paintable()->scroll_state().snapshot(); context.display_list_recorder().paint_nested_display_list(display_list, move(scroll_state_snapshot), context.enclosing_device_rect(absolute_rect).to_type()); diff --git a/Libraries/LibWeb/Painting/PaintContext.h b/Libraries/LibWeb/Painting/PaintContext.h index abfd67f714a..1419e765807 100644 --- a/Libraries/LibWeb/Painting/PaintContext.h +++ b/Libraries/LibWeb/Painting/PaintContext.h @@ -32,9 +32,6 @@ public: void set_device_viewport_rect(DevicePixelRect const& rect) { m_device_viewport_rect = rect; } CSSPixelRect css_viewport_rect() const; - bool has_focus() const { return m_focus; } - void set_has_focus(bool focus) { m_focus = focus; } - void set_svg_transform(Gfx::AffineTransform transform) { m_svg_transform = transform; @@ -75,7 +72,6 @@ public: clone.m_device_viewport_rect = m_device_viewport_rect; clone.m_should_show_line_box_borders = m_should_show_line_box_borders; clone.m_should_paint_overlay = m_should_paint_overlay; - clone.m_focus = m_focus; return clone; } @@ -90,7 +86,6 @@ private: DevicePixelRect m_device_viewport_rect; bool m_should_show_line_box_borders { false }; bool m_should_paint_overlay { true }; - bool m_focus { false }; bool m_draw_svg_geometry_for_clip_path { false }; Gfx::AffineTransform m_svg_transform; u64 m_paint_generation_id { 0 }; diff --git a/Services/WebContent/PageClient.cpp b/Services/WebContent/PageClient.cpp index 94f54660f2d..e0b4e522c5a 100644 --- a/Services/WebContent/PageClient.cpp +++ b/Services/WebContent/PageClient.cpp @@ -239,7 +239,6 @@ void PageClient::paint_next_frame() void PageClient::start_display_list_rendering(Web::DevicePixelRect const& content_rect, Web::Painting::BackingStore& target, Web::PaintOptions paint_options, Function&& callback) { paint_options.should_show_line_box_borders = m_should_show_line_box_borders; - paint_options.has_focus = m_has_focus; auto& traversable = *page().top_level_traversable(); auto display_list = traversable.record_display_list(content_rect, paint_options); if (!display_list) {