Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Firefox OSでSVGをつかってみた

kadoppe
November 23, 2013

Firefox OSでSVGをつかってみた

2013/11/23 に開催された「関西Firefox OS勉強会 5th GIG」で使ったプレゼンスライドです。

kadoppe

November 23, 2013
Tweet

More Decks by kadoppe

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ • ໊લ • ໳࿬߃ฏ!LBEPQQF • ৬ۀ • ιϑτ΢ΣΞΤϯδχΞ •

    3VCZ $P⒎FFc+BWB 4DSJQU0CKFDUJWF$ • ॴଐ • גࣜձࣾγΣΞ΢Οζ)5.-8&45KQ
  2. 47(ͷ࢖͍ํ  <html>! <body>! <h1>Inline SVGαϯϓϧ</h1>! <svg width=100 height=100>! <circle

    r=50 cx=50 cy=50 />! </svg>! </body>! </html> svgཁૉΛ࢖͏ *OMJOF47(
  3. HFU##PY var textElm = document.getElementById('text'); var box = textElm.getBBox(); !

    alert(box.height); // textཁૉͷߴ͞ alert(box.width); // textཁૉͷ෯ ཁૉͷେ͖͞Λऔಘ͢ΔͨΊͷ"1*
  4. /4@&3303@'"*-63& 23 /* Returned when a function fails */ 24

    ERROR(NS_ERROR_FAILURE, 0x80004005), NP[JMMBYQDPNCBTF&SSPS-JTUI ԿΒ͔ͷݪҼͰؔ਺ͷ࣮ߦ͕ࣦഊͨ࣌͠ͷΤϥʔ
  5. ͪͳΈʹ$ISPNFͩͱ // display: none ͳͲͰඇදࣔʹͳ͍ͬͯΔཁૉΛऔಘ var hiddenElm = document.getElementById('hidden'); var

    box = hiddenElm.getBBox(); ! alert(box.height); // 0 alert(box.width); // 0 ͪΌΜͱzz͕ग़ྗ͞ΕΔ
  6. ରॲํ๏USZDBUDI // display: none ͳͲͰඇදࣔʹͳ͍ͬͯΔཁૉΛऔಘ var hiddenElm = document.getElementById('hidden'); try

    { var box = hiddenElm.getBBox(); ! alert(box.height); // 0 alert(box.width); // 0 } catch (e) { // NS_ERROR_FAILUREൃੜ࣌ͷॲཧ }