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

updates to custom elements #210

Merged
merged 6 commits into from
Feb 13, 2021
Merged

updates to custom elements #210

merged 6 commits into from
Feb 13, 2021

Conversation

scottaohara
Copy link
Member

@scottaohara scottaohara commented Feb 3, 2020

Closes #180

Updates autonomous custom elements and form associated custom elements to indicate that they have no corresponding role if an author did not define a role in the custom element’s ElementInternals.

The allowed roles and properties column has been updated to indicate that if a custom element has an author defined role, then the allowed roles to that element must adhere to the defined role of the custom element.

I'm thinking it's probably a good idea to add an example, at the end of section 2, to help demonstrate proper conformance here.

e.g.
<my-element> with no role defined from its ElementInternals can accept any role.

but if <my-check> were created and had its role defined via its internals...

class MyCheckbox extends HTMLElement {
  static get formAssociated() { return true; }
  static get observedAttributes() { return ['checked']; }

  constructor() {
    super();
    this._internals = this.attachInternals();
    this.addEventListener('click', this._onClick.bind(this));

    this._internals.role = 'checkbox';
    this._internals.ariaChecked = false;
  }
  // ...

(example from the pending PR to the HTML spec)
Then only roles allowed on a checkbox would be allowed on this custom element.

That all said, we shouldn't merge this update until the linked HTML and ARIA issues in #180 are merged.

cc @carmacleod


Preview | Diff

Updates autonomous custom elements and form associated custom elements to indicate that they have no corresponding role if an author did not define a role in the custom element’s `ElementInternals`.

The allowed roles and properties column has been updated to indicate that if a custom element has an author defined role, then the allowed roles to that element must be in adherence to the defined role.
@scottaohara scottaohara added the Do not merge A PR which needs additional work or question resolved before it can be merged. label Feb 3, 2020
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
scottaohara and others added 2 commits February 3, 2020 15:12
Co-Authored-By: Carolyn MacLeod <[email protected]>
Co-Authored-By: Carolyn MacLeod <[email protected]>
@carmacleod
Copy link
Contributor

carmacleod commented Feb 3, 2020

Looks good.
Agree that an example would be really useful in this case.
How does this document refer to examples in section 2?
i.e. For the fish example, I would have thought that the role img table row might refer to it (e.g. "See EXAMPLE 2"), but I don't see any reference?

@scottaohara
Copy link
Member Author

yes, no references presently. we should make them

@mtrootyy
Copy link

whatwg/html#4658 was merged.

@carmacleod
Copy link
Contributor

Also w3c/aria#984 was merged. So I think the "not ready for merge" label can be removed now.

@scottaohara scottaohara removed the Do not merge A PR which needs additional work or question resolved before it can be merged. label Feb 13, 2021
@scottaohara scottaohara merged commit 3a0d3dc into gh-pages Feb 13, 2021
@scottaohara scottaohara deleted the issue_180 branch February 13, 2021 21:13
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.

update custom element
3 participants