In my Firefox 1.5 (on Win XP Pro) a <BR>
element's .textContent returns the empty string.
I have no idea why they (W3C) construed this to
be reasonable, but it was contested, and denied
here:
https://bugzilla.mozilla.org/show_bug.cgi?id=316063
Boris suggests doing something else to get what
I believe most users are really after, but doesn't
say what. Here's a possible approach, with initial
tests working in my FF1.5:
HTMLBRElement.p rototype.__defi neGetter__("inn erText",
function() {return "\n";});
Node.prototype. __defineGetter_ _("innerText" ,
function() {
if (!this.firstChi ld) return this.textConten t;
s=this.firstChi ld;
var res=s.innerText ;
while (s=s.nextSiblin g) res+=s.innerTex t;
return res; });
However, it would be FFFFAAAAAAARRRR nicer
to simply redefine .textContent on the
HTMLBRElement.p rototype and not muck about
with innerText, all on account of the <BRelement
adhering to a standard (whose reasonableness
on this point escapes me). However, the following
line is ignored as far as I can tell - any ideas?:
HTMLBRElement.p rototype.__defi neGetter__("tex tContent",
function() {return "\n";});
Thanks,
Csaba Gabor from Vienna