Skip to content

"Reflection" can be a confusing term #1

Description

@mrego

We already use reflection term for ARIA attribute reflection, and reflection of HTML elements in general (see HTML spec: https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#reflect).

There reflection means that the HTML attributes are "reflected" on the JavaScript/DOM side, so one can query/modify them from JavaScript. Example:

  <div id="foo" aria-label="Test"></div>

With ARIA attribute reflection you can do things like:

  console.log(foo.ariaLabel); // Test
  foo.ariaLabel = "Modified";
  console.log(foo.ariaLabel); // Modified

If I understand correctly this proposal, this is a different kind of reflection than the one I've described above. This is more about how to "export" or "expose" the Shadow DOM internal elements, so they can be somehow referenced from outside the shadow tree. From the explainer:

This proposal introduces a reflection API which would allow ARIA attributes and properties set on elements in a shadow root can be reflected by their host element into the parent DOM tree.

So I believe this can be confusing, for example the README talks about "reflect" ARIA attributes, which is very similar to the wording we've been using for ARIA attribute reflection.

It's not possible to "reflect" ARIA attributes from am element in a shadow root up to the host of that shadow root.

Also in the AOM Features in progress document, this repo is now linked in Aria attribute reflection feature, which is not totally right I believe.

I don't have a great suggestion for a better name, but I think it'd be better to look for alternatives to avoid this kind of misunderstandings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions