jamietre / CsQuery

CsQuery is a complete CSS selector engine, HTML parser, and jQuery port for C# and .NET 4.
Other
1.16k stars 249 forks source link

Possible wrong selection context #191

Open gravityFlower opened 9 years ago

gravityFlower commented 9 years ago

Hello,

i have the problem that on calling Cq() on an element, there seems to be a problem with the context. I'm loading a html file and filter the elements. Then i call Each() on the filtered list of elements. In the assigned function, i call Cq() on the element. I assume that the element is the context for the applied filter( like jQuery $("<filter-expression>",element). But the result contains all elements of the site matching this expression. You can see this in an example here: https://gist.github.com/gravityFlower/6e42f0c1f3f25306ebf6 I hope you can tell me if i'm doing something wrong or if this is a bug. If this is intended, it would be best to document this feature.