-
Notifications
You must be signed in to change notification settings - Fork 125
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
Treat undefined and null the same when setting IDL #2057
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.
The language look good to me, and as it matches the majority of the implementation -- but also it seems like we can write a simple javascript test for this in WPT?
Maybe we should add an idl directory here? https://github.com/web-platform-tests/wpt/tree/master/wai-aria
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.
Seems okay to me, but I defer to @annevk on IDL matters.
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.
There's also #1110 still.
otherwise, the IDL attribute must get the value in a transparent, case-preserving manner. | ||
On setting, if the new value is null, the content attribute must be removed, and otherwise, | ||
On setting, if the new value is nullish (<code>null</code>code> or <code>undefined</code>), the content attribute must be removed, and otherwise, |
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.
This is handled by IDL, you wouldn't get undefined here.
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.
Is there a better way to phrase this?
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.
Yes, not saying anything as this already follows from https://webidl.spec.whatwg.org/#es-nullable-type.
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.
So to be clear, do you recommend removing both of these paragraphs entirely?
The following algorithm should […]
On getting, […]
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.
No, this PR isn't needed, that's all.
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.
In that case, I'm happy to close this PR! Thanks.
Thanks for the reviews! I opened a PR on WPT: web-platform-tests/wpt#42748 FWIW Firefox has also shipped this in 119 with the same behavior as Chromium/WebKit (i.e. the behavior described in this PR). |
Closing per #2057 (comment). |
Closes #1858
This aligns with the de-facto behavior of Chromium and WebKit on setting ARIA-reflected IDL string attributes.
In short: both
null
andundefined
remove the attribute during setting, but a missing attribute always returnsnull
from the getter. (This too aligns with de-facto Chromium/WebKit behavior.)Related bug on Firefox.
FYI @alice per discussion in AOM meeting.
PR tracking
Check these when the relevant issue or PR has been made, OR after you have confirmed the
related change is not necessary (add N/A). Leave unchecked if you are unsure. Read the
Process Document or
Test Overview for more information.
Implementation tracking
Preview | Diff