We should merge MarkupAccumulator and MarkupAccumulatorWrapper. This is a follow up bug for https://bugs.webkit.org/show_bug.cgi?id=43227.
Created attachment 64084 [details]
first attempt to merge
This is my first attempt to merge the two classes. I merged MarkupAccumulator::appendMarkup and serializeNodes to centralize all serializations in one place. But I feel like this approach is wrong because serializations done in two different versions of createMarkup are so different. I should probably add a recursive serializeNodesWithNamespace to replace MarkupAccumulator::appendMarkup instead. serializeNodesWithNamespace can take MarkupAccumulatorWrapper as an argument and this will allow us to merge two classes.
Created attachment 64148 [details]
(In reply to comment #2)
> Created an attachment (id=64148) [details]
In this patch, I didn't try to merge two serializations. But instead, I added serializeNodeWithNamespaces which uses MarkupAccumulatorWrapper for the node version of createMarkup. I'm intending to put most of functions in markup.cpp into MarkupAccumulatorWrapper and rename it to MarkupAccumulator once this patch is landed.
Comment on attachment 64148 [details]
Committed r65265: <http://trac.webkit.org/changeset/65265>