Skip to content

Comment on 4chan switches to HTML5/CSS3 (SFW)

Comments

My 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?

Visit 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.

Relevant 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"

According 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?

They'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.

Considering that we're talking about 4chan, this might count as heavy abuse of the "article" tag…

Seems 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.

Even if you don't use any new browser-features, HTML5 is better than HTML4 because of niceties like simpler doctype, not having to write type="text/javascript" on all script tags and so on.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.