DOM Source Of Selection replaces '&' with '&'

Bug #255524 reported by scribu
4
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Won't Fix
Low
firefox-3.0 (Ubuntu)
Won't Fix
Low
Mozilla Bugs

Bug Description

Binary package hint: firefox-3.0

When viewing a part of the source code of a web page, i.e. DOM Source of Selection, every '&' character (wheter in an url or otherwise) is replaced with it's html entity code, '&'.

I'm running Ubuntu 8.04 and the Firefox package version is 3.0.1+build1+nobinonly-0ubuntu0.8.04.3

ProblemType: Bug
Architecture: i386
Date: Thu Aug 7 01:32:28 2008
DistroRelease: Ubuntu 8.04
NonfreeKernelModules: fglrx
Package: firefox-3.0 3.0.1+build1+nobinonly-0ubuntu0.8.04.3
PackageArchitecture: i386
ProcEnviron:
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: firefox-3.0
Uname: Linux 2.6.24-19-generic i686

Tags: apport-bug
Revision history for this message
scribu (scribu) wrote :
Revision history for this message
Andreas Moog (ampelbein) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. However:

Isn't that what is supposed to happen? What does the code look like if you retrieve it via wget?

Changed in firefox-3.0:
assignee: nobody → andreas-moog
status: New → Incomplete
Revision history for this message
scribu (scribu) wrote :

It converts them even when they are actualy '&' in the code.

Revision history for this message
Andreas Moog (ampelbein) wrote :

I can't reproduce here. Could you give a detailed example?

Changed in firefox-3.0:
assignee: andreas-moog → nobody
Revision history for this message
scribu (scribu) wrote :

See this test file. When hit Ctrl+U and view the page source, I get:

 <a href="http://example.com?param=1&etc">Link text with & char</a>

but when I select the link text, right click and select 'View selection source', I get:

 <a href="http://example.com?param=1&amp;etc">Link text with &amp; char</a>

Revision history for this message
In , Andreas Moog (ampelbein) wrote :

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.2) Gecko/2008090211 Ubuntu/8.10 (intrepid) Firefox/3.0.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.2) Gecko/2008090211 Ubuntu/8.10 (intrepid) Firefox/3.0.1

When viewing a part of the source code of a web page, i.e. Source of Selection, every '&' character (wheter in an url or otherwise) is replaced with it's html entity code, '&amp;'.

Reproducible: Always

Steps to Reproduce:
1. See attached html-file.
2. Select the link
3. Right Click and choose source of selection
Actual Results:
<a href="http://example.com?param=1&amp;etc">Link text with &amp; char</a>

Expected Results:
<a href="http://example.com?param=1&etc">Link text with & char</a>

This bug was reported on Launchpad:
https://bugs.edge.launchpad.net/ubuntu/+source/firefox-3.0/+bug/255524

Revision history for this message
Andreas Moog (ampelbein) wrote :

Thanks for reporting this bug and any supporting documentation. I reported the issue upstream, you can track the status and make comments here: https://bugzilla.mozilla.org/show_bug.cgi?id=454655
Thanks for taking the time to make Ubuntu better!

Changed in firefox-3.0:
assignee: nobody → mozillateam
importance: Undecided → Low
status: Incomplete → Triaged
assignee: mozillateam → mozilla-bugs
Revision history for this message
In , Jruderman (jruderman) wrote :

View Selection Source serializes the DOM; it is not required to show a precise substring of the original source.

The DOM contains a '&' character, and the correct way to serialize that inside an href attribute is to convert it to "&amp;". It would be wasteful and difficult to "remember" that the original HTML was invalid and emit invalid HTML during serialization.

Revision history for this message
Andreas Moog (ampelbein) wrote :

Upstream won't fix it:

  ------- Comment #1 From Jesse Ruderman 2008-09-10 15:24:55 PDT (-) [reply] -------

View Selection Source serializes the DOM; it is not required to show a precise
substring of the original source.

The DOM contains a '&' character, and the correct way to serialize that inside
an href attribute is to convert it to "&amp;". It would be wasteful and
difficult to "remember" that the original HTML was invalid and emit invalid
HTML during serialization.

Revision history for this message
scribu (scribu) wrote :

Oh well...please close it then.

Andreas Moog (ampelbein)
Changed in firefox-3.0:
status: Triaged → Won't Fix
Changed in firefox:
status: Unknown → Won't Fix
Changed in firefox:
importance: Unknown → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.