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

Document that title property in WebEngine gets updated asynchronously

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 8, openjfx11, openjfx17
    • Component/s: javafx
    • Labels:
      None
    • Subcomponent:
      web
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      Applications that read the title property immediately after loading a web page may get the wrong answer.
    • Interface Kind:
      Java API
    • Scope:
      JDK

      Description

      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
            */

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: