Subject: Re: ReSpec patch for IE9+
From: Robin Berjon <[email-masked]>
To: Travis Leithead <[email-masked]>
Cc: Adrian Bateman <[email-masked]>
Date: Tue, 29 Nov 2011 14:03:09 +0000

On Nov 28, 2011, at 20:15 , Travis Leithead wrote:
> I found a couple more issues that I'd like to bring to your attention. These aren't blockers for me, but I figured you'd like to know.
>
> 1)
>
> In the function "sh_getXMLHttpRequest" of "sh_main.min.js" ([email-masked]), there's a poor feature detect that routes IE down a legacy ActiveX code path instead of using its native XMLHttpRequest object:

Yeech, this is horrible indeed, hadn't seen it. In general I'm not happy with the syntax highlighter in v1. It was the best thing available that I could easily integrate at the time, but there are better options now. In v2 I use another one that has fewer problems — I'll see how hard it is to include it in v1 as well (but probably not in the next two weeks).

> Specs that are hosted on sites other than "dev.w3.org" run into a cross-origin XHR problem when spec authors use <pre> tags with classes prefixed with "sh_". This happens because "sh_highlightDocument" is passed "this.base" which is "dev.w3.org". Then, in the intervening logic of the minified code, any "sh_" prefixed class values end up using XHR to dynamically load the associated file. Of course, XHR's permissions use the document.domain's domain, and in some cases (Contacts API being one example; http://w3c-test.org/dap/contacts/) "dev.w3.org" is clearly cross-domain from "w3c-test.org".

Yes, I'm aware of this issue. Again, this is something that v2 fixes by adding a build step that packages all the dependencies into one single file using RequireJS. Unfortunately, the contract that was funding my work on ReSpec ended about a year ago so plans for v2 have been delayed quite a bit. W3C is looking into funding that since so many specs are now using it, so I have good hopes that I'll be able to take it out of alpha next year. Most of it is already done (I use it for my own stuff), it mostly needs polish and testing. Fingers crossed!

In the meantime I'll try to swap the sh_* stuff out as that's a useful short term improvement.

> I can live with the current results, but I figured you'd like to at least be aware of this.

Thanks for the heads up!

One thing I forgot to mention in my previous email: don't hesitate to patch and commit to ReSpec directly. We do commit then review (I get emails with all the commits, and read them). It's a bit of a pain to patch since it's a good example of what happens when you start with a fifty lines hack and grow organically from there, but so far we've managed ;-)

--
Robin Berjon - http://berjon.com/ - @robinberjon