[whatwg] pattern attribute

Max Romantschuk max at provico.fi
Mon Aug 23 05:03:30 PDT 2004


Ian Hickson wrote:
> The silent dropping of errors was one of the main catalysts to the success 
> of the Web, IMHO.
> 
> One of WHATWG's design principles is based on this:
> 
> # Users should not be exposed to authoring errors
> #
> # Specifications must specify exact error recovery behaviour for each 
> # possible error scenario. Error handling should for the most part be 
> # defined in terms of graceful error recovery (as in CSS), rather than 
> # obvious and catastrophic failure (as in XML).
>  -- http://www.w3.org/2004/04/webapps-cdf-ws/papers/opera.html

I hate to admit it, but you have a very good point. I guess I'm put off 
by the idea due to being a programmer at heart ;)


> I'm open to suggestions; what do you think should happen with invalid 
> pattern attributes? Bear in mind the design principle mentioned above; 
> end users shouldn't be exposed to these errors.

Perhaps there should be a debugging attribute which could be added to a 
form during development? User agents which supported the attribute could 
then trigger a suitable error during form validation and abort 
submission as defined in the current spec [1]. This way there would be a 
simple way for authors to check their regexps without having to revert 
to a bunch of additional tools.

This is just a quick thought though. I realize the risk of authors 
leaving the debugging attribute in place, so that may be a reason not to 
even consider this. Another option would be for WF2 to define a special 
debugging mode which could be activated in the user agent.

In any case, I feel that some kind of mechanism for checking the 
regexp's syntax would be very beneficial.

.max


[1] http://www.whatwg.org/specs/web-forms/current-work/#form-submission

-- 
Max Romantschuk
http://max.nma.fi/



More information about the whatwg mailing list