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.
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.
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 ***