[html5] r8008 - [giow] (3) Make showModalDialog()'s returnValue logic more closely match Firefox [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Jul 2 12:22:25 PDT 2013


Author: ianh
Date: 2013-07-02 12:22:24 -0700 (Tue, 02 Jul 2013)
New Revision: 8008

Modified:
   complete.html
   index
   source
Log:
[giow] (3) Make showModalDialog()'s returnValue logic more closely match Firefox. Previously it matched nobody. None of the browsers match each other. Firefox's behaviour seems the sanest.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=21771
Affected topics: DOM APIs

Modified: complete.html
===================================================================
--- complete.html	2013-07-01 23:43:32 UTC (rev 8007)
+++ complete.html	2013-07-02 19:22:24 UTC (rev 8008)
@@ -256,7 +256,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 1 July 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 2 July 2013</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -73712,7 +73712,7 @@
 
    <li>
 
-    <p>Let the <a href=#dialog-arguments>dialog arguments</a> of the new browsing context be set to the value of <var title="">argument</var>, or the 'undefined' value if the argument was omitted.</p>
+    <p>Let the <a href=#dialog-arguments>dialog arguments</a> of the new browsing context be set to the value of <var title="">argument</var>, or the <i>undefined</i> value if the argument was omitted.</p>
 
    </li>
 
@@ -73724,6 +73724,18 @@
 
    <li>
 
+    <p>Let the <a href=#return-value>return value</a> of the new browsing context be the <i>undefined</i> value.</p>
+
+   </li>
+
+   <li>
+
+    <p>Let the <a href=#return-value-origin>return value origin</a> be <var title="">incumbent origin</var>.</p>
+
+   </li>
+
+   <li>
+
     <p><a href=#navigate>Navigate</a><!--DONAV showModalDialog--> the new <a href=#browsing-context>browsing context</a> to
     the <a href=#absolute-url>absolute URL</a> that resulted from <a href=#resolve-a-url title="resolve a url">resolving</a>
     <var title="">url</var> earlier, with <a href=#replacement-enabled>replacement enabled</a>, and with the <a href="#script's-browsing-context" title="script's browsing context">browsing context</a> of the <a href=#incumbent-script>incumbent
@@ -73748,10 +73760,10 @@
 
    <li>
 
-    <p>If the <a href=#effective-script-origin>effective script origin</a> of the <a href=#auxiliary-browsing-context>auxiliary browsing context</a>'s
-    <a href=#active-document>active document</a> at the time the browsing context was <a href=#close-a-browsing-context title="close a browsing
-    context">closed</a> was the <a href=#same-origin>same origin</a> as the <a href="#dialog-arguments'-origin">dialog arguments'
-    origin</a>, then let <var title="">return value</var> be the <a href=#auxiliary-browsing-context>auxiliary browsing
+    <p>If the <a href=#auxiliary-browsing-context>auxiliary browsing context</a>'s <a href=#return-value-origin>return value origin</a> at
+    the time the browsing context was <a href=#close-a-browsing-context title="close a browsing
+    context">closed</a> was the <a href=#same-origin title="same origin">same</a> as <var title="">incumbent origin</var>,
+    then let <var title="">return value</var> be the <a href=#auxiliary-browsing-context>auxiliary browsing
     context</a>'s <a href=#return-value>return value</a> as it stood when the browsing context was <a href=#close-a-browsing-context title="close a browsing context">closed</a>.</p>
 
     <p>Otherwise, let <var title="">return value</var> be undefined.</p>
@@ -73806,17 +73818,22 @@
 
   <p>The <dfn id=dom-windowmodal-dialogarguments title=dom-WindowModal-dialogArguments><code>dialogArguments</code></dfn> IDL
   attribute, on getting, must check whether its browsing context's <a href=#active-document>active document</a>'s
-  <a href=#origin>origin</a> is the <a href=#same-origin title="same origin">same</a> as the <a href="#dialog-arguments'-origin">dialog arguments'
+  <a href=#effective-script-origin>effective script origin</a> is the <a href=#same-origin title="same origin">same</a> as the <a href="#dialog-arguments'-origin">dialog arguments'
   origin</a>. If it is, then the browsing context's <a href=#dialog-arguments>dialog arguments</a> must be
   returned unchanged. Otherwise, the IDL attribute must return <i>undefined</i>.</p>
 
-  <p>These browsing contexts also have an associated <dfn id=return-value>return value</dfn>. The <a href=#return-value>return
-  value</a> of a browsing context must be initialized to the empty string when the browsing
-  context is created.</p>
+  <p>These browsing contexts also have an associated <dfn id=return-value>return value</dfn> and <dfn id=return-value-origin>return value
+  origin</dfn>. As with the previous two values, these values are set by the <code title=dom-showModalDialog><a href=#dom-showmodaldialog>showModalDialog()</a></code> method in the algorithm above, when the
+  browsing context is created.</p>
 
   <p>The <dfn id=dom-windowmodal-returnvalue title=dom-WindowModal-returnValue><code>returnValue</code></dfn> IDL attribute, on
-  getting, must return the <a href=#return-value>return value</a> of its browsing context, and on setting, must
-  set the <a href=#return-value>return value</a> to the given new value.</p>
+  getting, must check whether its browsing context's <a href=#active-document>active document</a>'s <a href=#effective-script-origin>effective
+  script origin</a> is the <a href=#same-origin title="same origin">same</a> as the current <a href=#return-value-origin>return
+  value origin</a>. If it is, then the browsing context's <a href=#return-value>return value</a> must be
+  returned unchanged. Otherwise, the IDL attribute must return <i>undefined</i>. On setting, the
+  attribute must set the <a href=#return-value>return value</a> to the given new value, and the <a href=#return-value-origin>return
+  value origin</a> to the browsing context's <a href=#active-document>active document</a>'s <a href=#effective-script-origin>effective
+  script origin</a>.</p>
 
   </div>
 

Modified: index
===================================================================
--- index	2013-07-01 23:43:32 UTC (rev 8007)
+++ index	2013-07-02 19:22:24 UTC (rev 8008)
@@ -256,7 +256,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 1 July 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 2 July 2013</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -73712,7 +73712,7 @@
 
    <li>
 
-    <p>Let the <a href=#dialog-arguments>dialog arguments</a> of the new browsing context be set to the value of <var title="">argument</var>, or the 'undefined' value if the argument was omitted.</p>
+    <p>Let the <a href=#dialog-arguments>dialog arguments</a> of the new browsing context be set to the value of <var title="">argument</var>, or the <i>undefined</i> value if the argument was omitted.</p>
 
    </li>
 
@@ -73724,6 +73724,18 @@
 
    <li>
 
+    <p>Let the <a href=#return-value>return value</a> of the new browsing context be the <i>undefined</i> value.</p>
+
+   </li>
+
+   <li>
+
+    <p>Let the <a href=#return-value-origin>return value origin</a> be <var title="">incumbent origin</var>.</p>
+
+   </li>
+
+   <li>
+
     <p><a href=#navigate>Navigate</a><!--DONAV showModalDialog--> the new <a href=#browsing-context>browsing context</a> to
     the <a href=#absolute-url>absolute URL</a> that resulted from <a href=#resolve-a-url title="resolve a url">resolving</a>
     <var title="">url</var> earlier, with <a href=#replacement-enabled>replacement enabled</a>, and with the <a href="#script's-browsing-context" title="script's browsing context">browsing context</a> of the <a href=#incumbent-script>incumbent
@@ -73748,10 +73760,10 @@
 
    <li>
 
-    <p>If the <a href=#effective-script-origin>effective script origin</a> of the <a href=#auxiliary-browsing-context>auxiliary browsing context</a>'s
-    <a href=#active-document>active document</a> at the time the browsing context was <a href=#close-a-browsing-context title="close a browsing
-    context">closed</a> was the <a href=#same-origin>same origin</a> as the <a href="#dialog-arguments'-origin">dialog arguments'
-    origin</a>, then let <var title="">return value</var> be the <a href=#auxiliary-browsing-context>auxiliary browsing
+    <p>If the <a href=#auxiliary-browsing-context>auxiliary browsing context</a>'s <a href=#return-value-origin>return value origin</a> at
+    the time the browsing context was <a href=#close-a-browsing-context title="close a browsing
+    context">closed</a> was the <a href=#same-origin title="same origin">same</a> as <var title="">incumbent origin</var>,
+    then let <var title="">return value</var> be the <a href=#auxiliary-browsing-context>auxiliary browsing
     context</a>'s <a href=#return-value>return value</a> as it stood when the browsing context was <a href=#close-a-browsing-context title="close a browsing context">closed</a>.</p>
 
     <p>Otherwise, let <var title="">return value</var> be undefined.</p>
@@ -73806,17 +73818,22 @@
 
   <p>The <dfn id=dom-windowmodal-dialogarguments title=dom-WindowModal-dialogArguments><code>dialogArguments</code></dfn> IDL
   attribute, on getting, must check whether its browsing context's <a href=#active-document>active document</a>'s
-  <a href=#origin>origin</a> is the <a href=#same-origin title="same origin">same</a> as the <a href="#dialog-arguments'-origin">dialog arguments'
+  <a href=#effective-script-origin>effective script origin</a> is the <a href=#same-origin title="same origin">same</a> as the <a href="#dialog-arguments'-origin">dialog arguments'
   origin</a>. If it is, then the browsing context's <a href=#dialog-arguments>dialog arguments</a> must be
   returned unchanged. Otherwise, the IDL attribute must return <i>undefined</i>.</p>
 
-  <p>These browsing contexts also have an associated <dfn id=return-value>return value</dfn>. The <a href=#return-value>return
-  value</a> of a browsing context must be initialized to the empty string when the browsing
-  context is created.</p>
+  <p>These browsing contexts also have an associated <dfn id=return-value>return value</dfn> and <dfn id=return-value-origin>return value
+  origin</dfn>. As with the previous two values, these values are set by the <code title=dom-showModalDialog><a href=#dom-showmodaldialog>showModalDialog()</a></code> method in the algorithm above, when the
+  browsing context is created.</p>
 
   <p>The <dfn id=dom-windowmodal-returnvalue title=dom-WindowModal-returnValue><code>returnValue</code></dfn> IDL attribute, on
-  getting, must return the <a href=#return-value>return value</a> of its browsing context, and on setting, must
-  set the <a href=#return-value>return value</a> to the given new value.</p>
+  getting, must check whether its browsing context's <a href=#active-document>active document</a>'s <a href=#effective-script-origin>effective
+  script origin</a> is the <a href=#same-origin title="same origin">same</a> as the current <a href=#return-value-origin>return
+  value origin</a>. If it is, then the browsing context's <a href=#return-value>return value</a> must be
+  returned unchanged. Otherwise, the IDL attribute must return <i>undefined</i>. On setting, the
+  attribute must set the <a href=#return-value>return value</a> to the given new value, and the <a href=#return-value-origin>return
+  value origin</a> to the browsing context's <a href=#active-document>active document</a>'s <a href=#effective-script-origin>effective
+  script origin</a>.</p>
 
   </div>
 

Modified: source
===================================================================
--- source	2013-07-01 23:43:32 UTC (rev 8007)
+++ source	2013-07-02 19:22:24 UTC (rev 8008)
@@ -82514,7 +82514,7 @@
    <li>
 
     <p>Let the <span>dialog arguments</span> of the new browsing context be set to the value of <var
-    title="">argument</var>, or the 'undefined' value if the argument was omitted.</p>
+    title="">argument</var>, or the <i>undefined</i> value if the argument was omitted.</p>
 
    </li>
 
@@ -82526,6 +82526,18 @@
 
    <li>
 
+    <p>Let the <span>return value</span> of the new browsing context be the <i>undefined</i> value.</p>
+
+   </li>
+
+   <li>
+
+    <p>Let the <span>return value origin</span> be <var title="">incumbent origin</var>.</p>
+
+   </li>
+
+   <li>
+
     <p><span>Navigate</span><!--DONAV showModalDialog--> the new <span>browsing context</span> to
     the <span>absolute URL</span> that resulted from <span title="resolve a url">resolving</span>
     <var title="">url</var> earlier, with <span>replacement enabled</span>, and with the <span
@@ -82552,10 +82564,10 @@
 
    <li>
 
-    <p>If the <span>effective script origin</span> of the <span>auxiliary browsing context</span>'s
-    <span>active document</span> at the time the browsing context was <span title="close a browsing
-    context">closed</span> was the <span>same origin</span> as the <span>dialog arguments'
-    origin</span>, then let <var title="">return value</var> be the <span>auxiliary browsing
+    <p>If the <span>auxiliary browsing context</span>'s <span>return value origin</span> at
+    the time the browsing context was <span title="close a browsing
+    context">closed</span> was the <span title="same origin">same</span> as <var title="">incumbent origin</var>,
+    then let <var title="">return value</var> be the <span>auxiliary browsing
     context</span>'s <span>return value</span> as it stood when the browsing context was <span
     title="close a browsing context">closed</span>.</p>
 
@@ -82620,17 +82632,23 @@
 
   <p>The <dfn title="dom-WindowModal-dialogArguments"><code>dialogArguments</code></dfn> IDL
   attribute, on getting, must check whether its browsing context's <span>active document</span>'s
-  <span>origin</span> is the <span title="same origin">same</span> as the <span>dialog arguments'
+  <span>effective script origin</span> is the <span title="same origin">same</span> as the <span>dialog arguments'
   origin</span>. If it is, then the browsing context's <span>dialog arguments</span> must be
   returned unchanged. Otherwise, the IDL attribute must return <i>undefined</i>.</p>
 
-  <p>These browsing contexts also have an associated <dfn>return value</dfn>. The <span>return
-  value</span> of a browsing context must be initialized to the empty string when the browsing
-  context is created.</p>
+  <p>These browsing contexts also have an associated <dfn>return value</dfn> and <dfn>return value
+  origin</dfn>. As with the previous two values, these values are set by the <code
+  title="dom-showModalDialog">showModalDialog()</code> method in the algorithm above, when the
+  browsing context is created.</p>
 
   <p>The <dfn title="dom-WindowModal-returnValue"><code>returnValue</code></dfn> IDL attribute, on
-  getting, must return the <span>return value</span> of its browsing context, and on setting, must
-  set the <span>return value</span> to the given new value.</p>
+  getting, must check whether its browsing context's <span>active document</span>'s <span>effective
+  script origin</span> is the <span title="same origin">same</span> as the current <span>return
+  value origin</span>. If it is, then the browsing context's <span>return value</span> must be
+  returned unchanged. Otherwise, the IDL attribute must return <i>undefined</i>. On setting, the
+  attribute must set the <span>return value</span> to the given new value, and the <span>return
+  value origin</span> to the browsing context's <span>active document</span>'s <span>effective
+  script origin</span>.</p>
 
   </div>
 




More information about the Commit-Watchers mailing list