W3C home > Mailing lists > Public > www-style@w3.org > March 2010

Re: Select elements based on text content

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 29 Mar 2010 17:55:33 -0700
Message-ID: <dd0fbad1003291755o47a75418o2c6b4db2c2c5c587@mail.gmail.com>
To: David Chambers <david.chambers.05@gmail.com>
Cc: www-style@w3.org
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

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:44 UTC