You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Should onselectstart and onselectionchange have content attributes or just IDL attributes? #351
Firefox and Safari will attach selectionchange event listeners for both elements, but chrome does neither. I'd be happy to implement this in chrome if the spec is updated to explicitly say that we should have global onselectionchange content attributes in addition to IDL attributes.
I suspect that onselectstart has the same interop issue right now.
I think Chrome should have it. on* global attribute is the only way to check whether the browser supports the event. Although nobody needs to check that for selectionchange, but the consistency must be good.
Creating a partial interface of GlobalEventHandlers is not sufficient to add new HTML attributes though.
Having them as content attributes is probably good for consistency, but what that would require is a change to the HTML standard. Add the attributes there and then remove the partial interface here. (In theory you could also define the content attributes separately here, but I don't think that's good. We want HTML to be defined in a single place.)
Activity
josepharhar commentedon Sep 8, 2025
@rniwa do you have any thoughts on this?
masayuki-nakano commentedon Sep 9, 2025
I think Chrome should have it.
on*global attribute is the only way to check whether the browser supports the event. Although nobody needs to check that forselectionchange, but the consistency must be good.And the partial interface is GlobalEventHandlers which is explicitly included by HTMLElement.
annevk commentedon Sep 9, 2025
Creating a partial interface of
GlobalEventHandlersis not sufficient to add new HTML attributes though.Having them as content attributes is probably good for consistency, but what that would require is a change to the HTML standard. Add the attributes there and then remove the partial interface here. (In theory you could also define the content attributes separately here, but I don't think that's good. We want HTML to be defined in a single place.)