how to get a serialization of a browsers rendering tree (in C#)
I need a way to analyse a web page with all its layout relevant information (HTML + relevant CSS). For this, the DOM Tree is not enough, and so I was thinking that the best solution would be to analyse the browsers rendering tree (aka frame tree).
Can anybody help me, how i possibly could get to a serialisation of the rendering tree?
The analysis I would like to make is to get the answer if anything visible has changed on the user interface. The rendering tree (as I have read) 开发者_开发问答is the browsers-internal tree that is extracted out from the DOM tree and is used to render the page. So DOM elements that are not visible are not part of the rendering tree. Hope this makes my questio clearer...
There is a tool named DumpRenderTree which comes along with the source code of WebKit (chrome as well as it is based on WebKit).
This tool dumps the render tree of a webpage on console. You can take a look at its source code (mostly C/C++) and call it from C# or you can also parse the console's output.
Here is the code which might help: https://github.com/WebKit/webkit/tree/master/Tools/DumpRenderTree
精彩评论