HTML version of slides:

Similar documents
Mobile & More: Preparing for the Latest Design Trends

Mastering Mobile Web with 8 Key Rules. Mastering Mobile Web with 8 Key Rules

These are notes for the third lecture; if statements and loops.

Todd toddreifsteck

Firefox for Android. Reviewer s Guide. Contact us:

c122jan2714.notebook January 27, 2014

EnGiNeErInG HtMl5 applications for better performance

2

Visualforce & Lightning Experience

B r o w s e r s u p p o r t

Web Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh

Building mobile app using Cordova and AngularJS, common practices. Goran Kopevski

HOW TO MAKE YOUR INTERNET REGISTRATION WEBSITE YOUR OWN IN CLASS. Andrew Chau

Client-side Debugging. Gary Bettencourt

DIRECTV Message Board

What do we mean by layouts?

CSS & Troubleshooting IE6

Advanced CSS. Slava Kim

HTML5 Evolution and Development. Matt Spencer UI & Browser Marketing Manager

11/5/16 WEB DESIGN. Branding Fall 2016

QCon - Mobile Maps HTML5 Team Andrea

The 9 th International Scientific Conference elearning and software for Education Bucharest, April 25-26, / X

IGME-330. Rich Media Web Application Development I Week 1

(try adding using css to add some space between the bottom of the art div and the reset button, this can be done using Margins)

Reliably Measuring Responsiveness in the Wild

The Benefits of CSS. Less work: Change look of the whole site with one edit

What Are CSS and DHTML?

Introduction to HTML & CSS. Instructor: Beck Johnson Week 5

Responsive Web Design Discover, Consider, Decide

Introduction to WEB PROGRAMMING

WebRTC: Possible? Don McGregor Research Associate MOVES Institute.

Assignment 0. Nothing here to hand in

Programming Lab 1 (JS Hwk 3) Due Thursday, April 28

HTML5 for mobile development.

Embracing HTML5 CSS </> JS javascript AJAX. A Piece of the Document Viewing Puzzle

Designing RIA Accessibility: A Yahoo UI (YUI) Menu Case Study

Firefox 4 for Mobile Reviewer s Guide. Contact us:

mgwt Cross platform development with Java

MultiBrowser Documentation

A pixel is not a pixel. Peter-Paul Koch BlackBerry Jam, 6 February 2012

Need Help? Page 1 of 36 WORK

WebKit ; FOR : DUMMIES. by Chris Minnick WILEY. John Wiley & Sons, Inc.

Etanova Enterprise Solutions

Web Design and Implementation

BrowseEmAll Documentation

ThousandEyes for. Application Delivery White Paper

Table of contents. DMXzone Nivo Slider 3 DMXzone

Javascript Performance in the Browser. Charlie Fiskeaux II User Interface Engineer

Flash Ads. Tracking Clicks with Flash Clicks using the ClickTAG

Embedded Linux UI Comparison. Tim Bird Senior Staff Software Engineer Sony Electronics

Level 5 Digital technologies Chapter 4

Visual HTML5. Human Information Interaction for Knowledge Extraction, Interaction, Utilization, Decision making HI-I-KEIUD

From a laptop or desktop computer.

Contents at a Glance

Getting Started Guide

FIREFOX REVIEWER S GUIDE. Contact us:

Welcome Back! Without further delay, let s get started! First Things First. If you haven t done it already, download Turbo Lister from ebay.

Book keeping. Will post HW5 tonight. OK to work in pairs. Midterm review next Wednesday

HTML/CSS Lesson Plans

Apple Inc. November 2007

A Look Into the Future: SVG and related XML standards. Jon Ferraiolo Jon Ferraiolo Consulting 15 July 2002

django-gollum Documentation

Parashar Technologies HTML Lecture Notes-4

Hi! My name is Peter Rushforth. I work for Natural Resources Canada, in the Canada Centre for Mapping and Earth Observation.

In this project, you ll learn how to create your own webpage to tell a story, joke or poem. Think about the story you want to tell.

Anjuli Kannan. Google Earth Driving Simulators (3:00-7:00)

Reading How the Web Works

How to get a perfect 100 in Google PageSpeed Insights

Stanko Tadić

<Insert Picture Here> JavaFX 2.0

Designing the Home Page and Creating Additional Pages

How the Internet Works

HTML is a mark-up language, in that it specifies the roles the different parts of the document are to play.

Using Development Tools to Examine Webpages

CS WEB TECHNOLOGY

WHAT IS WEBKIT? COPYRIGHTED MATERIAL SMASHING WEBKIT CHAPTER 1

This document is for informational purposes only. PowerMapper Software makes no warranties, express or implied in this document.

MODULE 2 HTML 5 FUNDAMENTALS. HyperText. > Douglas Engelbart ( )

Internet Programming 1 ITG 212 / A

I m sorry but HTML5 mobile games DO work.

Beginning HTML. The Nuts and Bolts of building Web pages.

ThingLink User Guide. Andy Chen Eric Ouyang Giovanni Tenorio Ashton Yon

What s new in SketchUp Pro?

Smoother Graphics Taking Control of Painting the Screen

1 Font embedding in HTML page output

James Woods Regional High School

User Interfaces for Web Sites and Mobile Devices. System and Networks

CSS worksheet. JMC 105 Drake University

CS637 Midterm Review

Choosing the web s future. Peter-Paul Koch Van Lanschot, 9 February 2017

3 Continuous Integration 3. Automated system finding bugs is better than people

SaaS Providers. ThousandEyes for. Summary

Student Success Guide

Personal Information Manager Overview & Installation Guide

This document provides a concise, introductory lesson in HTML formatting.

ANNOYING COMPUTER PROBLEMS

Preface. WELCOME to Filthy Rich Clients. This book is about building better, more. Organization

California Open Online Library for Education & Accessibility

Developing for touch. Peter-Paul Koch Mobilism, 16 and 17 May 2013

_APP A_541_10/31/06. Appendix A. Backing Up Your Project Files

Transcription:

HTML version of slides: http://people.mozilla.org/~bbirtles/pres/graphical-web-2014/

Animations can be used for more than just cat gifs. They can be used to tell stories too.

Animation is essentially about using time to convey information.

Animation can be used as component of user interface design to describe the results of an action.

It can be more intuitive without cluttering the screen or requiring extra explanation.

But when animation runs slowly or hesitates, that information is lost. Hence for animation, performance is critical. In order to fix animation performance in Web pages, we really need to understand how browsers work.

As we follow the journey from markup to our eyeballs, we will consider how we can make each step smoother or skip it all together.

Parsing can be slow. Most browsers do it in a separate thread. If we skip parsing while animating surely it goes faster?

A micro-benchmark suggests an API that skips parsing is faster.

How about in a real-world animation?

It doesn t make a lot of difference. Perhaps 3~4 fps at best.

After creating a DOM tree, browsers construct a render tree suitable for painting to the screen. There are bigger performance gains to be had from the style system.

What happens if we exploit the fact that display:none elements don t appear in the render tree?

(Firefox doesn t show such a big difference in this case since the test case animates top which, as we ll see, does not trigger reflow in Firefox so setting display:none doesn t have as big an impact.)

This technique improved performance for the Parapara animation project where characters are set to display:none when they are off-stage.

Of the operations performed in the style system, the layout/reflow step is often expensive.

We can measure style resolution and layout time in profiling tools in Firefox (above) and Chrome (below).

Firefox lets you inspect reflow (layout) in the console.

Let s see how different animations affect layout

Animating margin-top causes reflow on every frame

But in Firefox, animating top or transform does not trigger reflow (layout)

Comparing the performance of margin-top and transform, transform is faster because it avoids reflow but it also benefits from layerization which we will see later.

Since these processes can be expensive, browsers avoid doing them until either they have to paint, or until script asks a question about the current state.

Painting is often the most expensive part. Firefox creates a display list of items to paint, then creates a layer tree into which it paints. The layers in the tree are then composited together.

We can see exactly what area is being painted

When animating transform we only paint once at the start. This is because it gets put in its own layer.

When animating independent areas Chrome seems to paint the union of dirty areas so layerization can be more important there.

However, SVG filters are often hardware accelerated. Sometimes the combination of features is what is slow.

We can sometimes make things faster by pre-rendering. Desktop apps, native apps, Flash apps, everyone does it.

Alternatively, for SVG, simply referring to the SVG using <img> instead of <iframe> lets the browser make more optimizations. Especially Firefox.

Most browsers hardware accelerate layer compositing. That means they can often paint an animated element once then just change its transform, opacity etc. and let the GPU re-composite. That saves a lot of painting.

It s up to the browser what gets a layer. Typically it s things like the above.

Firefox OS

In the previous example, we can see why the transform animation only gets painted once. That element has its own layer.

Layerization is performed by the browser so it can automatically do it for SVG (SMIL) animation too.

And even for scripted animation, the browser can detect that an element is moving a lot and decide it would benefit from being on a separate layer. (The red boxes in this example indicate image layers.)

Often, however, the browser won t create a layer until an element starts animating. Sometimes that can be too late and can cause the animation to stutter at the start as the browser sets up the layer.

will-change:transform/ opacity/etc. lets the browser create the layer in advance if it thinks that would help improve performance. transform:translatez(0) doesn t work crossbrowser

Apart from low frame-rates, animation performance is affected by other processes on the same thread like layout, garbage collection, or other scripts, that cause the animation to stop and start (jank).

To avoid jank, some animations can be run on a separate thread/process.

Unlike animations running on the main thread which stop and start

these animations continue along uninterrupted.

But not everything can be animated in this way. In particular, when the browser doesn t know all the parameters of the animation like most scripted animations the browser can t delegate the animation to another thread/process.

One way around this is to use the Web Animations API to create animations. This lets the browser optimize the animation in the same way as it does for declarative animations like CSS Animations/Transitions.

Summarizing our journey

Using our knowledge of how browsers work we can make animations that run smoothly on any browser on any device and convey their intended effect.

HTML version of slides: http://people.mozilla.org/~bbirtles/pres/graphical-web-2014/