[webkit-dev] DOM Serialization?

ZHOU Xiao-bo zhxb.ustc at gmail.com
Sun Jan 24 00:26:35 PST 2010

---------- Forwarded message ----------
From: ZHOU Xiao-bo <zhxb.ustc at gmail.com>
Date: 2010/1/24
Subject: Re: [webkit-dev] DOM Serialization?
To: Christopher White <skullknife at gmail.com>

I think you can do that, if you don't care about the strick definition of

Actually, a Node is composed of Attrs which are <key, value> pairs. And
'key' and 'value' are strings.

So, you can just use TLVs to store the Node's type and Attrs. You can either
ignore its non-string member variables, because you can rebuild them through
Attrs or store them in
TLVs too.

As for the implimentation, you can write a two friend functions for every
class derived from Node to make serialization and deserialization. And the
function 'createmarkup' may give you some clue.

BTW: the DOM Level 3 defines Load & Save interface of DOM, does WebCore
impliment that.

2010/1/22 Christopher White <skullknife at gmail.com>

> Is it possible to save the DOM resulting from the parsing of HTML / CSS
> into a file and then read it back instead of re-parsing the HTML (similar to
> Java object serialization). Does it save any time or is it a wash?
> I know there is a dump render tree function but does it save everything you
> need so that you can re-render the HTML page w/o the original HTML / CSS
> files?
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100124/2f157661/attachment.html>

More information about the webkit-dev mailing list