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

Add DOM - core, events, ranges, tree walker etc #2007

Merged
merged 29 commits into from
Nov 4, 2024

Conversation

autonome
Copy link
Collaborator

@autonome autonome commented Oct 21, 2024

See #1380 for discussion on DOM as a standalone feature, ranges, etc:

  • we seem to be sticking w/ putting things w/ where they're used, so putting ranges w/ selection api
  • there was no conclusion on a general "DOM" feature

Looking at the spec-generated DOM draft, some thoughts and questions:

  • events seem like something that should stand alone as one or more features, and Caniuse has various separate related features: addEventListener, passive: true, CustomEvent, EventTarget.dispatchEvent and more
  • Document, DocumentFragment and DocumentType are proposed features in Add document, document fragment, document type #1983
  • MutationObserver seems standalone and Caniuse treats it that way too
  • the Node and Element keys together have so many "use it 10,000 times per day" APIs, could be a standalone feature probably
  • qS/A are standalone on Caniuse, which seems right
  • there's a set of list-ish APIs HTMLCollection, NamedNodeMap, NodeList, NodeIterator` - if we go big-dom-feature, could leave them all in there, for now at least
  • and then some bits like Attr, Comment, CharacterData, Text etc, some of which will align w/ their HTML spec counterparts - these each seem like standalone features of the web

Aside from the list-ish bits, there's not much left for a standalone DOM feature if we do the above... and those might actually be ok living in Document.

@github-actions github-actions bot added the feature definition Creating or defining new features or groups of features. label Oct 21, 2024
@autonome autonome changed the title Add bits of DOM - ranges, tree walker and more Add DOM - core, events, ranges, tree walker etc Oct 22, 2024
Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm feeling pretty positively toward this so far. I'm inclined toward lumping more stuff into the DOM feature itself (Node, Element, and maybe querySelector), which I've noted in a few places. But this is a good outline of what to do with a LOT of keys.

features/dom.yml Show resolved Hide resolved
features/events.yml Show resolved Hide resolved
features/mutations.yml Outdated Show resolved Hide resolved
features/dom.yml.dist Outdated Show resolved Hide resolved
features/node.yml Outdated Show resolved Hide resolved
features/queryselector.yml Outdated Show resolved Hide resolved
@autonome autonome marked this pull request as ready for review October 27, 2024 13:13
@autonome
Copy link
Collaborator Author

autonome commented Oct 27, 2024

Implemented the DOM rollup approach, and review feedback integrated.

Edit: Er, and subsequent files updated also.

@autonome autonome marked this pull request as draft October 28, 2024 04:47
@autonome autonome marked this pull request as ready for review October 28, 2024 04:59
Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Dietrich is on holiday, I'm going to take this one over, since I think this is quite close to landing. Leaving some notes for myself.

features/mutationobserver.yml Outdated Show resolved Hide resolved
features/events.yml Outdated Show resolved Hide resolved
features/dom.yml Outdated Show resolved Hide resolved
features/dom.yml Outdated Show resolved Hide resolved
features/dom.yml Outdated Show resolved Hide resolved
@ddbeck ddbeck requested a review from Elchi3 October 30, 2024 17:05
@ddbeck
Copy link
Collaborator

ddbeck commented Oct 30, 2024

OK, I've tidied this up a bit and I think it's ready for another reviewer. Some notes on key changes I made from what Dietrich originally did:

  • I dropped nearly all the events. Some belong in other features. Some (focus, blur) I could imagine re-landing in the events or DOM feature, but I think it'll be easier to approach them separately.
  • I dropped all the global/element attribute reflections I could find. It's possible I missed some. They belong with the elements or related features themselves.

Copy link
Collaborator

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! Just one thing that I wouldn't have put in the DOM kitchen sink.

features/dom.yml.dist Outdated Show resolved Hide resolved
@ddbeck ddbeck merged commit 5d1238e into web-platform-dx:main Nov 4, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature definition Creating or defining new features or groups of features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants