Bug 40329 - postMessage should serialise dom objects to null by default
Summary: postMessage should serialise dom objects to null by default
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Oliver Hunt
URL:
Keywords:
: 40232 (view as bug list)
Depends on:
Blocks: 39757
  Show dependency treegraph
 
Reported: 2010-06-08 13:28 PDT by Kim Grönholm
Modified: 2010-06-17 15:21 PDT (History)
4 users (show)

See Also:


Attachments
Removes the test case with wrong expected output (2.41 KB, patch)
2010-06-16 11:31 PDT, Kim Grönholm
ap: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kim Grönholm 2010-06-08 13:28:16 PDT
Internal structured cloning algorithm should result in null when attempting to
serialise Dom objects that are not real JS objects.

This is not the case currently as can be seen in the test:
LayoutTests/fast/dom/Window/window-postmessage-clone.html

Also the expected output of the layout test is wrong.
Comment 1 Kim Grönholm 2010-06-08 13:35:32 PDT
*** Bug 40232 has been marked as a duplicate of this bug. ***
Comment 2 Kim Grönholm 2010-06-16 11:31:10 PDT
Created attachment 58911 [details]
Removes the test case with wrong expected output

Temporarily disabling the postMessage(window, "*") test as the expected
result and the behavior are both wrong. This doesn't fix the actual
issue but prevents the test case from failing due to any unrelated changes. 
The test case should be enabled again with correct expected output after
the bug has been fixed.
Comment 3 Alexey Proskuryakov 2010-06-17 15:17:18 PDT
From IRC discussion: 
- currently, the subtest raises "TypeError: Cannot post cyclic structures";
- with an unrelated patch, a different exception is raised, because the order of traversal changes;
- the correct behavior is to return null.
Comment 4 Alexey Proskuryakov 2010-06-17 15:21:50 PDT
Comment on attachment 58911 [details]
Removes the test case with wrong expected output

It's best to keep this subtest to make sure that we don't break window serialization even more (e.g. that we don't start to crash).

I think that the best way to proceed is to change this subtest's results in the same unrelated change that will affect it.