Skip to content

Commit

Permalink
Add documentation for Element(Internals).aria[Col/Row]IndexText (mdn#…
Browse files Browse the repository at this point in the history
…30261)

* Revert "Remove documentation for api.Element(Internals).aria[Col/Row]IndexText (mdn#23489)"

This reverts commit ad62351.

* Fix linting issues

* Fix flaw
  • Loading branch information
Elchi3 committed Nov 14, 2023
1 parent f6310f5 commit 33f5bef
Show file tree
Hide file tree
Showing 8 changed files with 270 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ See related [`aria-rowindextext`](/en-US/docs/Web/Accessibility/ARIA/Attributes/
- `<string>`
- The human-readable text alternative of the numeric [`aria-colindex`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-colindex)

## ARIAMixin API

- {{domxref("Element.ariaColIndexText")}}
- : The [`ariaColIndexText`](/en-US/docs/Web/API/Element/ariaColIndexText) property, part of the {{domxref("Element")}} interface, reflects the value of the `aria-colindextext` attribute.
- {{domxref("ElementInternals.ariaColIndexText")}}
- : The [`ariaColIndexText`](/en-US/docs/Web/API/ElementInternals/ariaColIndexText) property, part of the {{domxref("ElementInternals")}} interface, reflects the value of the `aria-colindextext` attribute.

## Associated roles

Used in roles:
Expand All @@ -85,6 +92,7 @@ Inherits into roles:

## See Also

- [`Element.ariaColIndexText`](/en-US/docs/Web/API/Element/ariaColIndexText)
- [`aria-colindex`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-colindex)
- [`aria-rowindextext`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-rowindextext)
- [`aria-colcount`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-colcount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ The `aria-rowindextext` is added to each {{HTMLElement('tr')}} or to elements wi
- `<string>`
- The human-readable text alternative of the numeric [`aria-rowindex`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-rowindex)

## ARIAMixin API

- {{domxref("Element.ariaRowIndexText")}}
- : The [`ariaRowIndexText`](/en-US/docs/Web/API/Element/ariaRowIndexText) property, part of the {{domxref("Element")}} interface, reflects the value of the `aria-rowindextext` attribute.
- {{domxref("ElementInternals.ariaRowIndexText")}}
- : The [`ariaRowIndexText`](/en-US/docs/Web/API/ElementInternals/ariaRowIndexText) property, part of the {{domxref("ElementInternals")}} interface, reflects the value of the `aria-rowindextext` attribute.

## Associated roles

Used in roles:
Expand Down
88 changes: 88 additions & 0 deletions files/en-us/web/api/element/ariacolindextext/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: Element.ariaColIndexText
slug: Web/API/Element/ariaColIndexText
page-type: web-api-instance-property
browser-compat: api.Element.ariaColIndexText
---

{{DefaultAPISidebar("DOM")}}

The **`ariaColIndexText`** property of the {{domxref("Element")}} interface reflects the value of the [`aria-colindextext`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-colindextext) attribute, which defines a human readable text alternative of aria-colindex.

## Value

A string.

## Examples

In this example the `aria-colindex` attribute on the element with an ID of `role-heading` is set to "Aria Role column". Using `ariaColIndexText` we update the value to the string "New column name".

```html
<table
id="semantic-table"
role="table"
aria-label="Semantic Elements"
aria-describedby="semantic_elements_table_desc"
aria-rowcount="100">
<caption id="semantic_elements_table_desc">
Semantic Elements to use instead of ARIA's roles
</caption>
<thead role="rowgroup">
<tr role="row">
<th
role="columnheader"
id="role-heading"
aria-sort="none"
aria-rowindex="1"
aria-colindex="1"
aria-colindextext="Aria Role column">
ARIA Role
</th>
<th
role="columnheader"
id="element-heading"
aria-sort="none"
aria-rowindex="1">
Semantic Element
</th>
</tr>
</thead>
<tbody role="rowgroup">
<tr role="row">
<td role="cell" aria-rowindex="11">header</td>
<td role="cell" aria-rowindex="11">h1</td>
</tr>
<tr role="row">
<td role="cell" aria-rowindex="16">header</td>
<td role="cell" aria-rowindex="16">h6</td>
</tr>
<tr role="row">
<td role="cell" aria-rowindex="18">rowgroup</td>
<td role="cell" aria-rowindex="18">thead</td>
</tr>
<tr role="row">
<td role="cell" aria-rowindex="24">term</td>
<td role="cell" aria-rowindex="24">dt</td>
</tr>
</tbody>
</table>
```

```js
let el = document.getElementById("role-heading");
console.log(el.ariaColIndexText); // "Aria Role"
el.ariaColIndexText = "New column name";
console.log(el.ariaColIndexText); // "New column name"
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [ARIA: table role](/en-US/docs/Web/Accessibility/ARIA/Roles/table_role)
87 changes: 87 additions & 0 deletions files/en-us/web/api/element/ariarowindextext/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: Element.ariaRowIndexText
slug: Web/API/Element/ariaRowIndexText
page-type: web-api-instance-property
browser-compat: api.Element.ariaRowIndexText
---

{{DefaultAPISidebar("DOM")}}

The **`ariaRowIndexText`** property of the {{domxref("Element")}} interface reflects the value of the [`aria-rowindextext`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-rowindextext) attribute, which defines a human readable text alternative of aria-rowindex.

## Value

A string.

## Examples

In this example the `aria-rowindextext` attribute on the element with an ID of `role-heading` is set to "Heading row". Using `ariaRowIndexText` we update the value to "Updated heading row".

```html
<table
id="semantic-table"
role="table"
aria-label="Semantic Elements"
aria-describedby="semantic_elements_table_desc"
aria-rowcount="100">
<caption id="semantic_elements_table_desc">
Semantic Elements to use instead of ARIA's roles
</caption>
<thead role="rowgroup">
<tr role="row">
<th
role="columnheader"
id="role-heading"
aria-sort="none"
aria-rowindex="1"
aria-rowindextext="Heading row">
ARIA Role
</th>
<th
role="columnheader"
id="element-heading"
aria-sort="none"
aria-rowindex="1">
Semantic Element
</th>
</tr>
</thead>
<tbody role="rowgroup">
<tr role="row">
<td role="cell" aria-rowindex="11">header</td>
<td role="cell" aria-rowindex="11">h1</td>
</tr>
<tr role="row">
<td role="cell" aria-rowindex="16">header</td>
<td role="cell" aria-rowindex="16">h6</td>
</tr>
<tr role="row">
<td role="cell" aria-rowindex="18">rowgroup</td>
<td role="cell" aria-rowindex="18">thead</td>
</tr>
<tr role="row">
<td role="cell" aria-rowindex="24">term</td>
<td role="cell" aria-rowindex="24">dt</td>
</tr>
</tbody>
</table>
```

```js
let el = document.getElementById("role-heading");
console.log(el.ariaRowIndexText); // "Heading row"
el.ariaRowIndexText = "Updated heading row";
console.log(el.ariaRowIndexText); // "Updated heading row"
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [ARIA: table role](/en-US/docs/Web/Accessibility/ARIA/Roles/table_role)
4 changes: 4 additions & 0 deletions files/en-us/web/api/element/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ _The `Element` interface includes the following properties, defined on the `ARIA
- : A string reflecting the [`aria-colcount`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-colcount) attribute, which defines the number of columns in a table, grid, or treegrid.
- {{domxref("Element.ariaColIndex")}}
- : A string reflecting the [`aria-colindex`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-colindex) attribute, which defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
- {{domxref("Element.ariaColIndexText")}}
- : A string reflecting the [`aria-colindextext`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-colindextext) attribute, which defines a human readable text alternative of aria-colindex.
- {{domxref("Element.ariaColSpan")}}
- : A string reflecting the [`aria-colspan`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-colspan) attribute, which defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
- {{domxref("Element.ariaCurrent")}}
Expand Down Expand Up @@ -150,6 +152,8 @@ _The `Element` interface includes the following properties, defined on the `ARIA
- : A string reflecting the [`aria-rowcount`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-rowcount) attribute, which defines the total number of rows in a table, grid, or treegrid.
- {{domxref("Element.ariaRowIndex")}}
- : A string reflecting the [`aria-rowindex`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-rowindex) attribute, which defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
- {{domxref("Element.ariaRowIndexText")}}
- : A string reflecting the [`aria-rowindextext`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-rowindextext) attribute, which defines a human readable text alternative of aria-rowindex.
- {{domxref("Element.ariaRowSpan")}}
- : A string reflecting the [`aria-rowspan`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-rowspan) attribute, which defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
- {{domxref("Element.ariaSelected")}}
Expand Down
36 changes: 36 additions & 0 deletions files/en-us/web/api/elementinternals/ariacolindextext/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: ElementInternals.ariaColIndexText
slug: Web/API/ElementInternals/ariaColIndexText
page-type: web-api-instance-property
browser-compat: api.ElementInternals.ariaColIndexText
---

{{DefaultAPISidebar("DOM")}}

The **`ariaColIndexText`** property of the {{domxref("ElementInternals")}} interface reflects the value of the [`aria-colindextext`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-colindextext) attribute, which defines a human readable text alternative of aria-colindex.

> **Note:** Setting aria attributes on `ElementInternals` allows default semantics to be defined on a custom element. These may be overwritten by author-defined attributes, but ensure that default semantics are retained should the author delete those attributes, or fail to add them at all. For more information see the [Accessibility Object Model explainer](https://wicg.github.io/aom/explainer.html#default-semantics-for-custom-elements-via-the-elementinternals-object).
## Value

A string.

## Examples

In this example the value of `ariaColIndexText` is set to "Column name".

```js
this.internals_.ariaColIndexText = "Column name";
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [ARIA: table role](/en-US/docs/Web/Accessibility/ARIA/Roles/table_role)
36 changes: 36 additions & 0 deletions files/en-us/web/api/elementinternals/ariarowindextext/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: ElementInternals.ariaRowIndexText
slug: Web/API/ElementInternals/ariaRowIndexText
page-type: web-api-instance-property
browser-compat: api.ElementInternals.ariaRowIndexText
---

{{DefaultAPISidebar("DOM")}}

The **`ariaRowIndexText`** property of the {{domxref("ElementInternals")}} interface reflects the value of the [`aria-rowindextext`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-rowindextext) attribute, which defines a human readable text alternative of aria-rowindex.

> **Note:** Setting aria attributes on `ElementInternals` allows default semantics to be defined on a custom element. These may be overwritten by author-defined attributes, but ensure that default semantics are retained should the author delete those attributes, or fail to add them at all. For more information see the [Accessibility Object Model explainer](https://wicg.github.io/aom/explainer.html#default-semantics-for-custom-elements-via-the-elementinternals-object).
## Value

A string.

## Examples

In this example the value of `ariaRowIndexText` is set to "Heading row".

```js
this.internals_.ariaRowIndexText = "Heading row";
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [ARIA: table role](/en-US/docs/Web/Accessibility/ARIA/Roles/table_role)
4 changes: 4 additions & 0 deletions files/en-us/web/api/elementinternals/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ The `ElementInternals` interface includes the following properties, defined on t
- : A string reflecting the [`aria-colcount`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-colcount) attribute, which defines the number of columns in a table, grid, or treegrid.
- {{domxref("ElementInternals.ariaColIndex")}}
- : A string reflecting the [`aria-colindex`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-colindex) attribute, which defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
- {{domxref("ElementInternals.ariaColIndexText")}}
- : A string reflecting the [`aria-colindextext`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-colindextext) attribute, which defines a human readable text alternative of aria-colindex.
- {{domxref("ElementInternals.ariaColSpan")}}
- : A string reflecting the [`aria-colspan`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-colspan) attribute, which defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
- {{domxref("ElementInternals.ariaCurrent")}}
Expand Down Expand Up @@ -99,6 +101,8 @@ The `ElementInternals` interface includes the following properties, defined on t
- : A string reflecting the [`aria-rowcount`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-rowcount) attribute, which defines the total number of rows in a table, grid, or treegrid.
- {{domxref("ElementInternals.ariaRowIndex")}}
- : A string reflecting the [`aria-rowindex`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-rowindex) attribute, which defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
- {{domxref("ElementInternals.ariaRowIndexText")}}
- : A string reflecting the [`aria-rowindextext`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-rowindextext) attribute, which defines a human readable text alternative of aria-rowindex.
- {{domxref("ElementInternals.ariaRowSpan")}}
- : A string reflecting the [`aria-rowspan`](/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-rowspan) attribute, which defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
- {{domxref("ElementInternals.ariaSelected")}}
Expand Down

0 comments on commit 33f5bef

Please sign in to comment.