LibWeb: Don't send OOPWV repaint requests for views without backing

This fixes an assertion in TextEditor when changing the system theme,
since that would trigger a repaint request for the HTML preview widget
which may not have backing unless it's actually been used to perform
HTML (or Markdown) preview yet.
This commit is contained in:
Andreas Kling 2020-10-24 12:28:38 +02:00
parent 950c999d3a
commit bf1ed34236

View file

@ -214,6 +214,10 @@ void OutOfProcessWebView::did_scroll()
void OutOfProcessWebView::request_repaint()
{
// If this widget was instantiated but not yet added to a window,
// it won't have a back bitmap yet, so we can just skip repaint requests.
if (!m_back_bitmap)
return;
client().post_message(Messages::WebContentServer::Paint(m_back_bitmap->rect().translated(horizontal_scrollbar().value(), vertical_scrollbar().value()), m_back_bitmap->shbuf_id()));
}