Instead of using string everywhere, have the CSS parser produce enum
values, since they are a lot nicer to work with.
In the future we should generate most of this code based on a list of
supported CSS properties.
This is a lot nicer than first_child_with_tag_name(...).
The is<T>(Node) functions are obviously unoptimized at the moment,
and this is about establishing pleasant patterns right now. :^)
This allows any external actor to signal that the document layout may be
stale. This can be used when loading resources, changing the size or
placement of an element, adding/removing nodes, or really any time.
Instead of branching on the Node type, let subclasses decide how their
layout nodes get constructed.
This will allow elements to create custom layout nodes if they want.
You can now pass a file:/// URL to HtmlView and it will take care of
the loading logic for you. Each Document remembers the URL it was
loaded from, which allows us to also have reload().
This patch also adds a very simple function for resolving relative
URL's into absolute ones.
This patch implements basic support for presentational hints, which are
old-school HTML attributes that affect style.
You add support for a presentational hint attribute by overriding
Element::apply_presentational_hints(StyleProperties&) and setting all
of the corresponding CSS properties as appropriate.
To make the background color fill the entire document, not just the
bounds of the <body> element's LayoutNode, we special-case it in the
HtmlView::paint_event() code for now. I'm not entirely sure what the
nicest solution would be, but I'm sure we'll discover it eventually.
Each HtmlView now has a main_frame(), which represents the main frame
of the web page. Frame inherits from TreeNode<Frame>, which will allow
us to someday implement a Frame tree (to support the <frame> element.)
You can now query Document::title() to get a String containing whatever
is inside the document's <title> tag.
In support of this, this patch adds the <html>, <head> and <title>
elements.