There are a few cross-browser incompatibilities with the demo that prevent it from working at all in Safari, and cause rendering glitches in Firefox. I've included a patch diff below with the fixes:

diff -r CalaisPHPDemo_08May29/src/public/ViewerJSON/CalaisViewerJSON.html CalaisPHPDemo_08May29_original/src/public/ViewerJSON/CalaisViewerJSON.html
41c41
<         <div id="CalaisJSONInfo" style="display: none; position: absolute; top:80; left:7;">
---
>         <div id="CalaisJSONInfo" style="visibility: hidden; position: absolute; top:80; left:7;">
78,83c78
<                         {
<                             var textNode = br.ownerDocument.createTextNode(smalltxts[j]);
<                             br.parentNode.insertBefore(textNode, br.nextSibling);
< // Pete - Removed due to lack of insertAdjacentText function in Safari
< //                            br.insertAdjacentText("afterEnd", smalltxts[j]);
<                         }
---
>                             br.insertAdjacentText("afterEnd", smalltxts[j]);
diff -r CalaisPHPDemo_08May29/src/public/ViewerJSON/js/clfframeattributes.js CalaisPHPDemo_08May29_original/src/public/ViewerJSON/js/clfframeattributes.js
65c65
<     if ((this.allTerms!=null) && (this.allTerms[this.category] != null))
---
>     if (this.allTerms[this.category] != null)

I've also made the demo available online, with integrated CAPTCHA to prevent robot usage. I don't see anything in the Terms of Service or elsewhere to discourage this, but let me know if this is considered improper and I'll take it down.

 


Comments

Hi Pete,

Can you please help us in isolating/reproducing the Firefox glitches by answering the questions below?
1. Operating system used
2. Firefox version used
3. Which actions trigger the behavior (mouse-over, clicks, double-clicks, specific entities/events, etc.) ?
4. What is the behavior exactly (flickers, overlapping images, etc.)?
5. If possible, can you send the text you used?

Thanks,
Shai Dagan

Here's a bug report, hope this helps:


Summary:
Running the PHP demo in Firefox on OS X draws an extra frame over part of the results. The results page suffers a Javascript error and only displays an error message in Safari.


Reproduction steps:
Download CalaisPHPDemo_08May29.zip
Unzip onto a folder on your server
Copy JSON.php from src/pear/ to src/public
Navigate to src/public/CalaisPHPDemo.html in Firefox 2.0.15 or Safari Version 3.1.1 on OS X 10.5.3
(I have a version online at http://funhousepicture.com/calaisdemo_original/src/public/CalaisPHPDemo.... )
Copy and past the text from the example file test/text1.txt (asteroid news story) into the main text box
Leave the format pulldown on Document Viewer Style
Click on the Show Results button


Results:
On Firefox the document text shows up, but there's a pair of scroll bars partially obscuring the top portion. I've uploaded a screenshot as http://funhousepicture.com/calais_firefox_result.png
On Safari, the result page is just the logo and a message stating 'Unsupported Document'. The screenshot is http://funhousepicture.com/calais_safari_result.png
I'd expect to see the results page rendered as it does in Internet Explorer.


Regression:
I was able to run the demo with no problems on Internet Explorer 7 on Windows Vista. I don't see the scroll-bar issue on Firefox 2.0.14 on Vista either.


Notes:
By poking around with Firebug, I determined that the bogus scrollbars came from the CalaisJSONInfo element with its style set to 'visibility: hidden;', which still affects layout, whereas 'display:none;' makes it truly vanish. This may or may not be the correct fix depending on your intent, but it does remove the rendering glitch.
The Safari error was a bit more involved. The immediate cause was an exception in the initHighlight() Javascript, but it was unclear why that was happening. After some debugging with Drosera I found a couple of places where the code didn't sit well with Safari's JS host that caused errors, notably a use of insertAdjacentText() which is unsupported in webkit, and a null check that for some reason caused an error. After working around those I was able to see the result document successfully.

Pete:

No problem whatsoever with making the demo available online.

We'll also take a look at the code and see about releasing a more Safari / Firefox friendly update.

Thanks for taking the time to post the code and deploy the demo!

Regards,