Open Bug 739184 Opened 10 years ago Updated 10 years ago

Don't involve the HTML parser in View Source when an external editor is in use

Categories

(Toolkit :: View Source, defect)

defect
Not set
normal

Tracking

()

People

(Reporter: hsivonen, Unassigned)

References

()

Details

http://mxr.mozilla.org/mozilla-central/source/toolkit/components/viewsource/content/viewSourceUtils.js#159

When an external editor is used for View Source, the page is a non-file:-URL page and the page is in cache, the code in viewSourceUtils.js loads the source into a broken docshell using the HTML parser, takes the textContent of the body of the syntax-highlighted DOM and dumps that into a temporary file encoded using the encoding of the document.

Changes to the HTML parser have broken this feature twice now. (This feature has no tests. That's bug 712227.)

Instead of involving the HTML parser, viewSourceUtils.js should obtain the bytes from the cache by some other means.

See also bug 712229.
See Also: → 712229
Remember to undo the hack from bug 739033 when fixing this.
Well, depending on how much of docshell internals you're willing to expose, you could get the page descriptor's cache key and set that on the XHR's caching channel. Dunno what you would do for the source of postdata documents though.
You need to log in before you can comment on or make changes to this bug.