Native Browser Validation in Fore

This demo shows how native HTML5 constraint validation (min, max, pattern, type, required) works in sync with Fore's update cycle. The browser's ValidityState is read (side-effect-free) at the end of fx-model.revalidate() and propagated via ModelItem.nativeValid into AbstractControl.handleValid().

No <form> wrapper is needed. widget.validity.valid works on individual inputs independent of a form element. Fore's fx-submission handles submission — a native form would only conflict.

Implementation Note — checkValidity() fires events: The integration reads widget.validity.valid (a live property) rather than calling widget.checkValidity(). Calling checkValidity() dispatches an invalid event on the input that would clash with Fore's own invalid event on fx-control.
Implementation Note — early :invalid flash on page load: CSS :valid and :invalid apply the moment the page renders — before the user touches anything. The solution is :user-valid / :user-invalid, which wait for interaction. For browsers that don't support them yet, the :valid:not(:placeholder-shown) / :invalid:not(:placeholder-shown) fallback produces the same behaviour. Both patterns are integrated in fore.css.

Architecture Notes