Closed Bug 472071 Opened 16 years ago Closed 16 years ago

e.textContent.length != e.firstChild.textContent.length when they should be

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 194231

People

(Reporter: terrafrost, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5

http://www.frostjedi.com/terra/scripts/demo/ff-parent-vs-firstchild.php

In Opera, they're equal, as expected.  In Firefox, they're not.

http://www.frostjedi.com/terra/scripts/demo/ff-parent-vs-firstchild.php

Here, they're both equal.  In Firefox and in Opera.  The difference between the two is that the first one's textContent is being generated by <?php echo str_repeat(str_repeat('x', 63) . "\n", 128); ?> whereas the second one's textContent is being generated by <?php echo str_repeat(str_repeat('x', 63) . "\n", 127); ?>.

As for why you'd use e.firstChild as opposed to just e...

http://www.frostjedi.com/terra/scripts/demo/ff-first-child.php

Copy / paste the highlighted text, there, and you'll see that every line is preceded by four spaces.

http://www.frostjedi.com/terra/scripts/demo/ff-first-child2.php

Copy / paste that text and the four spaces are gone.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
The problem is that there are two textNodes side by side:

http://www.frostjedi.com/terra/scripts/demo/ff-first-child4.php
(In reply to comment #1)
> The problem is that there are two textNodes side by side:
> 
> http://www.frostjedi.com/terra/scripts/demo/ff-first-child4.php

Same as bug 194231 then?
Component: General → DOM: Core & HTML
Product: Firefox → Core
QA Contact: general → general
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.