[Bug 10877] New: Spec should explain that the structured clone algorithm breaks Directed Acyclic Graphs into trees

http://www.w3.org/Bugs/Public/show_bug.cgi?id=10877

           Summary: Spec should explain that the structured clone
                    algorithm breaks Directed Acyclic Graphs into trees
           Product: HTML WG
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: adrianba@microsoft.com
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org


http://dev.w3.org/html5/spec/common-dom-interfaces.html#safe-passing-of-structured-data

The "If input is an Array object, If input is an Object object" section of the
algorithm results in a tree.

Consider this graph:

    A
    |\
    B C
    |/
    D

The recursion that looks like the following (each “memory” argument is it’s
caller’s “new memory” variable):

Clone(node = A, memory = { } )
    Clone(node = B, memory = { A } )
        Clone (node = D, memory = { A, B } )
    Clone(node = C, memory = { A } )
        Clone(node = D, memory = { A, C } )

The result is as follows:

    A
    |\
    B C
    | |
    D D

An example of this form would make the intent of algorithm clear.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 30 September 2010 17:17:27 UTC