with tagTokenRe defined as /^(#)?([\w\-\*\\]+)/ and path as '<123/>', tokenMatch will always be null for ids starting with a non-word char, and thus the DomQuery will not search matching token by ids.
We've found that having a number at the start of the ID causes a massive error - DOM Exception 12. Sure, having numbers at the start of ID attributes is illegal - but at least 3.x and 4.0.x (and even 4.1 RC1) previously didn't explode.
We've reverted back to RC1 for the time being which seemed to be getting there. There are too many strange behaviours and seemingly fundamental changes in RC2 causing bugs that we don't have time right now to look into.
This is not supported. The fact that RC1 did not enforce the HTML5 rule should not be a cause to stop using.
Several items that were allowed in 4.07 are not enforced in 4.1. To be compliant, rules have to be enforced.
188.8.131.52 The id attributeThe id attribute specifies its element's unique identifier (ID). The value must be unique amongst all the IDs in the element's home subtree and must contain at least one character. The value must not contain any space characters.An element's unique identifier can be used for a variety of purposes, most notably as a way to link to specific parts of a document using fragment identifiers, as a way to target an element when scripting, and as a way to style a specific element from CSS.If the value is not the empty string, user agents must associate the element with the given value (exactly, including any space characters) for the purposes of ID matching within the element's home subtree (e.g. for selectors in CSS or for the getElementById() method in the DOM).
Identifiers are opaque strings. Particular meanings should not be derived from the value of the id attribute.
This specification doesn't preclude an element having multiple IDs, if other mechanisms (e.g. DOM Core methods) can set an element's ID in a way that doesn't conflict with the id attribute.
The id IDL attribute must reflect the id content attribute.
imho, the rule being enforced in this specific case (basically ids should be an xml token) is not an HTML 5 rule (or at least I could not figure out where this rule is specified) . Can your review this and eventually file it as a bug ?