# HG changeset patch # Parent e4d920161c6108861bc68694d7187492b098b6a1 RT-36838 - don't reapply CSS in the middle of an update or reapply diff -r e4d920161c61 -r 96e4265758fd modules/graphics/src/main/java/javafx/scene/Node.java --- a/modules/graphics/src/main/java/javafx/scene/Node.java Fri May 02 17:33:21 2014 -0400 +++ b/modules/graphics/src/main/java/javafx/scene/Node.java Mon May 05 21:02:15 2014 -0400 @@ -26,6 +26,7 @@ package javafx.scene; +import javafx.application.Platform; import javafx.beans.InvalidationListener; import javafx.beans.Observable; import javafx.beans.binding.BooleanExpression; @@ -961,7 +962,13 @@ @Override protected void invalidated() { - impl_reapplyCSS(); + // RT-36838 - don't reapply CSS in the middle of an update or reapply + if ((cssFlag == CssFlags.UPDATE) || (cssFlag == CssFlags.REAPPLY)) { + Platform.runLater(()->impl_reapplyCSS()); + } + else { + impl_reapplyCSS(); + } if (PrismSettings.printRenderGraph) { impl_markDirty(DirtyBits.DEBUG); } @@ -994,7 +1001,13 @@ private ObservableList styleClass = new TrackableObservableList() { @Override protected void onChanged(Change c) { - impl_reapplyCSS(); + // RT-36838 - don't reapply CSS in the middle of an update or reapply + if ((cssFlag == CssFlags.UPDATE) || (cssFlag == CssFlags.REAPPLY)) { + Platform.runLater(()->impl_reapplyCSS()); + } + else { + impl_reapplyCSS(); + } } @Override @@ -1079,7 +1092,13 @@ protected void invalidated() { // If the style has changed, then styles of this node // and child nodes might be affected. - impl_reapplyCSS(); + // RT-36838 - don't reapply CSS in the middle of an update or reapply + if ((cssFlag == CssFlags.UPDATE) || (cssFlag == CssFlags.REAPPLY)) { + Platform.runLater(()->impl_reapplyCSS()); + } + else { + impl_reapplyCSS(); + } } @Override