O'Reilly logo

Hands-On Data Structures and Algorithms with JavaScript by Kashyap Mukkamala

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required