Finally my otherwise useless knowledge of Javascript, the XML DOM, and funky browser quirks has come in handy. All those hours of firebugging, unwasted after all
Explanation:
The common thread here is that all the browsers that had this problem are based around a piece of software called WebKit, which in turn was based off of KHTML. WebKit and KHTML are
rendering engines or pieces of software designed to tackle the immense task of looking at a web page and deciding how it should look. I realized that the problem affected only WebKit, because Gecko-based browsers (Firefox) and Trident-based browsers (IE) didn't display the problem. I think what went on, and I can't confirm this, is that the button traversed up two levels to find which box to open rather than one. See, the way a single spoiler is arranged is using invisible boxes (HTML programmers call them <div> tags) like this:
wrapper box said:
[ button ]
spoiler said:
The actual spoiler goes here
What the button does is it has this event called onclick, so that when you click it it has a function attached that basically means, "find the first <div> tag under the tag two levels up of where I am; if it's invisible, make it visible, otherwise make it invisible." If you look at an HTML document as a tree, going up two levels means look at the <div> that is ABOVE (outside of) the actual spoiler tag. So it's basically showing and hiding the wrong piece of the document. Hell, I'm surprised that didn't completely screw up every post it was in. What I did was rewrite the code so that it correctly traversed the document and correctly found the <div> it was looking for by using standardized DOM methods. It might break compatibility with older browsers or IE, but it is W3C compliant which means if it doesn't work, it's the fault of the person or company that wrote your web browser, not me. </geekrant>
--Danny :ninja: