Closed
Bug 37029
Opened 26 years ago
Closed 26 years ago
nsIDocumentEncoder::EncodeToString should output <head> contents if part of selection
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
VERIFIED
FIXED
M16
People
(Reporter: cmanske, Assigned: cmanske)
References
Details
Attachments
(1 file)
|
644 bytes,
patch
|
Details | Diff | Splinter Review |
We need to output the contents of the <head> region of a document in HTML
format. To do this, we would like to set the selection to the children of the
<head>, the call nsIDocumentEncoder::EncodeToString to get the formated
string.
| Assignee | ||
Comment 2•26 years ago
|
||
| Assignee | ||
Comment 3•26 years ago
|
||
Fix is ready. Set the selection to include <head> elements and use output flag
nsIDocumentEncoder::OutputSelectionOnly if you want to get HTML version of
<head>
Comment 4•26 years ago
|
||
This is very weird. nsHTMLToTXTSinkStream produces plaintext output, not html.
Yet Charley somehow was getting html output from it (I was there and saw it).
We need to figure out how we're getting into this class in the first place; the
change should be in nsHTMLContentSinkStream.cpp, not nsHTMLToTXTSinkStream.cpp.
Comment 5•26 years ago
|
||
It looks like this is working okay now, except that body tags are always part of
the selection (a known problem -- we had to add it in order to get the style
node on the body for multiline plaintext editing). Charley's going to look into
stripping the body tags out for this particular case. Bummer, really -- it
would be nice if we had a better place than the body tag to put plaintext style
elements like wrapcolumn.
Assignee: akkana → cmanske
Status: ASSIGNED → NEW
| Assignee | ||
Comment 6•26 years ago
|
||
I can easily truncate the output string at "<body", although I'm having some
difficulty trying to ensure that last character of the string is a newline!
Status: NEW → ASSIGNED
| Assignee | ||
Comment 7•26 years ago
|
||
Checked in 4/28
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 9•26 years ago
|
||
Akkana: Should we reopen this to change implementation to use a new flag
for OutputHeadOnly or to do output on a domFragment?
You need to log in
before you can comment on or make changes to this bug.
Description
•