JDK-8177636 : Reduce frequency of CSS resetting properties temporarily to initial state
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: controls
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-03-27
  • Updated: 2018-05-25
  • Resolved: 2017-07-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10
10Fixed
Related Reports
Relates :  
Relates :  
Description
As discussed in this thread: http://mail.openjdk.java.net/pipermail/openjfx-dev/2015-December/018460.html

This could be low-hanging fruit that results in some performance wins. I think as it is now, everything is thrown away and reset before the new set of styles is calculated. Maybe it is just a "simple" matter of recalculating styles and then cleaning up the delta. The less calls to 'set', the better! 
Comments
changeset: c03a52eca7f3 user: aghaisas date: Tue Jul 11 12:34:02 2017 +0530 description: 8177636: Reduce frequency of CSS resetting properties temporarily to initial state Reviewed-by: jgiles URL: http://hg.openjdk.java.net/openjfx/10-dev/rt/rev/c03a52eca7f3
11-07-2017

I've applied the patch and run through a barrage of manual tests. I am unable to spot any visual regressions. This means that I +1 the webrev and think you should push it at your earliest convenience. Then for the next few months we need to keep an eye out for any visual or performance regressions, and keep in mind this changeset as one possible reason why. Good work!
09-07-2017

Just two comments for others following along: 1) Ajit and I have worked through this webrev offline to get it to this point, so I'm implicitly +1 with the webrev. However, I still intend to run the patch on my machine for a few days to ensure there are no obvious regressions. I'll +1 again once I'm done with this testing. 2) David Grieve, author of the CSS engine, has also reviewed the webrev and has stated that it looks good to him.
06-07-2017

I tried uploading the test file 4 times - it gave error every time, but seems files got uploaded at every try. Now, removing file is also throwing error :( All we need is Main.java and application.css This test is based on sample code provided at : http://mail.openjdk.java.net/pipermail/openjfx-dev/2015-December/018460.html
06-07-2017

Run the attached program 3 times and every time click a different button - observe the command line: program prints the count of how many times the StackPane change listener has been invoked. Exiting behavior : ----------------- StackPane ChangeListener invocation during application launch : 10 1) On clicking button "Modify Pane[0] CSS" : change listener invocation count : 2 (total count is 12 on command line) 2) On clicking button "Modify Pane[9] CSS" : change listener invocation count : 20 (total count is 30 on command line) 3) On clicking button "Modify Root CSS" : change listener invocation count : 20 (total count is 30 on command line) With proposed code change : ----------------------------- StackPane ChangeListener invocation during application launch : 10 1) On clicking button "Modify Pane[0] CSS" : change listener invocation count : 2 (total count is 12 on command line) 2) On clicking button "Modify Pane[9] CSS" : change listener invocation count : 2 (total count is 12 on command line) 3) On clicking button "Modify Root CSS" : change listener invocation count : 0 (total count is 10 on command line)
06-07-2017

Here is an attempt to reduce temporary reset of properties to initial state. http://cr.openjdk.java.net/~aghaisas/fx/e8177636/webrev.1/ My testing seems promising. Request you to review.
06-07-2017

Target JDK10
28-03-2017