Dom with Rendering info for HTML pages

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Dom with Rendering info for HTML pages

john alden
Hi
   
  I am new to Mozilla. I am interested in knowing how the rendering engine works.
   
  I want to traverse the DOM which has rendering information of each of its node given its environment is fixed ( if the Window size, resolution etc is fixed ).  I am looking at only HTML pages. Is there any way in which i can use Gecko to get what i need ? Any suggestions (or sample code) would be great. Essentially i want to traverse the html page in the order it is displayed to the user.
   
  Thanks,
  John Alden

 
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates starting at 1¢/min.
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Dom with Rendering info for HTML pages

Robert O'Callahan-3
john alden wrote:
> Hi
>    
>   I am new to Mozilla. I am interested in knowing how the rendering engine works.
>    
>   I want to traverse the DOM which has rendering information of each of its node given its environment is fixed ( if the Window size, resolution etc is fixed ).  I am looking at only HTML pages. Is there any way in which i can use Gecko to get what i need ? Any suggestions (or sample code) would be great. Essentially i want to traverse the html page in the order it is displayed to the user.

One way would be to apply the patch in
https://bugzilla.mozilla.org/show_bug.cgi?id=174397. Then you can
traverse the DOM calling getClientRects on each element.

Rob
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Dom with Rendering info for HTML pages

john alden
In reply to this post by john alden
Hi
   
  Thanks for your reply Robert.
   
  But what i want something which is slightly different from what is mentioned there. As far as i understand, whats mentioned in the bug you mentioned below is a way to access rendering information from JavaScript for a particular node. What i need is, I wanted to build a Document Object Model (DOM) which has rendering information for its nodes. I wanted to use the Gecko layout engine and the Mozilla's DOM to build an interface to get what i want. Once i have the DOM with rendering information, i want to serialize the dom ( store the dom as xml ). Put in a simple way, if i give a url as input, i need a DOM which has rendering information for its nodes as output. Then later i will serialize the data on my own.
   
  If any one can help me how to approach the above problem, it would be really great :)
   
  Thanks,
John Alden.
   
  > Robert O'Callahan wrote:
>  
> One way would be to apply the patch in
> https://bugzilla.mozilla.org/show_bug.cgi?id=174397. Then you can
> traverse the DOM calling getClientRects on each element.
>
> Rob

john alden <[hidden email]> wrote:
    Hi
   
  I am new to Mozilla. I am interested in knowing how the rendering engine works.
   
  I want to traverse the DOM which has rendering information of each of its node given its environment is fixed ( if the Window size, resolution etc is fixed ).  I am looking at only HTML pages. Is there any way in which i can use Gecko to get what i need ? Any suggestions (or sample code) would be great. Essentially i want to traverse the html page in the order it is displayed to the user.
   
  Thanks,
  John Alden
 


 
---------------------------------
How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Dom with Rendering info for HTML pages

Robert O'Callahan-3
In reply to this post by john alden
john alden wrote:
> Hi
>    
>   Thanks for your reply Robert.
>    
>   But what i want something which is slightly different from what is mentioned there. As far as i understand, whats mentioned in the bug you mentioned below is a way to access rendering information from JavaScript for a particular node. What i need is, I wanted to build a Document Object Model (DOM) which has rendering information for its nodes. I wanted to use the Gecko layout engine and the Mozilla's DOM to build an interface to get what i want. Once i have the DOM with rendering information, i want to serialize the dom ( store the dom as xml ). Put in a simple way, if i give a url as input, i need a DOM which has rendering information for its nodes as output. Then later i will serialize the data on my own.

What sort of rendering information do you want?

Rob
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Dom with Rendering info for HTML pages

john alden
In reply to this post by john alden
> What sort of rendering information do you want?

Given an element in DOM, i want information about its layout. For example, for a given text element i want co-ordinates of the rectangle in which the text element is rendered. The co-ordinates can be top,left,bottom,right ( as mentioned in the bug pointed by you initially).
   
  Given a standard window size ( and other enviroment variables which influence layout of elements), i want to build a dom which has layout information ( rectangle co-ordinates) of each of the elemnent.
   
  I wanted to build an application on top of DOM which has rendering information of its elements. So i wanted to use Gecko layout engine ( and DOM ) to get this. It would be difficult for me to use the JavaScript APIs ( exposed in the patch described in the inital bug pointed by you ) to get what i want. As i have previously said, i want to build an interface to give the url and get the DOM with rendering information. I would later serialize it and use it.
   
   
  Thanks,
  John Alden

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Dom with Rendering info for HTML pages

Robert O'Callahan-3
In reply to this post by john alden
john alden wrote:
>> What sort of rendering information do you want?
>
> Given an element in DOM, i want information about its layout. For example, for a given text element i want co-ordinates of the rectangle in which the text element is rendered. The co-ordinates can be top,left,bottom,right ( as mentioned in the bug pointed by you initially).
>    
>   Given a standard window size ( and other enviroment variables which influence layout of elements), i want to build a dom which has layout information ( rectangle co-ordinates) of each of the elemnent.
>    
>   I wanted to build an application on top of DOM which has rendering information of its elements. So i wanted to use Gecko layout engine ( and DOM ) to get this. It would be difficult for me to use the JavaScript APIs ( exposed in the patch described in the inital bug pointed by you ) to get what i want. As i have previously said, i want to build an interface to give the url and get the DOM with rendering information. I would later serialize it and use it.

I don't understand why it would be difficult to use getClientRects to
get what you say you want.

Rob
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Dom with Rendering info for HTML pages

john alden
In reply to this post by john alden
Hi
   
  I understood that the patch mentioned by you will be useful to get what i want. Thank you for the info.
  I have been trying to understand the various components of mozilla code base. The code base is huge and i got lost in it. I dont know where to start from. Can you please give me pointers on where/how to start coding to get what i want. Since i will be running the code on many urls, performance is also a concern. So i dont want unnecessary components to include in my processing pipeline. It would be really great if you can help me.
   
  Thanks,
  John Alden

> Rob  wrote:
   
  > I don't understand why it would be difficult to use getClientRects to
> get what you say you want.


 
---------------------------------
How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Dom with Rendering info for HTML pages

Robert O'Callahan-3
In reply to this post by john alden
john alden wrote:
> Hi
>    
>   I understood that the patch mentioned by you will be useful to get what i want. Thank you for the info.
>   I have been trying to understand the various components of mozilla code base. The code base is huge and i got lost in it. I dont know where to start from. Can you please give me pointers on where/how to start coding to get what i want. Since i will be running the code on many urls, performance is also a concern. So i dont want unnecessary components to include in my processing pipeline. It would be really great if you can help me.

I'll help you as much as I can, but I need to understand what you need.
If getClientRects is enough for you, then why do you need to do any more
work? Just wait for my patch to land.

Rob
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: Dom with Rendering info for HTML pages

tower
  I guess his bigest concern is the performance, and want to know will disable displaying step of gecko and just get the positions of nodes make the render more fast.
  I'm also a newbie to gecko and is also wondering how fast the layout engine can be if disable many visual features rendering? Because in some research work, a fast html parser with viusal information (position of element) is very useful, especially in large number of documents. Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Dom with Rendering info for HTML pages

alex-192
In reply to this post by john alden
Recently I'm trying to explore gecko engine also, it seems a seperately
self-maintained codebase of render engine is what many guys want, but it
seems it's very hard to extract the codes from the firefox / mozilla
codebase yet (At least I didn't find a good solution yet. According to the
document, gecko is within xurunner codebase, but after unpacked xurunner
source jar file, I got a 300M-sized codes).

The huge source codebase seems really hard to be understood and extended.
The easier extension to Mozilla is browsers, but I'm not sure whether there
are many other type of applications based on part of the core modules.
Personally I feel Eclipse does better. Its codebase is composed by many
plugins that can be more easilly controled and extended for particular
functions, and in fact the entire eclipse codebase is huge as well.

"john alden" <[hidden email]> ????
news:[hidden email]...
> Hi
>
>   I am new to Mozilla. I am interested in knowing how the rendering engine
works.
>
>   I want to traverse the DOM which has rendering information of each of
its node given its environment is fixed ( if the Window size, resolution etc
is fixed ).  I am looking at only HTML pages. Is there any way in which i
can use Gecko to get what i need ? Any suggestions (or sample code) would be
great. Essentially i want to traverse the html page in the order it is
displayed to the user.
>
>   Thanks,
>   John Alden
>
>
> ---------------------------------
> Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great
rates starting at 1¢/min.


_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout