1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-01 11:22:12 +00:00

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.
This commit is contained in:
Andreas Kling 2020-06-07 17:12:42 +02:00
parent 3ae3729b4e
commit d93bf78346

View file

@ -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();
}
}