You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because Sizzle.selectors.relative functions "return" only a single match, Sizzle can be trapped into a false negative with respect to preceding parts of the full selector when the relative selector tests against multiple elements (e.g., "~" and "").
I'm pretty sure that fixing this will require changing the Sizzle.selectors.relative Extension API to allow "returning" arrays, so I will hold off working on this until the core team weighs in with their comments/approval.
Technical explanation: Given a query like "A + B ~ C", Sizzle:
Gets a set of all C, then
Uses Sizzle.selectors.relative["~"] to replace each element with the first preceding sibling element matching B (or false if nonexistent), then
Uses Sizzle.selectors.relative["+"] to replace each element with the preceding sibling element if it matches A (or false if it doesn't), then
Returns all elements from the set at step 1 that stayed non-false through all subsequent steps
The problem here is that step 2 fails to report back all preceding siblings matching B, erroneously restricting the input set for subsequent step 3.
The text was updated successfully, but these errors were encountered:
…are left out. This is more accurate, but a little slower is some cases. -61 bytes compressed. Really fixes jQuery bug #11109. Closesjquerygh-86. Closesjquerygh-107.
Copied from http://bugs.jquery.com/ticket/11109
Test case: http://jsfiddle.net/JBBM8/
Because
Sizzle.selectors.relative
functions "return" only a single match, Sizzle can be trapped into a false negative with respect to preceding parts of the full selector when the relative selector tests against multiple elements (e.g.,"~"
and""
).I'm pretty sure that fixing this will require changing the
Sizzle.selectors.relative
Extension API to allow "returning" arrays, so I will hold off working on this until the core team weighs in with their comments/approval.Technical explanation: Given a query like
"A + B ~ C"
, Sizzle:C
, thenSizzle.selectors.relative["~"]
to replace each element with the first preceding sibling element matchingB
(orfalse
if nonexistent), thenSizzle.selectors.relative["+"]
to replace each element with the preceding sibling element if it matchesA
(orfalse
if it doesn't), thenfalse
through all subsequent stepsThe problem here is that step 2 fails to report back all preceding siblings matching
B
, erroneously restricting the input set for subsequent step 3.The text was updated successfully, but these errors were encountered: