Skip to content

Commit 8decfba

Browse files
sadym-chromiumpmeenan
authored andcommitted
Introduce "is offline" algorithm and use it
This is needed for WebDriver BiDi emulated network offline and allows navigator.onLine to build upon the same primitive. Tests: web-platform-tests/wpt#55300. HTML PR: whatwg/html#11575.
1 parent f4d1f15 commit 8decfba

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

fetch.bs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,17 @@ steps:
415415
</ol>
416416
</div>
417417

418+
<div algorithm>
419+
<p>To check if the <a>environment settings object</a> <var>environment</var>
420+
<dfn export>is offline</dfn>:
421+
422+
<ul>
423+
<li><p>If the user agent assumes it does not have internet connectivity, then return true.
424+
425+
<li><p>Return <var>environment</var>'s <a>WebDriver BiDi network is offline</a>.
426+
</ul>
427+
</div>
428+
418429
<hr>
419430

420431
<p>To <dfn>serialize an integer</dfn>, represent it as a string of the shortest possible decimal
@@ -6526,6 +6537,9 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
65266537
<ol>
65276538
<li><p>Let <var>request</var> be <var>fetchParams</var>'s <a for="fetch params">request</a>.
65286539

6540+
<li><p>If <var>request</var>'s <a for=request>client</a> <a>is offline</a>, then return a
6541+
<a>network error</a>.
6542+
65296543
<li><p>Let <var>response</var> be null.
65306544

65316545
<li><p>Let <var>timingInfo</var> be <var>fetchParams</var>'s <a for="fetch params">timing info</a>.

0 commit comments

Comments
 (0)