Aria role to apply to the table's cells based on the table's own role.
()
| 473 | |
| 474 | /** Aria role to apply to the table's cells based on the table's own role. */ |
| 475 | _getCellRole(): string | null { |
| 476 | // Perform this lazily in case the table's role was updated by a directive after construction. |
| 477 | if (this._cellRoleInternal === undefined) { |
| 478 | // Note that we set `role="cell"` even on native `td` elements, |
| 479 | // because some browsers seem to require it. See #29784. |
| 480 | const tableRole = this._elementRef.nativeElement.getAttribute('role'); |
| 481 | return tableRole === 'grid' || tableRole === 'treegrid' ? 'gridcell' : 'cell'; |
| 482 | } |
| 483 | |
| 484 | return this._cellRoleInternal; |
| 485 | } |
| 486 | private _cellRoleInternal: string | null | undefined = undefined; |
| 487 | |
| 488 | /** |
no test coverage detected