Answer source: How Do Browser Rendering Engines Work?
The primary function of a browser rendering engine is to visualize the content requested by users in an interactive view. For instance, if a user requests an HTML script content, the rendering engine’s job is to parse the CSS and HTML. Henceforth, the content is displayed after being parsed through a rendering engine. The scalable dimension-based format ensures a rendered display significantly restoring an original page layout interpreted from its original form, while indulging scaling and panning features of the web content in real-time environment. The interaction between the end-user through an interface & the rendering engine is facilitated by the browser engines. It facilitates with a high-level interface between the User Interface and Rendering engine.
A network layer tenders the browser rendering engine with the requested document by the user. The contents available in such document is then transferred in parts of sizes of 8 kilobyte each. In this order, the below points are furthered to accomplish this process as mentioned below :
- The HTML elements are parsed and then converted into DOM nodes once after the formation of a content tree is ensued. Data styled in both internal and external CSS is also parsed and utilization of visual information along with styling indulges the formation of render tree.
- Rectangles arranged with specific colours are manageably sorted inside the rendered tree.
- After the creation of a rendered tree, a layout process is followed where nodes are defined by a precise set of coordinates, which leads them to be visualized on the user-screen.
- Considering ‘painting’ the final stage in the process, each node of the render tree is defined as per the code written in the backend layer of the user interface.
- Browser engine is responsible to start loading of a URL and considering care of processes of reloading, backing and forward browsing actions.
- When a user is supposed to insert a URL in the address space, UI takes the address to the browser engine where it search the domain name out of the URL and confirms its existence in browser and OS caches. If the domain name is not found in both browser and OS caches, then it requests to the Internet Service Provider (ISP) to extract the IP address from Domain Name System (DNS). Hereby, the website receives a request from the browser to retrieve its content.