Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8237469: Inherited styles don't update when node is moved #87

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -131,7 +131,7 @@ static CssStyleHelper createStyleHelper(final Node node) {
}
node.styleHelper.cacheContainer.forceSlowpath = true;
node.styleHelper.triggerStates.addAll(triggerStates[0]);
node.styleHelper.firstStyleableAncestor = findFirstStyleableAncestor(node);
This conversation was marked as resolved by kevinrushforth

This comment has been minimized.

Copy link
@dsgrieve

dsgrieve Jan 22, 2020

In canReuseStyleHelper, there is this check

       // If the style maps are the same instance, we can re-use the current styleHelper if the cacheContainer is null.
        // Under this condition, there are no styles for this node _and_ no styles inherit.
        if (node.styleHelper.cacheContainer == null) {
            return true;
        }

And later in the same function is a check for (parent == null) that returns true. In both cases, firstStyleableAncestor will still point to the old first-styleable ancestor.

This comment has been minimized.

Copy link
@DeanWookey

DeanWookey Jan 22, 2020

Author Contributor

Thanks. For some reason I thought all the early exits out of the method returned false. I'll push a fix.


updateParentTriggerStates(node, depth, triggerStates);
return node.styleHelper;

@@ -299,6 +299,9 @@ private static boolean canReuseStyleHelper(final Node node, final StyleMap style
return false;
}

//update ancestor since this node may have changed positions in the scene graph (JDK-8237469)
node.styleHelper.firstStyleableAncestor = findFirstStyleableAncestor(node);

// If the style maps are the same instance, we can re-use the current styleHelper if the cacheContainer is null.
// Under this condition, there are no styles for this node _and_ no styles inherit.
if (node.styleHelper.cacheContainer == null) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.