The way we've been creating DOM::Document has been pretty far from what
the spec tells us to do, and this is a first big step towards getting us
closer to spec.
The new Document::create_and_initialize() is called by FrameLoader after
loading a "text/html" resource.
We create the JS Realm and the Window object when creating the Document
(previously, we'd do it on first access to Document::interpreter().)
The realm execution context is owned by the Environment Settings Object.
The existing implementation of this AO lives in Interpreter::create(),
which makes it impossible to use without also constructing an
Interpreter.
This patch adds a new Realm::initialize_host_defined_realm() and takes
the global object and global this customization steps as Function
callback objects. This will be used by LibWeb to create realms during
Document construction.
A lot of code assumes that there's a current execution context. By
setting up a dummy context right after creating the main thread VM,
we ensure that such code can always run.
The escape sequence to color a section's name was separated
by a newline from the section's name, making less(1) trim
the escape sequence off when the section's name was on the
first line.
Previously Toolbars were governed by a strict minimum size which
guaranteed all actions remained visible. Now, if set collapsible,
extra actions will fold into an overflow menu on the Toolbar.
And assume 24x24 button sizes by default.
There currently aren't any toolbars with custom button sizes, but if
the need arises, they can always determine their own padding.
Adds fallible functions for opening and saving fonts and cutting
and copying selections. FontEditor now falls back on a guaranteed
default BitmapFont on startup. Fixes crashing on start when the
default system font is set to TrueType.
The flame graph view used to draw only so much of the graph that could
be displayed. Change to draw the whole graph, and add a scrollbar.
Does some tricks with the scrolling to keep the bottom of the graph
fixed when resizing or double-clicking, since it works better then.
This implements the image size extension that's quite commonly used:
https://github.com/commonmark/commonmark-spec/wiki/Deployed-Extensions#image-size
This supports specifying...
Both width and height: ![](foo.png =100x200)
Width only: ![](foo.png =100x)
Height only: ![](foo.png =x200)
The size is always in pixels (relative sizing does not seem
to be spec'd anywhere).
Previously, we were incorrectly assuming that the daylight global
variable indicated whether the current time zone is in DST. In reality,
the daylight variable only indicates whether a time zone *can* be in
DST.
Instead, the tm structure has a tm_isdst member that should be used for
this purpose. Ensure our LibC handles tm_isdst, and avoid errant usage
of the daylight variable in Core::DateTime.
Right now, the tm_to_time helper invokes time_to_tm to validate the
time_t it creates. Soon, both tm_to_time and time_to_tm will perform
some TZDB lookups to handle DST. This isn't a huge cost, but let's
avoid the double lookup here.
The time zone name will be needed for TZDB lookups in various time.h
functions. Cache the value found by tzset(), defaulting to the system-
wide default of UTC.
This also moves the time.h global definitions to the top of the file.
The cached time zone name will be needed above where these variables are
defined, so this is just to keep them all together.
When you press the escape key in the Browse dialog, the key down event
closes the dialog while the key up event then closes the Run window.
Prevent this by only listening to key down events.