components icon indicating copy to clipboard operation
components copied to clipboard

perf(cdk/table): Optimize a11y role logic in CdkCell.

Open kseamon opened this issue 1 year ago • 0 comments

  1. Uplevels repeated logic to the host CdkTable which does it once instead of n times.
  2. Skips setting role=cell in native tables, for which it is already the default (see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#technical_summary)

This saves just over a tenth of a millisecond per cell in the native TD case and about a twentieth in other cases. Doesn't sound like much, but it adds up in larger tables.

kseamon avatar Dec 27 '23 20:12 kseamon