Posts

Showing posts with the label CSSOM

Optimized Document Object Model (DOM) & Optimized CSS Object Model (CSSOM)

Image
Before the browser can render the page, it needs to construct the DOM and CSSOM trees. As a result, we need to ensure that we deliver both the HTML and CSS to the browser as quickly as possible. Let’s start with the simplest possible case: a plain HTML page with some text and a single image. How does the browser process this page? Conversion: The browser reads the raw bytes of HTML off the disk or network, and translates them to individual characters based on specified encoding of the file (for example, UTF-8). Tokenizing: The browser converts strings of characters into distinct tokens—as specified by the  W3C HTML5 standard ; for example, "<html>", "<body>"—and other strings within angle brackets. Each token has a special meaning and its own set of rules. Lexing: The emitted tokens are converted into "objects," which define their properties and rules. DOM construction: Finally, because the HTML markup defines relationships between...