Case-Sensitivity & SVG-in-HTML5

Vincent asked me to send a summary of the case-sensitivity problem
with SVG-in-HTML; I brought this up at SVG Open last week. This bug
occurs when attempting to select camelCase elements via JavaScript,
either using the Selectors API or getElementsByTagName.

The problem is trivial to reproduce: if you have an element with a
camelCase local name, such as an SVGTextPathElement, it is impossible
to select that element by tag name using querySelector,
querySelectorAll, or getElementsByTagName.

Test case here:

  http://bl.ocks.org/1322814

This bug affects other case-sensitive namespaces as well, such as
MathML. You can still select these elements using an alternative
means, such as by class or wildcard.

The WebKit bug is here:

  https://bugs.webkit.org/show_bug.cgi?id=46800

This bug does not occur on Firefox; you can select using a
case-matching selector, such as "textPath".

Personally, I would prefer for the selectors to be case-insensitive if
the containing document is case-insensitive (HTML5 doctype, in this
case). Or even everything to be case-insensitive in this case, which
differs from the proposal. [1] But at the least it should be possible
to select if your selector is case-matching.

Mike

[1] http://dev.w3.org/SVG/proposals/svg-html/svg-html-proposal.html#make_tokeniser_case-preserving

Received on Monday, 31 October 2011 16:16:53 UTC