Closed Bug 155635 Opened 22 years ago Closed 22 years ago

View Selection Source replaces non-breaking spaces

Categories

(Core Graveyard :: View Source, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 165686

People

(Reporter: InvisibleSmiley, Assigned: doronr)

Details

Reproducible: Always
Steps to reproduce:
1. Go to some page with content that you know contains non-breaking spaces
( ) - or simply create one.
2. Select the area containing the nbsp. and right-click on it, selecting "View
Selection Source".
3. View Source Code of the page and scroll to the according area.

Actual Results:
View Selection Source replaces the nbsp.s by plain spaces, thus making this
source view kind of useless for web developers who need the actual source being
viewed. View Page Source is showing everything as-is, i.e. correctly.

Expected Results:
The according areas shown by both View Selection Source and View Page/Frame
Source should exactly match. Maybe the problem is not limited to nbsp.s - please
investigate that in the Mozilla sources, I'm not involved enough in the project
to do that.
cc:roc
There is no way to have "selection source" match the original text, since
"selection source" shows HTML that would lead to the page's DOM (and the DOM may
well have been modified with scripts and the like).

But we _should_ be escaping non-breaking spaces with the corresponding entity...
OK, agreed; I didn't know Selection Source uses generated source code. But don't
forget to also change back other entities: German Umlaute appear converted to
ISO-Latin1 or-whatever, for example, even if the corresponding entities were
used in the original source code. One question could be if that transformation
should also be done for non-HTML/XML files such as *.txt (which shows up in
<pre> in Selection Source)...
> But we _should_ be escaping non-breaking spaces with the corresponding
> entity...

The content that is displayed comes direcly from the DOM function |.innerHTML|,
so perhaps that function isn't reverting things properly.

> I didn't know Selection Source uses generated source code.

The name "View Selection Source" was a compromise between a more precise but
long name, and a less precise and common name.
Status: UNCONFIRMED → NEW
Ever confirmed: true
So, is it that hard to implement (re-)converting non-breaking spaces? Let's say
forget about other entities, why not implement the basic needs for now?

*** This bug has been marked as a duplicate of 165686 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Product: Browser → Seamonkey
Product: SeaMonkey → Core Graveyard
You need to log in before you can comment on or make changes to this bug.