HTML layers

As we have seen in the earlier example, once the element is re-laid out, we Paint the element, that is, fill the pixels with the color, which is supposed to be a part of the element at the given position (determined by Layout). 

Once the Paint event is complete, the browser then performs Composition, which is basically our browser putting together all the parts of the page. The lesser these parts, the faster the page load will be. Also, if a certain section of the Composition takes too long, then the entire page load is delayed. 

How do we handle these operations which take too long? We can handle it by promoting them to their own layer. There are certain CSS operations that we can perform on elements, which will promote them ...

Get Hands-On Data Structures and Algorithms with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.