<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 5, 2008, at 10:22 AM, Darin Fisher wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Wed, Nov 5, 2008 at 7:04 AM, Maciej Stachowiak <span dir="ltr">&lt;<a href="mailto:mjs@apple.com">mjs@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> <div style="word-wrap:break-word"><div class="Ih2E3d"><br><div><div>On Oct 30, 2008, at 9:47 AM, Darin Fisher wrote:</div><br><blockquote type="cite"><div class="gmail_quote"><div><br></div><div>We have code to support this feature in the Chromium code base. &nbsp;You can find it here:</div> <div><a href="http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/dom_serializer.h?view=markup" target="_blank">http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/dom_serializer.h?view=markup</a><br></div> <div><a href="http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/dom_serializer.cc?view=markup" target="_blank">http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/dom_serializer.cc?view=markup</a></div> <div> <br></div><div>It is something we would love to one day see as part of WebKit.</div></div></blockquote><br></div></div><div>WebKit already includes code to serialize the DOM, in WebCore/editing/markup.cpp. This is used by innerHTML, XMLSerializer, the clipboard code, Web archives, and other things. I think a better approach to a "save as Web page, complete" style feature would be to use the existing DOM serialization code (fixing bugs, if necessary), instead of adding completely separate DOM serialization code. The only tricky part is fixing up URL references in the markup to point to the right place for saved subresources.</div> <div><br></div><div>Regards,</div><div>Maciej</div><font color="#888888"><div><br></div></font></div></blockquote></div><br><div><br></div><div>I agree. &nbsp;I would rather see that happen too. &nbsp;Our code was created because we didn't want to fork WebCore, but we are happy to see it die in favor of enchancements to markup.cpp. &nbsp;There is more than just fixing up URLs. &nbsp;We also need to deal with charset encoding issues, base tags, and motw (for windows). &nbsp;There may be a few other subtle details to get right.</div></blockquote><br></div><div>Your code also has some obvious bugs that are not in the WebCore code. For instance it serializes the following incorrectly:</div><div><br></div><div><div>&lt;p style="color: red">&lt;/p></div><div>&lt;b>bold line&lt;/b></div><div><br></div><div>Regards,</div><div>Maciej</div><div><br></div></div></body></html>