Skip to content

Commit

Permalink
Do not compute accessible role and name for non-Element nodes in the …
Browse files Browse the repository at this point in the history
…accessibility locator (#702)

SHA: e74d46a
Reason: push, by OrKoN

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
OrKoN and github-actions[bot] committed May 7, 2024
1 parent 2a15afd commit 948c48f
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link href="https://www.w3.org/StyleSheets/TR/2021/W3C-ED" rel="stylesheet">
<meta content="Bikeshed version 82ce88815, updated Thu Sep 7 16:33:55 2023 -0700" name="generator">
<link href="https://w3c.github.io/webdriver-bidi/" rel="canonical">
<meta content="f3f93f5e9f073e1714212e3b6b8ac1b0e38e1cab" name="document-revision">
<meta content="e74d46a20308bc2ba1bdb415703e559ff7c98ade" name="document-revision">
<style>
var {
color: #cd5c5c
Expand Down Expand Up @@ -567,7 +567,7 @@
<div class="head">
<p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2021/logos/W3C" width="72"> </a> </p>
<h1 class="p-name no-ref" id="title">WebDriver BiDi</h1>
<p id="w3c-state"><a href="https://www.w3.org/standards/types#ED">Editor’s Draft</a>, <time class="dt-updated" datetime="2024-04-23">23 April 2024</time></p>
<p id="w3c-state"><a href="https://www.w3.org/standards/types#ED">Editor’s Draft</a>, <time class="dt-updated" datetime="2024-05-07">7 May 2024</time></p>
<details open>
<summary>More details about this document</summary>
<div data-fill-with="spec-metadata">
Expand Down Expand Up @@ -3542,29 +3542,35 @@ <h5 class="heading settled" data-level="7.3.3.7" id="command-browsingContext-loc
<li data-md>
<p>Let <var>match</var> be true.</p>
<li data-md>
<p>If <var>selector</var> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists③">contains</a> "<code>role</code>":</p>
<p>If <var>context node</var> implements <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element" id="ref-for-element②">Element</a></code>:</p>
<ol>
<li data-md>
<p>Let <var>role</var> be the <a data-link-type="dfn" href="https://www.w3.org/TR/core-aam-1.2/#roleMappingComputedRole" id="ref-for-roleMappingComputedRole">computed role</a> of <var>context node</var>.</p>
<li data-md>
<p>If <var>selector</var>["<code>role</code>"] <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string-is" id="ref-for-string-is①">is not</a> <var>role</var>:</p>
<p>If <var>selector</var> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists③">contains</a> "<code>role</code>":</p>
<ol>
<li data-md>
<p>Set <var>match</var> to false.</p>
<p>Let <var>role</var> be the <a data-link-type="dfn" href="https://www.w3.org/TR/core-aam-1.2/#roleMappingComputedRole" id="ref-for-roleMappingComputedRole">computed role</a> of <var>context node</var>.</p>
<li data-md>
<p>If <var>selector</var>["<code>role</code>"] <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string-is" id="ref-for-string-is①">is not</a> <var>role</var>:</p>
<ol>
<li data-md>
<p>Set <var>match</var> to false.</p>
</ol>
</ol>
</ol>
<li data-md>
<p>If <var>selector</var> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists④">contains</a> "<code>name</code>":</p>
<ol>
<li data-md>
<p>Let <var>name</var> be the <a data-link-type="dfn" href="https://www.w3.org/TR/accname-1.2/#dfn-accessible-name" id="ref-for-dfn-accessible-name">accessible name</a> of <var>context node</var>.</p>
<li data-md>
<p>If <var>selector</var>["<code>name</code>"] <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string-is" id="ref-for-string-is②">is not</a> <var>name</var>:</p>
<p>If <var>selector</var> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists④">contains</a> "<code>name</code>":</p>
<ol>
<li data-md>
<p>Set <var>match</var> to false.</p>
<p>Let <var>name</var> be the <a data-link-type="dfn" href="https://www.w3.org/TR/accname-1.2/#dfn-accessible-name" id="ref-for-dfn-accessible-name">accessible name</a> of <var>context node</var>.</p>
<li data-md>
<p>If <var>selector</var>["<code>name</code>"] <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string-is" id="ref-for-string-is②">is not</a> <var>name</var>:</p>
<ol>
<li data-md>
<p>Set <var>match</var> to false.</p>
</ol>
</ol>
</ol>
<li data-md>
<p>Otherwise, set <var>match</var> to false.</p>
<li data-md>
<p>If <var>match</var> is true:</p>
<ol>
Expand All @@ -3578,7 +3584,7 @@ <h5 class="heading settled" data-level="7.3.3.7" id="command-browsingContext-loc
<p>Let <var>child nodes</var> be an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①⓪">list</a> and, for each node <var>child</var> in the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-tree-child" id="ref-for-concept-tree-child①">children</a> of <var>context node</var>:</p>
<ol>
<li data-md>
<p>If <var>child</var> implements <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element" id="ref-for-element">Element</a></code>, <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append⑦">append</a> <var>child</var> to <var>child nodes</var>.</p>
<p>If <var>child</var> implements <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element" id="ref-for-element">Element</a></code>, <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append⑦">append</a> <var>child</var> to <var>child nodes</var>.</p>
</ol>
<li data-md>
<p><a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-try" id="ref-for-dfn-try①⑤">Try</a> to <a data-link-type="dfn" href="#collect-nodes-using-accessibility-attributes" id="ref-for-collect-nodes-using-accessibility-attributes">collect nodes using accessibility attributes</a> with <var>child nodes</var>, <var>selector</var>, <var>maximum returned node count</var>, and <var>returned nodes</var>.</p>
Expand Down Expand Up @@ -7857,7 +7863,7 @@ <h5 class="heading settled" data-level="7.5.3.14" id="type-script-RemoteValue"><
<li data-md>
<p>If <var>node value</var> is not null set <var>serialized</var>["<code>nodeValue</code>"] to <var>node value</var>.</p>
<li data-md>
<p>If <var>value</var> implements <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element" id="ref-for-element">Element</a></code> or <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#attr" id="ref-for-attr">Attr</a></code>:</p>
<p>If <var>value</var> implements <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element" id="ref-for-element">Element</a></code> or <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#attr" id="ref-for-attr">Attr</a></code>:</p>
<ol>
<li data-md>
<p>Set <var>serialized</var>["<code>localName</code>"] to <a data-link-type="dfn" href="https://tc39.es/ecma262/#sec-get" id="ref-for-sec-get④">Get</a>(<var>value</var>, "localName").</p>
Expand Down Expand Up @@ -7892,7 +7898,7 @@ <h5 class="heading settled" data-level="7.5.3.14" id="type-script-RemoteValue"><
<li data-md>
<p>If <var>children</var> is not null, set <var>serialized</var>["<code>children</code>"] to <var>children</var>.</p>
<li data-md>
<p>If <var>value</var> implements <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element" id="ref-for-element">Element</a></code>:</p>
<p>If <var>value</var> implements <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element" id="ref-for-element">Element</a></code>:</p>
<ol>
<li data-md>
<p>Let <var>attributes</var> be a new <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map⑨①">map</a>.</p>
Expand Down Expand Up @@ -9591,7 +9597,7 @@ <h4 class="heading settled" data-level="7.8.1" id="module-input-definition"><spa
</pre>
<h4 class="heading settled" data-level="7.8.2" id="module-input-types"><span class="secno">7.8.2. </span><span class="content">Types</span><a class="self-link" href="#module-input-types"></a></h4>
<h5 class="heading settled" data-level="7.8.2.1" id="type-input-origin"><span class="secno">7.8.2.1. </span><span class="content">input.ElementOrigin</span><a class="self-link" href="#type-input-origin"></a></h5>
<p>The <code>input.ElementOrigin</code> type represents an <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element" id="ref-for-element">Element</a></code> that will
<p>The <code>input.ElementOrigin</code> type represents an <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element" id="ref-for-element">Element</a></code> that will
be used as a coordinate origin.</p>
<pre class="cddl remote-cddl">input.ElementOrigin = {
type: "element",
Expand Down Expand Up @@ -9627,7 +9633,7 @@ <h5 class="heading settled" data-level="7.8.2.1" id="type-input-origin"><span cl
<li data-md>
<p>Let <var>element</var> be the result of <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-try" id="ref-for-dfn-try⑥③">trying</a> to <a data-link-type="dfn" href="#deserialize-remote-reference" id="ref-for-deserialize-remote-reference②">deserialize remote reference</a> with <var>reference</var>, <var>realm</var>, and <var>session</var>.</p>
<li data-md>
<p>If <var>element</var> doesn’t implement <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element" id="ref-for-element">Element</a></code> return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors⑧①">error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑦⑤">error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-no-such-element" id="ref-for-dfn-no-such-element②">no such element</a>.</p>
<p>If <var>element</var> doesn’t implement <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element" id="ref-for-element">Element</a></code> return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors⑧①">error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑦⑤">error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-no-such-element" id="ref-for-dfn-no-such-element②">no such element</a>.</p>
<li data-md>
<p>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-success" id="ref-for-dfn-success⑦⑦">success</a> with data <var>element</var>.</p>
</ol>
Expand Down Expand Up @@ -9878,7 +9884,7 @@ <h5 class="heading settled" data-level="7.8.3.3" id="command-input-setFiles"><sp
<li data-md>
<p>Let <var>element</var> be the result of <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-try" id="ref-for-dfn-try⑥⑨">trying</a> to <a data-link-type="dfn" href="#deserialize-remote-reference" id="ref-for-deserialize-remote-reference③">deserialize remote reference</a> with <var>command parameters</var>["<code>element</code>"], <var>realm</var>, and <var>session</var>.</p>
<li data-md>
<p>If <var>element</var> doesn’t implement <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element" id="ref-for-element">Element</a></code>, return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors⑧②">error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑦⑥">error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-no-such-element" id="ref-for-dfn-no-such-element③">no such element</a>.</p>
<p>If <var>element</var> doesn’t implement <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element" id="ref-for-element">Element</a></code>, return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors⑧②">error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑦⑥">error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-no-such-element" id="ref-for-dfn-no-such-element③">no such element</a>.</p>
<li data-md>
<p>If <var>element</var> doesn’t implement <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/input.html#htmlinputelement" id="ref-for-htmlinputelement">HTMLInputElement</a></code>, <var>element</var>’s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/input.html#attr-input-type" id="ref-for-attr-input-type">type</a></code> is not in the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/input.html#file-upload-state-(type=file)" id="ref-for-file-upload-state-(type=file)">File Upload state</a>, or <var>element</var> is <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-disabled" id="ref-for-concept-fe-disabled">disabled</a>,
return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors⑧③">error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑦⑦">error code</a> <a data-link-type="dfn" href="#errors-unable-to-set-file-input" id="ref-for-errors-unable-to-set-file-input">unable to set file input</a>.</p>
Expand Down Expand Up @@ -11224,7 +11230,7 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
window.dfnpanelData['7d9483c4'] = {"dfnID": "7d9483c4", "url": "https://drafts.csswg.org/cssom-view/#dom-visualviewport-pagetop", "dfnText": "visual viewport page top", "refSections": [{"refs": [{"id": "ref-for-dom-visualviewport-pagetop"}], "title": "7.3.3.2. The browsingContext.captureScreenshot Command"}], "external": true};
window.dfnpanelData['99573380'] = {"dfnID": "99573380", "url": "https://dom.spec.whatwg.org/#attr", "dfnText": "Attr", "refSections": [{"refs": [{"id": "ref-for-attr"}], "title": "7.5.3.14. The script.RemoteValue Type"}], "external": true};
window.dfnpanelData['85394472'] = {"dfnID": "85394472", "url": "https://dom.spec.whatwg.org/#document", "dfnText": "Document", "refSections": [{"refs": [{"id": "ref-for-document"}], "title": "7.3.2.2. The browsingContext.Info Type"}, {"refs": [{"id": "ref-for-document\u2460"}], "title": "8.1. HTML"}], "external": true};
window.dfnpanelData['296f3551'] = {"dfnID": "296f3551", "url": "https://dom.spec.whatwg.org/#element", "dfnText": "Element", "refSections": [{"refs": [{"id": "ref-for-element"}], "title": "7.3.3.2. The browsingContext.captureScreenshot Command"}, {"refs": [{"id": "ref-for-element\u2460"}, {"id": "ref-for-element\u2461"}], "title": "7.3.3.7. The browsingContext.locateNodes Command"}, {"refs": [{"id": "ref-for-element\u2462"}, {"id": "ref-for-element\u2463"}], "title": "7.5.3.14. The script.RemoteValue Type"}, {"refs": [{"id": "ref-for-element\u2464"}, {"id": "ref-for-element\u2465"}], "title": "7.8.2.1. input.ElementOrigin"}, {"refs": [{"id": "ref-for-element\u2466"}], "title": "7.8.3.3. The input.setFiles Command"}], "external": true};
window.dfnpanelData['296f3551'] = {"dfnID": "296f3551", "url": "https://dom.spec.whatwg.org/#element", "dfnText": "Element", "refSections": [{"refs": [{"id": "ref-for-element"}], "title": "7.3.3.2. The browsingContext.captureScreenshot Command"}, {"refs": [{"id": "ref-for-element\u2460"}, {"id": "ref-for-element\u2461"}, {"id": "ref-for-element\u2462"}], "title": "7.3.3.7. The browsingContext.locateNodes Command"}, {"refs": [{"id": "ref-for-element\u2463"}, {"id": "ref-for-element\u2464"}], "title": "7.5.3.14. The script.RemoteValue Type"}, {"refs": [{"id": "ref-for-element\u2465"}, {"id": "ref-for-element\u2466"}], "title": "7.8.2.1. input.ElementOrigin"}, {"refs": [{"id": "ref-for-element\u2467"}], "title": "7.8.3.3. The input.setFiles Command"}], "external": true};
window.dfnpanelData['9714d594'] = {"dfnID": "9714d594", "url": "https://dom.spec.whatwg.org/#htmlcollection", "dfnText": "HTMLCollection", "refSections": [{"refs": [{"id": "ref-for-htmlcollection"}], "title": "7.5.3.14. The script.RemoteValue Type"}], "external": true};
window.dfnpanelData['96c16e60'] = {"dfnID": "96c16e60", "url": "https://dom.spec.whatwg.org/#node", "dfnText": "Node", "refSections": [{"refs": [{"id": "ref-for-node"}, {"id": "ref-for-node\u2460"}], "title": "7.5.3.14. The script.RemoteValue Type"}, {"refs": [{"id": "ref-for-node\u2461"}], "title": "7.5.3.17. The script.SharedId Type"}], "external": true};
window.dfnpanelData['aa414f4c'] = {"dfnID": "aa414f4c", "url": "https://dom.spec.whatwg.org/#nodelist", "dfnText": "NodeList", "refSections": [{"refs": [{"id": "ref-for-nodelist"}], "title": "7.5.3.14. The script.RemoteValue Type"}], "external": true};
Expand Down

0 comments on commit 948c48f

Please sign in to comment.