Commit graph

51786 commits

Author SHA1 Message Date
Shannon Booth 55d59636ef LibWeb: Implement Web::URL::url_encode closer to spec 2023-06-25 11:28:32 +02:00
Shannon Booth 799c79cc5a LibWeb: Simplify logic in Web::URL::URLSearchParams::sort 2023-06-25 11:28:32 +02:00
Shannon Booth e99c0ddb0e LibWeb: Add spec link for Web::URL::url_decode 2023-06-25 11:28:32 +02:00
Shannon Booth be9fcaf92d AK: Expose URLParser::percent_encode_after_encoding
This function is useful in places outside of the URLParser in LibWeb.
2023-06-25 11:28:32 +02:00
Kenneth Myhra c445bd3a0c LibWeb: Move WebSocket constructor steps closer to spec 2023-06-25 11:28:18 +02:00
FalseHonesty 110eeb8591 LibWeb: Support calc(...) in box-shadow's values of type Length
The CSS box-shadow property takes 2-4 properties that are `<length>`s,
those being:
  - offset-x
  - offset-y
  - blur-radius
  - spread-radius

Previously these were resolved directly to concrete Lengths at parse
time, but now they will be parsed as LengthStyleValues and/or
CalculatedStyleValues and be stored that way until styles are later
resolved.
2023-06-25 10:27:08 +01:00
Andreas Kling 8873bf5016 LibJS/Bytecode: Use ToString instead of generic add() in ConcatString
This avoids invoking valueOf() on the values, which is observable.

48 new passes on test262. :^)
2023-06-25 11:20:05 +02:00
Liav A 99cc33bce9 Ports: Mark cbonsai package.sh as executable
This should fix a recent CI lint problem.
2023-06-25 09:40:00 +02:00
Andreas Kling 8021048bc9 LibJS/Bytecode: Throw on destructuring object assignment to nullish LHS
24 new passes on test262. :^)
2023-06-25 09:19:53 +02:00
Beckett Normington 4032bfc2fc Ports: Add cbonsai port
This commit modifies the port list and adds the package.sh script
for `cbonsai`.
2023-06-25 08:04:23 +01:00
Andi Gallo 8b34af816e LibWeb: Report border box width for tables in a block
For the containing block, table borders are opaque and have to be
accounted when computing the table width since they use available space.
2023-06-25 08:13:04 +02:00
Andi Gallo 2c4908094c LibWeb: Don't subtract border from used table width
The used width is already a content width, which doesn't include
borders. Border widths should be subtracted from the specified width
instead, since that initially specifies the total width including
borders, for consistent comparison. Also handle table box padding as an
additional fix.
2023-06-25 08:13:04 +02:00
Andreas Kling 1f95a40780 LibJS/Bytecode: Actually exit switch statement's lexical scope
95 new passes on test262. :^)
2023-06-25 08:09:39 +02:00
Lucas CHOLLET cc1bd2d2d9 LibGfx/JPEG: Use a look-up table for cosine values
This solution is a middle ground between re-computing `cos` every time
and a much more mathematically complicated approach (as we have in the
decoder).

While still being far from optimal it already gives us a 10x
improvement, not that bad :^)

Co-authored-by: Tim Flynn <trflynn89@pm.me>
2023-06-25 00:22:21 +02:00
Sam Atkins 5056668ab2 Meta: Add lint check that ports have an executable package.sh 2023-06-25 00:18:52 +02:00
kleines Filmröllchen e0dce41ddf AudioServer: Add a hack to make audio "just work" on HDA for now
This should be fixed properly, but we have decided that a quick hack is
fine so that audio "just works" for most people.
2023-06-25 00:16:44 +02:00
kleines Filmröllchen 03fac609ee AudioServer+Userland: Separate audio IPC into normal client and manager
This is a sensible separation of concerns that mirrors the WindowServer
IPC split. On the one hand, there is the "normal" audio interface, used
for clients that play audio, which is the primary service of
AudioServer. On the other hand, there is the management interface,
which, like the WindowManager endpoint, provides higher-level control
over clients and the server itself.

The reasoning for this split are manifold, as mentioned we are mirroring
the WindowServer split. Another indication to the sensibility of the
split is that no single audio client used the APIs of both interfaces.
Also, useless audio queues are no longer created for managing clients
(since those don't even exist, just like there's no window backing
bitmap for window managing clients), eliminating any bugs that may occur
there as they have in the past.

Implementation-wise, we just move all the APIs and implementations from
the old AudioServer into the AudioManagerServer (and respective clients,
of course). There is one point of duplication, namely the hardware
sample rate. This will be fixed in combination with per-client sample
rate, eliminating client-side resampling and the related update bugs.
For now, we keep one legacy API to simplify the transition.

The new AudioManagerServer also gains a hardware sample rate change
callback to have exact symmetry on the main server parameters (getter,
setter, and callback).
2023-06-25 00:16:44 +02:00
Valtteri Koskivuori c3f5b514c8 WindowServer: Yank out window frame opacity
This facility was added in 15a1d9a, but isn't being used for anything.
It wasn't even hooked up to LibGUI for applications to use.
Relevant use-cases, such as the most prominent one in `AnalogClock`, use
`GUI::Window::set_frameless()` instead.
2023-06-24 23:45:27 +02:00
Valtteri Koskivuori 6931a5a0a8 WindowServer+LibGUI: Yank out window-global opacity
From what I can tell, this facility was added to WSWindow/GWindow in
2019 in 9b71307. I only found a single place in the codebase still using
this facility: `WindowServer::Menu::start_activation_animation()`. A
subtle fade-out animation that happens when a menu item is selected, and
the menu disappears.
I think our compositing facilities have improved enough to make this
facility redundant. The remaining use mentioned above was ported to just
directly blit the fade-out animation instead of requesting it from
WindowServer.
2023-06-24 23:45:27 +02:00
Andreas Kling 4fd71e3c3a LibJS/Bytecode: Support destructuring in try..catch
112 new passes in test262.
2023-06-24 21:10:07 +02:00
MacDue 3d755a57b6 LibGfx: Ensure last subpath is closed by Path::close_all_subpaths() 2023-06-24 19:31:30 +02:00
MacDue 6b40271b95 LibWeb: Close all subpaths when filling SVG paths 2023-06-24 19:31:30 +02:00
Shannon Booth f2881f4662 headless-browser: Use Diff::write_normal to output hunks
Saving a bunch of code :^)

The "Hunk:" text is preserved as there is no real need for the browser
test harness to be producing valid patch files.
2023-06-24 18:34:08 +02:00
Shannon Booth 2b56aefaed diff: Use Diff::write_normal to output hunks
Saving a bunch of code :^)
2023-06-24 18:34:08 +02:00
Shannon Booth 7afff80e71 LibDiff: Add Diff::write_normal for outputting normal hunks
In order to extract duplicated code between browser and the diff
utility.
2023-06-24 18:34:08 +02:00
Shannon Booth 312de21498 diff: Remove "Hunk:" text from output
While this is a useful piece of information it means that diff is
producing hunks that are not of a valid normal diff format. This breaks
the ability to redirect the output of diff to a file to generate a
patch.
2023-06-24 18:34:08 +02:00
Aliaksandr Kalenik 331f6a9e60 LibJS: Invalidate cached environment coordinate after delete in global
Fixes the bug in interpreter when cached environment coordinate is not
invalidated after `delete` operator usage on global `this`.
2023-06-24 18:33:44 +02:00
Daniel Bertalan 9d4dfc1061 AK: Work around Apple Clang __builtin_subc codegen issue
Apple Clang 14.0.3 (Xcode 14.3) miscompiles this builtin on AArch64,
causing the borrow flag to be set incorrectly. I have added a detailed
writeup on Qemu's issue tracker, where the same issue led to a hang when
emulating x86:

https://gitlab.com/qemu-project/qemu/-/issues/1659#note_1408275831

I don't know of any specific issue caused by this on Lagom, but better
safe than sorry.
2023-06-24 18:31:14 +02:00
Daniel Bertalan 7dadc9ff33 AK: Prefer __builtin_{subc,addc} intrinsics to x86-specific ones
GCC 14 (https://gcc.gnu.org/g:2b4e0415ad664cdb3ce87d1f7eee5ca26911a05b)
has added support for the previously Clang-specific add/subtract with
borrow builtins. Let's use `__has_builtin` to detect them instead of
assuming that only Clang has them. We should prefer these to the
x86-specific ones as architecture-independent middle-end optimizations
might deal with them better.

As an added bonus, this significantly improves codegen on AArch64
compared to the fallback implementation that uses
`__builtin_{add,sub}_overflow`.

For now, the code path with the x86-specific intrinsics stays so as to
avoid regressing the performance of builds with GCC 12 and 13.
2023-06-24 18:31:14 +02:00
kleines Filmröllchen e7b7d1b347 Base: Add a new quote to the fortunes database 2023-06-24 19:13:42 +03:30
Andreas Kling 06ac768c8b LibJS/Bytecode: Add some basic codegen for ExportStatement
This is by no means complete, but at least a bunch of test-js and
test262 tests start working. :^)
2023-06-24 17:13:30 +02:00
Andreas Kling 5d79431859 LibJS/Bytecode: Actually generate & run bytecode for SourceTextModule 2023-06-24 17:13:30 +02:00
Andreas Kling 8a5e71256d LibJS/Bytecode: Add codegen for ImportCall
Also moved most of the AST ImportCall::execute() into a helper so we can
share the code.
2023-06-24 17:13:30 +02:00
Andreas Kling eb9298b54e LibJS/Bytecode: Support destructuring function parameters
To reduce code duplication, I've added new VM::execute_ast_node()
helper that handles bytecode compilation if needed.

918 new passes on test262. :^)
2023-06-24 08:38:54 +02:00
Andreas Kling b3a3c53007 LibJS: Fix bad indentation when dumping FunctionNode AST nodes 2023-06-24 08:38:54 +02:00
Zaggy1024 c760713650 LibWeb: Prioritize video duration when loading video element media
Previously, an audio loader could succeed for an HTMLVideoElement that
contains a video file, which caused the duration to be set to the bogus
duration of the audio loader instead of the correct duration from the
video container. Instead of setting the duration based on audio always,
set it to the video duration if we are creating a video element.
2023-06-24 06:20:06 +02:00
Xexxa e3a0f84ffb Browser: Change "Same Origin" to "Same-Origin" 2023-06-24 06:19:39 +02:00
Xexxa 84e7dd60ea Ladybird: Add missing shortcuts
Add the missing shortcuts from Ladybird SerenityOS to Ladybird QT
2023-06-24 06:19:39 +02:00
Luke Wilde 95d619943e LibJS/Bytecode: Support private identifiers in optional chaining
Fixes 4 test262 tests :^)
2023-06-23 21:05:18 +02:00
Andi Gallo fc45831fb3 LibWeb/Tests: Better trigger for table style update test 2023-06-23 20:23:00 +02:00
Timothy Flynn 8b668da9d5 LibRegex: Bail parsing class set characters upon early EOF
Otherwise, we reach a skip() invocation at the end of this function,
which crashes due to EOF. Caught by test262.
2023-06-23 20:22:45 +02:00
Timothy Flynn 32502fceed LibJS: Update spec numbers/steps for RegExp unicode sets flag proposal
This proposal has been merged into the main ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/26b2369
2023-06-23 20:22:45 +02:00
Timothy Flynn 9407e05a3c LibJS: Update RegExp spec numbers to match re-ordering within the spec
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/abee2e6
https://github.com/tc39/ecma262/commit/77256bf
2023-06-23 20:22:45 +02:00
Andreas Kling 99b23fe2ad LibJS/Bytecode: Emit GetPrivateById for private member expressions
This makes it possible to call private member functions.

347 new passes on test262. :^)
2023-06-23 17:51:04 +02:00
Timothy Flynn e7db199249 LibJS: Do not fail a test if the flags list is empty
There are hundreds of test262 tests with the following metadata line:

    flags: []

Other engine runners are apparently able to ignore those lines, so we
should as well.
2023-06-23 17:31:48 +02:00
René Hickersberger b0ef956fe0 Ports: Add lynx port 2023-06-23 17:25:37 +02:00
Aliaksandr Kalenik 934cb601c2 LibWeb: Implement "destroy the child navigable" on navigable containers
Co-authored-by: Andreas Kling <kling@serenityos.org>
2023-06-23 17:24:32 +02:00
Andi Gallo 55f1a70577 LibWeb: Fix style updates for table box nodes
On style update, we have to preserve the invariant established when we
built the layout tree - some properties are applied to the table wrapper
and the table box values are reset to their initial values.

This also ensures that the containing block of a table box is always a
table wrapper, which isn't the case if we set absolute position on the
box instead of the wrapper.

Fixes #19452.
2023-06-23 16:40:19 +02:00
Andi Gallo e28578363a LibWeb: Get initial values for table box from CSS::InitialValues 2023-06-23 16:40:19 +02:00
Andreas Kling 406e3ed849 LibWeb: Implement getting the container document of a navigable
Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-06-23 16:20:29 +02:00