[webkit-dev] DOM Serialization?

2010-01-24 Thread ZHOU Xiao-bo
-- Forwarded message --
From: ZHOU Xiao-bo zhxb.u...@gmail.com
Date: 2010/1/24
Subject: Re: [webkit-dev] DOM Serialization?
To: Christopher White skullkn...@gmail.com


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

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 skullkn...@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@lists.webkit.org
 http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] build-webkit but not all of it

2009-10-27 Thread ZHOU Xiao-bo
Use autogen and configure?

2009/10/27 Alexander Cohen naft...@me.com

 Is there a cmd to run if i only want to rebuild WebCore but not touch any
 of the other frameworks, something similar to build-webkit?

 thx

 AC
 ___
 webkit-dev mailing list
 webkit-dev@lists.webkit.org
 http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Windows Multithread issue

2009-06-16 Thread ZHOU Xiao-bo
There are so many classes containing static hashmap, such as string.
Cache is a singleton and the contents it caches is not thread-safe.
As for js, JSGlobalOjbect is linked by a list.


2009/6/16 John Abd-El-Malek j...@google.com

 Yes it's possible.  The Chromium port runs web views in different
 processes.  You can look at the design docs and source to see how it's done,
 that should give you an idea of what you have to do this on different
 threads.

 2009/6/15 熊科浪 xiongkel...@hotmail.com


 hi
 I want to develop c++ application that uses WebKit on Windows. Can I
 start a thread for each web view? or I must ceate every web view and handle
 every event in the main thread?and why?are there any plan to change it?

 Thank you.

 --
 clive
 --
 立刻下载 MSN 保护盾,保障Messenger 安全稳定! 现在就下载! http://im.live.cn/safe/

 ___
 webkit-dev mailing list
 webkit-dev@lists.webkit.org
 http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev



 ___
 webkit-dev mailing list
 webkit-dev@lists.webkit.org
 http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] about hashmap staticDOMObjects

2009-04-22 Thread ZHOU Xiao-bo
hi all:
 I still don't understand the purpose of the HashMap:

static DOMObjectMap domObjects()
{
// Don't use malloc here. Calling malloc from a mark function can
deadlock.
static DOMObjectMap staticDOMObjects;
return staticDOMObjects;
}

what kind of DOMObjects should be stored in it? And why?
I searched the source codes and I found that these classes below will do
that:

Document, Event, HTMLCollection, XMLHttpRequest, CanvasGradient,
CanvasPattern, CanvasRenderingContext2D, DOMCoreException,
DOMImplementation, DOMParser, EventException, History, NamedNodeMap,
NodeFilter, NodeIterator, NodeList, Range, RangeException, TreeWalker,
XMLHttpRequestException, XMLSerializer, Clipboard

but what's the reason? Is it because these classes are essentially simple
and just acting as a tool?

thanks a lot
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] about hashmap staticDOMObjects

2009-04-22 Thread ZHOU Xiao-bo
oh, I got an idea:
Is it because these domobjects doesn't belong to a Document, so they can't
be
stored in

static NodePerDocMap domNodesPerDocument()
{
ASSERT(JSLock::lockCount());
static NodePerDocMap staticDOMNodesPerDocument;
return staticDOMNodesPerDocument;
}




2009/4/22 ZHOU Xiao-bo zhxb.u...@gmail.com

 hi all:
  I still don't understand the purpose of the HashMap:

 static DOMObjectMap domObjects()
 {
 // Don't use malloc here. Calling malloc from a mark function can
 deadlock.
 static DOMObjectMap staticDOMObjects;
 return staticDOMObjects;
 }

 what kind of DOMObjects should be stored in it? And why?
 I searched the source codes and I found that these classes below will do
 that:

 Document, Event, HTMLCollection, XMLHttpRequest, CanvasGradient,
 CanvasPattern, CanvasRenderingContext2D, DOMCoreException,
 DOMImplementation, DOMParser, EventException, History, NamedNodeMap,
 NodeFilter, NodeIterator, NodeList, Range, RangeException, TreeWalker,
 XMLHttpRequestException, XMLSerializer, Clipboard

 but what's the reason? Is it because these classes are essentially simple
 and just acting as a tool?

 thanks a lot

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] about WTF::HashMap::iterator

2009-04-08 Thread ZHOU Xiao-bo
hi all:
  WTF::Hashmap::iterator uses WTF::HashTable::iterator as its m_impl.
When you call 'remove( oldIter )', the current 'iter' may be changed. And
it's not about memory reallocation or element shift, but it's because the
member variable 'm_table' in WTF::HashTable::iterator may become NULL
if there is only one entry in the HashMap before you call remove( olditer ).

So, how can I delete an element of a HashMap when I traversing the
container? e.x.

while( iter ) {
  oldIt = iter;
  ++iter;
  remove( oldIT ); // not always safe
}

thx
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] about referencing objects between JavaScriptCore and WebCore

2009-03-23 Thread ZHOU Xiao-bo
dear all:

I have a question about the objects referencing between Javasciptcore
and WebCore:

JSNode uses m_impl to reference a Node in WebCore. And when
KJS::Collector::collect() is called the function mark() of each JSNode is
invoked to keep the corresponding Node in WebCore alive in memory.

The problem is: I want to seperate the memory managment of
each page. To do so, I allocate a large block of memory for eache page,
and delete it when loading the next page. ( I have commented out
'pagecache', 'backforwardlist' etc.)

But, when it jumps back to a page which has been visited before, and a
block of
javascipt codes is excuted, it crashes when JSNode use m_impl to reference
a Node in WebCore. The reason is m_impl is pointing an empty memory block.

   I used gdb to examine the value of m_impl, and I found that it likely
contained an
address  of a Node created when this page was loaded the first time.

   My question is: how do JavaSciptCore maintain the JSNode(s) to make them
reference
the old Nodes? And how can I force JSNode's m_impl reference the new Node?

   Do I make myself clear?
   Appreciate any clues!

thx!

ZHOU Xiao-bo
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev