-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
There was a problem hiding this 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.
Co-authored-by: Kasper Isager <[email protected]>
* 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; |
There was a problem hiding this comment.
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 🙈
I'll fix https://github.com/Siteimprove/alfa/pull/273/files#r448164685 on |
We've built ourselves a nice footgun by putting the conflict resolution in
Node.build
which is bypassed by many functions such ashasRole
callingRole.from
directly…Moving the resolution deeper to where role computation actually happens clean that up. And also avoids
Node.build
doing a double roundtrip toRole.from
.Also removing the default value of
isAllowedPresentational
from the individual features to eliminate the risk of them disagreeing on that…