What's the relation between the renderer process and a JavaScript engine?

231 views Asked by At

I'm learning about how a browser works and so far I've learned that browsers have a process called the renderer.
Part of the job of this process is to parse and run a JavaScript code when it finds one.
If that's the case, then where's the JavaScript engine?
Is it another name for the render process? Or is it another process that gets invoke when the render process sees a JavaScript source code? Or is it something that I'm totally unaware of?!
Appreciated if someone could explain this matter.

1

There are 1 answers

1
jackdbd On

In a browser, the responsabilities of a rendering engine are:

  1. Parsing a text string (HTML) and create the DOM
  2. Style calculation: create computed styles and apply them to the DOM nodes
  3. Layout: create the Layout tree
  4. Paint: create paint records
  5. Compositing: create the Layer tree

Blink (the Chrome rendering engine) embeds V8 (the JS engine). As far as I know, every renderer process in Chrome has its own V8 instance.

This document of 2013 describes the rendering pipeline of Blink.

By their own admission:

No one understands the current Rendering system fully. One approach to fixing it may be to start documenting it.

That's why they started a project called servicification, which aimed to split the responsabilities of the browser engine into "processes". I used the quotation marks because these "processes" are not necessarily OS processes.