8 ms·
4chan switches to HTML5/CSS3 (SFW)
- chris_wot 15y agoIt's buggy. For instance, I can see an anchor inside a span, but the span is closed before the anchor is closed. Also, and admittedly nitpicking a little here (don't hate me 4Chan! I come in peace...) but they are still using CDATA in their script tags. If you are using HTML5, I don't think you still need to support legacy browsers :-)
- sbierwagen 15y agoHTML5 is supposed to degrade gracefully. Nothing about it should instantly break old browsers, so there's nothing really inconsistent about using CDATA with HTML5.
- chris_wot 15y agoLike I say: I'm nitpicking. To be honest, I'm not a fan of inline javascript. But I'm not really 4chan's core audience - they may have a reason why they have so much inline js.
- gee_totes 15y agoMy question is WHY do they need to switch to HTML5? Does the complicated layout and rich metadata of 4chan require something more advanced than HTML4?
- mhd 15y agoAccording to the post, they got rid of a lot of spans and tables. Sure, they probably could've done that while staying within HTML4/XHTML, but when you're changing things around already, why not stick to the most recent standard?
- ceol 15y agoThey're using JavaScript onmouseover to show spoilers which can be accomplished in straight CSS2. I assume that's for IE compatibility. They're also still using <br/> tags in post comments, but I assume that's because it's easier to write a nl2br converter than to intelligently parse comments with more than two newlines into semantically-correct paragraphs. I would have thought 4chan's thread format perfect to use the new <article>, <header>, and <footer> tags.
- mhd 15y agoConsidering that we're talking about 4chan, this might count as heavy abuse of the "article" tag…
- asdfaoeu 15y agoSeems like it was just a rewrite for the sake of cleaning up code rather than to be HTML5 and it's not like the old site was valid HTML4 or that the HTML5 can't be parsed by most HTML4 parsers. I don't know why you wouldn't use a HTML5 doctype.
- deathwarmedover 15y agoRelevant quotes: * "The new HTML should be much easier to parse, and when benchmarking the official 4chan Chrome extension, we found that it parses approximately 600% faster." * "CORS [Cross-origin resource sharing] is now supported" * "responsive design for mobile browsers"
- bri3d 15y agoVisit https://boards.4chan.org/htmlnew/ https://boards.4chan.org/htmlnew/ and narrow the browser window (or better yet, visit from your phone). It's somewhat responsive - posts wrap correctly and once the page is narrow enough "view thread" buttons appear for easier browsing and less scrolling. The old 4chan layout didn't even wrap correctly on mobile devices (requiring tons of horizontal scrolling) - IMO, this alone is worth the rewrite.
- samstr 15y agoWell done I guess... heh slow clap
- TomNomNom 15y agoOne of the things that this does improve vastly is rendering in Chrome for Android/ICS (and I assume, other mobile browsers). The old markup didn't scale very well and made for a lot of horizontal scrolling.
- stu_wilson 15y agoHTML5 but the same old UI? What benefits it brings?
- Lockyy 15y agoRead the post and you'll see. Faster parsing, new features etc.
- christianmann 15y agoAlso, if they changed the old UI, the denizens of 4chan would kill them.
- masklinn 15y ago> What benefits it brings? Much better behavior on smaller width (e.g. mobile phones), smaller, simpler markup (so faster downloading, parsing & rendering), and likely increased simplicity for extension developers.
- fadelakin 15y agoSince when did 4chan innovate?
- huggah 15y agoThis is the first time I've ever seen (SFW) and 4chan in the same sentence. And probably, one of the only places where I'd believe it.
- deathwarmedover 15y agoJust glancing at the front page, the SFW boards on 4chan outnumber the NSFW (18+) boards. Of the top 4 boards in terms of 4chan's traffic, only two are in the 18+ category. /b/ (the very NSFW board responsible for 4chan's notorious infamy) accounts for 30% of 4ch's traffic but the next two most popular boards /v/ (video games) and /a/ (anime and manga) are both SFW. Not that I would recommend anyone to lurk 4chan at work. The traffic and popularity figures I mention are on Wikipedia with citations: http://en.wikipedia.org/wiki/4chan http://en.wikipedia.org/wiki/4chan
- huggah 15y agoI don't doubt that, but I never see links to the SFW boards. I almost exclusively read or get sent links to /b/.
- redthrowaway 15y agoWhy would anyone ever send someone a link to /b/? Threads last half an hour, tops. By the time the person sees the link, the thread has likely 404'd.
- huggah 15y agoIM, not email.
- whamill 15y agoEdit: Apologies, my bad. Misread.
- keypusher 15y agoI think you misread, nobody was suggesting to lurk 4chan at work, in fact the exact opposite.
- greghinch 15y agoI was expecting more Pedobear
- sbank 15y agoSFW, you say. I think I will play it safe by not clicking.
- JonnieCache 15y agoSurely HN must now be next? The cobbler's children have gone unshod so long!
- TazeTSchnitzel 15y agoDear God, HN has neither a doctype nor a tableless layout... D:
- Devilboy 15y agoYet somehow it just works. Why waste your time on idiomatic CSS when good old tables work just fine?
- evincarofautumn 15y agoAccessibility, bandwidth savings, maintainability, semantic markup, visual consistency, support for more complex layouts, and removing the need for ugly hacks—remember spacer gifs?
- mkramlich 15y agoExcept... the site works fine like it is. And it's not a mass consumer site. It's mostly for techies/geeks. And it's not PG's core business. YC is. Believe me, I have at least a few upgrades I wish were made here (fixing that "the link does not exist" bug, and making commenting/editing more friendly like Reddit), but they are not a big deal, we'll survive.
- evincarofautumn 15y agoHey. Don’t ruin my broad oversimplifications by adding reasonable context.
- mkramlich 15y agosorry :)
- blendmaster 15y agoThe change mostly benefits 4chan extension/userscript developers (like 4chanX) and board archivers, which have to parse the DOM (the only public 4chan API) back into data. If you look at the current markup (the new markup isn't live yet), it's a total mess of tables and font tags. Also as mentioned, it has a responsive layout for mobile screens. I'm pretty sure the new markup is designed by moot (the 4chan admin/creator) himself, so it's fairly clunky for 2012 (wrapper divs and spans everywhere, inline javascript and styles), but again, it's still a vast improvement.
- unconed 15y agoThis isn't HTML5, this is HTML4 div and span soup with an HTML5 doctype. If they really wanted clean markup, they'd use the proper elements everywhere.
- PommeDeTerre 15y agoThe "proper elements" seem to change every two or three of years. For people getting real work done, especially if there's a lot of legacy markup involved, it can be very challenging to stay up-to-date with what the talking heads have decided is the "proper" way of doing things. Just look at the <b> tag. 10 years ago, we used it frequently. Five years ago, we were told NEVER to use it, and to use CSS instead. These days we're told it's okay to use again, because now under HTML5 it has new semantic meaning. Five years from now, by the time people have used it throughout their markup again, the attitude will change and it'll once more be verboten.
- unconed 15y agoSo? There is a new version of the spec, go read it, learn how it's supposed to work, then decide which parts you want to implement. Point is, there is not a single HTML5 tag in 4chan's markup as far as I could see. They're completely missing the point. It's only the OCD CSS designers who treat every superfluous div and span as a stain upon their work. The rest of us happily use the new meaningful HTML5 structure where appropriate, and keep sprinkling on divs/spans to help guide the layout and style. And FYI, the <b> tag wasn't supposed to be replaced by CSS, it was supposed to be replaced by <strong> in cases where you wanted to highlight a span in text. Because the act of highlighting text shouldn't be coupled to what it looks like. Unfortunately, most people can't think in semantic terms and still write web content like it's MS Word. That's why HTML is such a complex beast: because we humans constantly give ourselves too much credit, and ultimately, the web is an enormous hack job achieved through minimum effort.
- redthrowaway 15y agoInterestingly, I think the real story here is how popular this mostly content-free post is. makes me wonder how many HNers are closet /b/tards (I count myself in that group).