LibWeb: Resolve background size and offset only after style invalidation

This change fixes layering violation by moving to_px() calls to happen
before display list recording. Also it should make display list
recording a bit faster by resolving background properties beforehand.
This commit is contained in:
Aliaksandr Kalenik
2024-08-02 16:58:26 +03:00
committed by Andreas Kling
parent 2995a57f63
commit f574e2b03a
8 changed files with 244 additions and 176 deletions

View File

@@ -43,9 +43,13 @@ void ImageStyleValue::load_any_resources(DOM::Document& document)
if (!m_document)
return;
// FIXME: Do less than a full repaint if possible?
if (auto navigable = m_document->navigable())
if (auto navigable = m_document->navigable()) {
// Once the image has loaded, we need to re-resolve CSS properties that depend on the image's dimensions.
m_document->set_needs_to_resolve_paint_only_properties();
// FIXME: Do less than a full repaint if possible?
navigable->set_needs_display();
}
auto image_data = m_resource_request->image_data();
if (image_data->is_animated() && image_data->frame_count() > 1) {