Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.2
    • Fix Version/s: 2.6.2
    • Component/s: DOM (Level 3 Core)
    • Labels:
      None

      Description

      DOMNormalizer and DOMSerializerImpl make use of the method reportDOMError to report a DOMError to the error handler. This method has a relatedNode parameter in addition to being passed a DOMLocator object.

      Currently, W3C DOM test documentnormalizedocument07 is failing because normalizeNode calls isCDataWF, sending the nodeValue (containing "]]>") as a string, but the isCDataWF method does not receive the actual CDATA node as a parameter. isCDataWF subsequently calls reportDOMError passing null for the value of the relatedNode parameter, instead of the expected problem CDATA node.

      In the proposed patch, reportDOMError no longer takes relatedNode as a parameter, as this should be available in the Locator passed to it. The actual setting of relatedNode takes place in normalizeNode (in DOMNormalizer) and verify (in DOMSerializeImpl) above the switch statement. In a few instances, (such as when invalid characters are present in an attribute name), the value of relatedNode must be explicitly overridden to the value of a specific node. Not sure if this is the best way to handle things, since Locator data members would have to stay public.

      Aside, I think it should still be okay for reportDOMError to set the value of relatedData to that of relatedNode, as the spec states that "When called, DOMError.relatedData will contain the closest node to where the error occurred" [1], although I know elsewhere it says relatedData is of type DOMObject

      [1]http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#parameter-error-handler

        Activity

        Hide
        Michael Glavassevich added a comment -

        Closed.

        Show
        Michael Glavassevich added a comment - Closed.
        Hide
        Naela Nissar added a comment -

        Verified the patch. Thanks a lot Michael. I'm not sure if I'm able to change the status, but this can be marked as Closed.

        Show
        Naela Nissar added a comment - Verified the patch. Thanks a lot Michael. I'm not sure if I'm able to change the status, but this can be marked as Closed.
        Hide
        Michael Glavassevich added a comment -

        Thanks Naela, your patch is in CVS. Please verify.

        Show
        Michael Glavassevich added a comment - Thanks Naela, your patch is in CVS. Please verify.
        Hide
        Naela Nissar added a comment -

        Proposed patch to DOMSerializerImpl and DOMNormalizer concerning the reporting of relatedNode

        Show
        Naela Nissar added a comment - Proposed patch to DOMSerializerImpl and DOMNormalizer concerning the reporting of relatedNode

          People

          • Assignee:
            Michael Glavassevich
            Reporter:
            Naela Nissar
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development