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

Treat undefined and null the same when setting IDL #2057

Closed
wants to merge 1 commit into from

Conversation

nolanlawson
Copy link
Member

@nolanlawson nolanlawson commented Oct 6, 2023

Closes #1858

This aligns with the de-facto behavior of Chromium and WebKit on setting ARIA-reflected IDL string attributes.

In short: both null and undefined remove the attribute during setting, but a missing attribute always returns null 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.

  • Related Core AAM Issue/PR:
  • Related AccName Issue/PR:
  • Related APG Issue/PR:
  • Any other dependent changes?

Implementation tracking


Preview | Diff

Copy link
Contributor

@spectranaut spectranaut left a 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

Copy link
Contributor

@cookiecrook cookiecrook left a 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.

Copy link
Member

@annevk annevk left a 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,
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

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, […]

Copy link
Member

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.

Copy link
Member Author

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.

@nolanlawson
Copy link
Member Author

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).

@nolanlawson
Copy link
Member Author

Closing per #2057 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In Chromium/WebKit, setting ARIA reflected properties to undefined behaves the same as null
4 participants