Skip to content

Commit 0829d7b

Browse files
author
Raphael Kubo da Costa
committed
Fix broken references to WebDriver definitions.
We were hardcoding some dfn URLs `anchors` section that have changed in the WebDriver spec, resulting in broken links. Several of those actually became exported definitions in w3c/webdriver#1639, so we can simply rely on Bikeshed autolinking working for them. In these cases, remove the hardcoded dfns and adjust the wording in the spec (e.g. "WebDriver error" -> "error"). Additionally, use the "WebDriver-2" shortname to refer to the spec, as it points to the current version which includes the exported definitions that we need. Finally, also adapt to w3c/webdriver#1345 which renamed the "Handling Errors" section to "Errors". Fixes w3c#443.
1 parent 39ae75f commit 0829d7b

File tree

1 file changed

+24
-39
lines changed

1 file changed

+24
-39
lines changed

index.bs

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,12 @@ urlPrefix: https://html.spec.whatwg.org/multipage/; spec: HTML
4949
urlPrefix: https://w3ctag.github.io/security-questionnaire/; spec: SECURITY-PRIVACY-QUESTIONNAIRE
5050
type: dfn
5151
text: same-origin policy violations; url: sop-violations
52-
urlPrefix: https://w3c.github.io/webdriver/; spec: WebDriver
52+
urlPrefix: https://w3c.github.io/webdriver/; spec: WEBDRIVER2
5353
type: dfn
5454
text: current browsing context; url: dfn-current-browsing-context
55-
text: WebDriver error; url: dfn-errors
5655
text: WebDriver error code; url: dfn-error-code
57-
text: extension commands; url: dfn-extension-command
58-
text: remote end steps; url: dfn-remote-end-steps
59-
text: extension command URI template; url: dfn-extension-command-uri-template
60-
text: invalid argument; url: dfn-invalid-argument
6156
text: local end; url: dfn-local-ends
6257
text: url variable; url: dfn-url-variables
63-
text: session; url: dfn-sessions
64-
text: success; url: dfn-success
65-
text: handling errors
6658
text: Object; url: dfn-object
6759
text: no longer open; url: dfn-no-longer-open
6860
text: no such window; url: dfn-no-such-window
@@ -97,6 +89,7 @@ urlPrefix: https://w3c.github.io/proximity; spec: PROXIMITY
9789
spec: webidl; type:dfn; text:attribute
9890
spec: webidl; type:dfn; text:dictionary member
9991
spec: webidl; type:dfn; text:identifier
92+
spec: webdriver-2; type:dfn; text:error
10093
</pre>
10194

10295
<pre class=biblio>
@@ -1572,7 +1565,7 @@ to {{SensorErrorEventInit}}.
15721565
The Generic Sensor API and its [=extension specifications=] pose a challenge
15731566
to test authors, as fully exercising those interfaces requires physical hardware
15741567
devices that respond in predictable ways. To address this challenge this document
1575-
defines a number of [=extension commands=] to the [[WebDriver]] specification
1568+
defines a number of [=extension commands=] to the [[WEBDRIVER2]] specification
15761569
for controlling [=mock sensor=] on the host that the user agent is running on.
15771570
With these [=extension commands=], devices with particular properties can be created
15781571
and their responses to requests are well defined.
@@ -1754,14 +1747,12 @@ Each [=mock sensor type=] has a [=mock sensor reading values=] dictionary:
17541747

17551748
The [=remote end steps=] are:
17561749
1. Let |configuration| be the |configuration| parameter, [=converted to an IDL value=]
1757-
of type {{MockSensorConfiguration}}. If this throws an exception, return a
1758-
[=WebDriver error=] with [=WebDriver error code=] [=invalid argument=].
1750+
of type {{MockSensorConfiguration}}. If this throws an exception, return an
1751+
[=invalid argument=] [=error=].
17591752
1. Let |type| be the |configuration|.{{MockSensorConfiguration/mockSensorType}}. If the [=current browsing context=]
1760-
already has this |type| of [=mock sensor=], return a [=WebDriver error=] with [=WebDriver error code=]
1761-
[=mock sensor already created=].
1762-
1. If the [=current browsing context=] is [=no longer open=], return a [=WebDriver error=] with
1763-
[=WebDriver error code=] [=no such window=].
1764-
1. [=Handle any user prompts=], and return its value if it is a [=WebDriver error=].
1753+
already has this |type| of [=mock sensor=], return a [=mock sensor already created=] [=error=].
1754+
1. If the [=current browsing context=] is [=no longer open=], return a [=no such window=] [=error=].
1755+
1. [=Handle any user prompts=], and return its value if it is an [=error=].
17651756
1. Run these sub-steps [=in parallel=] to create a [=mock sensor=] in the [=current browsing context=]:
17661757
1. Let |mock| be a new [=mock sensor=].
17671758
1. Set |mock|'s [=mock sensor type=] to |type|.
@@ -1786,7 +1777,7 @@ Each [=mock sensor type=] has a [=mock sensor reading values=] dictionary:
17861777
}
17871778
</pre>
17881779
Be aware that only one [=mock sensor=] of a given [=mock sensor type=] can be created in [=current browsing context=],
1789-
otherwise a [=WebDriver error=] with [=WebDriver error code=] [=mock sensor already created=] will be thrown.
1780+
otherwise a [=mock sensor already created=] [=error=] will be thrown.
17901781
</div>
17911782

17921783
### Get mock sensor ### {#get-mock-sensor-command}
@@ -1811,13 +1802,11 @@ Each [=mock sensor type=] has a [=mock sensor reading values=] dictionary:
18111802

18121803
The [=remote end steps=] are:
18131804
1. Let |type| be a [=url variable=], [=converted to an IDL value=] of type {{MockSensorType}}.
1814-
If this throws an exception, return a [=WebDriver error=] with [=WebDriver error code=]
1815-
[=invalid argument=].
1816-
1. If the [=current browsing context=] is [=no longer open=], return a [=WebDriver error=] with
1817-
[=WebDriver error code=] [=no such window=].
1818-
1. [=Handle any user prompts=], and return its value if it is a [=WebDriver error=].
1805+
If this throws an exception, return an [=invalid argument=] [=error=].
1806+
1. If the [=current browsing context=] is [=no longer open=], return a [=no such window=] [=error=].
1807+
1. [=Handle any user prompts=], and return its value if it is an [=error=].
18191808
1. If |type| does not match a [=mock sensor type=] amongst all associated [=mock sensors=] of the
1820-
[=current browsing context=], return a [=WebDriver error=] with [=WebDriver error code=] [=no such mock sensor=].
1809+
[=current browsing context=], return a [=no such mock sensor=] [=error=].
18211810
1. Return [=success=] with the [=serialized mock sensor=] as data.
18221811
</div>
18231812

@@ -1843,16 +1832,14 @@ Each [=mock sensor type=] has a [=mock sensor reading values=] dictionary:
18431832

18441833
The [=remote end steps=] are:
18451834
1. Let |type| be a [=url variable=], [=converted to an IDL value=] of type {{MockSensorType}}.
1846-
If this throws an exception, return a [=WebDriver error=] with [=WebDriver error code=]
1847-
[=invalid argument=].
1848-
1. If the [=current browsing context=] is [=no longer open=], return a [=WebDriver error=] with
1849-
[=WebDriver error code=] [=no such window=].
1850-
1. [=Handle any user prompts=], and return its value if it is a [=WebDriver error=].
1835+
If this throws an exception, return an [=invalid argument=] [=error=].
1836+
1. If the [=current browsing context=] is [=no longer open=], return a [=no such window=] [=error=].
1837+
1. [=Handle any user prompts=], and return its value if it is an [=error=].
18511838
1. If |type| does not match a [=mock sensor type=] amongst all associated [=mock sensors=] of the
1852-
[=current browsing context=], return a [=WebDriver error=] with [=WebDriver error code=] [=no such mock sensor=].
1839+
[=current browsing context=], return a [=no such mock sensor=] [=error=].
18531840
1. Let |reading| be the |reading| argument, [=converted to an IDL value=] of the |type|'s
1854-
associated {{MockSensorReadingValues}}. If this throws an exception, return a
1855-
[=WebDriver error=] with [=WebDriver error code=] [=invalid argument=].
1841+
associated {{MockSensorReadingValues}}. If this throws an exception, return an
1842+
[=invalid argument=] [=error=].
18561843
1. [=map/For each=] |key| → <var ignore>value</var> of |reading|.
18571844
1. [=map/Set=] [=mock sensor reading=][|key|] to the corresponding value of |reading|.
18581845
1. Return [=success=] with data `null`.
@@ -1880,20 +1867,18 @@ Each [=mock sensor type=] has a [=mock sensor reading values=] dictionary:
18801867

18811868
The [=remote end steps=] are:
18821869
1. Let |type| be a [=url variable=].
1883-
1. If {{MockSensorType}} [=set/contains|does not contain=] |type|, return a [=WebDriver error=] with
1884-
[=WebDriver error code=] [=invalid argument=].
1885-
1. If the [=current browsing context=] is [=no longer open=], return a [=WebDriver error=] with
1886-
[=WebDriver error code=] [=no such window=].
1887-
1. [=Handle any user prompts=], and return its value if it is a [=WebDriver error=].
1870+
1. If {{MockSensorType}} [=set/contains|does not contain=] |type|, return an [=invalid argument=] [=error=].
1871+
1. If the [=current browsing context=] is [=no longer open=], return a [=no such window=] [=error=].
1872+
1. [=Handle any user prompts=], and return its value if it is an [=error=].
18881873
1. If |type| does not match a [=mock sensor type=] amongst all associated [=mock sensors=] of the
1889-
[=current browsing context=], return a [=WebDriver error=] with [=WebDriver error code=] [=no such mock sensor=].
1874+
[=current browsing context=], return a [=no such mock sensor=] [=error=].
18901875
1. Delete |type| of [=mock sensor=] in [=current browsing context=].
18911876
1. Return [=success=] with data `null`.
18921877
</div>
18931878

18941879
<h3 id="extension-handling-errors">Handling errors</h3>
18951880

1896-
This section extends the [=Handling Errors=] and defines extended [=WebDriver error codes=]
1881+
This section extends the [[WEBDRIVER2#errors]] section and defines extended [=WebDriver error codes=]
18971882
specific for [=mock sensor=] in following table.
18981883

18991884
<table id="mock-sensor-error-code" class="def">

0 commit comments

Comments
 (0)