Re: [css3-images] CSS element reference identifier

On Mon, Feb 6, 2012 at 9:33 PM, Robert O'Callahan <robert@ocallahan.org> wrote:
> On Mon, Feb 6, 2012 at 9:46 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>> Elika and I were recently discussing this, and realized that having
>> the element reference identifier use the current grammar (as a bare
>> IDENT) is future-hostile, as we plan to eventually extend it to accept
>> arbitrary selectors, and IDENTs collide with tagname selectors.
>
> We've discussed this at least a couple of times before ... I think that if
> you want to have something that can use arbitrary selectors, you should
> define a new function elements() that takes a selector and can handle
> multiple matched elements, and does not consult the CSSElementMap at all.

I think element() is fine as an analogue to .find() in JS, and
elements() (when we need it) will be an analogue to .findAll().  When
element() grows to accept an arbitrary selector, it'll just return the
first matched element.

~TJ

Received on Tuesday, 7 February 2012 11:19:19 UTC