Closed Bug 1576899 Opened 3 months ago Closed 3 months ago

Set output argument in `nsIContentSerializer::Init` instead of passing it to `nsIContentSerializer::Append*`

Categories

(Core :: DOM: Serializers, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: mbrodesser, Assigned: mbrodesser)

Details

Attachments

(1 file)

No description provided.
Assignee: nobody → mbrodesser

Before, all nsIContentSerializer::Append* methods took an output
string. The state of nsPlainTextSerializer depended on the string
pointing to the same object.

Now, it's ensured that the same output string is used between
nsIContentSerializer::Init and nsIContentSerializer::Finish.

Moreover, nsHTMLCopyEncoder::EncodeToStringWithContext re-used
mSerializer without initializing it again. This was error-prone,
because after serializing with mSerializer, it's internal state might
have changed to an undesirable one (e.g.
nsPlainTextSerializer::mWrapColumn could've been modified).
Hence, it is now initialized again before serializing the common
ancestors.

Pushed by mbrodesser@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/10716060af24
change `nsIContentSerializer` to take output string as argument in `nsIContentSerializer::Init`. r=hsivonen
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.