{"id":440,"date":"2008-03-16T22:10:43","date_gmt":"2008-03-17T04:10:43","guid":{"rendered":"http:\/\/blog.codedread.com\/archives\/2008\/03\/16\/fake-smile\/"},"modified":"2008-03-16T22:10:43","modified_gmt":"2008-03-17T04:10:43","slug":"fake-smile","status":"publish","type":"post","link":"https:\/\/www.codedread.com\/blog\/archives\/2008\/03\/16\/fake-smile\/","title":{"rendered":"Fake Smile"},"content":{"rendered":"<p><object type=\"image\/svg+xml\" width=\"100\" height=\"100\" align=\"right\" hspace=\"10\" data=\"http:\/\/codedread.com\/clipart\/smile.svgz\"><span\/><\/object><a href=\"http:\/\/fakesmil.blogspot.com\/\">David Leunen<\/a> has released a new <a href=\"http:\/\/leunen.d.free.fr\/fakesmile\/\" title=\"FakeSmile\">JavaScript library<\/a> to fake <a href=\"http:\/\/www.w3.org\/AudioVideo\/\" title=\"Synchronized Multimedia Integration Language\">SMIL<\/a> for modern browsers that do not yet support declarative animation (Firefox 3.0- and Safari 3.0-).  The nice thing about this is that it uses existing standards, so that when Mozilla and WebKit finally implement SMIL, this script will avoid executing.  On that day, suddenly animations will become less processor-intensive.  I'm all about <a href=\"http:\/\/en.wikipedia.org\/wiki\/Progressive_enhancement\">progressive enhancement<\/a>, but I'm also not above occasionally faking it a little to experiment with cool features.  <!--more--><\/p>\n<p>As with all experiments of late, you need a cool browser like <a href=\"http:\/\/www.opera.com\/\">Opera<\/a>, <a href=\"http:\/\/www.mozilla.org\/firefox\/\">Firefox<\/a> or <a href=\"http:\/\/www.apple.com\/safari\">Safari<\/a> to see this stuff.  I'd be interested to hear if Konqueror 4.0 supports it.  Internet Explorer will just not do, I'm afraid.<\/p>\n<p id=\"where-i-use-smil\">I currently use SMIL in <a href=\"http:\/\/www.codedread.com\/menu.svg\">my menu<\/a> above, in the leering FakeSmile icon to the right <strike>(which I've inlined to see what happens when it gets aggregated in feed readers like <a href=\"http:\/\/intertwingly.net\/code\/venus\/\">Planet Venus<\/a>)<\/strike>, and now in my comment box when you focus and blur it.<\/p>\n<p>Yes, this is just <abbr title=\"shits and giggles\">shiggles<\/abbr> and not very productive - but I'm <a href=\"http:\/\/realtech.burningbird.net\/design\/having-ones-cake\/\">not alone<\/a> in experimenting with some advanced web features on my blog.<\/p>\n<p>Yes, SMIL intermixes \"presentational\"-type markup with \"content\" markup - but <a href=\"http:\/\/www.w3.org\/TR\/2008\/WD-timesheets-20080110\/\">SMIL Timesheets<\/a> looks to me like an attempt by the SYMM Working Group to address this.  Maybe something in the future for FakeSmile to support?<\/p>\n<p>And yes, it's kinda fun.  SMIL is the blink tag of the new millenium...<\/p>\n<p>Oh, and in case you <a href=\"#where-i-use-smil\">missed it<\/a> above, I've started using SMIL in my blog's <a href=\"http:\/\/blog.codedread.com\/?p=440&preview=true#comment\">comment<\/a> textarea - that's XHTML, not SVG.  The FakeSmile library supports a limited subset of SMIL functionality in not just SVG content but on any attribute in a XML-based language (provided you properly namespace where required, like in XHTML):<\/p>\n<div class=\"code\">&#60;textarea rows=\"5\" ...&#62;<br \/><b>&#160;&#160;&#60;smil:animate attributeName=\"rows\" from=\"5\" to=\"10\" dur=\"350ms\" begin=\"focus\" end=\"blur\" fill=\"freeze\" \/&#62;<\/b><br \/>&#60;\/textarea&#62;<\/div>\n<p>That's what makes XHTML so attractive to me - the X is for eXtensibility.  While I still support the effort, the <a href=\"http:\/\/esw.w3.org\/topic\/HTML\/SVGInTextHTML\">current HTML 5 activity<\/a> is mostly focused on SVG (and to a lesser extent MathML) integration with text\/html.  I hope they do address more <a href=\"http:\/\/www.intertwingly.net\/blog\/2007\/08\/02\/HTML5-and-Distributed-Extensibility\">flexible extensibility<\/a> within HTML5 at a later date.  It would be great if someone had already done <a href=\"http:\/\/www.w3.org\/TR\/NOTE-HTMLplusTIME\">HTML+SMIL<\/a> so there was some basis off which to work.  Snarkiness aside, I will admit to not understanding the ins-and-outs of namespaces within HTML and all the problems it poses, but I'm trying to learn in my spare time...<\/p>\n<p>One semi-amusing footnote:  You won't see the textarea expand when you focus it in Opera.  This is because Opera supports SMIL-in-SVG already, so the FakeSmile script is not executed (short-circuited).  It would be great if Opera went ahead with <a href=\"http:\/\/www.w3.org\/TR\/XHTMLplusSMIL\/\">XHTML+SMIL<\/a> support.  I'm not sure why that hasn't happened yet...<\/p>\n<p><i>[Update: David has fixed his library to allow Opera to use the library for XHTML+SMIL as well as interpolate between properties with units (i.e. 2em).]<\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>David Leunen has released a new JavaScript library to fake SMIL for modern browsers that do not yet support declarative animation (Firefox 3.0- and Safari 3.0-). The nice thing about this is that it uses existing standards, so that when Mozilla and WebKit finally implement SMIL, this script will avoid executing. On that day, suddenly [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,43,25,46,11,28],"tags":[192,136,198],"class_list":["post-440","post","type-post","status-publish","format-standard","hentry","category-javascript","category-ria","category-software","category-svg","category-technology","category-web","tag-javascript","tag-smil","tag-svg"],"_links":{"self":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/posts\/440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/comments?post=440"}],"version-history":[{"count":0,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/posts\/440\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/media?parent=440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/categories?post=440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/tags?post=440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}