HTML5设计原理Word文件下载.docx
《HTML5设计原理Word文件下载.docx》由会员分享,可在线阅读,更多相关《HTML5设计原理Word文件下载.docx(37页珍藏版)》请在冰豆网上搜索。
Actually,someotherpeoplearegoingtobetalkingaboutthecontentsofthespec.SteveFaulknerwillbetalkingaboutaccessibilityandHTML5.PaulIrishisgoingtogothroughawholebunchoftheAPIsthatareinHTML5.SoI’mnotjustgoingtostanduphereandrunthroughwhat’sinHTML5.
Actually,beforeIevengetstartedIshouldprobablyclarifywhatImeanbyHTML5,whichseemskindofcrazy‘causewhyshouldIhavetoclarifywhatImeanbyHTML5whenwhatImeanbyHTML5isHTML5?
There’saspecification,it’scalledHTML5andwhenIsayHTML5that’swhatIamreferringto.TheproblemisotherpeopleareusingthetermHTML5torefertojustaboutanything,whichcanbeproblematic.Forexample,referringtoCSS3asHTML5forsomereasonseemstobeacommontechnique.That’snotwhatI’mreferringto.WhenIsayHTML5Idon’tmeanCSS3,ImeanHTML5.
We’vebeenherebeforewithterms.ItusedtobethatAjaxmeantsomethingspecificandthen,afterawhile,itjustbecame“doinganythingcoolwithJavascript.”ThatwasAjax,right?
AndnowthesamethingseemstobehappeningtothetermHTML5.It’ssupposedtomeanaspecificspecificationandnowitjustmeans“doinganythingcool(fullstop)ontheweb.”Butthat’snottheHTML5Imean.Idon’tmeanthisumbrellatermthatcoversanythingthat’snewthesedays.I’mspecificallytalkingaboutthespecification:
HTML5.
AsIsaid,it’snotsomuchthecontentsIwanttotalkabout.It’snotgoingthroughachecklistofwhat’sinHTML5.It’stheothersideofit,it’sthedesignofHTML5.WhatIwanttotalkaboutisnotsomuchwhatisinthespecbutwhythesethingsareinthespec,whattheprocesswasinthinkingofthesethingswhendesigningaspecification.
Inparticular,oneofthereasonswhyIthinkHTML5asaspecificationisquitesuccessful—andtheprocesshasbeensuccessful—isthatitisdrivenbydesignprinciples.DesignprinciplesaresomethingIamgettingmoreandmorefascinatedwith.
Designprinciples
Adesignprincipleisessentiallyabelief,atenant,aconceptthatyourallybehind.Itdoesn’tmatterwetheryourmakingaspecificationorifyouaremakingaphysicalobjectorapieceofsoftwareoraprogramminglanguage.Youwillprobablyfindadesignprincipleormultipledesignprinciplesbehindallgoodexamplesofanythingthathasbeenbuiltcollaboratively.Andit’snotjustfromtheworldoftheweb.Throughouthistorythereexampleofdesignprinciplesbehindlargescaleconstructionslikecountries,societies.
Togiveyouanexample,fromtheUnitedStatesofAmerica,thisisadesignprinciplebuiltintotheDeclarationofIndependence.
WeholdtheseTruthstobeself-evident,thatallMenarecreatedequal,thattheyareendowedbytheirCreatorwithcertainunalienableRights,thatamongtheseareLife,LibertyandthepursuitofHappiness.
Theyhavethewatchwordsinthere:
life,liberty,thepursuitofhappiness.Thesearethekeysthingsenthronedintotheconstitution,thisiswhatweareallabout,thesearetheprinciplesonwhichwewanttobuildoursociety.
AnotherexamplewouldbefromKarlMarxwhosewritingwereusedasabasisforbuildingsocietiesthroughoutthe20thcenturyandalotofitcouldbeboileddowntothisonedesignprinciple:
Fromeachaccordingtohisability,toeachaccordingtohisneed.
Soherewehavethisdesignprincipleguidinganeconomicsystem.
Anotherexample,mucholderthanthatbutusingasimilarprincipletothiswouldbe:
Dountoothersasyouwouldhavethemdountoyou.
Averysimple,smalldesignprinciplefromJesusChrist,aNazareneJewfromtwothousandyearsago.Andthisdesignprincipletheoreticallyiswhatdrivesanumberofreligionsthathavebeenbuiltontopoftheteachingsofthisprinciple.Theprinciplesandthepracticessometimesgooutofsync.
Here’sanexamplefromfiction.WhenGeorgeOrwellwroteAnimalFarmhehadafictionalsocietyandthatfictionalsocietywasbuiltuponadesignprinciple.Inthiscasethedesignprinciplewas:
Fourlegsgood,twolegsbad.
What’sinterestingisthatinAnimalFarm,asthesocietychanges,asthesocietyevolvesfortheworse,thedesignprinciplechangesalongwithitsothedesignprinciplecomesfourlegsgood,twolegsbetterastheanimalfarmitselfchangesbutit’sinterestingtoseethisinworksoffiction.
Thereisanotherworkoffictionthathasthreedesignprinciplesbakedinandthat’sfromthecanonofworkfromIsaacAsimovonrobotics.Hecoinedthetermroboticsandhebasicallyensconcedthesethreelawsofrobotics,threefairlysimpledesignprinciplesbutthenbuildawholecanonofwouldaroundthem,aboutfiftybooks,eachpermutationsexaminingthesedesignprinciplesfromdifferentaspects.You’reprobablyfamiliarwiththethreelawsofroboticsI’msure.
Arobotmaynotinjureahumanbeingor,throughinaction,allowahumanbeingtocometoharm.
Arobotmustobeyanyordersgiventoitbyhumanbeings,exceptwheresuchorderswouldconflictwiththeFirstLaw.
ArobotmustprotectitsownexistenceaslongassuchprotectiondoesnotconflictwiththeFirstorSecondLaw.
Thisis,Ithink,thefirstexampleinfictionofdesignprinciplesforapieceofsoftware.Inthiscaseitwouldbeapriceofsoftwaretorunapositronicbraininarobotthat’sdesignedtothethreesimpledesignprinciples.ButIthinkthismightbethestartofactuallyhavingdesignprinciplesforsoftware.Andsincethenweseedesignprinciplesforalotofreallygoodsoftware.
TimBerners-Leewho,asyouknow,co-inventedtheweb.HehasadocumentontheW3CwebsitewherehekeepshisownsetofpersonaldesignprinciplesataURL.Theyarekindofsprawling,therearealotofthemthere,headdstothem,headjuststhem,hetakesthingsawayastimegoesonbutIthinkit’sareallygoodideatohaveapersonalsetofdesignprinciplessomewhere.
Actually,BertBos,co-inventorofCSS,he’sgotgreatdocumentontheW3Cwebsitethatiskindofametadesignprinciplesdocument.Likehowtodesignbuildingaformat,whetherit’sCSSoranythingelse.Itiswellworthreading.
SoifyourootaroundtheW3CsiteyoufindabunchofthesedesignprinciplesincludingTImBerners-Lee’spersonalonesandyouseethewatchwordshe’stakenfromschoolsofsoftwareengineering:
decentralisation,tolerance,simplicity,modularity.Thesearekeywatchwordsthathekeepsinmindastheycomeupwithformats.
You’reallprettyfamiliarwiththeworkofTimBerners-Leeasyouuseiteveryday.Heinventedtheweb,co-inventedthewebwithRobertCailliau,andaswellasinventingthewebitselfhealsocameupwiththelanguagethatweuseeverydayonthewebandthatlanguageisofcourseHTML:
HyperTextMarkupLanguage.
HTML
ThisisanearlyhistoryofHTML,itstartedwithversiontwopointzero.ThereneverwasaHTMLone.IfanyoneevertellsyoutheyhavebeendoingHTMLsinceversionone,theyarebullshittingyou.TherewasadocumentcalledHTMLTagsthatcontainedahandfuloftagsthatstillexiststodaybutitwasn’tanofficialspecification.
Thiswholeideaofusingtags,anglebrackets,‘p’or‘h1’orwhathaveyou;
thatisn’tsomethingthanTimBerners-Leecameupwith.HewasbasicallytakinganexistingvocabularyfromSGML,theparticularversionofSGMLthatwasinuseatCERNatthetime.Soevenbackthenhewasn’tcreatingthingsfromscratch;
that’sanimportantlessonthatyoucanstillseeintheevolutionofHTML.Buildonwhat’scomebeforeratherthantryingtobuildsomethingfromscratch.
SothisHTMLTagsdocumentwasthefirstversionofHTMLbutwasn’tanofficialversion.ThefirstofficialversionwasHTML2.0whichdidn’tcomefromtheW3C.HTML2.0wasfromtheIETF,theInternetEngineeringTaskForce.TheywereresponsibleforputtingoutalotofstandardsbeforetheW3Creallystartedoff.ButfromversionthreeonwardsitwasattheW3C,theWorldWideWebConsortium,wherelaterversionsofHTMLwerespecced.
Therewassomefairlyrapidmovementinthenineties.Asyoucansee,theninetieswereaprettyturbulenttimeforanyonebuildingwebsitesbackthen.Wehadthebrowserwars,itwasprettymessy.Wehadalotofproprietaryshitbeingthrownintobrowsers.Theyweretryingtocompeteonhavingthebestproprietaryshit.Itwaskindofamessytimeanditwasn’tclearatallatthistimeifHTMLwasevengoingtobearoundandifHTMLwasgoingtolastastheformatfortheweb.
Youcanseeitevolvedfairlyquickly,3.2,4.0,4.01from1997to1999;
veryrapidevolution.Whathappenedwith4.01istheW3Csteppedback,lookedatitandsaid“Okay,thisisgood,wearedonewithHTML;
HTML4.01isthefinalversionofHTML,wedon’tneedaHTMLworkinggroupanymore.”
Theydidn’tstopworkingonthelanguagebutitwasnolongerHTMLtheywereinterestedin.RightafterHTMl4.01,theycameupwithXHTML1.0.ItsoundscompletelydifferentbutactuallyXHTML1.0wasthesameasHTML4.01.Imeanliterally,thecontentsofthespecificationwerethesame,thevocabularywasthesame,allthesameelements,allthesameattributes.Theonlydifference,theonlydifference,wasthatinXHTML1.0youwoulduseXMLsyntax.Sothatmeantallyourattributeshadtobelowercase,allyourelementshadtobelowercase,allyourattributeshadtobequoted,youhadtoremembertouseclosingtagsandyouhadtoselfclosetagslikeimgandbr.
Fromthepointofviewofthecont