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