--- old/modules/graphics/src/main/java/com/sun/javafx/css/StyleManager.java 2014-05-07 09:36:28.103207200 -0700 +++ new/modules/graphics/src/main/java/com/sun/javafx/css/StyleManager.java 2014-05-07 09:36:27.654181600 -0700 @@ -25,6 +25,7 @@ package com.sun.javafx.css; +import javafx.application.Application; import javafx.css.Styleable; import java.io.FileNotFoundException; import java.io.FilePermission; @@ -1270,6 +1271,41 @@ CssError.setCurrentScene(null); } + + /** + * Removes the specified stylesheet from the application default user agent + * stylesheet list. + * @param url The file URL, either relative or absolute, as a String. + */ + public void removeUserAgentStylesheet(String url) { + if (url == null ) { + throw new IllegalArgumentException("null arg url"); + } + + final String fname = url.trim(); + if (fname.isEmpty()) { + return; + } + + // if we already have this stylesheet, remove it! + boolean removed = false; + for (int n = platformUserAgentStylesheetContainers.size() - 1; n >= 0; n--) { + // don't remove the platform default user agent stylesheet + if (fname.equals(Application.getUserAgentStylesheet())) { + continue; + } + + StylesheetContainer container = platformUserAgentStylesheetContainers.get(n); + if (fname.equals(container.fname)) { + platformUserAgentStylesheetContainers.remove(n); + removed = true; + } + } + + if (removed) { + userAgentStylesheetsChanged(); + } + } /** * Set the user agent stylesheet. This is the base default stylesheet for