@@ -93595,6 +93595,8 @@ dictionary <dfn>EventSourceInit</dfn> {
93595
93595
boolean <dfn data-x="dom-EventSourceInit-withCredentials">withCredentials</dfn> = false;
93596
93596
};</pre>
93597
93597
93598
+ <div w-nodev>
93599
+
93598
93600
<p>Each <code>EventSource</code> object has the following associated with it:</p>
93599
93601
93600
93602
<ul>
@@ -93615,6 +93617,58 @@ dictionary <dfn>EventSourceInit</dfn> {
93615
93617
<p>Apart from <span data-x="concept-EventSource-url">url</span> these are not currently exposed on
93616
93618
the <code>EventSource</code> object.</p>
93617
93619
93620
+ </div>
93621
+
93622
+ <dl class="domintro">
93623
+
93624
+ <dt><var>source</var> = new <code subdfn data-x="dom-EventSource">EventSource</code>(
93625
+ <var>url</var> [, { <code data-x="dom-EventSourceInit-withCredentials">withCredentials</code>:
93626
+ true } ])</dt>
93627
+ <dd>
93628
+ <p>Creates a new <code>EventSource</code> object.</p>
93629
+
93630
+ <p><var>url</var> is a string giving the <span>URL</span> that will provide the event
93631
+ stream.</p>
93632
+
93633
+ <p>Setting <code data-x="dom-EventSourceInit-withCredentials">withCredentials</code> to true
93634
+ will set the <span data-x="concept-request-credentials-mode">credentials mode</span>
93635
+ for connection requests to <var>url</var> to "<code data-x="">include</code>".</p>
93636
+ </dd>
93637
+
93638
+ <dt><var>socket</var> . <code subdfn data-x="dom-EventSource-close">close</code>()</dt>
93639
+
93640
+ <dd>
93641
+ <p>Aborts any instances of the <span data-x="concept-fetch">fetch</span> algorithm started for
93642
+ this <code>EventSource</code> object, and sets the <code
93643
+ data-x="dom-EventSource-readyState">readyState</code> attribute to <code
93644
+ data-x="dom-EventSource-CLOSED">CLOSED</code>.</p>
93645
+ </dd>
93646
+
93647
+ <dt><var>source</var> . <code subdfn data-x="dom-EventSource-url">url</code></dt>
93648
+
93649
+ <dd>
93650
+ <p>Returns the <span data-x="concept-EventSource-url">URL providing the event stream</span>.
93651
+ </dd>
93652
+
93653
+ <dt><var>source</var> . <code subdfn data-x="dom-EventSource-withCredentials">withCredentials</code></dt>
93654
+
93655
+ <dd>
93656
+ <p>Returns true if the <span data-x="concept-request-credentials-mode">credentials mode</span>
93657
+ for connection requests to the <span data-x="concept-EventSource-url">URL providing the
93658
+ event stream</span> is set to "<code data-x="">include</code>", and false otherwise.</p>
93659
+ </dd>
93660
+
93661
+ <dt><var>socket</var> . <code subdfn data-x="dom-EventSource-readyState">readyState</code></dt>
93662
+
93663
+ <dd>
93664
+ <p>Returns the state of this <code>EventSource</code> object's connection. It can have the
93665
+ values described below.</p>
93666
+ </dd>
93667
+
93668
+ </dl>
93669
+
93670
+ <div w-nodev>
93671
+
93618
93672
<p>The <dfn><code data-x="dom-EventSource">EventSource(<var>url</var>,
93619
93673
<var>eventSourceInitDict</var>)</code></dfn> constructor, when invoked, must run these steps:</p>
93620
93674
@@ -93679,6 +93733,8 @@ dictionary <dfn>EventSourceInit</dfn> {
93679
93733
<p>The <dfn><code data-x="dom-EventSource-readyState">readyState</code></dfn> attribute represents
93680
93734
the state of the connection. It can have the following values:</p>
93681
93735
93736
+ </div>
93737
+
93682
93738
<dl>
93683
93739
93684
93740
<dt><dfn><code data-x="dom-EventSource-CONNECTING">CONNECTING</code></dfn> (numeric value 0)</dt>
@@ -93697,6 +93753,8 @@ dictionary <dfn>EventSourceInit</dfn> {
93697
93753
93698
93754
</dl>
93699
93755
93756
+ <div w-nodev>
93757
+
93700
93758
<p>When the object is created its <code data-x="dom-EventSource-readyState">readyState</code> must
93701
93759
be set to <code data-x="dom-EventSource-CONNECTING">CONNECTING</code> (0). The rules given below
93702
93760
for handling the connection define when the value changes.</p>
@@ -93708,6 +93766,8 @@ dictionary <dfn>EventSourceInit</dfn> {
93708
93766
data-x="dom-EventSource-CLOSED">CLOSED</code>.</p> <!-- this also causes all the message events to
93709
93767
stop firing, even if they were queued before close() was called -->
93710
93768
93769
+ </div>
93770
+
93711
93771
<p>The following are the <span>event handlers</span> (and their corresponding <span data-x="event
93712
93772
handler event type">event handler event types</span>) <span w-nodev>that must be</span> supported,
93713
93773
as <span>event handler IDL attributes</span>, by all objects implementing the
@@ -93724,6 +93784,7 @@ dictionary <dfn>EventSourceInit</dfn> {
93724
93784
93725
93785
<hr>
93726
93786
93787
+ <div w-nodev>
93727
93788
93728
93789
<h4 id="sse-processing-model"><span id="processing-model-9"></span>Processing model</h4>
93729
93790
@@ -93863,8 +93924,12 @@ dictionary <dfn>EventSourceInit</dfn> {
93863
93924
data-x="queue a task">queued</span> by <code>EventSource</code> objects is the <dfn>remote event
93864
93925
task source</dfn>.</p>
93865
93926
93927
+ </div>
93928
+
93929
+
93930
+ <h4 w-nodev>Parsing an event stream</h4>
93866
93931
93867
- <h4>Parsing an event stream</h4>
93932
+ <h4 w-nohtml>The event stream format </h4>
93868
93933
93869
93934
<p>This event stream format's <span>MIME type</span> is <code>text/event-stream</code>.</p>
93870
93935
@@ -93894,13 +93959,15 @@ any-char = %x0000-0009 / %x000B-000C / %x000E-10FFFF
93894
93959
pair, a single U+000A LINE FEED (LF) character, or a single U+000D CARRIAGE RETURN (CR)
93895
93960
character.</p>
93896
93961
93897
- <p>Since connections established to remote servers for such resources are expected to be
93962
+ <p w-nodev >Since connections established to remote servers for such resources are expected to be
93898
93963
long-lived, UAs should ensure that appropriate buffering is used. In particular, while line
93899
93964
buffering with lines are defined to end with a single U+000A LINE FEED (LF) character is safe,
93900
93965
block buffering or line buffering with different expected line endings can cause delays in event
93901
93966
dispatch.</p>
93902
93967
93903
93968
93969
+ <div w-nodev>
93970
+
93904
93971
<h4 id="event-stream-interpretation">Interpreting an event stream</h4>
93905
93972
93906
93973
<p>Streams must be decoded using the <span>UTF-8 decode</span> algorithm.</p>
@@ -94084,6 +94151,8 @@ any-char = %x0000-0009 / %x000B-000C / %x000E-10FFFF
94084
94151
<p>For other user agents, the appropriate steps to <span>dispatch the event</span> are
94085
94152
implementation dependent, but at a minimum they must set the <var>data</var> and <var>event type</var> buffers to the empty string before returning.</p>
94086
94153
94154
+ </div>
94155
+
94087
94156
<div class="example">
94088
94157
94089
94158
<p>The following event stream, once followed by a blank line:</p>
@@ -94169,7 +94238,7 @@ data: test
94169
94238
</div>
94170
94239
94171
94240
94172
- <H4 >Authoring notes</h4>
94241
+ <h4 >Authoring notes</h4>
94173
94242
94174
94243
<p>Legacy proxy servers are known to, in certain cases, drop HTTP connections after a short
94175
94244
timeout. To protect against such proxy servers, authors can include a comment line (one starting
@@ -94194,6 +94263,7 @@ data: test
94194
94263
functionality on a per-page basis, or by sharing a single <code>EventSource</code> object using a
94195
94264
<span data-x="SharedWorkerGlobalScope">shared worker</span>.</p>
94196
94265
94266
+ <div w-nodev>
94197
94267
94198
94268
<h4 id="eventsource-push">Connectionless push and other features</h4>
94199
94269
@@ -94303,6 +94373,8 @@ data: test
94303
94373
consoles whenever an <code data-x="event-error">error</code> event is fired, since little to no
94304
94374
information can be made available in the events themselves.</p>
94305
94375
94376
+ </div>
94377
+
94306
94378
94307
94379
<h3 split-filename="web-sockets" id="network"><dfn>Web sockets</dfn></h3>
94308
94380
0 commit comments