The data segment offset should be checked _before_ checking if the
contents of the segment are non-existent.
(cherry picked from commit 78c56d80f90f913e4cbc14c865af308c6af9aeae)
Add the missing `print` function to the spectest namespace. Also, spec
externs cannot be re-used because operations that modify "memory", for
example, will carry over into subsequent spec test runs. This can be
remedied in the future by implementing some sort of garbage collector
for allocations in the store.
(cherry picked from commit 1e19be412f17f99e5c3979ccf790c3ca90d637d6)
Previously, navigating to or from `about:newtab` caused a crash due to
inadvertent null dereferences when checking whether a request or
response to a request should be blocked as mixed content.
(cherry picked from commit 572ebe00eacd5aaeecc17207c75c6bf2327a3897)
If the Document's navigable has been destroyed since we started this
timer, or it's no longer the active document of its navigable, we
shouldn't navigate to it.
(cherry picked from commit 7b67fa706fd2dabfda3c72a752ac70d8c95bb060;
amended commit message to say "LibWeb:" instead of "DOM:")
This implements a stub ElementInternals object which implements the
shadowRoot getter only.
Also implement attachInternals function.
(cherry picked from commit a65f1ecc375fa02deeab5d0e7ab4702972ffa72e)
This change solves a crash where it was possible that the
"Color Masking" could try to access pixel coordinates that where beyond
the boundaries of the image.
Methods and attributes marked with [FIXME] are now implemented as
direct properties with the value `undefined` and are marked with the
[[Unimplemented]] attribute. This allows accesses to these properties
to be reported, while having no other side-effects.
This fixes an issue where [FIXME] methods broke feature detection on
some sites.
(cherry picked from commit 2f5cf8ac204a58dc2a6f722dd95015c6c2fb7a78)
Properties marked with the [[Unimplemented]] attribute behave as normal
but invoke the `VM::on_unimplemented_property_access callback` when
they are accessed.
(cherry picked from commit 88d425f32b3b49d5dfa8d86e6e4e2c263cd450d4)
If a flex item has a preferred aspect ratio and the flex basis is not
definite, we were falling back to using stretch-fit for the main size,
since that appeared to match other browsers.
However, we missed the case where we actually have a definite cross size
through which the preferred aspect ratio can be naturally resolved.
(cherry picked from commit db1faef786dbd1722bbe6a1f4a5616f3069bdb6a)
This was made redundant in GH-12971 (SerenityOS), and removing it drops
a FIXME :^)
See:
- https://github.com/SerenityOS/serenity/pull/12971
(cherry picked from commit be08abbf8a0a62ae46275c3133f711c27b2efa02)
This stuff has moved from a mixin defined by the DOM Parsing spec, over
to the HTML spec, where they are now defined as partial interfaces for
Element and ShadowRoot.
There's also some new functionality that we don't implement yet, so
patch marks them as FIXME properties.
(cherry picked from commit 0c47b3ff971437c4bd3923134d26ad086b5f6a75)
And let the old shadow_root(), which was only supposed to be used by
bindings, be called shadow_root_for_bindings() instead.
This makes it much easier to read DOM code, and we don't have to worry
about when to use shadow_root_internal() or why.
(cherry picked from commit f4bdf562127c12a7af18029777a88d4260af82d3)
We now honor the shadowrootmode attribute on template elements while
parsing, and instantiate a shadow tree as required by the spec.
(cherry picked from commit 9eb4b91168145def5677cd41057d34ecf369372b)
The bulk of this function is moved to a new "attach a shadow root"
helper, designed to be used both from here and the HTML parser.
(cherry picked from commit 043ad0eb7644a529c1ffbd4de9a4b89771808c84,
and amended to make `is_valid_shadow_host_name()` static.
The expectation with these messages is that no other code is allowed to
run while we're waiting for the response to arrive.
Not meeting this requirement did not degrade any (observable)
functionality, however.
These were made invalid with P1787, and Clang (19) trunk started warning
on them with https://github.com/llvm/llvm-project/pull/80801.
(cherry picked from commit 397774d42272fff8dbc6d8d53616d79667d6608a)
The default implementation of die() causes the client process to simply
exit cleanly. This prevents any tests from recognizing that something
went wrong, as the process exits with a code of 0. With this patch, we
still just exit when the connection dies, but with a fatal signal. In
the future, we will want to launch a new RequestServer process and
re-establish client connections.
(cherry picked from commit d1ec32e28feee10c2c36f4cd0d496b8a95d375f8)
8263e0a619 added `-Wno-coroutine-missing-unhandled-exception` to the
cmake build, and the coroutine code does not build without it.
Unbreaks building e.g. `js` with GN.
These can use an EnvironmentCoordinate for caching, just like normal
binding lookups. Saves a bunch of time for repeated typeof checks.
(cherry picked from commit 60a05ef414f804fe0c44d20fe13c795800826368)
This is actually safe everywhere but in the topmost program scope.
For web compatibility reasons, we have to flush all top-level bindings
to the environment, in case a subsequent separate <script> program
comes looking for them.
(cherry picked from commit 9d21d88374cf440ddf381e02a597a59ad329ed62)
Instead of displaying locals as "locN", we now show them as "name~N".
This makes it a lot easier to follow bytecode dumps, especially in
longer functions.
Note that we keep displaying the local index, to avoid confusion in case
there are multiple separate locals with the same name in one executable.
(cherry picked from commit 0aa8cb7dac60c88eac3bb7674e3fe575cf1da60b)
When resuming execution of a suspended function, we must not overwrite
any cached `this` value with something from the ExecutionContext.
This was causing an empty JS::Value to leak into the VM when resuming
an async arrow function, since the "this mode" for such functions is
lexical and thus ExecutionContext will have an empty `this`.
It became a problem due to the bytecode optimization where we allow
ourselves to assume that `this` remains cached after we've executed a
ResolveThisBinding in this (or the first) basic block of the executable.
Fixes https://github.com/LadybirdBrowser/ladybird/issues/138
(cherry picked from commit a91bb72dabe54849657720e36e19a3d3b737055f)