Every Document now has an Origin, found via Document::origin().
It's based on the URL of the document.
This will be used to implement things like the same-origin policy.
Running event handlers in response to a mouse event may cause full
layout invalidation, so we can't expect the layout root to be present
right after returning from JS.
Fixes#1629.
The Help application was hooking HtmlView::on_link_click, which would
get invoked before DOM event dispatch. Since we were holding on to the
clicked node with a Node*, the DOM node was gone after returning from
the on_link_click callback.
Fix this by keeping DOM nodes in RefPtrs in the event management code.
Also move DOM event dispatch before widget hook invocation, to try and
keep things sane on the LibWeb side of things.
Fixes#1605.
This patch adds the Event base class, along with a MouseEvent subclass.
We now dispatch MouseEvent objects for mousedown, mouseup and mousemove
and these objects have the .offsetX and .offsetY properties.
Both of those properties are hard-coded at the moment. This will be
fixed in the next patch. :^)