LambdaTest Community

Find answers, support, and inspiration from other users

Questions
LambdaTest Community
Answered

How do web browsers work? What languages are they built with?

Please anyone tell me how do web browsers work and also i want to know what languages are they built with.

Up Vote Down Vote 0 Votes
Posted 3 months ago

Answers


Components a browser is made up of the -

1. User Interface – This consists of forward and back button, bookmarks, address bar etc. along with the window that displays the requested page.

2. Browser engine – It commands action between rendering engine and the user interface.

3. Rendering engine – The main function of rendering engine is to display the content that is requested. For example, if an HTML content is requested, the engine parses CSS and HTML and when the content is parsed, it is displayed on the screen.

4. User Interface backend – It can be used for painting basic images like windows or combo box. The backend exposes only a generic platform independent interface. Beneath it, user interface methods are used by the operating system.

5. JS Interpreter – JavaScript and all other types of scripting is parsed and executed by the inbuilt interpreter.

6. Networking – Performs implements of HTTP request and response.

7. Data Storage – All types of data, like cookies are saved locally by the browser. Storage mechanisms like WebSQL, FileSystem, localStorage are also supported by the browser.

How a Browser works

  1. The rendering engine receives the contents of the document sent by the networking layer.
  2. The content tree is created by the rendering engine where the HTML elements get parsed and converted to DOM nodes. CSS Style data is parsed and visual information along with styling is used to create the render tree.
  3. Rectangles with specific colors and dimensions are arranged inside the rendered tree. They are meant to be in the right order to be rendered on the screen.
  4. Once the rendered tree is constructed, it is followed by the layout process where each node is given the exact coordinates, according to their expected displayed on the screen.
  5. Painting. Each node in the render tree will be designed according to the code written in the back-end layer of the UI. Painting usually takes place in an order: - i) background color, ii) background image, iii) order, iv) stacking of child elements, and v) page outline.

Ans as far as languages on which a browser is built is C++, as it supports parsing, tree walking, accelerated graphics and fast networking. It works on all the supported platforms and for more advanced browsers.

Up Vote Down Vote 0 Votes
Posted 3 months ago
161 Views
1 Answer
3 months ago