Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How Browsers Render

How Browsers Render

Avatar for Ricardo Andrés Bello

Ricardo Andrés Bello

May 13, 2015
Tweet

More Decks by Ricardo Andrés Bello

Other Decks in Programming

Transcript

  1. As a web developer, learning the internals of browser operations

    helps you make better decisions and know the justifications behind development best practices. Paul Irish, Chrome Dev Tools Team
  2. Google Chrome 52.96% Internet Explorer 19.85% Firefox 18.27% Safari 5.23%

    Opera 1.73% Most used Desktop Browsers (May, 12, 2015) http://gs.statcounter.com
  3. Google Chrome 32.30% Safari 19.49% Android Browser 17.96% UC Browser

    13.69% Opera 9.09% http://gs.statcounter.com Most used Mobile Browsers (May, 12, 2015)
  4. The rendering engine will start parsing the request document from

    the Networking layer. This is usually done in 8KB chunks.
  5. What triggers a reflow? • Font Size Change • Screen

    Resize • Add/Remove Stylesheets • JS Changing DOM • User Input • :hover • Changing Class attribute • offset calculation
  6. Do not use inline styles When we edit inline styles

    the browser is gonna make a reflow for every property affected. Instead, you can use classes, just to make a single reflow.
  7. tables… Tables often require multiple passes before the definitive layout

    is finally stablished. Every new element affects previous elements. Imagine the last cell of the table which is very very (very) wide, it will cause a reflow of the entire table. Another reason to avoid using tables is that the minimum change in a cell affects the entire table, forcing a new reflow.