introduction to html5 - world wide web consortium · 2009-07-28 · html5 differences •syntax...

35
Introduction to HTML5

Upload: others

Post on 20-Feb-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

Introduction to HTML5

Page 2: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

Where to start learning about HTML5?

Page 3: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

HTML 5 differences from HTML 4

http://w3.org/TR/html5-diff/

Page 4: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

HTML 5 ― HTML 4からの変更点

http://standards.mitsue.co.jp/resources/w3c/TR/html5-diff/

Page 5: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed
Page 6: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

HTML5 differences

•Syntax simplifications

•MathML and SVG integration

•New elements/attributes added

• Removed old elements/attributes

• Added new APIs for scripting

Page 7: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

Syntax simplifications

Page 8: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0

Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Page 9: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

<!DOCTYPE html>

Page 10: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">

Page 11: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

<meta charset="Shift_JIS">

Page 12: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

New elements•<video> & <audio> (no plugins)

• <canvas> (scriptable image)

• <ruby> (ふりがな)

• <article>, <section>, <header>

•more...

Page 13: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

New attributes• draggable (drag-and-drop)

• contenteditable (editable pages)

• spellcheck (catch spelling errors)

• new form attributes (for client- side validation, plus new form controls such as date picker, etc.)

Page 14: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

Elements and attributes that have been

removed or obsoleted

•<frame>, <frameset>

•<a name>

•more...

Page 15: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

New APIs for scripting

•API for <video> & <audio>

• 2D drawing API for <canvas>

• getElementsByClassName()

• innerHTML

•more...

Page 16: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

Design principles

Page 17: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

HTML design principles

http://w3.org/TR/html-design-principles/

Page 18: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

HTML 設計原則

http://standards.mitsue.co.jp/resources/w3c/TR/2007/WD-html-design-principles-20071126/

Page 19: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed
Page 20: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

HTML design principles

• Support existing content

• Ensure interoperability

• Precisely define UA behavior

•Handle errors (non-draconian)

• Evolution not revolution

Page 21: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

Very important point:HTML5 includes XHTML

Page 22: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

Frequently Asked Questions (FAQ) about the future of XHTML

http://www.w3.org/2009/06/xhtml-faq.html

Page 23: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

XHTML の今後に関する FAQ

http://standards.mitsue.co.jp/resources/w3c/2009/06/xhtml-faq.html

Page 24: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

Very important point:HTML5 focuses onWeb applications

(not just Web documents)

Page 25: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

About error handling...

Page 26: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

• Well-formed XML: <input disabled="disabled"/> • Empty attribute: <input disabled> • Without quotes: <input value=yes> • Single quotes: <input type='checkbox'/> • Double quotes: <input name="be evil"/>

Which of these are errors?

Page 27: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

<i><b>misnested tags</i></b>

This is a real error

Page 28: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

HTML5 defines how browsers can handle real errors interoperably and

gracefully.

Page 29: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

Why is it important to handle errors?

Page 30: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

More than 93% of Alexa Top 500 sites

contain are not conformant XHTML

Page 31: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

We need to specify error handling behavior to ensure

interoperability “even in the face of documents that do not comply to the letter of the specifications”.

Page 32: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

Authors will write invalid content regardless of what we spec. So the spec states “what authors must not do, and then tells implementors what they

must do when an author does it anyway”.

Page 33: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

HTML5 Validator

http://validator.nu

Page 34: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

That’s it.

Page 35: Introduction to HTML5 - World Wide Web Consortium · 2009-07-28 · HTML5 differences •Syntax simplifications •MathML and SVG integration •New elements/attributes added •Removed

Thank you.