Commit dbab0d33 authored by timeless%mozdev.org's avatar timeless%mozdev.org

Bug 320275 !Node "compat" hack is very broken

r=myk a=justdave
parent db151383
......@@ -109,9 +109,11 @@
[% END %]
<script type="text/javascript">
if (!Node) {
/* MSIE doesn't define Node, so provide a compatibility array */
var Node = { TEXT_NODE: 3 };
if (typeof Node == 'undefined') {
/* MSIE doesn't define Node, so provide a compatibility object */
window.Node = {
TEXT_NODE: 3
};
}
function toggleDisplay(node)
......@@ -143,7 +145,7 @@ function listToggle(event)
}
}
</script>
</script>
[% PROCESS global/footer.html.tmpl %]
......
......@@ -32,7 +32,8 @@
/* Outputs a link to call replyToComment(); used to reduce HTML output */
function addReplyLink(id) {
/* XXX this should really be updated to use the DOM Core's
* createElement, but finding a container isn't trivial */
* createElement, but finding a container isn't trivial.
*/
document.write('[<a href="#add_comment" onclick="replyToComment(' +
id + ');">reply<' + '/a>]');
}
......@@ -44,7 +45,8 @@
var text = getText(text_elem);
/* make sure we split on all newlines -- IE or Moz use \r and \n
* respectively */
* respectively.
*/
text = text.split(/\r|\n/);
var replytext = "";
......@@ -67,9 +69,9 @@
textarea.focus();
}
if (!Node) {
/* MSIE doesn't define Node, so provide a compatibility array */
var Node = {
if (typeof Node == 'undefined') {
/* MSIE doesn't define Node, so provide a compatibility object */
window.Node = {
TEXT_NODE: 3,
ENTITY_REFERENCE_NODE: 5
};
......@@ -77,7 +79,8 @@
/* Concatenates all text from element's childNodes. This is used
* instead of innerHTML because we want the actual text (and
* innerText is non-standard) */
* innerText is non-standard).
*/
function getText(element) {
var child, text = "";
for (var i=0; i < element.childNodes.length; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment