Firefox 10, BibTemplate, and the catalogue – heads up


We discovered today that Firefox 10 (coming to desktops near you over the past few days) reacts strongly to some things that it always used to accept without complaint – which can end up in a degraded or completely broken catalogue, depending on how you’ve customized it with BibTemplate.

Long story short, we’ve been able to figure out that Firefox 10 is reacting to particular CSS3 selector syntax combinations. A solid clue is if you check the JavaScript error console, you might see a warning like:

Warning: An unbalanced tree was written using document.write() causing data from the network to be reparsed.

The warning also links to Optimizing your pages for speculative parsing from the Mozilla project, which sort of helps; at least it is clear that the Firefox project is trading fault-tolerance for speed. One thing that is known to make it angry is attribute values without quotes; for example:

  • query='datafield[tag=245]' /* breaks in Firefox 10 */
  • query='datafield[tag="245"]' /* works in Firefox 10 */

We have also determined that CSS3 selector syntax that uses hierarchies is also broken, at least in some cases. For example:

  • query='datafield[tag="245"] subfield[code="a"]' /* breaks in Firefox 10 */

The current recommended workaround is to wrap another dojo.query() function and
select the second element of the CSS2 selector syntax that way; for example:


<td type='opac/slot-data' query='datafield[tag="245"]'>
<script type='opac/slot-format'>< ![CDATA[ dojo.query('subfield[code="a"]', item).forEach(function(item) { /* code you would have previously dumped directly in the script tag */ }); ]]></script>
</td>

This isn’t perfect, by any means, but it should get you on the road to getting Firefox 10 working better than it might be right now. If you want to see what we’re doing at Conifer, you can follow along with our skins branch. (I’m trying not to put too much profanity in the commit messages).

Many thanks to Dan Wells for figuring out the CSS3 selector quoting; this Firefox 10 incompatibility absolutely blindsided us all and it’s always nice to have a calm voice of reason sorting things out šŸ™‚


About Dan Scott

I'm the systems librarian for Laurentian University, with a background in information architecture, database software development, and project planning from spending 8 years with IBM.