Re: Select elements based on text content

On Mon, Mar 29, 2010 at 5:51 PM, David Chambers
<david.chambers.05@gmail.com> wrote:
> That's interesting. I have very little understanding of how selectors work
> behind the scenes, and had assumed that selecting elements based on their
> text content would be no more difficult than selecting elements based on an
> attribute value.
>
> Thanks to the quoted responses, I believe that I now have an understanding
> of why selecting elements based on their text content is a slower operation.
>
> Without text content matching:
>
>     <td class="unsupported">(browser can determine at this point which
> selectors match this td)
>
> With text content matching:
>
>     <td class="unsupported">(browser unable to determine at this point which
> selectors match this td)No</td>(browser can determine at this point which
> selectors match this td)
>
> Have I understood the problem correctly?

Yes, that's correct.  (This is also why things like a parent-selector
haven't been added yet.)

~TJ

Received on Tuesday, 30 March 2010 00:56:20 UTC