I think my change incorrectly allows all mouse clicks to mutate checkboxes/radios. The intention here is:
So, is this intention met by the current PR? Let me try to summarize; please correct anything I get wrong.
Physical mouse click (trusted click event): no mutation
.click() (untrusted event): no mutation
click from (untrusted event): no mutation
The spec is not precise about label activation behavior one way or another. https://html.spec.whatwg.org/#the-label-element says
The label element's exact default presentation and behavior, in particular what its activation behavior might be, if anything, should match the platform's label behavior.
and discusses examples of firing clicks on the element. So hmm.
My suggestion is that we don't touch this area for now. We could consider improving the requirements there in general, but as-is, we can't make strong assertions. As such, I think we should remove the label tests from web-platform-tests/wpt#24975.
direct .dispatchEvent(new MouseEvent("click")) (untrusted event): mutation
This is what this PR fixes, by adding an exception in the activation behavior for checkboxes and radios.