Project

General

Profile

Actions

Bug #11669

closed

Delayed invisible changes end up in prelearned stateless slot

Added by Dries Mys over 1 year ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
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.


Related issues 2 (0 open2 closed)

Related to Bug #12022: Session crash due wrong renderingClosedMatthias Van Ceulebroeck10/11/2023

Actions
Related to Bug #9076: Opening popup (calendar) of Wt::WDateEdit fails in Widgetset mode on first render.ClosedKorneel Dumon09/17/2021

Actions
Actions #1

Updated by Dries Mys over 1 year ago

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

Actions #2

Updated by Matthias Van Ceulebroeck over 1 year ago

  • Target version set to 4.11.0
Actions #3

Updated by Matthias Van Ceulebroeck about 1 year ago

  • Related to Bug #12022: Session crash due wrong rendering added
Actions #4

Updated by Matthias Van Ceulebroeck about 1 year ago

  • Related to Bug #9076: Opening popup (calendar) of Wt::WDateEdit fails in Widgetset mode on first render. added
Actions #5

Updated by Matthias Van Ceulebroeck about 1 year ago

  • Status changed from New to InProgress
  • Assignee set to Matthias Van Ceulebroeck
  • Target version changed from 4.11.0 to 4.10.2
Actions #6

Updated by Matthias Van Ceulebroeck about 1 year ago

  • Status changed from InProgress to Review
  • Assignee deleted (Matthias Van Ceulebroeck)
Actions #7

Updated by Matthias Van Ceulebroeck about 1 year ago

  • Target version changed from 4.10.2 to 4.10.3
Actions #8

Updated by Matthias Van Ceulebroeck about 1 year ago

  • Assignee set to Korneel Dumon
Actions #9

Updated by Matthias Van Ceulebroeck about 1 year ago

  • Status changed from Review to Implemented @Emweb
  • Assignee changed from Korneel Dumon to Matthias Van Ceulebroeck
Actions #10

Updated by Matthias Van Ceulebroeck 4 months ago

  • Status changed from Implemented @Emweb to Closed
Actions

Also available in: Atom PDF