On Thu, Nov 24, 2011 at 10:53 AM, Yehuda Katz <[email protected]> wrote: >> > * Is :scope always implied if it begins with an explicit combinator >> > other >> > than descendant, even if :scope is used elsewhere? >> > find(">div :scope"); >> > find("+div :scope"); >> > find("~div :scope"); >> >> Yes. > > I think I would be ok with this case throwing, because all of the cases are > nonsense queries.
*Those* cases are nonsense. Use the reference combinator, though, and it suddenly becomes possibly reasonable. Alternately, assume that :matches() is eventually changed to allow complex selectors. Using :scope there is completely fine. Rather than trying to carve out some ways that are okay and other ways that throw, I think it's better to just use the simplest possible rule: prepend :scope to them and evaluate them as normal. The selectors above just won't match anything, is all. ~TJ
