Chrome Layout

Crimped layout

Construction of trees, layout and colour CSSOM and TOM are merged into a single rendered palette that is used to calculate the layout of each visual component and provides information for the painting operation where the pixel is displayed on the canvas. Previously, in the section on building the objectmodel, we created the dome and the CSSOM tables using HTML and css input. But both are separate entities that cover different facets of the document: one describing the contents, the other describing the styles that must be adhered to in the work. So how can we bring the two together and get the web browsers to display pixel on the canvas? Summarize the CSSOM and DOOM files into a single rendered file.

contains only the knots necessary for rendering the page. The layout calculates the precise location and dimensions of each item. Last but not least is painting, which picks up the ultimate rendered trees and places the pixel on the canvas. Initially, the web browsers combine the CSSOM and CSSOM into a "render tree" that includes all viewable CSSOM contents on the page and all CSSOM styles information for each knot.

In order to create the rendersetree, the webrowser does the following: Beginning at the DOM hierarchy roots, you pass through each apparent knot. A few knots are not displayed (e.g. JavaScript tag, meeta tag, etc.) and are omitted because they are not included in the rendering. For example, the chip code - in the example above - is absent from the drawing tree because we have an explicitly defined rules that places the attribute "display: none" on it.

Find and implement the appropriate CSSOM rule for each apparent knot. Show visual knots with contents and their calculated style. While the former makes the item hidden, the latter still takes up layout room (i.e. it is displayed as an empty box), the latter (display: none) completely deletes the item from the drawing tree, making the item hidden and not part of the layout.

Definitive rendering is a rendering that contains both the contents and styling information of all visual contents on the monitor display. Once the rendered trees are present, we can go to the Layout phase. Until this point, we have been calculating which knots should be displayed and which ones should be displayed, but we have not been calculating their precise location and sizes in the device's Viewer - this is the "Layout" phase, also known as "Reflow".

" In order to find out the precise location and sizing of each item on the page, the web navigator starts at the beginning of the rendered page and runs through it. There are two interlaced div's in the above body: The first (parent) divider will set the node's viewport width to 50% of the viewport's width, and the second divider--contained by the parent--will set its width to 50% of its parent width, i.e. 25% of the viewport's width.

Layout processing outputs a "box model" that accurately measures the precise location and dimensions of each item within the viewport: all related readings are transformed into pixel values on the sreen. Eventually, now that we know which knots are exposed and their calculated shapes and geometries, we can transfer this information to the power amplifier, which transforms each knot in the rendered beam into real pixel on the display.

Chrome DevTools can, however, give an overview of all three phases described above. Let's look at the layout phase for our initial "Hello World" example: Layout " records the design, location, and resizing of the rendered trees in the Timeline. Once the layout is finished, the Web browsers displays the Pain Setup and Paints occurrences, which converts the rendered trees to pixel on the display.

How long it takes to create, layout and colour renders depends on the file sizes, the style used and the equipment on which it is executed: the bigger the file, the more work the web browsers have to do; the more complex the style, the more times it takes to colour it (e.g. a plain colour is "cheap" to colour, while a cast shade is "expensive" to calculate and display).

This page is at last displayed in the viewport: Use HTML mark-up and create the dome trees. Use CSS mark-up and create the CSSOM treeview. Merge the CSSOM and CSSOM into one single rendered file. Execute the layout on the rendered tree to calculate the shape of each knot. Draw the knots on the monitor.

When either the DDOM or CSSOM would be changed, you would have to redo the operation to find out which pixel on the desktop needs to be re-rendered. This allows contents to be transferred to the monitor as quickly as possible and also shortens the period between monitor update after first rendering, i.e. higher update speeds for interactivity are achieved.

Mehr zum Thema