
We ran a small survey about which form factors developers support vs prioritize.
We have more form factors than ever before, and it's accelerating.
It’s not the desktop web, nor the mobile web...
We can assess every device (known and unknown) in the same way:
Network | Compute | Render | Screen | |
---|---|---|---|---|
Desktop | Good | Good | Good | Large |
Mobile | Bad | OK | Bad | Small |
TV | Good | Bad | Bad | Large |
Console | Bad | OK | Bad | Small |
New Device | ? | ? | ? | ? |
Network | Compute | Render | Screen | |
---|---|---|---|---|
Desktop | Maybe | Maybe | Maybe | Maybe |
Mobile | Maybe | Maybe | Maybe | Maybe |
TV | Maybe | Maybe | Maybe | Maybe |
Console | Maybe | Maybe | Maybe | Maybe |
New Device | ? | ? | ? | ? |
Source: Strangeloop
Sources: [1] HTTP Archive, [2] Chromium Blog
body
when you should change child elements directlyvar target = document.getElementById('target'); // set each element to have the same width as the target for (var e = 0; e < elements.length; e++) elements[e].style.width = target.offsetWidth + 'px';
offsetWidth
(causes a layout)style.width
(invalidates the layout)var target = document.getElementById('target'); // get the width and cache it var targetWidth = target.offsetWidth; // now set each element's width with the cached value for (var e = 0; e < elements.length; e++) elements[e].style.width = targetWidth + 'px';
position:fixed
is your friendposition:sticky
is upcominghttp://jankfree.org/ - some must-see resources
Also watch Jank Free: Chrome Rendering Performance
@aerotwist | google.com/+aerotwist
@beverloo | peter.sh/+