@@ -87199,15 +87199,16 @@ interface <dfn>NavigatorOnLine</dfn> {
87199
87199
87200
87200
<dt><dfn data-x="concept-current-everything">Current</dfn></dt>
87201
87201
<dd>This corresponds to the currently-running function object, including built-in user-agent
87202
- functions which might not be implemented as JavaScript. (It is derived from the <span>current
87203
- JavaScript realm</span>.)</dd>
87202
+ functions which might not be implemented as JavaScript. (It is derived from the <span
87203
+ data-x="current Realm Record">current JavaScript realm</span>.)</dd>
87204
87204
87205
87205
<dt><dfn data-x="concept-relevant-everything">Relevant</dfn></dt>
87206
87206
<dd>Every <span>platform object</span> has a <span data-x="concept-relevant-realm">relevant
87207
- Realm</span>. When writing algorithms, the most prominent <span>platform object</span> whose
87208
- <span data-x="concept-relevant-realm">relevant Realm</span> might be important is the
87209
- <b>this</b> value of the currently-running function object. In some cases, there can be other
87210
- important <span data-x="concept-relevant-realm">relevant Realms</span>, such as those of any
87207
+ Realm</span>, which is roughly the <span>JavaScript realm</span> in which it was created. When
87208
+ writing algorithms, the most prominent <span>platform object</span> whose <span
87209
+ data-x="concept-relevant-realm">relevant Realm</span> might be important is the <b>this</b>
87210
+ value of the currently-running function object. In some cases, there can be other important
87211
+ <span data-x="concept-relevant-realm">relevant Realms</span>, such as those of any
87211
87212
arguments.</dd>
87212
87213
</dl>
87213
87214
@@ -87271,31 +87272,33 @@ interface <dfn>NavigatorOnLine</dfn> {
87271
87272
87272
87273
<p class="warning">The <span data-x="concept-incumbent-everything">incumbent</span> and <span
87273
87274
data-x="concept-entry-everything">entry</span> concepts should not be used by new specifications,
87274
- and we are considering whether we can remove almost all existing uses. See <a
87275
- href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=26603">Bugzilla bug 26603</a> for <span
87275
+ as they are excessively complicated and unintuitive to work with. We are working to remove almost
87276
+ all existing uses from the platform: see <a
87277
+ href="https://github.com/whatwg/html/issues/1430">issue #1430</a> for <span
87276
87278
data-x="concept-incumbent-everything">incumbent</span>, and <a
87277
- href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=27203">Bugzilla bug 27203 </a> for <span
87279
+ href="https://github.com/whatwg/html/issues/1431">issue #1431 </a> for <span
87278
87280
data-x="concept-entry-everything">entry</span>.</p>
87279
87281
87280
- <p class="note">Currently, the <span data-x="concept-incumbent-everything">incumbent</span>
87281
- concept is used in some security checks, and the <span
87282
- data-x="concept-entry-everything">entry</span> concept is sometimes used to obtain, amongst other
87283
- things, the <span>API base URL</span> to <span data-x="parse a url">parse a URL</span>, used in
87284
- scripts running in that <span>unit of related similar-origin browsing contexts</span>.</p>
87282
+ <p>In general, web platform specifications should use the <span
87283
+ data-x="concept-relevant-everything">relevant</span> concept, applied to the object being operated
87284
+ on (usually the <b>this</b> value of the current method). This mismatches the JavaScript
87285
+ specification, where <span data-x="concept-current-everything">current</span> is generally used as
87286
+ the default (e.g. in determining the <span>JavaScript realm</span> whose <code
87287
+ data-x="">Array</code> constructor should be used to construct the result in <code
87288
+ data-x="">Array.prototype.map</code>). But this inconsistency is so embedded in the platform that
87289
+ we have to accept it going forward.</p>
87285
87290
87286
- <p>In general, the <span data-x="concept-current-everything">current</span> concept is what should
87287
- be used by specifications going forward. There is an important exception, however. If an algorithm
87288
- is creating an object that is to be persisted and returned multiple times (instead of simply
87289
- returned to author code right away, and never vended again), it should use the <span
87290
- data-x="concept-relevant-everything">relevant</span> concept with regard to the object on which
87291
- the method in question is being executed. This prevents cross-realm calls from causing an object
87292
- to store objects created in the "wrong" realm.</p>
87291
+ <p>Note that in constructors, where there is no <b>this</b> value yet, the <span
87292
+ data-x="concept-current-everything">current</span> concept is the appropriate default.</p>
87293
87293
87294
87294
<div class="example">
87295
- <p>The <code data-x="dom-navigator-getBattery">navigator.getBattery()</code> method creates
87296
- promises in the <span data-x="concept-relevant-realm">relevant Realm</span> for the
87297
- <code>Navigator</code> object on which it is invoked. This has the following impact: <ref
87298
- spec=BATTERY>
87295
+ <p>One reason why the <span data-x="concept-relevant-everything">relevant</span> concept is
87296
+ generally a better default choice than the <span
87297
+ data-x="concept-current-everything">current</span> concept is that it is more suitable for
87298
+ creating an object that is to be persisted and returned multiple times. For example, the <code
87299
+ data-x="dom-navigator-getBattery">navigator.getBattery()</code> method creates promises in the
87300
+ <span data-x="concept-relevant-realm">relevant Realm</span> for the <code>Navigator</code> object
87301
+ on which it is invoked. This has the following impact: <ref spec=BATTERY>
87299
87302
87300
87303
<pre><!-- outer.html -->
87301
87304
<!DOCTYPE html>
0 commit comments