A picture is worth a thousand words. So, let’s have a high-level view of how a browser works!
hmm… what’s “browser engine” and “rendering engine”?
The primary job of a browser engine is to transform HTML documents and other resources of a web page into an interactive visual representation on a user’s device.
Besides “browser engine”, two other terms are in common use regarding related concepts: “layout engine” and “rendering engine”. In theory, layout and rendering (or “painting”) could be handled by separate engines. In practice, however, they are tightly coupled and rarely considered separately.
When you hit enter on some link or URL browser make an HTTP request to that page and the corresponding server provides (often) HTML document in response. (a hell lot of things happen in between)
Step by step processing
styleattributes of the HTML tags
display: none, it won't be represented in the render tree. Same for the other invisible elements, like
headand everything in it. On the other hand, there might be DOM elements that are represented with more than one node in the render tree-like text nodes for example where every line in a
<p>needs a render node. A node in the render tree is called a frame, or a box (as in a CSS box, according to the box model). Each of these nodes has the CSS box properties - width, height, border, margin, etc
Here is a snapshot of how browser draws user interface on the screen.
It happens in the fraction of seconds that we don’t even notice that all this happened.
How browser drawing the layout and trying to detect root element, siblings and it’s child element as a node comes and rearranging it’s layout accordingly.
Let’s take one example
<html> <head> <title>Repaint And Reflow</title> </head> <body> <p> <strong>How's The Josh?</strong> <strong><b> High Sir...</b></strong> </p> <div style="display: none"> Nothing to display </div> <div><img src="..." /></div> ... </body> </html>
The DOM tree that represents this HTML document basically has one node for each tag and one text node for each piece of text between nodes (for simplicity let’s ignore the fact that whitespace is text nodes too) :
documentElement (html) head title body p strong [text node] p strong b [text node] div [text node] div img ...
The render tree would be the visual part of the DOM tree. It is missing some stuff — the head and the hidden div, but it has additional nodes (aka frames, aka boxes) for the lines of text.
root (RenderView) body p line 1 line 2 line 3 ... div img ...
The root node of the render tree is the frame (the box) that contains all other elements. You can think of it as being the inner part of the browser window, as this is the restricted area where the page could spread. Technically WebKit calls the root node
RenderView and it corresponds to the CSS initial containing block, which is basically the viewport rectangle from the top of the page (
0) to (
Figuring out what and how exactly to display on the screen involves a recursive walk down (a flow) through the render tree.
Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.
Have you ever thought of having your own app that runs smoothly over multiple platforms? React Native is an open-source cross-platform mobile application framework which is a great option to create mobile apps for both Android and iOS. **[Hire...
Hire dedicated React Native developers for your next project. As the top react native development company we offer you the best service as per your business needs.
Are you looking to [hire React JS developer](https://www.mobiwebtech.com/react-js-development-company/ "hire React JS developer") from a prestigious and reliable React JS development company? Visit at Mobiweb Technologies here we have a big team...
With the rapid development in technology, the old ways to do business have changed completely. A lot more advanced and developed ways are ...