On Tue, 4 Aug 2026 15:26:56 GMT, Andy Goryachev <[email protected]> wrote:

>> Marius Hanl has updated the pull request with a new target base due to a 
>> merge or a rebase. The pull request now contains two commits:
>> 
>>  - Merge branch 'master' of https://github.com/openjdk/jfx into 
>> 8388277-REDO]-Looked-up-color-fails-for--fx-background-color-in-JavaFX-CSS-file
>>    
>>    # Conflicts:
>>    # 
>> modules/javafx.graphics/src/test/java/test/javafx/scene/CssStyleHelperTest.java
>>  - 8388277: [REDO] Looked-up color fails for -fx-background-color in JavaFX 
>> CSS file
>
> modules/javafx.graphics/src/main/java/javafx/scene/CssStyleHelper.java line 
> 104:
> 
>> 102:         Styleable parent = node;
>> 103:         int depth = 0;
>> 104:         while (parent != null) {
> 
> there might be potential quadratic execution time here.
> 
> imagine a long chain of nodes
> 
> root
>   + node1
>       + node2
>          ...
>             + nodeN
> 
> 
> - start by adding a child to nodeN, this makes the entire chain dirty.
> - change style class in all the nodes in the chain
> - add a second child to nodeN
> 
> adding the second child recursively rebuilds every stale ancestor, walking 
> all the way to the root.

this will only rebuild the style helper that needs it. And only the first 
ancestor. I can't see how this could be a problem - do you have a unit test in 
mind? 
I tested several scenarios and could not spot any problem. Note that this is a 
very rare case that usually only happens for the scenarios I implemented as 
tests

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/2225#discussion_r3741372168

Reply via email to