This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10877 - Spec should explain that the structured clone algorithm breaks Directed Acyclic Graphs into trees
Summary: Spec should explain that the structured clone algorithm breaks Directed Acycl...
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://dev.w3.org/html5/spec/common-d...
Whiteboard:
Keywords:
Depends on: 10878
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-30 17:17 UTC by Adrian Bateman [MSFT]
Modified: 2010-10-11 22:42 UTC (History)
4 users (show)

See Also:


Attachments

Description Adrian Bateman [MSFT] 2010-09-30 17:17:25 UTC
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 its callers 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.
Comment 1 Adrian Bateman [MSFT] 2010-09-30 17:28:53 UTC
See also bug 10878 (http://www.w3.org/Bugs/Public/show_bug.cgi?id=10878).
Comment 2 Ian 'Hixie' Hickson 2010-10-11 22:42:24 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: This became moot because bug 10878 made the spec preserve DAGs and cycles.