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

Have to call toString on org.w3c.dom.Node in order to init jsPeer field.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 7u40
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      java version "1.7.0_10-ea"
      Java(TM) SE Runtime Environment (build 1.7.0_10-ea-b09)
      Java HotSpot(TM) Client VM (build 23.6-b03, mixed mode, sharing)

      Windows XP, Eclipse 3.7.2

    • Subcomponent:
      web

      Description

      Trying to use a org.w3c.dom.Node as the context node for a call to Document.evaluate (xpath).
      Have to call toString on Node object before the Node object can be used as an argument to JSObject.call.
      Please see the code summary, all works as expected once you call contextNode.toString().
      The Document.evaluate method complains about an invalid context node if you dont call toString.

      Summary of code:

      Document doc= webView.getEngine().getDocument();
      Node contextNode= doc.getDocumentElement();
      // contextNode.toString()
      JSObject jsdoc= (JSObject) doc;
      jsdoc.call("evaluate", "//*" , contextNode, null, 9, null);

      Exception thrown:

      NOT_SUPPORTED_ERR: DOM Exception 9

      Possible reason:

      The debugger shows the field jsPeer is set to something else than 0 after the call to Node.toString()

      Expected behavior:

      No need for calling toString before you are able to use the contextNode.

        Attachments

          Activity

            People

            Assignee:
            pbothner Per Bothner (Inactive)
            Reporter:
            dklerkjfx DM de Klerk (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: