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

Document that title property in WebEngine gets updated asynchronously

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • jfx11, 8, jfx17
    • javafx
    • None
    • web
    • behavioral
    • low
    • Applications that read the title property immediately after loading a web page may get the wrong answer.
    • Java API
    • JDK

      Summary

      Document that title property in WebEngine gets updated asynchronously.

      Problem

      The title property is not guaranteed to be updated right after the page is loaded, but gets updated asynchronously. This may cause getTitle() to return empty string instead of the title of the page when called just after the page is loaded.

      Solution

      Update the WebEngine javadoc mentioning that the value gets updated asynchronously.

      Specification

      Changed the javadoc of javafx.scene.web.WebEngine::titleProperty to:

           /**
            * Title of the current Web page. If the current page has no title,
      -     * the value is {@code null}.
      +     * the value is {@code null}. This property will be updated
      +     * asynchronously some time after the page is loaded. Applications
      +     * should not rely on any particular timing, but should listen for
      +     * changes to this property, or bind to it, to know when it has
      +     * been updated.
            *
            * @return the title property
            */

            ajoseph Arun Joseph (Inactive)
            ajoseph Arun Joseph (Inactive)
            Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: