Comment 8 for bug 2047713

Revision history for this message
Leonard Richardson (leonardr) wrote (last edit ):

I've written some tests and done some updates and there are three places where I'd like your help.

1. I added an "Advanced search techniques" section to the documentation but it's missing examples. If you can come up with a simple, useful example of what to do with this functionality I'd appreciate it.

2. I'm uncertain about having this technique use hook functions passed into the constructor, instead of requiring that the user subclass the base class. Basically because there's no other functionality in the class. This especially applies to allow_tag_creation_function and allow_string_creation_function, but also applies to match_function to some extent. If I get rid of the other two match functions then it definitely applies to match_function as well, for consistency reasons.

How would you feel if using this functionality required subclassing instead of passing a (possibly anonymous) function into a constructor?

3. I renamed ElementMatcher to ElementSelector, since that's a term used elsewhere, but I'm not so sure about that idea for a couple of reasons:

* The term "selector" seems associated mainly with CSS selectors in peoples' minds, so it might be too technology-specific.
* Specifically, there's a method called Tag.select which has nothing to do with ElementSelector, and instead uses CSS selectors. So ElementSelector might be _misleadingly_ technology-specific.

I'm still not wild about ElementMatcher but I think I might go back to it. What do you think?