W3C home > Mailing lists > Public > public-html@w3.org > November 2010

Re: ISSUE-137 case-insensitive: Chairs Solicit Proposals

From: Maciej Stachowiak <mjs@apple.com>
Date: Wed, 10 Nov 2010 09:34:41 -0800
Cc: Jonas Sicking <jonas@sicking.cc>, HTML WG <public-html@w3.org>
Message-id: <C9A3498F-9E6A-48DC-9C7A-E5A93F54F510@apple.com>
To: Ian Hickson <ian@hixie.ch>

On Nov 10, 2010, at 9:18 AM, Ian Hickson wrote:

> On Wed, 10 Nov 2010, Jonas Sicking wrote:
>>> 
>>> http://dev.w3.org/html5/status/issue-status.html#ISSUE-137
>> 
>> The editor was never given a chance to respond to the new information 
>> that was made available in the bug before this was turned into an issue.
>> 
>> So given the fact that it's unlikely that the regexp won't be extended 
>> to deal with the use case, Ian, are you still opposed adding some 
>> attribute to allow case insensitive matching?
> 
>> From a holistic point of view, I think the platform would be best served 
> by improving regular expression syntax throughout the platform rather than 
> having to update each place that uses regular expressions each time a new 
> feature is added. I also think it is too early to know how we should 
> improve pattern="" at this point, since it is not widely used. So on 
> balance I do not think it is a good idea for us to make the proposed 
> change at this point.


Just as a technical point about ECMAScript regexps (with chair hat off):

In ECMAScript, the regular expression syntax is split into two parts, pattern and flags. All ways of creating a regexp from a string allow passing both. The HTML5 pattern="" attribute only allows expressing the pattern, not the lags. So it's not consistent with the regexp system in the rest of the platform. Allowing the flags to be expressed (either with a separate attribute, or by allowing the full regexp literal syntax in the pattern attribute) would make HTML5 consistent with ECMAScript. It is currently not consistent. Allowing the pattern attribute to express the flags part of the regexp syntax would also guarantee all future ES regexp improvements carry over to HTML5, whether they are in the flags part or the pattern part of the syntax.

Short version: ECMAScript has the capability to express a case-insensitive regexp already, but the pattern="" attribute does not gain that feature because it only allows one part of the two-part ECMAScript regexp syntax.

In fairness, of the current three ECMAScript regexp flags, only two seem likely to have a useful effect on the pattern attribute, specifically the "m" and "i" flags, but not the "g" flag.

Regards,
Maciej
Received on Wednesday, 10 November 2010 17:35:16 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:16:06 UTC