Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ public final BooleanProperty javaScriptEnabledProperty() {
* Location of the user stylesheet as a string URL.
*
* <p>This should be a local URL, i.e. either {@code 'data:'},
* {@code 'file:'}, or {@code 'jar:'}. Remote URLs are not allowed
* {@code 'file:'}, {@code 'jar:'}, or {@code 'jrt:'}. Remote URLs are not allowed
* for security reasons.
*
* @defaultValue null
Expand Down Expand Up @@ -554,6 +554,7 @@ public final StringProperty userStyleSheetLocationProperty() {
dataUrl = url;
} else if (url.startsWith("file:") ||
url.startsWith("jar:") ||
url.startsWith("jrt:") ||
url.startsWith("data:"))
{
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,4 +473,18 @@ void waitForCompletion() {
assertNull(getEngine().executeScript("window.xmlDoc.body"));
});
}

@Test public void jrtCssFileIsNotRejected() {
submit(() -> {
try {
getEngine().setUserStyleSheetLocation("jrt:/javafx.web/html/imported-styles.css");
} catch (IllegalArgumentException e) {
// A jrt file is supposed to be a valid argument
throw new AssertionError(e);
} catch (RuntimeException e) {
// The css file cannot be loaded in the tests (since they are not modularized).
// We thus simply ignore this exception here
}
});
}
}