Project

General

Profile

Actions

Bug #11669

open

Delayed invisible changes end up in prelearned stateless slot

Added by Dries Mys 4 months ago. Updated 4 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
Start date:
05/25/2023
Due date:
% Done:

0%

Estimated time:

Description

Consider the following example:

void MyApplication::initialize()
{
    // construct a large invisible widget to ensure two-phase rendering threshold is triggered.
    Wt::WText *pText = m_pRoot->addNew<Wt::WText>("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum");
    pText->setHidden(true);
    // Modify the background color. This change will end up in an unrelated prelearned slot
    pText->decorationStyle().setBackgroundColor(Wt::WColor("#ff0000"));
}

This results in the following prelearned slot for Wt::WDefaultLoadingIndicator::show (see WebRenderer::updateLoadIndicator):

showLoadingIndicator = function() {var o=null,e=null;
var j1=Wt4_9_1.$('o1fco89w'); 
j1.style.backgroundColor='#ff0000'; // bad: is not related to showing the load indicator
Wt4_9_1.show('o1fco89s', ''); // ok: showing the load indicator
};

This may even result in a js exception, when the widget is already removed from the dom when the loading indicator is being shown.

Not sure if this is related to WCssDecorationStyle::updateDomElement specifically, or to prelearning in general. Currently, I only see WCssDecorationStyle related code ending up in showLoadingIndicator.

If it is a general issue, it may be a solution to collect the invisible changes before prelearning the stateless slots (inside WebRenderer::serveMainAjax) as WebRenderer::collectChanges will collect non-rendered changes when learning, but not when collecting the visible only changes.

Actions #1

Updated by Dries Mys 4 months ago

Note that those delayed invisible changes may also end up in another (unrelated) learned slot.

Actions #2

Updated by Matthias Van Ceulebroeck 4 months ago

  • Target version set to 4.11.0
Actions

Also available in: Atom PDF