Open GoogleCodeExporter opened 9 years ago
Is this behavior defined by CSS standard, or is it just a jQuery feature?
Original comment by edin.daz...@gmail.com
on 24 Jan 2011 at 9:29
Whilst jQuery does define this, the CSS spec does not appear to: CSS3 "A
comma-separated list of selectors represents the union of all elements selected
by each of the individual selectors in the list."
Since jQuery and Fizzler can be used to manipulate (and not just display)
documents it's arguably far more important that they each define an order for
how that union happens.
Original comment by HighTech...@gmail.com
on 24 Jan 2011 at 10:42
Fizzler intentionally does not return the results in document order because
running a sort would end up buffering the results prior to yielding them. This
was done to maintain deferred execution semantics as much as possible and make
the caller pay for only the least necessary computation. For cases where
document order is significant, it seemed reasonable to let the caller compose
the results of QuerySelectorAll with OrderBy.
HtmlAgilityPack.HtmlNode has a StreamPosition property that can be used as the
key to get the results sorted in document order. Unfortunately, earlier
versions of HtmlAgilityPack also seemed to have an unreliable StreamPosition so
that was another (though lesser) reason for delegating the decision to sort to
the caller.
I am less concerned with jQuery. What Fizzler clearly violates is the
querySelectorAll contract specified as part of the NodeSelector[1] interface
and which states:
> The querySelectorAll() method on the NodeSelector interface
> must, when invoked, return a NodeList containing all of the
> matching Element nodes within the node’s subtrees, in
> document order.
One way forward I see is first have QuerySelectorAll return nodes in document
order. This way, there are no surprises but it will be clearly returning
buffered results (the inefficiency of which may in itself surprise others).
Then supply a non-normative alternative (YieldQuerySelectorAll?) that does not
guarantee document order but which streams out the results.
[1] http://www.w3.org/TR/selectors-api/#nodeselector
Original comment by azizatif
on 25 Jan 2011 at 1:12
Original comment by azizatif
on 25 Jan 2011 at 1:12
This issue has been migrated to:
https://github.com/atifaziz/Fizzler/issues/43
The conversation continues there.
DO NOT post any further comments to the issue tracker on Google Code as it is
shutting down.
You can also just subscribe to the issue on GitHub to receive notifications of
any further development.
Original comment by azizatif
on 23 Aug 2015 at 1:34
Original issue reported on code.google.com by
HighTech...@gmail.com
on 16 Jan 2011 at 8:48