w3c / aria-common

Shared files for the ARIA repositories
Other
8 stars 15 forks source link

modernizing aria.js #104

Open pkra opened 10 months ago

pkra commented 10 months ago

Besides https://github.com/w3c/aria-common/issues/92 we have https://github.com/w3c/aria/pull/1833/ (which has fallen of the radar) and now https://github.com/w3c/aria/issues/2073 suggesting changes in aria.js

Looking at the code, I wonder if there's interest in modernizing it a bit (and if there are any restrictions or W3C guidelines on this).

pkra commented 9 months ago

@jnurthen following our discussion, I was looking at ariaChild.js and from a rough comparison, they seem nearly identical. While aria.js seems to do extra stuff, I don't think the relevant if-checks would trigger in a child spec. The rest in differences looks like like two files going out of sync.

Does that sounds about right?

(If so then ideally we could refactor aria.js so that its parts are directly re-used in ariaChild.)

pkra commented 9 months ago

A quick search confirms that ariaChild is really only used in dpub-aria, graphics-aria. So mostly we'd worry about dpub aria.

pkra commented 9 months ago

Another point from the discussion with @jnurthen: re skipindex. A quick search only finds aria.js being used in the aria spec.

The performance benefit of ?fast seems to be ~1s (of 3.5s). I'd suggest to throw it out.

pkra commented 9 months ago

Some thoughts about testability. As James had said, running respec locally is probably the right direction.

Here's what I've got so far

Now the diff has some expected differences

So diffing these seems at least initially a feasible step for testing changes to aria.js

Next steps:

pkra commented 9 months ago

As suggested by James the other day, it should be sufficient to diff a local respec run before & after aria.js changes.

It looks like there will always be differences in the aria-wg-active.html includes -- they fail and seem to get a changing ID in the data-include-id attribute.

pkra commented 9 months ago

It looks like there will always be differences in the aria-wg-active.html includes -- they fail and seem to get a changing ID in the data-include-id attribute.

Oh, and for funders.html as well, of course.

pkra commented 9 months ago

As a way to explore what's going on, I've tried to extract/condense the pieces that generate roleInfo.js. I eventually ran into a roadblock. I couldn't figure out how some props are generated. I think it comes down to roletype's special treatment.

Since this didn't work out, I think I'll try for a naive refactoring next.