[webkit-dev] a question about node.h

Maciej Stachowiak mjs at apple.com
Sat May 2 01:12:03 PDT 2009


On May 2, 2009, at 12:48 AM, Shi Yan wrote:

> hello guys,
>
> i'm trying to modify the qt-webkit. i want to implement the a feature
> such that given a node object, i can get the html element inside. i'm
> developing under visual studio. i can see a member of the node class
> named [webcore::element], when i debug my code in the visual studio
> debuger. but if i open the node.h source code, i cannot see a
> corresponding member defined in the class. this seems to be weird.
>
> the node class is inherent from two other classes, public EventTarget
> and public TreeShared<Node>. i also checked them, but didn't find the
> member i want.
>
> so, how can i get the inner element contained by a node? or did i
> misunderstand something?

Nodes don't contain an inner Element. Elements are a kind of Node. Not  
all Nodes in the DOM tree are Elements, but some are. Without knowing  
more about the purpose of your request, I don't think I can help  
further. You may wish to study the DOM 3 Core specification which  
explains the nature of the DOM tree in some detail: <http://www.w3.org/TR/DOM-Level-3-Core/ 
 >.

  - Maciej



More information about the webkit-dev mailing list