Open garykac opened 9 months ago
Thanks @garykac. I haven't explored your experimental split in detail, but I think this plan makes a lot of sense.
With my Chair hat firmly on, do you think this will help us get some/all of the UI Events specs to Rec?
CC @patrickhlauke WRT the PE spec.
Regarding Pointer Events, we've got a few situations where we link back to (and, in some cases, expand/backfill the definitions provided in) the current monolithic UI Events spec. Purely from an organisational point of view, it always felt a bit odd that Pointer Events (and Touch Events) are split off and specific already, while the more "legacy"/entrenched inputs like keyboard and mouse are in the one monolithic spec - so purely on a gut feeling, I'd be inclined to agree that splitting these into more specific sub-specs makes sense
I wonder if focus events are actually defined well enough, or almost well enough in the HTML spec. https://html.spec.whatwg.org/#focus
@LJWatson : Considering the state of the specs and the amount of work needed, I believe that we won't be able to get UI Events to REC unless we split it up. Splitting out Keyboard code
and key
values into separate documents is the only reason why we were able to move those forward. We also need to convert the spec to be algorithmic, and that will be much easier if we can attack the problem piecemeal.
@patrickhlauke : One of the motivations for the monolithic spec was that there were interdependencies and event timing concerns that were easier to manage in a single document. PE (correctly, IMO) decided it was better to be a separate spec because they wanted to be able to actually finish the work without being anchored to all the other bits in UIEvents. Of course, that leads to interdependencies between the specs. Splitting up UI Events will cause more of these hooks/links between the specs, but it's a problem that needed to be solved in any case.
@smaug---- : I think that would be good outcome. And if the HTML spec is not sufficient, then it might make sense to update it rather than create a new FocusEvents spec.
The split files are as follows:
Again, these are based on an out-of-date spec so please review the overall structure of the split and whether or not something belongs in one place or another (or not at all). The spec will be re-split once we agree on the general approach.
Have you considered moving UI Events to the WHATWG?
Once we add algorithms, wouldn't there be a lot of interdependencies? I worry this might end up being a nightmare to maintain.
I agree that focus can move fully into HTML though: #185.
Although I appreciate the from-scratch survey of existing sections and the desire to trim redundancies, I don't think creating separate documents is actually helpful. It just makes maintenance and looking things up harder, in my experience. Indeed, if anything, I'd like to see fewer documents, with much of UI Events moving into HTML.
Also, as always, I want to reiterate that reaching REC should be an anti-goal. Fundamental parts of the platform like this need to stay as living specs; we can't ever assume they're finished, and consign them to dead specs (RECs). If part of the motivation for the split here is process-related, I'd suggest setting that aside and instead focusing on the technically-best outcome. (Which, IMO, is somewhere between a merger with HTML and a monolithic UI Events spec. But, it's ultimately the editor's judgement, not mine.)
Right, putting aside the REC stuff (which I agree is an anti-goal once in CR), we should be seeing how much we can reduce this spec by deferring to DOM and HTML where possible.
The goal is maintainability though. There are just different means of getting there.
I think the most important goal is to migrate the spec to use properly written algorithms. That will be a significant aid to maintainability because the existing spec text (written mostly as "do something like this") has proven over the past decade or so to be far too vague to support the level of detail that we need. Regardless of where the spec ends up being hosted, this conversion needs to take place.
I wrote up some algorithms as a starting point a few years ago, and recently people have begun augmenting them because it allowed them to specify the details that they wanted. However, I know that the algorithms are inadequate and I also know that we have some browser implementation differences that will be tricky to specify correctly.
These inadequacies are why I've hesitated to propose incorporating the algorithms as they currently are into the main spec. The algorithms look more official than ad-hoc text descriptions, so errors feel more consequential.
Thus, my plan was to split the spec to remove the cruft and choose one event type (perhaps MouseEvents) as a canary to test migrating the algorithms over. That experience would inform how we move over the other events. We can't avoid having some interdependencies (e.g., PointerEvents), but I don't think the problem is unmanageable (referencing a different spec vs. referencing a distant section in the same spec).
If we don't split the spec into parts, then we need to have a plan for how to migrate to algorithms.
What do people think about the following approach:
event-algo.bs
file.
Once (if) we have general agreement on the high-level approach, I'll create tracking issues for each task so it can be discussed in more detail. But I'm open to any suggestions.
What do people think about the following approach:
Sounds great!
To make managing the UI Events specification a bit easier, and to facilitate the transition to a more algorithmic format for the spec, we're considering splitting the spec into a set of smaller (and more manageable) specifications.
This is also an opportunity to remove sections that should not be present in the spec, usually because they cover topics already (and more properly) defined elsewhere.
As such, I've done a "test split" of the spec to give people an idea of how it would look so that we can agree that this is a reasonable path forward. Note that this split was done with a slightly out-of-date version (December 2023) of the spec as a test just to see how it would look. If we agree to move forward with this, then the split will need to be re-done after we pause edits and flush the queue of pending pull requests.
As a high-level summary, we're considering splitting the monolithic UI Events spec into:
Some of these specs are currently small, but I imagine that they will grow once we start adding proper algorithms to the documents.
Proposal for each section: