Instead of creating a new global object and proxying everything through
it, we now evaluate console inputs inside a `with` environment.
This seems to match the behavior of WebKit and Gecko in my basic
testing, and removes the ConsoleGlobalObject which has been a source of
confusion and invalid downcasts.
The globals now live in a class called ConsoleGlobalObjectExtensions
(renamed from ConsoleGlobalObject since it's no longer a global object).
To make this possible, I had to add a way to override the initial
lexical environment when calling JS::Interpreter::run(). This is plumbed
via Web::HTML::ClassicScript::run().
There was a FIXME about using raw delta y value of the mousewheel event
in TreeMapWidget::mousewheel_event. Some time after that code was
written, a raw delta x/y API was added to GUI::MouseEvent. This patch
simply uses that API and removes the FIXME message there.
- Wrapped sequence should be inserted before first non-match
node instead of next sibling of first non-match node
- If sequence is not empty after sibling traversal it should be
wrapped
This change makes outer min-content width and outer max-content
width for cells to be calculated in the way specifed in the spec:
- The outer min-content width of a table-cell is max(min-width,
min-content width) adjusted by the cell intrinsic offsets.
- The outer max-content width of a table-cell in a non-constrained
column is max(min-width, width, min-content width, min(max-width,
max-content width)) adjusted by the cell intrinsic offsets.
- The outer max-content width of a table-cell in a constrained
column is max(min-width, width, min-content width, min(max-width,
width)) adjusted by the cell intrinsic offsets.
Vectors that stick around in the AST were wasting a fair bit of memory
due to the growth padding we keep by default. This patch goes after some
of these vectors with the shrink_to_fit() stick to reduce waste.
Since the AST can stay around for a long time, it is worth making an
effort to shrink it down when we have a chance.
After setting up all the bindings in function_declaration_instantiation,
we now ask DeclarativeEnvironment to do a shrink_to_fit() on its vector
of bindings.
This ends up saving 5.6 MiB on twitter.com/awesomekling :^)
Instead of CallExpression storing its arguments in a Vector<Argument>,
we now custom-allocate the memory slot for CallExpression (and its
subclass NewExpression) so that it fits both CallExpression and its list
of Arguments in one allocation.
This reduces memory usage on twitter.com/awesomekling by 8.8 MiB :^)
This template allows us to allocate an AST node and an array of some
arbitrary type T with one allocation instead of two. This can save
a lot of memory in some cases.
Thanks to Jonathan Müller for suggesting this technique! :^)
ASTNode inherits from RefCounted, which has a single 32-bit member.
This means that there's a 32-bit padding hole after RefCounted,
where we are free to put something (or it will go to waste!)
This patch moves ASTNode::m_start_offset into that padding hole,
and we now have a 32-bit padding hole at the end of ASTNode instead.
This will allow ASTNode subclasses to put things in the ASTNode hole
by moving them to the head of the member list.
Similar to how LibJS and LibSQL used to behave, the boolean constructor
of JsonValue is currently allowing pointers to be used to construct a
boolean value. Explicitly disallow such construction.
The getters passed to REGISTER_STRING_PROPERTY are never invoked. But if
they were, they would errantly incur an implicit pointer-to-boolean cast
when their return type (Gfx::Bitmap*) is used to construct a JsonValue.
Widget's name are the current way to retrieve them when using GML.
Presently, there is no way to differentiate two items that share the
same name.
`IncrementalSearchBanner` uses common names as "close_button" or
"next_button", prepend them with `incremental_search_banner_` avoid
collisions.
This fixes a bug where the close button of `CrashReporter` was confused
with the one of the search banner.
However, This solution isn't perfect, down the road, we should probably
find a way to warn about equal names and introduce something like
namespace to avoid huge prefixes.
Currently, cookies are ephemeral and only survive for the lifetime of
Browser instance. This will make Browser instead store cookies in a SQL
database for persisted access.
Updating cookies through these hooks happens in one of two manners:
1. Through the Browser's storage inspector.
2. Through WebDriver's delete-cookies operation.
In (1), we should not restrict ourselves to being able to delete cookies
for the current page. For example, it's handy to open the inspector from
the welcome page and be able to delete cookies for any domain.
In (2), we already are only interacting with cookies that have been
matched against the document URL.
This also allows for overriding the path. Ladybird will want to store
the database files in a subdirectory of the standard data directory that
contains the Ladybird application name.
Fixes#16000.