Closed Bug 727459 Opened 12 years ago Closed 12 years ago

gatherTextUnder function adds bogus white space on empty nested elements

Categories

(Firefox :: Untriaged, defect)

10 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 306937

People

(Reporter: jgbishop, Unassigned)

References

()

Details

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.1) Gecko/20100101 Firefox/10.0.1
Build ID: 20120208060813

Steps to reproduce:

The gatherTextUnder() function, which happens to be called by the gContextMenu.linkText() function, adds a bogus space character for empty nested elements. Take the following two example links:

<a href="http://www.example.com/some/path">ThisLongTextIs<span></span>JammedAllTogether</a>
<a href="http://www.example.com/another/path">AnotherLongWord<wbr>WithNoSpaces</a>

In both of these cases, each link contains no space, but both contain an empty nested element. Calling gatherTextUnder() will insert a space where the empty element resided, resulting in a different string than what was there previously. This can be reproduced using the CoLT extension (http://www.borngeek.com/firefox/colt/), which simply uses the linkText() function in the gContextMenu global object.


Actual results:

A space is inserted in the resulting text, in the place of the empty element.


Expected results:

No space should be inserted.
I should have supplied the resulting strings in my original post. Here's the text I get when using gatherTextUnder (via linkText()):

Link 1 Actual: ThisLongTextIs JammedAllTogether
Link 1 Expected: ThisLongTextIsJammedAllTogether

Link 2 Actual: AnotherLongWord WithNoSpaces
Link 2 Expected: AnotherLongWordWithNoSpaces
Hi, this seems the same as bug 306937. Want to try fixing that?
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.