35
loading...
This website collects cookies to deliver better user experience
unicode
type with an HTML page to convert data into characters.Objects
because it needs to store information such as parentNode
, childNodes
, events attached to that respective element etcetera.display: none
or any of its descendants. Because render tree represents elements that are going to be painted on screen. So it omits any element that would not be part of our layout. We would talk in length about layout in the next step.viewport
of device, these properties vary. This process is called layout
or reflow
.To optimize DOM construction -
You can do this by attaching a async
attribute on your script tag like this
<script src="index.js" async></script>
When browser encounters async
tag, it understands that this is not critical resource for page, it doesn't stop and keeps the DOM construction going to next part of file.
How can we optimize the CSSOM construction step?
media types
and media queries
when we link our CSS files.<link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="mobile.css" media="screen and (max-width: 680px)">
<link rel="stylesheet" href="portrait.css" media="orientation:portrait">
will-change
to let browser know beforehand that this property would change in the future. If browser encounters this property then it does some optimizations even before the element actually changes.async
and loading them later.