w3c / uievents

UI Events
https://w3c.github.io/uievents/
Other
145 stars 52 forks source link

Move focus section to HTML #185

Open annevk opened 6 years ago

annevk commented 6 years ago

Given that HTML already defines almost everything around focus events, it seems better to uplift this section there and not have the existing split. Does that make sense?

HTML should first define dispatch of the focus events other than focus/blur though. See https://github.com/whatwg/html/issues/3514 for the tracking issue on the HTML side.

plehegar commented 6 years ago

if you move FocusEvent into the html spec, would you move the UIEvent interface as well?

annevk commented 6 years ago

No, that has other dependencies such as mouse events (though I'm not sure why load and some other events are defined to use it, that seems like a mistake).

plehegar commented 6 years ago

one other thought: if we move focusin/out in HTML, what would that mean for specs like SVG? We'd probably expect the focus behavior to be comparable when standalone and when embedded. I would think that having a general algorithm for focusin/out in UIEvents while allowing hooks for HTML and SVG handling would seem a better approach.

annevk commented 6 years ago

You need a single algorithm since you can mix the two arbitrarily. In general a lot in SVG already needs to be redefined to reference concepts only defined in HTML so I don't think that's a big deal per se. (E.g., only HTML defines browsing contexts and focus depends on that.)

AmeliaBR commented 6 years ago

The SVG 2 spec already references HTML for pretty much everything related to focus handling, including the tabindex attribute and focus() and blur() methods.

The only unique aspects defined for SVG in the focus section are:

Consistent cross-browser support for the SVG-specific details is still not great, but that's a separate matter.

If moving things to the HTML spec means that they aren't defined generally for all DOM elements, then we may need to add an extra paragraph here or there saying that SVG follows the HTML model. But I don't expect that to be a problem.

travisleithead commented 6 years ago

So, looking through the UIEvents Focus section, there's really not all that much there.

Given that HTML already defines almost everything around focus events, it seems better to uplift this section there and not have the existing split. Does that make sense?

Truthfully, I don't see much of a split here. @garykac is there any of the above sections that would make sense to stay put? Any strong objections?