Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move presentational role conflict resolution down to Role.from #273

Merged
merged 8 commits into from
Jun 23, 2020

Conversation

Jym77
Copy link
Contributor

@Jym77 Jym77 commented Jun 22, 2020

We've built ourselves a nice footgun by putting the conflict resolution in Node.build which is bypassed by many functions such as hasRole calling Role.from directly…

Moving the resolution deeper to where role computation actually happens clean that up. And also avoids Node.build doing a double roundtrip to Role.from.

Also removing the default value of isAllowedPresentational from the individual features to eliminate the risk of them disagreeing on that…

@Jym77 Jym77 requested a review from kasperisager as a code owner June 22, 2020 13:13
@Jym77 Jym77 added the patch Backwards-compatible change that doesn't touch public API label Jun 22, 2020
@Jym77 Jym77 self-assigned this Jun 22, 2020
Copy link
Contributor

@kasperisager kasperisager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! 💯 Just some minor nits.

packages/alfa-aria/src/role.ts Outdated Show resolved Hide resolved
packages/alfa-aria/src/role.ts Outdated Show resolved Hide resolved
packages/alfa-aria/src/role.ts Outdated Show resolved Hide resolved
packages/alfa-aria/src/role.ts Outdated Show resolved Hide resolved
packages/alfa-aria/src/node.ts Outdated Show resolved Hide resolved
packages/alfa-aria/src/role.ts Outdated Show resolved Hide resolved
@Jym77 Jym77 dismissed kasperisager’s stale review June 22, 2020 13:50

Changes done

@Jym77 Jym77 requested a review from kasperisager June 22, 2020 13:51
@Jym77 Jym77 merged commit 1efb4b5 into master Jun 23, 2020
@Jym77 Jym77 deleted the fix-presentational-conflict-resolution branch June 23, 2020 07:41
kasperisager added a commit that referenced this pull request Jun 23, 2020
* master:
  Rewrite the CLI internals (#265)
  Avoid discarding rules when adding to `RuleTree` (#274)
  Move presentational role conflict resolution down to Role.from (#273)
  Support passing additional arguments to `Parser`
  Update README
  Rewrite the @siteimprove/alfa-math package (#268)
  Create security.md
  Treat kind attribute as enumerated (#269)
  Account for presentational role conflict resolution in ARIA feature mappings (#264)
  Update lockfile
  Prevent infinite instantiation of `Interview` type (#266)
  Lazy load syntax definitions (#263)
  Add user agent styles for `<noscript>` element (#260)
  Fix some parse issues in `Media`
  `Preference.initial()` -> `Preference.unset()`
  Add scripting and user preferences as `Device` parameters (#259)
  Give build scripts a once-over
@@ -71,7 +67,7 @@ export namespace Feature {
/**
* @internal
*/
readonly allowPresentational?: boolean;
readonly allowPresentational: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now realise that this has caused the public API to change in a way that makes it impossible to not touch internal features from the outside as this internal property is now required 🙈

@kasperisager
Copy link
Contributor

I'll fix https://github.com/Siteimprove/alfa/pull/273/files#r448164685 on master and relabel this an internal change as that's really what it should have been.

@kasperisager kasperisager added internal Change that only affects internal APIs or other non-public aspects and removed patch Backwards-compatible change that doesn't touch public API labels Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Change that only affects internal APIs or other non-public aspects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants