Selaa lähdekoodia

LibWeb: Fix broken paint invalidation after subframe changes

Now that PageView actually respects the invalidation rect provided by
the layout system, it turns out we were invalidating too little.

Unfortunately, this is not really fixable until the initial containing
block starts having the right size (same as viewport), but that will
require a bunch of work to make overflow work again. So it's a FIXME
for now, and we'll return to this.
Andreas Kling 5 vuotta sitten
vanhempi
commit
d93bf78346
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      Libraries/LibWeb/PageView.cpp

+ 6 - 0
Libraries/LibWeb/PageView.cpp

@@ -329,6 +329,8 @@ Gfx::Rect PageView::to_widget_rect(const Web::Frame& frame, const Gfx::Rect& fra
 {
     Gfx::Point offset;
     for (auto* f = &frame; f; f = f->parent()) {
+        if (f->is_main_frame())
+            break;
         if (!f->host_element())
             return {};
         if (!f->host_element()->layout_node())
@@ -366,6 +368,10 @@ void PageView::notify_tooltip_area_leave(Badge<EventHandler>, Web::Frame&)
 void PageView::notify_needs_display(Badge<Web::Frame>, Web::Frame& frame, const Gfx::Rect& rect)
 {
     update(to_widget_rect(frame, rect));
+
+    // FIXME: This is a total hack that forces a full repaint every time.
+    //        We shouldn't have to do this, but until the ICB is actually viewport-sized, we have no choice.
+    update();
 }
 
 }