Skip to content

Commit 0e72db8

Browse files
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 4775fcb commit 0e72db8

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
@@ -412,6 +412,17 @@ steps:
412412
</ol>
413413
</div>
414414

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

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

6405+
<li><p>If <var>request</var>'s <a for=request>client</a> <a>is offline</a>, then return a
6406+
<a>network error</a>.
6407+
63946408
<li><p>Let <var>response</var> be null.
63956409

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

0 commit comments

Comments
 (0)