ADDITIONAL SYSTEM INFORMATION :
macOS 10.14.6
AdoptOpenJDK 12.0.2
JavaFX 11.0.2
A DESCRIPTION OF THE PROBLEM :
Within a JavaFX WebView, When a sufficiently large number of shapes are drawn on the canvas some subset of them will not be rendered. This phenomenon is most easily seen when a drawing large grid of shapes.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Initialize the JavaFX thread
2. On the JavaFX thread, initialize a WebView.
3. Create a Stage and set the scene to a new Scene wrapping the WebView.
4. Retrieve the WebEngine from the WebView.
5. Load HTML content into the WebEngine that contains a single canvas element.
6. Use the engine to execute a JavaScript script that draws a large grid of shapes that fills the canvas element.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A window opens showing a canvas completely full of a grid of shapes.
ACTUAL -
A window opens showing a canvas partially full of a grid of shapes. There is a large section in the middle where no shapes were drawn.
---------- BEGIN SOURCE ----------
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
class Bug {
public static void main (String args[]) {
Platform.startup(() -> {});
Platform.runLater(() -> {
WebView webView = new WebView();
Stage stage = new Stage();
stage.setScene(new Scene(webView));
stage.setAlwaysOnTop(true);
stage.setWidth(620);
stage.setHeight(640);
WebEngine engine = webView.getEngine();
engine.loadContent("<html><body><canvas id=\"canvas\" width=\"600\" height=\"600\" style=\"border: 1px solid red;\"></canvas></body></html>");
engine.executeScript("window.onload = function() {"
+ " var canvas = document.getElementById('canvas');"
+ " var c = canvas.getContext('2d');"
+ " var size = 4;"
+ " var step = size + 2;"
+ " for (var y = 0; y <= canvas.height; y = y + step) {"
+ " for (var x = 0; x <= canvas.width; x = x + step) {"
+ " c.fillRect(x, y, size, size);"
+ " }"
+ " }"
+ "}");
stage.show();
});
}
}
---------- END SOURCE ----------
FREQUENCY : always
macOS 10.14.6
AdoptOpenJDK 12.0.2
JavaFX 11.0.2
A DESCRIPTION OF THE PROBLEM :
Within a JavaFX WebView, When a sufficiently large number of shapes are drawn on the canvas some subset of them will not be rendered. This phenomenon is most easily seen when a drawing large grid of shapes.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Initialize the JavaFX thread
2. On the JavaFX thread, initialize a WebView.
3. Create a Stage and set the scene to a new Scene wrapping the WebView.
4. Retrieve the WebEngine from the WebView.
5. Load HTML content into the WebEngine that contains a single canvas element.
6. Use the engine to execute a JavaScript script that draws a large grid of shapes that fills the canvas element.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A window opens showing a canvas completely full of a grid of shapes.
ACTUAL -
A window opens showing a canvas partially full of a grid of shapes. There is a large section in the middle where no shapes were drawn.
---------- BEGIN SOURCE ----------
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
class Bug {
public static void main (String args[]) {
Platform.startup(() -> {});
Platform.runLater(() -> {
WebView webView = new WebView();
Stage stage = new Stage();
stage.setScene(new Scene(webView));
stage.setAlwaysOnTop(true);
stage.setWidth(620);
stage.setHeight(640);
WebEngine engine = webView.getEngine();
engine.loadContent("<html><body><canvas id=\"canvas\" width=\"600\" height=\"600\" style=\"border: 1px solid red;\"></canvas></body></html>");
engine.executeScript("window.onload = function() {"
+ " var canvas = document.getElementById('canvas');"
+ " var c = canvas.getContext('2d');"
+ " var size = 4;"
+ " var step = size + 2;"
+ " for (var y = 0; y <= canvas.height; y = y + step) {"
+ " for (var x = 0; x <= canvas.width; x = x + step) {"
+ " c.fillRect(x, y, size, size);"
+ " }"
+ " }"
+ "}");
stage.show();
});
}
}
---------- END SOURCE ----------
FREQUENCY : always