Initially, the usage of local variables for parameters had to be
disabled when default values were used because there was a bug that
didn't allow to correctly find the scope to which identifiers used
within the default parameter expression belonged, and hence correctly
identify if a variable can be local. However, this bug was fixed in
2f85faef0f, so now this restriction
is no longer needed.
This change fixes an issue where identifiers used in default function
parameters were being "registered" in the function's parent scope
instead of its own scope. This bug resulted in incorrectly detected
local variables. (Variables used in the default function parameter
expression should be considered 'captured by nested function'.)
To resolve this issue, the function scope is now created before parsing
function parameters. Since function parameters can no longer be passed
in the constructor, a setter function has been introduced to set them
later, when they are ready.
This includes a few new options to the .clang-format configuration file
to A) adhere to option changes within clang-format 16 (namely the option
AlignTrailingComments), and B) enforce existing style guide rules with
new clang-format rules.
Make sure the insets and margins calculated according to the spec are
not later ignored and ad-hoc recomputed in
layout_absolutely_positioned_element.
Use the static position calculation in a couple of places where the
spec (and comment) was indicating it should be used.
Fixes#19362
The tests still pass, but opening the files in Ladybird and Safari or
Firefox shows clearly where the layouting in Ladybird is incorrect
for some absolute positioned elements. The previous 1px border was
subtly hiding some issues.
On systems with the default ulimit for open files <= 256 (default
on some systems) the LibWeb tests were crashing because the
input file handles are not closed in headless-browser.
Since AST interpreter switches to bytecode to execute generator
functions, arguments stored in local variables always need to be
initialized for such functions.
`memcpy()` and `memmove()` are functionally equivalent if the source and
destination memory regions do not overlap. If this is the case, we
should prefer `memcpy()` as it's implemented in a simpler and faster
way. As our `memcpy()` starts copying from the lowest address first,
relaxing a `memmove()` call to `memcpy()` is safe if the destination:
- starts at a lower address than the source
- starts at a higher address than the source's end
Using local variables to store function parameters makes Kraken tests
run 7-10% faster.
For now this optimization is limited to only be applied if:
- Parameter does not use destructuring assignment
- None of the function params has default value
- There is no access to "arguments" variable inside function body
Converting a base value to an Object is performed by Reference::delete_.
Doing this early in the bytecode operator could be observable, although
it would likely be the first observable step in Reference::delete_
anyways. This will just align these operators with upcoming operators
for super references, where doing this coercion first will be observable
(we need to throw an exception for deleting a super property before this
coercion).
This implementation detail of audio support in ladybird is a QObject
that needs moc'd by the moc tools. Putting it in its own file follows
the pattern we have for all the other QObjects in Ladybird.
The main missing features are rootMargin, proper nested browsing
context support and content clip/clip-path support.
This makes images appear on some sites, such as YouTube and
howstuffworks.com.