Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8088406

Java crashes when accessing DOM elements from outside of application thread

XMLWordPrintable

    • web

      Reproducible: always for new webkit
      Is a regression: No
      Is a platform specific: reproducible on macos and linux.

      Java crashes when trying to access dom object using WebEngine.execute method.
      Steps to reproduce (example attached):
      1. Create javafx application with webview (gui is non necessary).
      2. Try to access any dom element with javascript: engine.executeScript("document.createElement('span')")
      3. Access that variable (e.g. call toString()) from outside of application thread

      Expected result: a kind of exception is thrown, because webengine objects must be manipulated only from application thread ("WebEngine objects must be created and accessed solely from the JavaFX Application thread. This rule also applies to any DOM and JavaScript objects obtained from the WebEngine object.")

      Actual result: java crashed with segfault.

            Unassigned Unassigned
            arusakov Andrey Rusakov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Imported: