@@ -1051,15 +1051,13 @@ public void fireSuperValueChangedEvent() {
1051
1051
}
1052
1052
}
1053
1053
1054
- // reapplyCSS should be true for root elements when they are added, and is false for children
1055
- // of the root element. This prevents CSS being reapplied recursively, as noted in JDK-8151756.
1056
- private void invalidatedScenes (Scene oldScene , SubScene oldSubScene , boolean reapplyCSS ) {
1054
+ private void invalidatedScenes (Scene oldScene , SubScene oldSubScene ) {
1057
1055
Scene newScene = sceneProperty ().get ();
1058
1056
boolean sceneChanged = oldScene != newScene ;
1059
1057
SubScene newSubScene = subScene ;
1060
1058
1061
1059
if (getClip () != null ) {
1062
- getClip ().setScenes (newScene , newSubScene , reapplyCSS );
1060
+ getClip ().setScenes (newScene , newSubScene );
1063
1061
}
1064
1062
if (sceneChanged ) {
1065
1063
updateCanReceiveFocus ();
@@ -1093,9 +1091,7 @@ private void invalidatedScenes(Scene oldScene, SubScene oldSubScene, boolean rea
1093
1091
}
1094
1092
updateTreeShowing ();
1095
1093
1096
- if (sceneChanged && reapplyCSS ) {
1097
- reapplyCSS ();
1098
- }
1094
+ if (sceneChanged ) reapplyCSS ();
1099
1095
1100
1096
if (sceneChanged && !isDirtyEmpty ()) {
1101
1097
//Note: no need to remove from scene's dirty list
@@ -1154,16 +1150,16 @@ private void invalidatedScenes(Scene oldScene, SubScene oldSubScene, boolean rea
1154
1150
}
1155
1151
}
1156
1152
1157
- final void setScenes (Scene newScene , SubScene newSubScene , boolean reapplyCSS ) {
1153
+ final void setScenes (Scene newScene , SubScene newSubScene ) {
1158
1154
Scene oldScene = sceneProperty ().get ();
1159
1155
if (newScene != oldScene || newSubScene != subScene ) {
1160
1156
scene .set (newScene );
1161
1157
SubScene oldSubScene = subScene ;
1162
1158
subScene = newSubScene ;
1163
- invalidatedScenes (oldScene , oldSubScene , reapplyCSS );
1159
+ invalidatedScenes (oldScene , oldSubScene );
1164
1160
if (this instanceof SubScene ) { // TODO: find better solution
1165
1161
SubScene thisSubScene = (SubScene )this ;
1166
- thisSubScene .getRoot ().setScenes (newScene , thisSubScene , reapplyCSS );
1162
+ thisSubScene .getRoot ().setScenes (newScene , thisSubScene );
1167
1163
}
1168
1164
}
1169
1165
}
@@ -1184,10 +1180,8 @@ public final ReadOnlyObjectProperty<Scene> sceneProperty() {
1184
1180
* Exists for Parent and LightBase
1185
1181
*/
1186
1182
void scenesChanged (final Scene newScene , final SubScene newSubScene ,
1187
- final Scene oldScene , final SubScene oldSubScene ) {
1188
- // On scenes change, reapply CSS for this Node
1189
- reapplyCSS ();
1190
- }
1183
+ final Scene oldScene , final SubScene oldSubScene ) { }
1184
+
1191
1185
1192
1186
/**
1193
1187
* The id of this {@code Node}. This simple string identifier is useful for
@@ -6982,13 +6976,13 @@ protected void invalidated() {
6982
6976
} else {
6983
6977
if (oldClip != null ) {
6984
6978
oldClip .clipParent = null ;
6985
- oldClip .setScenes (null , null , /* reapplyCSS */ false );
6979
+ oldClip .setScenes (null , null );
6986
6980
oldClip .updateTreeVisible (false );
6987
6981
}
6988
6982
6989
6983
if (newClip != null ) {
6990
6984
newClip .clipParent = Node .this ;
6991
- newClip .setScenes (getScene (), getSubScene (), /* reapplyCSS */ false );
6985
+ newClip .setScenes (getScene (), getSubScene ());
6992
6986
newClip .updateTreeVisible (true );
6993
6987
}
6994
6988
0 commit comments