[webkit-gtk] webkit_dom_element_get_elements_by_tag_name doesn't work properly

Ángel Luis angelluispg89 at hotmail.com
Thu Nov 21 11:25:18 PST 2013


I am trying to print name of nodes from DOM with WebKitGTK with the 
following code:

|WebKitDOMDocument  *dom=  webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(webView));
     WebKitDOMNodeList*  video=  webkit_dom_element_get_elements_by_tag_name(dom,  "*");

     gulong element_count=  webkit_dom_node_list_get_length(video);
     int  i=  0;
     for  (i=  0;  i<  element_count;  i++)
         {
         WebKitDOMNode  *element=  webkit_dom_node_list_item(video,  i);
         printf("tag: %s\n",webkit_dom_node_get_node_name(element));

     }

|

And I have the following webpage:

|<!DOCTYPE html>
<html>
<head>
     </head>
<body>
<video id="video"autoplay preload="none"width="320"height="240">
<source src="./movie.ogg"type="video/ogg">
                 Yourbrowser does not support the video tag.
</video>
     <video id="video2"width="320"height="240"autoplay preload="none">
<source src="./movie.ogg"type="video/ogg">
Yourbrowser does not support the video tag.
          </video>
     <input type="hidden"id="prueba"name="finish"value="false">
     </body>
</html>

|

And the output of my program is:

|tag:  HTML
tag:  HEAD
tag:  BODY|

I don't understand why it output that, the output should be:

|tag:  HTML
tag:  HEAD
tag:  BODY
tag:  VIDEO
tag:  SOURCE
tag:  VIDEO
tag:  SOURCE
tag:  INPUT|

Anyone know what's happend?

Thanks


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20131121/4ec32de1/attachment.html>


More information about the webkit-gtk mailing list