WICG / webcomponents

Web Components specifications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upstreaming Shadow DOM and outstanding v1 work

annevk opened this issue · comments

Previously: #377, #495.

  • 2. Shadow Tree (=> DOM Standard; information in "Shadow DOM" is obsolete)
  • 3. Mutation algorithms (=> DOM Standard; information in "Shadow DOM" is obsolete)
  • 4. Events (=> DOM Standard, UI Events, Touch Events; information about UI and Touch already removed from "Shadow DOM" and the remainder is obsolete)
  • 5. User interaction
  • 6. HTML Elements in Shadow Trees (=> HTML Standard; information in "Shadow DOM" is obsolete)
  • 7. Elements and DOM interfaces (=> DOM Standard and HTML Standard)

Outstanding issues in DOM and HTML:

Outstanding issues in this repository:

The main thing lacking in OP is information about corresponding CSS efforts. There's https://drafts.csswg.org/css-scoping/ and https://github.com/w3c/csswg-drafts/labels/css-scoping-1 at least, but maybe there's more?

@annevk perhaps update description. Missing a # 1.

The main thing lacking in OP is information about corresponding CSS efforts. There's https://drafts.csswg.org/css-scoping/ and https://github.com/w3c/csswg-drafts/labels/css-scoping-1 at least, but maybe there's more?

What is the status with the pseudo class :defined? Seemed to be lacking in certain vendors but also could be merely a reflection of their respective overall status of Custom Elements which of course is outside the scope of this issue.

The numbers correspond to the sections in https://w3c.github.io/webcomponents/spec/shadow/.

:defined is now #665, though note it's not related to shadow trees.

Ah yes i see now after re-assessing the steps section @annevk 🙏 Thanks for the clarification.

The Shadow DOM spec used to declare that DocumentOrShadowRoot is extended with elementFromPoint and elementsFromPoint. Here's the latest web archive snapshot that still says so: https://web.archive.org/web/20180228173001/http://www.w3.org/TR/shadow-dom/

It seems that was since changed to a short page that basically just says:

Shadow DOM specification is being incorporated into to the DOM specification, HTML specification, CSS Scoping Module Level 1, UI Events specification, and other relevant specifications.

I guess that was related to this issue? But I'm also very confused by where did that definition go.

The only current spec mentioning elementFromPoint and elementsFromPoint that I could find now is the CSSOM View Module draft that specifies them on the Document only.

Related: w3c/csswg-drafts#5886
See also: https://caniuse.com/mdn-api_documentorshadowroot_elementfrompoint

So it kind of looks like elementFromPoint and elementsFromPoint were being dropped from the spec for DocumentOrShadowRoot since they were defined in Shadow DOM spec for that but there's no live spec reference for it anymore but I'm pretty sure this is not intentional.

This confusion also seems to have caused TypeScript to drop those methods from their DOM type definitions in TS 4.4 but looks like were added back in TS 4.5.

TypeScript 4.4 libdom changes (microsoft/TypeScript-DOM-lib-generator#1029)

DocumentOrShadowRoot
Removed: caretPositionFromPoint, caretRangeFromPoint, elementFromPoint, elementsFromPoint, getSelection

TypeScript 4.5 libdom changes (microsoft/TypeScript-DOM-lib-generator#1143)

DocumentOrShadowRoot
Added: elementFromPoint, elementsFromPoint

They need to be defined in CSSOM. That hasn't happened yet, but as you found there's an issue tracking it.

Hi @annevk , any ETA when Shadow DOM / Roots will be included in web standards by W3C?