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

RESOLVED WONTFIX

Status

()

Core
Serializers
--
minor
RESOLVED WONTFIX
10 years ago
8 years ago

People

(Reporter: Andreas Moog, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

10 years ago
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, '&'. 



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

Comment 1

10 years ago
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.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 10 years ago
Component: General → Serializers
Product: Firefox → Core
QA Contact: general → dom-to-text
Resolution: --- → WONTFIX

Updated

8 years ago
You need to log in before you can comment on or make changes to this bug.