File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
main/java/javafx/scene/web
test/java/test/javafx/scene/web Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -499,7 +499,7 @@ public final BooleanProperty javaScriptEnabledProperty() {
499499 * Location of the user stylesheet as a string URL.
500500 *
501501 * <p>This should be a local URL, i.e. either {@code 'data:'},
502- * {@code 'file:'}, or {@code 'jar :'}. Remote URLs are not allowed
502+ * {@code 'file:'}, {@code 'jar:'}, or {@code 'jrt :'}. Remote URLs are not allowed
503503 * for security reasons.
504504 *
505505 * @defaultValue null
@@ -562,6 +562,7 @@ public final StringProperty userStyleSheetLocationProperty() {
562562 dataUrl = url ;
563563 } else if (url .startsWith ("file:" ) ||
564564 url .startsWith ("jar:" ) ||
565+ url .startsWith ("jrt:" ) ||
565566 url .startsWith ("data:" ))
566567 {
567568 try {
Original file line number Diff line number Diff line change @@ -472,4 +472,18 @@ void waitForCompletion() {
472472 assertNull (getEngine ().executeScript ("window.xmlDoc.body" ));
473473 });
474474 }
475+
476+ @ Test public void jrtCssFileIsNotRejected () {
477+ submit (() -> {
478+ try {
479+ getEngine ().setUserStyleSheetLocation ("jrt:/javafx.web/html/imported-styles.css" );
480+ } catch (IllegalArgumentException e ) {
481+ // A jrt file is supposed to be a valid argument
482+ throw new AssertionError (e );
483+ } catch (RuntimeException e ) {
484+ // The css file cannot be loaded in the tests (since they are not modularized).
485+ // We thus simply ignore this exception here
486+ }
487+ });
488+ }
475489}
You can’t perform that action at this time.
0 commit comments