Patrick Chanezon (slides from Matthew Papakipos) June 5 2009 Google’s HTML5 Work: What’s Next?

Slides:



Advertisements
Similar presentations
An Introduction Timmy Kokke | UNIT4 Internet Solutions | Expression Blend MVP / Webguy.
Advertisements

More CSS - Page layout + HTML5 new features Boriana Koleva Room: C54
HTML5 Haptics Standardization
Understanding Mobile App Development Concepts and Working with APIs Lesson 6.
Neal Stublen Why Use a Canvas?  Flexibility… Use of drawing primitives (lines, arcs, text) Direct access to element display pixels.
HTML 5 Previous version: HTML4.01, 1999 Still work in progress, most browsers support some of it.
HTML 5 The next generation of web programming. WHERE IT ALL BEGAN.
Web Platform Trident Browser Internet Explorer.
1 Canvas Tag In JavaScript Amy Luong Yan Ge Hon Yee Regneel Prahalad Michael Leggio.
Bartosz Kowalski Software Developer CERN. Presentation outline -HTML : introduction and history -HTML5 : -History and philosophy -New features -Structure.
Mobile Application Development
CHAPTER 21 INTRODUCING THE HTML 5 CANVAS. LEARNING OBJECTIVES How to create a canvas using the and tag pair How to test if a browser supports canvas operations.
Canvas, SVG, Workers Doncho Minkov Telerik Corporation
Chapter 11 Adding Media and Interactivity. Flash is a software program that allows you to create low-bandwidth, high-quality animations and interactive.
Web Programming Language Week 13 Ken Cosh HTML 5.
Gil Megidish And I love writing / rewriting / reverse engineering games.
HTML 5 New Standardization of HTML. I NTRODUCTION HTML5 is The New HTML Standard, New Elements New Attributes Full CSS3 Support Video and Audio 2D/3D.
CS7026 – HTML5 Canvas. What is the element 2  HTML5 defines the element as “a resolution-dependent bitmap canvas which can be used for rendering graphs,
IT Engineering I Instructor: Rezvan Shiravi
SVG: The Past, Present and Future of Vector Graphics for the Web Patrick Dengler Senior Program Manager, Internet Explorer Team Member, W3C SVG Working.
By: Rick A. VanVolkinburg.  WebView – displays web pages inside application.  JavaScript is disabled.  Enable: webview.getSettings().setJavaScriptEnabled(true);
Getting Started with Canvas IDIA Spring 2013 Bridget M. Blodgett.
HTML5 for Mobile Andrew Kinai. HTML vs HTML5 HTML:A language that describes documents' formatting and content, which is basically composed of static text.
HTML5 CANVAS. SAVING INFORMATION BETWEEN FUNCTION CALLS.
Session: 17. © Aptech Ltd. 2Canvas and JavaScript / Session 17  Describe Canvas in HTML5  Explain the procedure to draw lines  Explain the procedure.
Element. The element Used to dynamically draw graphics using javascript. Capable of drawing paths, circles, rectangles, text, and images.
HTML5, part III – API, … Štěpán Developer Evangelist Microsoft, Czech Republic.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Creating User Interfaces Recap HTML/HTML5 JavaScript features Homework: keep working on user observation studies. Review JavaScript.
Session: 1. © Aptech Ltd. 2Introduction to the Web / Session 1  Explain the evolution of HTML  Explain the page structure used by HTML  List the drawbacks.
UPLOAD / DOWNLOAD april  HTML5 is just the next iteration of HTML  Previous version was technically HTML 4.01, which incorporated XHTML 1.0.
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
Intro to the Canvas Canvas is an HTML5 element If you see this, your browser doesn't support the canvas Canvas is manipulated with javascript c = document.getElementById("mycanvas");
CHAPTER 15 HTML 5 VIDEO AND AUDIO Intro to HTML5 1.
Programming games Context of what we are doing. Drawing on canvas. Homework: [Complete coin toss examples.] Do your own drawings. Upload files to website.
Chapter 11 Adding Media and Interactivity. Chapter 11 Lessons Introduction 1.Add and modify Flash objects 2.Add rollover images 3.Add behaviors 4.Add.
Rich Internet Applications 9. HTML 5 and RIAs. HTML 5 Standard currently under development by W3C Aims to improve the language with support for the latest.
Presented By Nanda Kumar(972789) P. Trinesh (982816) Sk. Salma (982824) K. Madhuri (982814) HTML5.
08 – Canvas(2) Informatics Department Parahyangan Catholic University.
Can SAS Do Canvas? Creating Graphs Using HTML 5 Canvas Elements Edwin J. van Stein Astellas Pharma Global Development.
07 – HTML5 Canvas (1) Informatics Department Parahyangan Catholic University.
® ® copyright © 2013 Open Geospatial Consortium What HTML5 and REST mean to the Geo community Raj Singh, PhD Open Geospatial Consortium
What is HTML5? HTML5 will be the new standard for HTML. The previous version of HTML, HTML 4.01, came in The web has changed a lot since then. HTML5.
Introduction of Presented by Neetu sharma MCA (8 th trim)
M ULTIMEDIA ON THE W EB. Multimedia Purpose of Multimedia Multimedia Issues HTML5 and elements CSS Transitions and Animations Animation to avoid.
4.3. Code animations by using JavaScript Access data access by using JavaScript. Creating Animations, Working with Graphics, and Accessing Data.
Web Programming HTML-5. HTML5 Overview HTML5 is the next major revision of the HTML standard superseding HTML 4.01, XHTML 1.0, and XHTML 1.1. HTML5 is.
Development of Internet Applications HTML5 Ing. Jan Janoušek 7.
XHTML. What Is XHTML? XHTML stands for EXtensible HyperText Markup Language XHTML is almost identical to HTML XHTML is stricter than HTML XHTML is HTML.
The HTML5 logo was introduced by W3C in 2010
Game Development with JS and Canvas 2D
Internet of the Past.
Web Concepts Lesson 2 ITBS2203 E-Commerce for IT.
WebGL The HTML5/JavaScript 3D Computer Graphics API
HTML5 – The Saga Continues
Chapter 4: HTML5 Media - <video> & <audio>
Web Programming Language
Application with Cross-Platform GUI
ISC440: Web Programming II Ch14: HTML5 Canvas
The Canvas.
Progress <progress value="22" max="100"></progress>
Simple Canvas Example Your browser doesn’t support canvases var canvas = document.getElementById("canvas1"); var context.
HTML5 and Designing a Rich Internet Experience
HTML5 and Designing a Rich Internet Experience
Graphics Canvas.
Creating User Interfaces
Lesson 3 Web Browsers.
HTML5 and Designing a Rich Internet Experience
HTML5 – A few features L. Grewe.
Presentation transcript:

Patrick Chanezon (slides from Matthew Papakipos) June Google’s HTML5 Work: What’s Next?

Browsers Started a Revolution that Continues In 1995 Netscape introduced JavaScript In 1999, Microsoft introduces XMLHTTP In 2002, Mozilla 1.0 includes XMLHttpRequest natively... Then web applications started taking off... In 2004, Gmail launches as a beta In 2005, AJAX takes off (e.g. Google Maps)... Now web applications are demanding more capabilities 3

What New Capabilities do Webapps Need? Plugins currently address some needs, others are still not well addressed – Playing video – Webcam / microphone access – Better file uploads – Geolocation – Offline abilities – 3D – Positional and multi-channel audio – Drag and drop of content and files into and out of webapps Some of these capabilities are working their way through standards process 4

Our Goal Empower web applications – If a native app can do it, why can’t a webapp? – Can we build upon webapps strengths? Understand what new capabilities are needed – Talking to application developers (you!) – Figure out what native applications people run And what web applications serve similar purposes And what native applications have no web equivalent Implement (we’re going full speed ahead...) – We prototyped in Gears – Now we’re implementing natively in Google Chrome Standardize 5

Now I do not know whether I was then a man dreaming I was a butterfly, or whether I am now a butterfly, dreaming I am a man. 庄子 or 莊子 Zhūangzi

Web vector graphics today 7 99% 20% 33%

One of the first HTML5 additions to be implemented by browsers – in Safari, then Firefox and Opera. (We got it for free in Google Chrome from WebKit). Provides a surface on which you can draw 2D images Talk of extending the model for 3D (more later) 8 // canvas is a reference to a element var context = canvas.getContext('2d'); context.fillRect(0,0,50,50); canvas.setAttribute('width', '300'); // clears the canvas context.fillRect(0,100,50,50); canvas.width = canvas.width; // clears the canvas context.fillRect(100,0,50,50); // only this square remains (reproduced from work/#canvas with permission)

OpenWeb vector graphics available in a browser near you Firefox, Safari (+iPhone), Opera, Chrome ~33% browsers natively Open Source JS Shims for Canvas and SVG (autumn 2009) support in IE – Much of SVG 1.1 Full supported by all browsers except IE – Most of Canvas (except for text extensions) supported by all browsers except IE No Flash in iPhone & Android 9

The Grid 10 from

fill, stroke, lines, Rect 11 context.fillStyle = '#00f'; // blue context.strokeStyle = '#f00'; // red context.lineWidth = 4; // Draw some rectangles. context.fillRect (0, 0, 150, 50); context.strokeRect(0, 60, 150, 50); context.clearRect (30, 25, 90, 60); context.strokeRect(30, 25, 90, 60);

Path 12 // Set the style properties. context.fillStyle = '#00f'; context.strokeStyle = '#f00'; context.lineWidth = 4; context.beginPath(); // Start from the top-left point. context.moveTo(10, 10); // give the (x,y) coordinates context.lineTo(100, 10); context.lineTo(10, 100); context.lineTo(10, 10); // Done! Now fill the shape, and draw the stroke. context.fill(); context.stroke(); context.closePath();

Arcs, Curves 13 quadraticCurveTo(cp1x, cp1y, x, y) // (BROKEN in FF 3.5) bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) arc(x, y, radius, startAngle, endAngle, anticlockwise)

Styles and Colors 14 ctx.fillStyle = "orange"; ctx.fillStyle = "#FFA500"; ctx.fillStyle = "rgb(255,165,0)"; ctx.strokeStyle = "rgba(255,0,0,0.5)"; lineWidth = value lineCap = type lineJoin = type miterLimit = value createLinearGradient(x1,y1,x2,y2) createRadialGradient(x1,y1,r1,x2,y2,r2) addColorStop(position, color) createPattern(image,type)

Images: draw, scale, slice 15 // Draw frame ctx.drawImage(document.getElementById('frame'),0,0);cont ext.stroke();context.closePath(); //drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight)// Draw slice ctx.drawImage(document.getElementById('source'), 33,71,104,124,21,20,87,104);

Pixel manipulation of Images, Video 16 computeFrame: function() { this.ctx1.drawImage(this.video, 0, 0, this.width, this.height); let frame = this.ctx1.getImageData(0, 0, this.width, this.height); let l = frame.data.length / 4; for (let i = 0; i < l; i++) { let r = frame.data[i * 4 + 0]; let g = frame.data[i * 4 + 1]; let b = frame.data[i * 4 + 2]; if (g > 100 && r > 100 && b < 43) frame.data[i * 4 + 3] = 0; } this.ctx2.putImageData(frame, 0, 0); return; }

Tranformations 17 State: Canvas states are stored on a stack save()restore() translate(x, y) rotate(angle) scale(x, y) transform(m11, m12, m21, m22, dx, dy) setTransform(m11, m12, m21, m22, dx, dy)

transform example 18 var i = 0; var sin = Math.sin(Math.PI/6); var cos = Math.cos(Math.PI/6); ctx.translate(200, 200); var c = 0; for (i; i <= 12; i++) { c = Math.floor(255 / 12 * i); ctx.fillStyle = "rgb(" + c + "," + c + "," + c + ")"; ctx.fillRect(0, 0, 100, 10); ctx.transform(cos, sin, -sin, cos, 0, 0); } ctx.setTransform(-1, 0, 0, 1, 200, 200); ctx.fillStyle = "rgba(255, 128, 255, 0.5)"; ctx.fillRect(0, 50, 100, 100);

2D -> Triangles -> 3D 19

Demo

Local Storage Provides a way to store data client side Useful for many classes of applications, especially in conjunction with offline capabilities 2 main APIs provided: a database API (exposing a SQLite database) and a structured storage api (key/value pairs) Implementation under way in Google Chrome, already working in WebKit. 21 db.transaction(function(tx) { tx.executeSql('SELECT * FROM MyTable', [], function(tx, rs) { for (var i = 0; i < rs.rows.length; ++i) { var row = rs.rows.item(i); DoSomething(row['column']); } });

Workers Native apps have threads and processes Workers provide web apps with a means for concurrency Can offload heavy computation onto a separate thread so your app doesn’t block Come in 3 flavors – Dedicated (think: bound to a single tab) – Shared (shared among multiple windows in an origin) – Persistent (run when the browser is “closed”) Implementation is ongoing in WebKit and Google Chrome 22

Application Cache Application cache solves the problem of how to make it such that one can load an application URL while offline and it just “works” Web pages can provide a “manifest” of files that should be cached locally These pages can be accessed offline Enables web pages to work without the user being connected to the Internet Implemented in WebKit, implementation ongoing in Google Chrome 23

Allows a page to natively play video – No plugins required – As simple as including an image - Has built-in playback controls – Stop – Pause – Play Scriptable, in case you want your own dynamic control Chrome will support MP4 (H AAC), and Ogg (Theora + Vorbis) Implemented in WebKit, implementation under way in Google Chrome (now in dev channel). 24

Demo

Rich Text Editing contentEditable implementations vary widely between browsers Behaviour for simple things, such as selection ranges, is not well defined in any spec Currently helping to define a specification for existing behaviour, as well as improvements for new functionality – Specify exactly what selections select – Add execCommand to additional events where it makes sense – getData(‘text/html’) for paste and drop events No reason web apps should have to ship 200KB to do rich text editing 26

Notifications Alert() dialogs are annoying, modal, and not a great user experience Provide a way to do less intrusive event notifications Work regardless of what tab / window has focus Provide more flexibility than an alert() dialog Not currently in any standard, we’re currently prototyping 27

Web Sockets Allows bi-directional communication between client and server in a cleaner, more efficient form than hanging gets (or a series of XMLHttpRequests) Specification is under active development 28

3D APIs Canvas 3D, developed by Mozilla, is a command-mode API that allows developers to make OpenGL calls via JavaScript O3D is an effort by Google to develop a retain-mode API where developers can build up a scene graph and manipulate via JavaScript, also hardware accelerated Discussion on the web and in standards bodies to follow 29

3D Demo

And So Much More… There’s much work that we haven’t even started yet. Some is well defined – Geolocation – Forms2 – Datagrid Many things less defined – P2p APIs – Better drag + drop support – Webcam / Microphone access – O/S integration (protocol / file extension handlers and more) – Managing uploads, “blobs”, file APIs – And more 31

Our Work in a Nutshell 32 Web sockets, more CSS3 support hits dev channel hits dev channel, with local storage, appcache, and workers following Polish work on above Additional APIs (TBD) to better support web applications

Resources Spec All demos at Google Confidential

“it is Google which is driving web standards forward. That is why we at Zoho are firmly aligned with them, even if they are our primary competitor. We believe in an open web, there is plenty of opportunity for all of us. Could Google abuse its position? Well, I am sure they understand karma.” Sridhar Vembu, CEO of AdventNet (Zoho) Microsoft Silverlight vs Google Wave: Why Karma Matters | Zoho Blogs

Learn More at

Q&A