Live data from Hacker News

No-Bullshit Guide to Detecting Everything in HTML5

diveintohtml5.org

31–37 of 37 posts

Re: No-Bullshit Guide to Detecting Everything in HTML5

#31
post #10

Useful. Sadly, I don't see detection for @font-face -- perhaps because it's not very simple? http://paulirish.com/2009/font-face-feature-detection/

Modernizr (linked at the bottom of my guide) can detect support for @font-face. It is decidedly non-trivial. http://github.com/Modernizr/Modernizr

Thanks, and a note: under FFox3.5/Linux, I noticed a small delay before the title fonts (Agnes Nutter style ;-) loaded over something simpler. More interestingly, I cannot select the words "Appendix A" to copy elsewhere. I checked the source, and see they're in style ( h1:before{content:"Appendix A:"} ).

Curiously, under Konqueror 4.3 I can highlight those words, together with the rest of the title, but pasting (either X or ^c^v) also misses them ...

Re: No-Bullshit Guide to Detecting Everything in HTML5

#34
css3 transition support. You could probably make something smaller, but this does work.

function checkForTransitionSupport() { var cssTransitionsSupported = false; var div = document.createElement('div'); div.innerHTML = ''; cssTransitionsSupported = (div.firstChild.style.webkitTransition !== undefined) || (div.firstChild.style.OTransition !== undefined) || (div.firstChild.style.MozTransition !== undefined); delete div; return cssTransitionsSupported; }

Re: No-Bullshit Guide to Detecting Everything in HTML5

#35
post #31

Earlier quoted context omitted.

Modernizr (linked at the bottom of my guide) can detect support for @font-face. It is decidedly non-trivial. http://github.com/Modernizr/Modernizr

Thanks, and a note: under FFox3.5/Linux, I noticed a small delay before the title fonts (Agnes Nutter style ;-) loaded over something simpler. More interestingly, I cannot select the words "Appendix A" to copy elsewhere. I checked the source, and see they're in style ( h1:before{content:"Appendix A:"} ). Curiously, under Konqueror 4.3 I can highlight those words, together with the rest of the title, but pasting (eith…

Ah, the oddities of CSS. The first issue is because I'm using custom fonts via @font-face. Firefox has made some... design decisions... that cause the effect you're seeing. I've actually just recently discovered a way to reduce the number of dynamic fonts I'm loading, but the underlying issue is still that Firefox wants to paint the page before the dynamic fonts are finished loading.

The second issue is CSS generated content. I honestly don't remember why I chose to put chapter numbers and appendix letters in CSS and the rest of the title in content. Purity? Really? That doesn't sound like me. ;-) It would probably be simpler to move it all into the h1.

Post reply on HN