A form associated custom element can call `internals.setValidity(flags)`. If `customError` is missing or set to `false` in the flags, `internals.validity.customError` always reports true, as long as one of the validity flags is set to true. ``` <script> class XControl extends HTMLElement { static formAssociated = true; constructor() { super(); this.internals = this.attachInternals(); this.internals.setValidity({valueMissing: true, customError: false}, 'Value missing'); // Expecting "customError: false" alert(`customError: ${this.internals.validity.customError}`); } } customElements.define('x-control', XControl); </script> <x-control></x-control> ``` Repro: https://jsbin.com/nodibatala/edit?html,output Expectation: open the repro and get an alert of "customError: false". This works in Chrome and Firefox Actual: Safari 16.6 reports "customError: true", even when customError is set to false.
I am able to reproduce this bug in WebKit ToT (267909@main) and get `customError: true` while Firefox Nightly 118 and Chrome Canary 118 get `customError: false`.
Might be reseting validity here: https://searchfox.org/wubkat/source/Source/WebCore/html/FormListedElement.cpp#266 by using validityCheck(); ?
<rdar://problem/115681066>
Pull request: https://github.com/WebKit/WebKit/pull/19434