-
-
Couldn't load subscription status.
- Fork 120
Description
Some internal mathbox functions query Mathbox's DOM using invalid CSS selector queries.
For example:
- Edit Mathbox source at
https://gitgud.io/unconed/mathbox/-/blob/master/src/model/model.js#L322toconsole.logits first argument, a css selector query. - Rebuild, and load
examples/test/rtt.html
You will find that one of the queries logged to console is the string
vec4 getSample(vec2 xy);
vec4 getFramesSample(vec2 xy) { return getSample(xy); }
which is clearly not a valid css selector query.
Do we care?
Probably not right now.
I suspect Mathbox has always made these invalid queries, and the css-selection library cssauron tolerated them fine: it would just return false since no elements matched these invalid selectors. These invalid queries seem not to be causing any bugs.
I discovered this while working on replacing cssauron with css-select. The new library, css-select, is a bit stricter in that it throws errors when passed invalid css selectors. This error-throwing behavior seems desirable to me. (For one thing, it's consistent with the browser-native Element.querySelector API.)
Embracing the new error-throwing behavior probably requires preventing Mathbox internal functions from making these invalid CSS queries.