Skip to content

Commit 3f3b8c2

Browse files
domenicannevk
authored andcommitted
Tighten up [Serializable] and [Transferable] definitions
* Spells out how when interitance gets involved, specs need to handle the whole object; we don't do any automatic inheritance-chain-crawling. * Removes the attempt at supporting mixins. Mixins have changed, so the text was no longer correct, and it was never very complete anyway.
1 parent c912846 commit 3f3b8c2

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

source

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8061,7 +8061,7 @@ interface <dfn>DOMStringList</dfn> {
80618061
<span>serializable objects</span> are necessarily preserved when they are serialized.</p>
80628062

80638063
<p><span data-x="platform object">Platform objects</span> can be <span>serializable objects</span>
8064-
if they implement only interfaces decorated with the <dfn data-export=""
8064+
if their <span>primary interface</span> is decorated with the <dfn data-export=""
80658065
data-dfn-type="extended-attribute" data-lt="Serializable"
80668066
data-x="Serializable"><code>[Serializable]</code></dfn> IDL <span>extended attribute</span>. Such
80678067
interfaces must also define the following algorithms:</p>
@@ -8105,12 +8105,15 @@ interface <dfn>DOMStringList</dfn> {
81058105
and deserialized by these steps. Typically the steps are very symmetric.</p>
81068106

81078107
<p>The <code data-x="Serializable">[Serializable]</code> extended attribute must take no
8108-
arguments, and must not appear on anything other than an interface. It must appear only once on an
8109-
interface. It must not be used on a callback interface. If it appears on a partial interface or an
8110-
interface that is really a mixin, then it must also appear on the original or mixed-in-to
8111-
interface, and any supplied <span>serialization steps</span> and <span>deserialization
8112-
steps</span> for the partial interface or mixin should be understood as being appended to those of
8113-
the original or mixed-in-to interface.</p>
8108+
arguments, and must only appear on an interface. It must not appear more than once on an
8109+
interface.</p>
8110+
8111+
<p>For a given <span>platform object</span>, only the object's <span>primary interface</span> is
8112+
considered during the (de)serialization process. Thus, if inheritance is involved in defining the
8113+
interface, each <code data-x="Serializable">[Serializable]</code>-annotated interface in the
8114+
inheritance chain needs to define standalone <span>serialization steps</span> and
8115+
<span>deserialization steps</span>, including taking into account any important data that might
8116+
come from inherited interfaces.</p>
81148117

81158118
<div class="example">
81168119
<p>Let's say we were defining a platform object <code data-x="">Person</code>, which had
@@ -8178,7 +8181,7 @@ interface <dfn>DOMStringList</dfn> {
81788181
been transferred, it cannot be transferred, or indeed used, again.</p>
81798182

81808183
<p><span data-x="platform object">Platform objects</span> can be <span>transferable objects</span>
8181-
if they implement only interfaces decorated with the <dfn data-export=""
8184+
if their <span>primary interface</span> is decorated with the <dfn data-export=""
81828185
data-dfn-type="extended-attribute" data-lt="Transferable"
81838186
data-x="Transferable"><code>[Transferable]</code></dfn> IDL <span>extended attribute</span>. Such
81848187
interfaces must also define the following algorithms:</p>
@@ -8210,12 +8213,15 @@ interface <dfn>DOMStringList</dfn> {
82108213
by these steps. Typically the steps are very symmetric.</p>
82118214

82128215
<p>The <code data-x="Transferable">[Transferable]</code> extended attribute must take no
8213-
arguments, and must not appear on anything other than an interface. It must appear only once on an
8214-
interface. It must not be used on a callback interface. If it appears on a partial interface or an
8215-
interface that is really a mixin, then it must also appear on the original or mixed-in-to
8216-
interface, and any supplied <span>transfer steps</span> and <span>transfer-receiving
8217-
steps</span> for the partial interface or mixin should be understood as being appended to those of
8218-
the original or mixed-in-to interface.</p>
8216+
arguments, and must only appear on an interface. It must not appear more than once on an
8217+
interface.</p>
8218+
8219+
<p>For a given <span>platform object</span>, only the object's <span>primary interface</span> is
8220+
considered during the transferring process. Thus, if inheritance is involved in defining the
8221+
interface, each <code data-x="Transferable">[Transferable]</code>-annotated interface in the
8222+
inheritance chain needs to define standalone <span>transfer steps</span> and
8223+
<span>transfer-receiving steps</span>, including taking into account any important data that might
8224+
come from inherited interfaces.</p>
82198225

82208226
<p><span data-x="platform object">Platform objects</span> that are <span>transferable
82218227
objects</span> have a <dfn data-export="" data-dfn-for="platform object"
@@ -8578,9 +8584,9 @@ interface <dfn>DOMStringList</dfn> {
85788584

85798585
<li>
85808586
<p>Otherwise, if <var>value</var> is a <span>platform object</span> that is a <span
8581-
data-x="serializable objects">serializable object</span>, then perform the appropriate
8582-
<span>serialization steps</span> given <var>value</var>, <var>serialized</var>, and
8583-
<var>forStorage</var>.</p>
8587+
data-x="serializable objects">serializable object</span>, then perform the <span>serialization
8588+
steps</span> for <var>value</var>'s <span>primary interface</span>, given <var>value</var>,
8589+
<var>serialized</var>, and <var>forStorage</var>.</p>
85848590

85858591
<p>The <span>serialization steps</span> may need to perform a <dfn
85868592
data-export="">sub-serialization</dfn>. This is an operation which takes as input a value

0 commit comments

Comments
 (0)