Is it possible for a browser-based irc client to work without using any gateway, that is, to communicate with the irc sever directly?
Sure, as long as you're using an extension or browser language that can talk the IRC protocol, e.g. ChatZilla or PJIRC.
In the future this could be done with websockets, currently only chrome supports them but they are a part of the html 5 spec. http://dev.w3.org/html5/websockets/
This post suggests Kaazing has an in the mean time javascript work around: http://stackoverflow.com/questions/1252829/what-browsers-support-html-5-websocket
I'd expect that the workaround uses something like java or flash to simulate websockets.
HTML5 WebSockets are unable to make connections to non-WebSocket Servers. With WebSockets you can only connect to servers that can response to WebSocket Protocol Handshake requests. So no, you won't be able to use HTML5 to do an IRC Client (which is very sad since Flash is perfectly capable of doing this).