=================================
Writing a graphical web browser
=================================

I started writing a web browser recently, a graphical one this time.
Here is a screenshot of its prototype, at about 2 KLOC:
<https://defanor.uberspace.net/pictures/wwwlite.png>.

There's no CSS or JS support, but there is relatively good support for
images and complex text rendering with word caching. It also doesn't
reimplement many things from scratch, but uses GTK, Pango, libxml2,
and libsoup. HTML parsing and UI building are streaming, images are
loaded asynchronously (and with a bit more code it's easy to get
progressive image loading, GTK facilitates that). Form and table
support are planned, but at this point it looks like those won't
affect existing code and the overall architecture.

Since one of the goals was to explore how hard it is to write a web
browser like that, I'm planning to document the implementation in more
detail in its documentation. But so far it seems that it can be quite
small and maintainable.

Another goal was to get a lightweight web browser without the issues
of other lightweight web browsers (some of which are hinted above:
faulty custom HTML parsing, poor or slow text rendering, poor image
handling, custom fonts and colour themes). So far it goes pretty well
too.

Yet another goal was simply to find out how a GTK-based browser would
look like, especially HTML forms in it. That is almost done too,
though the forms aren't working yet.

While most of the unclear/challenging/design-affecting bits are
behind, perhaps the final major challenge is to get through the more
routine parts, to a somewhat complete version. But I expected it to
take a while, and one of the goals was to have something to tinker
with, so it's probably achievable as well.

I didn't sleep well and feeling rather tired today, so not working on
it (or on anything), and just writing here. But there's no hurry, and
I'm somewhat optimistic about slowly getting something nice. Pleased
with the prototype, too.


----

:Date: 2019-07-19