Re: [Selectors4] case-insensitive attribute value matching (in XML)

On Jul 25, 2011, at 11:45 AM, fantasai wrote:

> On 07/25/2011 11:17 AM, L. David Baron wrote:
>> On Monday 2011-07-25 10:03 -0700, fantasai wrote:
>>> 
>>> Added
>>>   http://dev.w3.org/csswg/selectors4/#attribute-case
>> 
>> I think putting the "i" outside of the [] is confusing -- it doesn't
>> *look* associated with the attribute selector.
>> 
>> I'd much rather see [att=val i] / [att="val" i] or
>> [att=val,i] / [att="val",i] or some other syntax that puts the
>> case-insensitive indicator *inside* the brackets.
> 
> That looks much better, yes. Fixed.

Agreed, that was my original proposal. The prose states "immediately inside the closing bracket", I'm not sure it should be that literal, whitespace and comments should be allowed between the 'i' and the ']'.

The grammar also needs to be updated for this, I propose:
  attrib
    : '[' S* [ namespace_prefix ]? IDENT S*
          [ [ PREFIXMATCH |
              SUFFIXMATCH |
              SUBSTRINGMATCH |
              '=' |
              INCLUDES |
              DASHMATCH ] S* [ IDENT | STRING ] S* [IDENT S*]?
          ]? ']'
    ;

I'm also wondering if we should have an 'always match case sensitively' identifier. At some point we also may want to add additional identifiers to select normalization modes, etc.

Peter

Received on Monday, 25 July 2011 19:31:37 UTC